Skip to content

Commit 2308a36

Browse files
kexianjunralf0131
authored andcommitted
Fix some unit test failure (#3337)
1 parent 21046c8 commit 2308a36

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TKvTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public void test1() {
3535
});
3636

3737
String kv = tKv.rendering();
38-
assertThat(kv, containsString("ABCDEFGHIJ\n"));
39-
assertThat(kv, containsString("KLMNOPQRST\n"));
40-
assertThat(kv, containsString("UVWXYZ\n"));
38+
assertThat(kv, containsString("ABCDEFGHIJ" + System.lineSeparator()));
39+
assertThat(kv, containsString("KLMNOPQRST" + System.lineSeparator()));
40+
assertThat(kv, containsString("UVWXYZ" + System.lineSeparator()));
4141

4242
tTable.addRow("OPTIONS", kv);
4343
String table = tTable.rendering();

dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TLadderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public void testRendering() throws Exception {
3131
ladder.addItem("3");
3232
ladder.addItem("4");
3333
String result = ladder.rendering();
34-
String expected = "1\n" +
35-
" `-2\n" +
36-
" `-3\n" +
37-
" `-4\n";
34+
String expected = "1" + System.lineSeparator() +
35+
" `-2" + System.lineSeparator() +
36+
" `-3" + System.lineSeparator() +
37+
" `-4" + System.lineSeparator();
3838
assertThat(result, equalTo(expected));
3939
System.out.println(result);
4040
}

dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TTableTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public void test1() throws Exception {
2828
table.addRow(1, "one", "uno", "un");
2929
table.addRow(2, "two", "dos", "deux");
3030
String result = table.rendering();
31-
String expected = "+-+---+---+----+\n" +
32-
"|1|one|uno|un |\n" +
33-
"+-+---+---+----+\n" +
34-
"|2|two|dos|deux|\n" +
35-
"+-+---+---+----+\n";
31+
String expected = "+-+---+---+----+" + System.lineSeparator() +
32+
"|1|one|uno|un |" + System.lineSeparator() +
33+
"+-+---+---+----+" + System.lineSeparator() +
34+
"|2|two|dos|deux|" + System.lineSeparator() +
35+
"+-+---+---+----+" + System.lineSeparator();
3636
assertThat(result, equalTo(expected));
3737
System.out.println(result);
3838
}
@@ -46,9 +46,9 @@ public void test2() throws Exception {
4646
});
4747
table.addRow(1, "abcde", "ABCDE");
4848
String result = table.rendering();
49-
String expected = "+-+----------+----------+\n" +
50-
"|1| abcde | ABCDE|\n" +
51-
"+-+----------+----------+\n";
49+
String expected = "+-+----------+----------+" + System.lineSeparator() +
50+
"|1| abcde | ABCDE|" + System.lineSeparator() +
51+
"+-+----------+----------+" + System.lineSeparator();
5252
assertThat(result, equalTo(expected));
5353
System.out.println(result);
5454
}

0 commit comments

Comments
 (0)