1616package com .ibm .g11n .pipeline .resfilter .impl ;
1717
1818import static org .junit .Assert .assertEquals ;
19+ import static org .junit .Assert .assertThat ;
1920import static org .junit .Assert .assertTrue ;
2021
2122import java .io .File ;
3233import java .util .Locale ;
3334
3435import org .junit .Test ;
36+ import org .xmlunit .matchers .CompareMatcher ;
3537
3638import com .ibm .g11n .pipeline .resfilter .FilterOptions ;
3739import com .ibm .g11n .pipeline .resfilter .LanguageBundle ;
@@ -62,7 +64,8 @@ public class XLIFFResourceTest {
6264 List <ResourceString > lst = new LinkedList <>();
6365
6466 lst .add (ResourceString .with ("1" , "Quetzal" ).sequenceNumber (1 ).build ());
65- lst .add (ResourceString .with ("3" , "An application to manipulate and process XLIFF documents" ).sequenceNumber (2 ).build ());
67+ lst .add (ResourceString .with ("3" , "An application to manipulate and process XLIFF documents" ).sequenceNumber (2 )
68+ .build ());
6669 lst .add (ResourceString .with ("4" , "XLIFF Data Manager" ).sequenceNumber (3 ).build ());
6770 Collections .sort (lst , new ResourceStringComparator ());
6871 EXPECTED_INPUT_RES_LIST = lst ;
@@ -72,8 +75,8 @@ public class XLIFFResourceTest {
7275
7376 static {
7477 LanguageBundleBuilder bundleBuilder = new LanguageBundleBuilder (false );
75- bundleBuilder .addResourceString ("3" , "XLIFF 文書を編集、または処理 するアプリケーションです。" , 2 ,
76- null , "An application to manipulate and process XLIFF documents" );
78+ bundleBuilder .addResourceString ("3" , "XLIFF 文書を編集、または処理 するアプリケーションです。" , 2 , null ,
79+ "An application to manipulate and process XLIFF documents" );
7780 bundleBuilder .addResourceString ("4" , "XLIFF データ・マネージャ" , 3 , null , "XLIFF Data Manager" );
7881 bundleBuilder .addResourceString ("1" , "Quetzal" , 1 , null , "Quetzal" );
7982
@@ -115,7 +118,7 @@ public void testWrite() throws IOException, ResourceFilterException {
115118 try (OutputStream os = new FileOutputStream (tempFile )) {
116119 res .write (os , WRITE_BUNDLE , new FilterOptions (Locale .JAPANESE ));
117120 os .flush ();
118- assertTrue ( ResourceTestUtil . compareFiles ( EXPECTED_WRITE_FILE , tempFile ));
121+ assertThat ( EXPECTED_WRITE_FILE , CompareMatcher . isIdenticalTo ( tempFile ));
119122 }
120123 }
121124
@@ -132,7 +135,8 @@ public void testMerge() throws IOException, ResourceFilterException {
132135 res .merge (is , os , MERGE_BUNDLE , new FilterOptions (Locale .ENGLISH ));
133136 os .flush ();
134137 // TODO: Not ready yet
135- // assertTrue(ResourceTestUtil.compareFiles(EXPECTED_MERGE_1_FILE, tempFile));
138+ // assertTrue(ResourceTestUtil.compareFiles(EXPECTED_MERGE_1_FILE,
139+ // tempFile));
136140 }
137141
138142 tempFile = File .createTempFile (this .getClass ().getSimpleName (), ".xlf" );
@@ -143,7 +147,8 @@ public void testMerge() throws IOException, ResourceFilterException {
143147 res .merge (is , os , MERGE_BUNDLE , new FilterOptions (Locale .JAPANESE ));
144148 os .flush ();
145149 // TODO: Not ready yet
146- // assertTrue(ResourceTestUtil.compareFiles(EXPECTED_MERGE_2_FILE, tempFile));
150+ // assertTrue(ResourceTestUtil.compareFiles(EXPECTED_MERGE_2_FILE,
151+ // tempFile));
147152 }
148153 }
149154}
0 commit comments