11package de .ids_mannheim .korap ;
22
33import static org .junit .Assert .assertEquals ;
4+ import static org .junit .Assert .assertTrue ;
45
56import java .io .ByteArrayOutputStream ;
67import java .io .File ;
@@ -33,21 +34,21 @@ public class TestIndexer {
3334 public void testArguments () throws IOException {
3435 Indexer .main (new String [] { "-c" , "src/test/resources/krill.properties" ,
3536 "-i" , "src/test/resources/bzk" });
36- assertEquals ( "Added or updated 1 file.\n " , outputStream . toString ( ));
37+ assertTrue ( outputStream . toString (). startsWith ( "Added or updated 1 file." ));
3738 }
3839
3940 @ Test
4041 public void testOutputArgument () throws IOException {
4142 Indexer .main (new String [] { "-c" , "src/test/resources/krill.properties" ,
4243 "-i" , "src/test/resources/bzk" , "-o" , "test-output" });
43- assertEquals ( "Added or updated 1 file.\n " , outputStream . toString ( ));
44+ assertTrue ( outputStream . toString (). startsWith ( "Added or updated 1 file." ));
4445 }
4546
4647 @ Test
4748 public void testMultipleInputFiles () throws IOException {
4849 Indexer .main (new String [] { "-c" , "src/test/resources/krill.properties" ,
4950 "-i" , "src/test/resources/wiki" });
50- assertEquals ( "Added or updated 19 files.\n " , outputStream . toString ( ));
51+ assertTrue ( outputStream . toString (). startsWith ( "Added or updated 19 files." ));
5152 }
5253
5354
@@ -58,7 +59,7 @@ public void testAdding () throws IOException {
5859 "-i" , "src/test/resources/bzk" ,
5960 "-a" });
6061 logger .info (outputStream .toString ());
61- assertEquals (outputStream .toString (), "Added 1 file.\n " );
62+ assertTrue (outputStream .toString (). startsWith ( "Added 1 file." ) );
6263 }
6364
6465
@@ -68,7 +69,7 @@ public void testMultipleInputDirectories () throws IOException {
6869 "-i" ,
6970 "src/test/resources/bzk;src/test/resources/goe;src/test/resources/sgbr" ,
7071 "-o" , "test-index" });
71- assertEquals ( "Added or updated 5 files.\n " , outputStream . toString ( ));
72+ assertTrue ( outputStream . toString (). startsWith ( "Added or updated 5 files." ));
7273 }
7374
7475 @ Test
@@ -103,7 +104,7 @@ public void testUnicodeProblem () throws IOException {
103104 "-o" , "test-index2"
104105 });
105106 logger .info (outputStream .toString ());
106- assertEquals (outputStream .toString (), "Added 1 file.\n " );
107+ assertTrue (outputStream .toString (). startsWith ( "Added 1 file." ) );
107108 }
108109
109110 @ Test
@@ -119,7 +120,7 @@ public void testMaxTextSize () throws IOException {
119120
120121 Indexer .main (new String [] { "-c" , tempPropertiesFile .getAbsolutePath (),
121122 "-i" , "src/test/resources/bzk" , "-o" , "test-output-1" });
122- assertEquals ( "Added or updated 1 file.\n " , outputStream . toString ( ));
123+ assertTrue ( outputStream . toString (). startsWith ( "Added or updated 1 file." ));
123124
124125 tempPropertiesFile .delete ();
125126 }
0 commit comments