DescriptorCreator { public void run() throws Exception { run(DEFAULT_OUTPUT_ROOT); }  static void main(String[] args); static String getComponentName(); void run(); void run(String outputRoot); static final String DEFAULT_OUTPUT_ROOT; }
@Test public void testRun() throws Exception { DescriptorCreator creator = new DescriptorCreator(); String outputRoot = "src" + File.separator + "test" + File.separator + "resources" + File.separator; creator.run(outputRoot); File crDir = new File(outputRoot + Stream.of("de", "julielab", "jcore", "reader", "testreader", "desc").collect(joining(File.separator))); File aeDir = new File(outputRoot + Stream.of("de", "julielab", "jcore", "ae", "testae", "desc").collect(joining(File.separator))); File consumerDir = new File(outputRoot + Stream.of("de", "julielab", "jcore", "consumer", "testconsumer", "desc").collect(joining(File.separator))); File multiplierDir = new File(outputRoot + Stream.of("de", "julielab", "jcore", "multiplier", "testmultiplier", "desc").collect(joining(File.separator))); File abstractAeDir = new File(outputRoot + Stream.of("de", "julielab", "jcore", "ae", "abstractae", "desc").collect(joining(File.separator))); assertTrue(crDir.exists()); assertTrue(aeDir.exists()); assertTrue(consumerDir.exists()); assertTrue(multiplierDir.exists()); assertFalse(abstractAeDir.exists()); assertTrue(containsDescriptor(crDir)); assertTrue(containsDescriptor(aeDir)); assertTrue(containsDescriptor(consumerDir)); assertTrue(containsDescriptor(multiplierDir)); final String content = IOStreamUtilities.getStringFromInputStream(new FileInputStream(Path.of(aeDir.getCanonicalPath(), "de.julielab.jcore.ae.testae.TestAE.xml").toFile())); assertTrue(content.contains("<import name=\"de.julielab.jcore.types.jcore-morpho-syntax-types\"/>")); }