You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2015/10/12 20:21:12 UTC

svn commit: r1708191 - in /webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io: ByteStreamComparator.java CharacterStreamComparator.java

Author: veithen
Date: Mon Oct 12 18:21:12 2015
New Revision: 1708191

URL: http://svn.apache.org/viewvc?rev=1708191&view=rev
Log:
Avoid usage of deprecated class.

Modified:
    webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/ByteStreamComparator.java
    webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/CharacterStreamComparator.java

Modified: webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/ByteStreamComparator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/ByteStreamComparator.java?rev=1708191&r1=1708190&r2=1708191&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/ByteStreamComparator.java (original)
+++ webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/ByteStreamComparator.java Mon Oct 12 18:21:12 2015
@@ -19,12 +19,12 @@
 
 package org.apache.axiom.testutils.io;
 
+import static org.junit.Assert.fail;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import junit.framework.Assert;
-
 /**
  * {@link OutputStream} implementation that compares the data written to it with another character
  * sequence specified by an {@link InputStream}.
@@ -42,11 +42,11 @@ public class ByteStreamComparator extend
         while (len > 0) {
             int c = in.read(compareBuffer, 0, Math.min(compareBuffer.length, len));
             if (c == -1) {
-                Assert.fail("The two streams have different lengths");
+                fail("The two streams have different lengths");
             }
             for (int i=0; i<c; i++) {
                 if (buffer[off] != compareBuffer[i]) {
-                    Assert.fail("Byte mismatch at position " + position);
+                    fail("Byte mismatch at position " + position);
                 }
                 off++;
                 len--;
@@ -60,7 +60,7 @@ public class ByteStreamComparator extend
 
     public void close() throws IOException {
         if (in.read() != -1) {
-            Assert.fail("The two streams have different lengths");
+            fail("The two streams have different lengths");
         }
     }
 

Modified: webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/CharacterStreamComparator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/CharacterStreamComparator.java?rev=1708191&r1=1708190&r2=1708191&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/CharacterStreamComparator.java (original)
+++ webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/io/CharacterStreamComparator.java Mon Oct 12 18:21:12 2015
@@ -19,12 +19,12 @@
 
 package org.apache.axiom.testutils.io;
 
+import static org.junit.Assert.fail;
+
 import java.io.IOException;
 import java.io.Reader;
 import java.io.Writer;
 
-import junit.framework.Assert;
-
 /**
  * {@link Writer} implementation that compares the data written to it with another character
  * sequence specified by a {@link Reader}.
@@ -42,11 +42,11 @@ public class CharacterStreamComparator e
         while (len > 0) {
             int c = in.read(compareBuffer, 0, Math.min(compareBuffer.length, len));
             if (c == -1) {
-                Assert.fail("The two streams have different lengths");
+                fail("The two streams have different lengths");
             }
             for (int i=0; i<c; i++) {
                 if (buffer[off] != compareBuffer[i]) {
-                    Assert.fail("Character mismatch at position " + position);
+                    fail("Character mismatch at position " + position);
                 }
                 off++;
                 len--;
@@ -60,7 +60,7 @@ public class CharacterStreamComparator e
 
     public void close() throws IOException {
         if (in.read() != -1) {
-            Assert.fail("The two streams have different lengths");
+            fail("The two streams have different lengths");
         }
     }
 }