@Test public void reuseProvider() { ContingenciesProviderFactory factory = new GroovyDslContingenciesProviderFactory(); InputStream inputStreamDsl = new ByteArrayInputStream(createAllBranchesDsl().getBytes(StandardCharsets.UTF_8)); ContingenciesProvider provider = factory.create(inputStreamDsl); assertTrue(provider instanceof GroovyDslContingenciesProvider); List<Contingency> contingencies1 = provider.getContingencies(network); assertEquals(4, contingencies1.size()); List<Contingency> contingencies2 = provider.getContingencies(network); assertEquals(4, contingencies2.size()); assertEquals(getContingenciesNames(contingencies1), getContingenciesNames(contingencies2)); }
@Override public List<Contingency> getContingencies(Network network) { return new ContingencyDslLoader(script).load(network); }
GroovyDslContingenciesProvider extends AbstractDslContingenciesProvider { @Override public List<Contingency> getContingencies(Network network) { return new ContingencyDslLoader(script).load(network); } }
GroovyDslContingenciesProvider extends AbstractDslContingenciesProvider { @Override public List<Contingency> getContingencies(Network network) { return new ContingencyDslLoader(script).load(network); } GroovyDslContingenciesProvider(final Path path);  GroovyDslContingenciesProvider(final InputStream input); }
GroovyDslContingenciesProvider extends AbstractDslContingenciesProvider { @Override public List<Contingency> getContingencies(Network network) { return new ContingencyDslLoader(script).load(network); } GroovyDslContingenciesProvider(final Path path);  GroovyDslContingenciesProvider(final InputStream input); @Override List<Contingency> getContingencies(Network network); }
GroovyDslContingenciesProvider extends AbstractDslContingenciesProvider { @Override public List<Contingency> getContingencies(Network network) { return new ContingencyDslLoader(script).load(network); } GroovyDslContingenciesProvider(final Path path);  GroovyDslContingenciesProvider(final InputStream input); @Override List<Contingency> getContingencies(Network network);  }