use of org.eclipse.xtext.xbase.imports.RewritableImportSection in project xtext-xtend by eclipse.
the class AbstractRewritableImportSectionTest method testVariousAdd.
@Test
public void testVariousAdd() {
final RewritableImportSection section = this.getSection();
this.addExtensionImport(section, Set.class);
this.addStaticImport(section, Collections.class);
this.addImport(section, List.class);
StringConcatenation _builder = new StringConcatenation();
_builder.append("import static extension java.util.Set.*");
_builder.newLine();
_builder.append("import static java.util.Collections.*");
_builder.newLine();
_builder.append("import java.util.List");
_builder.newLine();
this.assertEquals(section, _builder);
}
use of org.eclipse.xtext.xbase.imports.RewritableImportSection in project xtext-xtend by eclipse.
the class AbstractRewritableImportSectionTest method testDoubleAddAsString_5.
@Test
public void testDoubleAddAsString_5() {
final RewritableImportSection section = this.getSection(Collections.class);
section.addStaticImport("java.util.Collections", "sort");
section.addStaticImport("java.util.Collections", "*");
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.util.Collections");
_builder.newLine();
_builder.append("import static java.util.Collections.sort");
_builder.newLine();
_builder.append("import static java.util.Collections.*");
_builder.newLine();
this.assertEquals(section, _builder);
}
use of org.eclipse.xtext.xbase.imports.RewritableImportSection in project xtext-xtend by eclipse.
the class AbstractRewritableImportSectionTest method testSimpleAdd.
@Test
public void testSimpleAdd() {
final RewritableImportSection section = this.getSection(Set.class);
this.addImport(section, List.class);
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.util.Set");
_builder.newLine();
_builder.append("import java.util.List");
_builder.newLine();
this.assertEquals(section, _builder);
}
use of org.eclipse.xtext.xbase.imports.RewritableImportSection in project xtext-xtend by eclipse.
the class AbstractRewritableImportSectionTest method testVariousAdd_2.
@Test
public void testVariousAdd_2() {
final RewritableImportSection section = this.getSection();
this.addExtensionImport(section, Set.class);
this.addStaticImport(section, Set.class);
this.addImport(section, Set.class);
StringConcatenation _builder = new StringConcatenation();
_builder.append("import static extension java.util.Set.*");
_builder.newLine();
_builder.append("import java.util.Set");
_builder.newLine();
this.assertEquals(section, _builder);
}
use of org.eclipse.xtext.xbase.imports.RewritableImportSection in project xtext-xtend by eclipse.
the class AbstractRewritableImportSectionTest method testDoubleAddAsString_7.
@Test
public void testDoubleAddAsString_7() {
final RewritableImportSection section = this.getSection(Collections.class);
section.addStaticExtensionImport("java.util.Collections", "sort");
section.addStaticExtensionImport("java.util.Collections", "*");
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.util.Collections");
_builder.newLine();
_builder.append("import static extension java.util.Collections.sort");
_builder.newLine();
_builder.append("import static extension java.util.Collections.*");
_builder.newLine();
this.assertEquals(section, _builder);
}
Aggregations