Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8d47094

Browse filesBrowse files
committed
Investigating issue with failing test automation on pipeline calls.
1 parent 03b2d72 commit 8d47094
Copy full SHA for 8d47094

1 file changed

+13-5Lines changed: 13 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/test/java/org/utplsql/cli/VersionInfoCommandIT.java‎

Copy file name to clipboardExpand all lines: src/test/java/org/utplsql/cli/VersionInfoCommandIT.java
+13-5Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,23 @@ void setupCaptureSystemOut() {
1818
capturer = new SystemCapturer.SystemOutCapturer();
1919
}
2020

21-
private int getNonEmptyLines(String content) {
22-
return (int) Arrays.stream(content.split("[\n|\r]"))
21+
private String[] getNonEmptyLineArray(String content) {
22+
return Arrays.stream(content.split("[\r\n]+"))
2323
.filter(line -> !line.isEmpty())
24-
.count();
24+
.toArray(String[]::new);
2525
}
2626

2727
private void assertNumberOfLines( int expected, String content ) {
28-
int numOfLines = getNonEmptyLines(content);
29-
assertEquals(expected, numOfLines, String.format("Expected output to have %n lines, but got %n", expected, numOfLines));
28+
String[] lines = getNonEmptyLineArray(content);
29+
assertEquals(expected, lines.length, () -> {
30+
StringBuilder sb = new StringBuilder();
31+
sb.append(String.format("Expected output to have %d lines, but got %d.%n", expected, lines.length));
32+
sb.append("Actual lines were:").append(System.lineSeparator());
33+
for (int i = 0; i < lines.length; i++) {
34+
sb.append(String.format(" [%d] %s%n", i, lines[i]));
35+
}
36+
return sb.toString();
37+
});
3038
}
3139
@Test
3240
void infoCommandRunsWithoutConnection() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.