use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.
the class ParserTest method testImport_02.
@Test
public void testImport_02() throws Exception {
XImportDeclaration importDeclaration = importDeclaration("import java . util . /*comment*/ List");
assertNotNull(importDeclaration);
assertEquals("java.util.List", importDeclaration.getImportedTypeName());
assertFalse(importDeclaration.isWildcard());
assertFalse(importDeclaration.isStatic());
assertFalse(importDeclaration.isExtension());
}
use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.
the class ParserTest method testImport_03.
@Test
public void testImport_03() throws Exception {
XImportDeclaration importDeclaration = importDeclaration("import static java.util.Collections. * // foobar");
assertNotNull(importDeclaration);
assertEquals("java.util.Collections", importDeclaration.getImportedTypeName());
assertTrue(importDeclaration.isWildcard());
assertTrue(importDeclaration.isStatic());
assertFalse(importDeclaration.isExtension());
}
use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.
the class ParserTest method testImport_04.
@Test
public void testImport_04() throws Exception {
XImportDeclaration importDeclaration = importDeclaration("import static extension java.lang.reflect.\nArrays.*");
assertNotNull(importDeclaration);
assertEquals("java.lang.reflect.Arrays", importDeclaration.getImportedTypeName());
assertTrue(importDeclaration.isWildcard());
assertTrue(importDeclaration.isStatic());
assertTrue(importDeclaration.isExtension());
}
use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.
the class ParserTest method testBug367949.
@Test
public void testBug367949() throws Exception {
XImportDeclaration importDeclaration = importDeclaration("import org.eclipse.xtext.^create");
assertNotNull(importDeclaration);
assertEquals("org.eclipse.xtext.create", importDeclaration.getImportedTypeName());
}
use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.
the class ModelExtensionsTest method testXtendImport.
@Test
public void testXtendImport() throws Exception {
XImportDeclaration xtendImport = xtypeFactory.createXImportDeclaration();
assertFalse(xtendImport.isWildcard());
assertNull(xtendImport.getImportedTypeName());
xtendImport.setImportedNamespace("");
assertFalse(xtendImport.isWildcard());
assertEquals("", xtendImport.getImportedTypeName());
xtendImport.setImportedNamespace("java.lang.Collections.*");
assertTrue(xtendImport.isWildcard());
assertEquals("java.lang.Collections", xtendImport.getImportedTypeName());
}
Aggregations