Index: modules/luni/src/test/java/tests/api/java/io/StringWriterTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/StringWriterTest.java (revision 397199) +++ modules/luni/src/test/java/tests/api/java/io/StringWriterTest.java (working copy) @@ -83,8 +83,8 @@ char[] c = new char[1000]; "This is a test string".getChars(0, 21, c, 0); sw.write(c, 0, 21); - assertTrue("Chars not written properly", sw.toString().equals( - "This is a test string")); + assertEquals("Chars not written properly", + "This is a test string", sw.toString()); } /** @@ -140,7 +140,7 @@ public void test_writeI() { // Test for method void java.io.StringWriter.write(int) sw.write('c'); - assertTrue("Char not written properly", sw.toString().equals("c")); + assertEquals("Char not written properly", "c", sw.toString()); } /** @@ -149,8 +149,8 @@ public void test_writeLjava_lang_String() { // Test for method void java.io.StringWriter.write(java.lang.String) sw.write("This is a test string"); - assertTrue("String not written properly", sw.toString().equals( - "This is a test string")); + assertEquals("String not written properly", + "This is a test string", sw.toString()); } /** @@ -160,7 +160,7 @@ // Test for method void java.io.StringWriter.write(java.lang.String, // int, int) sw.write("This is a test string", 2, 2); - assertTrue("String not written properly", sw.toString().equals("is")); + assertEquals("String not written properly", "is", sw.toString()); } /** Index: modules/luni/src/test/java/tests/api/java/io/CharArrayWriterTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/CharArrayWriterTest.java (revision 397199) +++ modules/luni/src/test/java/tests/api/java/io/CharArrayWriterTest.java (working copy) @@ -34,7 +34,7 @@ public void test_Constructor() { // Test for method java.io.CharArrayWriter() cw = new CharArrayWriter(90); - assertTrue("Created incorrect writer", cw.size() == 0); + assertEquals("Created incorrect writer", 0, cw.size()); } /** @@ -43,7 +43,7 @@ public void test_ConstructorI() { // Test for method java.io.CharArrayWriter(int) cw = new CharArrayWriter(); - assertTrue("Created incorrect writer", cw.size() == 0); + assertEquals("Created incorrect writer", 0, cw.size()); } /** @@ -74,8 +74,8 @@ try { char[] c = new char[100]; cr.read(c, 0, 5); - assertTrue("Reset failed to reset buffer", "Hello" - .equals(new String(c, 0, 5))); + assertEquals("Reset failed to reset buffer", + "Hello", new String(c, 0, 5)); } catch (IOException e) { fail("Exception during reset test : " + e.getMessage()); } @@ -86,9 +86,9 @@ */ public void test_size() { // Test for method int java.io.CharArrayWriter.size() - assertTrue("Returned incorrect size", cw.size() == 0); + assertEquals("Returned incorrect size", 0, cw.size()); cw.write(hw, 5, 5); - assertTrue("Returned incorrect size", cw.size() == 5); + assertEquals("Returned incorrect size", 5, cw.size()); } /** @@ -101,8 +101,8 @@ try { char[] c = new char[100]; cr.read(c, 0, 10); - assertTrue("toCharArray failed to return correct array", - "HelloWorld".equals(new String(c, 0, 10))); + assertEquals("toCharArray failed to return correct array", + "HelloWorld", new String(c, 0, 10)); } catch (IOException e) { fail("Exception during toCharArray test : " + e.getMessage()); } @@ -115,7 +115,8 @@ // Test for method java.lang.String java.io.CharArrayWriter.toString() cw.write("HelloWorld", 5, 5); cr = new CharArrayReader(cw.toCharArray()); - assertTrue("Returned incorrect string", "World".equals(cw.toString())); + assertEquals("Returned incorrect string", + "World", cw.toString()); } /** @@ -128,8 +129,8 @@ try { char[] c = new char[100]; cr.read(c, 0, 5); - assertTrue("Writer failed to write correct chars", "World" - .equals(new String(c, 0, 5))); + assertEquals("Writer failed to write correct chars", + "World", new String(c, 0, 5)); } catch (IOException e) { fail("Exception during write test : " + e.getMessage()); } @@ -159,7 +160,7 @@ cw.write('T'); cr = new CharArrayReader(cw.toCharArray()); try { - assertTrue("Writer failed to write char", cr.read() == 'T'); + assertEquals("Writer failed to write char", 'T', cr.read()); } catch (IOException e) { fail("Exception during write test : " + e.getMessage()); } @@ -176,8 +177,8 @@ try { char[] c = new char[100]; cr.read(c, 0, 5); - assertTrue("Writer failed to write correct chars", "World" - .equals(new String(c, 0, 5))); + assertEquals("Writer failed to write correct chars", + "World", new String(c, 0, 5)); } catch (IOException e) { fail("Exception during write test : " + e.getMessage()); } @@ -205,8 +206,8 @@ StringWriter sw = new StringWriter(); try { cw.writeTo(sw); - assertTrue("Writer failed to write correct chars", "HelloWorld" - .equals(sw.toString())); + assertEquals("Writer failed to write correct chars", + "HelloWorld", sw.toString()); } catch (IOException e) { fail("Exception during writeTo test : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/io/PipedOutputStreamTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/PipedOutputStreamTest.java (revision 397199) +++ modules/luni/src/test/java/tests/api/java/io/PipedOutputStreamTest.java (working copy) @@ -196,7 +196,7 @@ rt.start(); out.write('c'); out.flush(); - assertTrue("Wrote incorrect byte", reader.read(1).equals("c")); + assertEquals("Wrote incorrect byte", "c", reader.read(1)); } catch (IOException e) { fail("IOException during write test : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java (revision 397199) +++ modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java (working copy) @@ -500,7 +500,7 @@ os = new java.io.PrintStream(bos, true); os.write('t'); bis = new java.io.ByteArrayInputStream(bos.toByteArray()); - assertTrue("Incorrect char written", bis.read() == 't'); + assertEquals("Incorrect char written", 't', bis.read()); }