public abstract class AbstractOutlineTest extends AbstractEditorTest
@RunWith(XtextRunner)
@InjectWith(MyLanguageUiInjectorProvider)
class OutlineTest extends AbstractOutlineTest {
override protected getEditorId() {
MyDslActivator.ORG_XTEXT_EXAMPLE_MYDSL
}
@Test def void myTest() {
'''
// DSL code
Foo bla {
Bar b
Bar c
}
'''.assertAllLabels('''
bla
b
c
'''
}
}
| Modifier and Type | Field and Description |
|---|---|
protected IXtextDocument |
document |
protected XtextEditor |
editor |
protected org.eclipse.core.resources.IFile |
file |
String |
fileExtension |
protected static int |
TAB_INDENT |
protected static String |
TEST_PROJECT |
protected IOutlineTreeProvider |
treeProvider |
| Constructor and Description |
|---|
AbstractOutlineTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToStringRepresentation(IOutlineNode node,
StringBuffer buffer,
int tabs) |
protected void |
assertAllLabels(CharSequence modelAsText,
CharSequence expected)
The root node of the outline of the passed program
is expanded and a string representation of the tree is
built where children are indented of TAB_INDENT number of tabs; this
string representation is then compared with the expected representation.
|
protected void |
assertAllLabels(IOutlineNode rootNode,
CharSequence expected)
The outline node is expanded and a string representation of the tree is
built where children are indented of TAB_INDENT number of tabs; this
string representation is then compared with the expected representation.
|
protected org.eclipse.jdt.core.IJavaProject |
createjavaProject(String projectName) |
protected String |
getNodeText(IOutlineNode node) |
protected IOutlineNode |
getOutlineTree(CharSequence modelAsText) |
protected void |
indent(StringBuffer buffer,
int tabs) |
protected String |
outlineStringRepresentation(IOutlineNode node) |
protected void |
outlineStringRepresentation(IOutlineNode node,
StringBuffer buffer,
int tabs) |
void |
setFileExtensionProvider(FileExtensionProvider extensionProvider) |
void |
setUp() |
void |
tearDown() |
getEditorId, openEditorcloseEditors, closeWelcomePage, getActivePage, getWorkbench, getWorkbenchWindow, sleepassertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, failprotected static int TAB_INDENT
protected static String TEST_PROJECT
protected org.eclipse.core.resources.IFile file
protected XtextEditor editor
protected IXtextDocument document
public String fileExtension
@Inject protected IOutlineTreeProvider treeProvider
@Inject public void setFileExtensionProvider(FileExtensionProvider extensionProvider)
public void setUp()
throws Exception
setUp in class AbstractWorkbenchTestExceptionprotected org.eclipse.jdt.core.IJavaProject createjavaProject(String projectName) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreExceptionpublic void tearDown()
throws Exception
tearDown in class AbstractWorkbenchTestExceptionprotected IOutlineNode getOutlineTree(CharSequence modelAsText) throws Exception
Exceptionprotected void assertAllLabels(CharSequence modelAsText, CharSequence expected) throws Exception
modelAsText - expected - Exceptionprotected void assertAllLabels(IOutlineNode rootNode, CharSequence expected)
rootNode - expected - protected String outlineStringRepresentation(IOutlineNode node)
protected void outlineStringRepresentation(IOutlineNode node, StringBuffer buffer, int tabs)
protected void addToStringRepresentation(IOutlineNode node, StringBuffer buffer, int tabs)
protected String getNodeText(IOutlineNode node)
protected void indent(StringBuffer buffer, int tabs)
Copyright © 2016. All Rights Reserved.