Skip to content

Commit a0c431d

Browse files
committed
test
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
1 parent 9c0abce commit a0c431d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

loadflow/loadflow-validation/src/test/java/com/powsybl/loadflow/validation/ValidationToolTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void loadFlowValidationShouldSucceedWithRequiredOption() {
6969
"Validate load-flow results of network network - validation type: SHUNTS - result: success",
7070
"Validate load-flow results of network network - validation type: TWTS - result: success",
7171
"Validate load-flow results of network network - validation type: TWTS3W - result: success" + System.lineSeparator());
72-
assertCommandSuccessfulMatch(new String[]{"loadflow-validation", "--case-file", "network.xiidm", "--output-folder", "test"}, expectedOut);
72+
assertTest(new String[]{"loadflow-validation", "--case-file", "network.xiidm", "--output-folder", "test"}, expectedOut);
7373
}
7474

7575
@Test
@@ -84,6 +84,6 @@ void loadFlowValidationShouldComputePrivateValidation() {
8484
"Validate load-flow results of network network - validation type: TWTS - result: success",
8585
"Validate load-flow results of network network - validation type: TWTS3W - result: success",
8686
"Validate load-flow results of network network - validation type: Extension/extensionValidationMock1 - result: success" + System.lineSeparator());
87-
assertCommandSuccessfulMatch(new String[]{"loadflow-validation", "--case-file", "network.xiidm", "--output-folder", "test", "--with-extensions-validation"}, expectedOut);
87+
assertTest(new String[]{"loadflow-validation", "--case-file", "network.xiidm", "--output-folder", "test", "--with-extensions-validation"}, expectedOut);
8888
}
8989
}

tools-test/src/main/java/com/powsybl/tools/test/AbstractToolTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ protected void assertCommandSuccessfulMatch(String[] args, String expectedOut) {
118118
assertCommandResult(args, CommandLineTools.COMMAND_OK_STATUS, expectedOut, "", AbstractToolTest::containsTxt);
119119
}
120120

121+
protected void assertTest(String[] args, String expectedOut) {
122+
assertCommandResult(args, CommandLineTools.EXECUTION_ERROR_STATUS, expectedOut, "", AbstractToolTest::containsTxt);
123+
}
124+
121125
/**
122126
* Asserts the command returns {@link CommandLineTools#COMMAND_OK_STATUS}, the error output is empty and the output matches the regex pattern
123127
* @param args the tested command and its parameters

0 commit comments

Comments
 (0)