@Test void run(@TempDir final File output) throws Exception { final File out = new File(output, "my.props"); new ScanTask(singletonList(new File("target/test-classes")), singletonList("org.talend.test.valid.update.UpdateService"), singletonList("org.talend.test.valid.*"), "include-exclude", out).run(); final Properties properties = new Properties(); try (final InputStream stream = new FileInputStream(out)) { properties.load(stream); } assertEquals(1, properties.size()); assertEquals("org.talend.test.valid.MyComponent," + "org.talend.test.valid.MyInternalization,org.talend.test.valid.MySource," + "org.talend.test.valid.customicon.MyComponent," + "org.talend.test.valid.customiconapi.MyComponent," + "org.talend.test.valid.datasetassourceconfig.MyComponent," + "org.talend.test.valid.datasetintwosourceswithonewithadditionalrequired.MyComponent," + "org.talend.test.valid.datasetintwosourceswithonewithadditionalrequired.MyComponent2," + "org.talend.test.valid.datastore.MyService," + "org.talend.test.valid.localconfiguration.MyComponent," + "org.talend.test.valid.nestedconfigtypes.WithNestedConfigTypes," + "org.talend.test.valid.nesteddataset.MyComponent," + "org.talend.test.valid.update.Comp,org.talend.test.valid.wording.MyComponent", properties.getProperty("classes.list")); }
@Override public void run() { output.getParentFile().mkdirs(); try (final OutputStream stream = new FileOutputStream(output)) { final Properties properties = new Properties(); properties.setProperty("classes.list", scanList().collect(joining(","))); properties.store(stream, "generated by " + getClass() + " at " + new Date()); } catch (final IOException e) { throw new IllegalStateException(e.getMessage(), e); } }
ScanTask implements Runnable { @Override public void run() { output.getParentFile().mkdirs(); try (final OutputStream stream = new FileOutputStream(output)) { final Properties properties = new Properties(); properties.setProperty("classes.list", scanList().collect(joining(","))); properties.store(stream, "generated by " + getClass() + " at " + new Date()); } catch (final IOException e) { throw new IllegalStateException(e.getMessage(), e); } } }
ScanTask implements Runnable { @Override public void run() { output.getParentFile().mkdirs(); try (final OutputStream stream = new FileOutputStream(output)) { final Properties properties = new Properties(); properties.setProperty("classes.list", scanList().collect(joining(","))); properties.store(stream, "generated by " + getClass() + " at " + new Date()); } catch (final IOException e) { throw new IllegalStateException(e.getMessage(), e); } }  }
ScanTask implements Runnable { @Override public void run() { output.getParentFile().mkdirs(); try (final OutputStream stream = new FileOutputStream(output)) { final Properties properties = new Properties(); properties.setProperty("classes.list", scanList().collect(joining(","))); properties.store(stream, "generated by " + getClass() + " at " + new Date()); } catch (final IOException e) { throw new IllegalStateException(e.getMessage(), e); } }  @Override void run(); }
ScanTask implements Runnable { @Override public void run() { output.getParentFile().mkdirs(); try (final OutputStream stream = new FileOutputStream(output)) { final Properties properties = new Properties(); properties.setProperty("classes.list", scanList().collect(joining(","))); properties.store(stream, "generated by " + getClass() + " at " + new Date()); } catch (final IOException e) { throw new IllegalStateException(e.getMessage(), e); } }  @Override void run();  }