diff --git a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TKvTest.java b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TKvTest.java index e681b640f49..e630f71c7b5 100644 --- a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TKvTest.java +++ b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TKvTest.java @@ -35,9 +35,9 @@ public void test1() { }); String kv = tKv.rendering(); - assertThat(kv, containsString("ABCDEFGHIJ\n")); - assertThat(kv, containsString("KLMNOPQRST\n")); - assertThat(kv, containsString("UVWXYZ\n")); + assertThat(kv, containsString("ABCDEFGHIJ" + System.lineSeparator())); + assertThat(kv, containsString("KLMNOPQRST" + System.lineSeparator())); + assertThat(kv, containsString("UVWXYZ" + System.lineSeparator())); tTable.addRow("OPTIONS", kv); String table = tTable.rendering(); diff --git a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TLadderTest.java b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TLadderTest.java index 7b57edbc3f2..4feb69e55fb 100644 --- a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TLadderTest.java +++ b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TLadderTest.java @@ -31,10 +31,10 @@ public void testRendering() throws Exception { ladder.addItem("3"); ladder.addItem("4"); String result = ladder.rendering(); - String expected = "1\n" + - " `-2\n" + - " `-3\n" + - " `-4\n"; + String expected = "1" + System.lineSeparator() + + " `-2" + System.lineSeparator() + + " `-3" + System.lineSeparator() + + " `-4" + System.lineSeparator(); assertThat(result, equalTo(expected)); System.out.println(result); } diff --git a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TTableTest.java b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TTableTest.java index 7d91ea8b1ff..abc70292dab 100644 --- a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TTableTest.java +++ b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/textui/TTableTest.java @@ -28,11 +28,11 @@ public void test1() throws Exception { table.addRow(1, "one", "uno", "un"); table.addRow(2, "two", "dos", "deux"); String result = table.rendering(); - String expected = "+-+---+---+----+\n" + - "|1|one|uno|un |\n" + - "+-+---+---+----+\n" + - "|2|two|dos|deux|\n" + - "+-+---+---+----+\n"; + String expected = "+-+---+---+----+" + System.lineSeparator() + + "|1|one|uno|un |" + System.lineSeparator() + + "+-+---+---+----+" + System.lineSeparator() + + "|2|two|dos|deux|" + System.lineSeparator() + + "+-+---+---+----+" + System.lineSeparator(); assertThat(result, equalTo(expected)); System.out.println(result); } @@ -46,9 +46,9 @@ public void test2() throws Exception { }); table.addRow(1, "abcde", "ABCDE"); String result = table.rendering(); - String expected = "+-+----------+----------+\n" + - "|1| abcde | ABCDE|\n" + - "+-+----------+----------+\n"; + String expected = "+-+----------+----------+" + System.lineSeparator() + + "|1| abcde | ABCDE|" + System.lineSeparator() + + "+-+----------+----------+" + System.lineSeparator(); assertThat(result, equalTo(expected)); System.out.println(result); }