33import static org .junit .Assert .assertEquals ;
44
55import java .io .ByteArrayOutputStream ;
6+ import java .util .Locale ;
67
78import org .junit .Before ;
89import org .junit .Test ;
@@ -54,7 +55,8 @@ public void setUp() throws Exception {
5455 }
5556
5657 @ Test
57- public void export () throws Exception {
58+ public void exportLocaleDe () throws Exception {
59+ Locale .setDefault (new Locale ("de" , "ch" ));
5860 ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
5961 SimpleGcWriter writer = new SimpleGcWriter (outputStream );
6062
@@ -74,4 +76,19 @@ public void export() throws Exception {
7476 assertEquals ("name of event 2" , "InitialMarkGC" , secondLine [0 ]);
7577 }
7678
79+ @ Test
80+ public void exportLocaleSv () throws Exception {
81+ Locale .setDefault (new Locale ("sv" , "se" ));
82+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
83+ SimpleGcWriter writer = new SimpleGcWriter (outputStream );
84+
85+ writer .write (gcModel );
86+
87+ String [] lines = outputStream .toString ().split (System .getProperty ("line.separator" ));
88+ assertEquals ("line count" , 2 , lines .length );
89+
90+ String [] firstLine = lines [0 ].split (" " );
91+ assertEquals ("number of parts in line 1" , 3 , firstLine .length );
92+ assertEquals ("timestamp" , "0.677000" , firstLine [1 ]);
93+ }
7794}
0 commit comments