File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
src/test/java/net/openhft/chronicle/wire/domestic/streaming/streams Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,12 @@ void streamTypeMarketDataSimple() {
5353 .map (Object ::toString )
5454 .collect (Collectors .joining ("," ));
5555
56- assertEquals ("!MarketData {\n " +
56+ java .util .function .Function <String , String > sort = str -> java .util .Arrays .stream (str .split ("\n " ))
57+ .map (l -> l .replaceAll (",$" , "" ))
58+ .sorted ()
59+ .collect (java .util .stream .Collectors .joining ("\n " ));
60+
61+ String expected = "!MarketData {\n " +
5762 " symbol: MSFT,\n " +
5863 " last: 100.0,\n " +
5964 " high: 110.0,\n " +
@@ -70,22 +75,27 @@ void streamTypeMarketDataSimple() {
7075 " last: 101.0,\n " +
7176 " high: 110.0,\n " +
7277 " low: 90.0\n " +
73- "}\n " , s );
78+ "}\n " ;
79+ assertEquals (sort .apply (expected ), sort .apply (s ));
7480 }
7581
7682 @ Test
7783 void streamTypeMarketDataSimpleWIthInvalid () {
7884 ClassAliasPool .CLASS_ALIASES .addAlias (MarketData .class );
7985 MarketData invalid = new MarketData ("invalid" , 0 , 0 , 0 );
8086 // toString() still works.
81- assertEquals ("" +
87+ java .util .function .Function <String , String > sort = s -> java .util .Arrays .stream (s .split ("\n " ))
88+ .map (l -> l .replaceAll (",$" , "" ))
89+ .sorted ()
90+ .collect (java .util .stream .Collectors .joining ("\n " ));
91+ String expected = "" +
8292 "!MarketData {\n " +
8393 " symbol: invalid,\n " +
8494 " last: 0.0,\n " +
8595 " high: 0.0,\n " +
8696 " low: 0.0\n " +
87- "}\n " ,
88- invalid .toString ());
97+ "}\n " ;
98+ assertEquals ( sort . apply ( expected ), sort . apply ( invalid .toString () ));
8999
90100 try {
91101 MarshallableIn wire = createThenValueOuts (
You can’t perform that action at this time.
0 commit comments