@Test public void checkNetworkBuses() throws IOException { Network.BusView networkBusView = Mockito.mock(Network.BusView.class); Mockito.when(networkBusView.getBusStream()).thenAnswer(dummy -> Stream.of(bus)); Network network = Mockito.mock(Network.class); Mockito.when(network.getId()).thenReturn("network"); Mockito.when(network.getBusView()).thenReturn(networkBusView); assertTrue(BusesValidation.INSTANCE.checkBuses(network, looseConfig, data)); assertFalse(BusesValidation.INSTANCE.checkBuses(network, strictConfig, data)); assertTrue(ValidationType.BUSES.check(network, looseConfig, tmpDir)); assertFalse(ValidationType.BUSES.check(network, strictConfig, tmpDir)); ValidationWriter validationWriter = ValidationUtils.createValidationWriter(network.getId(), looseConfig, NullWriter.NULL_WRITER, ValidationType.BUSES); assertTrue(ValidationType.BUSES.check(network, looseConfig, validationWriter)); }
public boolean checkBuses(Network network, ValidationConfig config, Path file) throws IOException { Objects.requireNonNull(network); Objects.requireNonNull(config); Objects.requireNonNull(file); try (Writer writer = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) { return checkBuses(network, config, writer); } }
BusesValidation { public boolean checkBuses(Network network, ValidationConfig config, Path file) throws IOException { Objects.requireNonNull(network); Objects.requireNonNull(config); Objects.requireNonNull(file); try (Writer writer = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) { return checkBuses(network, config, writer); } } }
BusesValidation { public boolean checkBuses(Network network, ValidationConfig config, Path file) throws IOException { Objects.requireNonNull(network); Objects.requireNonNull(config); Objects.requireNonNull(file); try (Writer writer = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) { return checkBuses(network, config, writer); } } private  BusesValidation(); }
BusesValidation { public boolean checkBuses(Network network, ValidationConfig config, Path file) throws IOException { Objects.requireNonNull(network); Objects.requireNonNull(config); Objects.requireNonNull(file); try (Writer writer = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) { return checkBuses(network, config, writer); } } private  BusesValidation(); boolean checkBuses(Network network, ValidationConfig config, Path file); boolean checkBuses(Network network, ValidationConfig config, Writer writer); boolean checkBuses(Network network, ValidationConfig config, ValidationWriter busesWriter); boolean checkBuses(Bus bus, ValidationConfig config, Writer writer); boolean checkBuses(Bus bus, ValidationConfig config, ValidationWriter busesWriter); boolean checkBuses(String id, double loadP, double loadQ, double genP, double genQ, double batP, double batQ,
                                     double shuntP, double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ,
                                     double lineP, double lineQ, double danglingLineP, double danglingLineQ,
                                     double twtP, double twtQ, double tltP, double tltQ, boolean mainComponent, ValidationConfig config, Writer writer); boolean checkBuses(String id, double loadP, double loadQ, double genP, double genQ, double batP, double batQ, double shuntP,
                                     double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ, double lineP, double lineQ,
                                     double danglingLineP, double danglingLineQ, double twtP, double twtQ, double tltP, double tltQ,
                                     boolean mainComponent, ValidationConfig config, ValidationWriter busesWriter); }
BusesValidation { public boolean checkBuses(Network network, ValidationConfig config, Path file) throws IOException { Objects.requireNonNull(network); Objects.requireNonNull(config); Objects.requireNonNull(file); try (Writer writer = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) { return checkBuses(network, config, writer); } } private  BusesValidation(); boolean checkBuses(Network network, ValidationConfig config, Path file); boolean checkBuses(Network network, ValidationConfig config, Writer writer); boolean checkBuses(Network network, ValidationConfig config, ValidationWriter busesWriter); boolean checkBuses(Bus bus, ValidationConfig config, Writer writer); boolean checkBuses(Bus bus, ValidationConfig config, ValidationWriter busesWriter); boolean checkBuses(String id, double loadP, double loadQ, double genP, double genQ, double batP, double batQ,
                                     double shuntP, double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ,
                                     double lineP, double lineQ, double danglingLineP, double danglingLineQ,
                                     double twtP, double twtQ, double tltP, double tltQ, boolean mainComponent, ValidationConfig config, Writer writer); boolean checkBuses(String id, double loadP, double loadQ, double genP, double genQ, double batP, double batQ, double shuntP,
                                     double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ, double lineP, double lineQ,
                                     double danglingLineP, double danglingLineQ, double twtP, double twtQ, double tltP, double tltQ,
                                     boolean mainComponent, ValidationConfig config, ValidationWriter busesWriter); static final BusesValidation INSTANCE; }