Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1aa3a3e514680f4656ab36368421d652efd442b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*******************************************************************************
 * Copyright (c) 2017 Rogue Wave Software Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Michał Niewrzał (Rogue Wave Software Inc.) - initial implementation
 *******************************************************************************/
package org.eclipse.ui.genericeditor.tests;

import org.junit.Assert;
import org.junit.Test;

import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Control;

import org.eclipse.jface.text.IDocument;

public class AutoEditTest extends AbstratGenericEditorTest {

	@Test
	public void testAutoEdit() throws Exception {
		IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput());
		StyledText control= (StyledText) editor.getAdapter(Control.class);
		control.setText("");
		// order of auto-edits from most specialized to least specialized
		Assert.assertEquals("AutoAddedThird!AutoAddedSecond!AutoAddedFirst!", document.get());
	}

}

Back to the top