@Test public void withComparison() throws IOException { writeToDslFile("for (l in network.lines) {", " if (l.terminal1.voltageLevel.nominalV >= 380) {", " contingency(l.id) { equipments l.id }", " }", "}"); List<Contingency> contingencies = new GroovyDslContingenciesProvider(dslFile) .getContingencies(network); assertEquals(2, contingencies.size()); assertEquals(Sets.newHashSet("NHV1_NHV2_1", "NHV1_NHV2_2"), getContingenciesNames(contingencies)); writeToDslFile("for (l in network.lines) {", " if (l.terminal1.voltageLevel.nominalV >= 500) {", " contingency(l.id) { equipments l.id }", " }", "}"); contingencies = new GroovyDslContingenciesProvider(dslFile) .getContingencies(network); assertTrue(contingencies.isEmpty()); }
@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);  }