ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1678521 - in /webservices/axiom/trunk: ./ aspects/dom-aspects/ aspects/dom-aspects/src/test/java/org/apache/axiom/dom/ modules/axiom-api/ modules/axiom-api/src/test/java/org/apache/axiom/util/base64/ systests/wss4j-tests/ systests/wss4j-te...
Date Sat, 09 May 2015 20:16:43 GMT
Author: veithen
Date: Sat May  9 20:16:42 2015
New Revision: 1678521

URL: http://svn.apache.org/r1678521
Log:
Use Google Truth instead of Hamcrest.

Modified:
    webservices/axiom/trunk/aspects/dom-aspects/pom.xml
    webservices/axiom/trunk/aspects/dom-aspects/src/test/java/org/apache/axiom/dom/DOMExceptionUtilTest.java
    webservices/axiom/trunk/modules/axiom-api/pom.xml
    webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/base64/Base64UtilsTest.java
    webservices/axiom/trunk/pom.xml
    webservices/axiom/trunk/systests/wss4j-tests/pom.xml
    webservices/axiom/trunk/systests/wss4j-tests/src/test/java/WSS4JTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/pom.xml
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestAddChild.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestInsertSibling.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestAppendChildForbidden.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestInsertBeforeForbidden.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/text/TestGetNodeValueBinary.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
    webservices/axiom/trunk/testing/dom-testsuite/pom.xml
    webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestReplaceDataAppend.java
    webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestSplitTextWithoutParent.java
    webservices/axiom/trunk/testing/saaj-testsuite/pom.xml
    webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/body/TestAddChildElementReification.java
    webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/element/TestGetOwnerDocument.java
    webservices/axiom/trunk/testing/testutils/pom.xml
    webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java

Modified: webservices/axiom/trunk/aspects/dom-aspects/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/pom.xml (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/pom.xml Sat May  9 20:16:42 2015
@@ -46,5 +46,10 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/test/java/org/apache/axiom/dom/DOMExceptionUtilTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/test/java/org/apache/axiom/dom/DOMExceptionUtilTest.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/test/java/org/apache/axiom/dom/DOMExceptionUtilTest.java
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/test/java/org/apache/axiom/dom/DOMExceptionUtilTest.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.dom;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import org.junit.Test;
 import org.w3c.dom.DOMException;
@@ -29,7 +27,7 @@ public class DOMExceptionUtilTest {
     @Test
     public void testMessage() {
         DOMException ex = DOMExceptionUtil.newDOMException(DOMException.NOT_FOUND_ERR);
-        assertThat(ex.getMessage(), is(equalTo(
-                "NOT_FOUND_ERR: An attempt is made to reference a node in a context where
it does not exist.")));
+        assertThat(ex.getMessage()).isEqualTo(
+                "NOT_FOUND_ERR: An attempt is made to reference a node in a context where
it does not exist.");
     }
 }

Modified: webservices/axiom/trunk/modules/axiom-api/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/pom.xml (original)
+++ webservices/axiom/trunk/modules/axiom-api/pom.xml Sat May  9 20:16:42 2015
@@ -79,6 +79,10 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+        </dependency>
+        <dependency>
             <groupId>xmlunit</groupId>
             <artifactId>xmlunit</artifactId>
             <scope>test</scope>

Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/base64/Base64UtilsTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/base64/Base64UtilsTest.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/base64/Base64UtilsTest.java
(original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/base64/Base64UtilsTest.java
Sat May  9 20:16:42 2015
@@ -19,13 +19,13 @@
 
 package org.apache.axiom.util.base64;
 
+import static com.google.common.truth.Truth.assertThat;
+
 import java.util.Random;
 
 import junit.framework.TestCase;
 
 import org.apache.commons.codec.binary.Base64;
-import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
 
 public class Base64UtilsTest extends TestCase {
     public void testDecode() {
@@ -33,9 +33,7 @@ public class Base64UtilsTest extends Tes
         for (int len=0; len<20; len++) {
             byte[] data = new byte[len];
             random.nextBytes(data);
-            Assert.assertThat(
-                    Base64Utils.decode(Base64.encodeBase64String(data)),
-                    CoreMatchers.equalTo(data));
+            assertThat(Base64Utils.decode(Base64.encodeBase64String(data))).isEqualTo(data);
         }
     }
     

Modified: webservices/axiom/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/pom.xml (original)
+++ webservices/axiom/trunk/pom.xml Sat May  9 20:16:42 2015
@@ -339,14 +339,9 @@
                 <version>4.11</version>
             </dependency>
             <dependency>
-                <groupId>org.hamcrest</groupId>
-                <artifactId>hamcrest-core</artifactId>
-                <version>1.3</version>
-            </dependency>
-            <dependency>
-                <groupId>org.hamcrest</groupId>
-                <artifactId>hamcrest-library</artifactId>
-                <version>1.3</version>
+                <groupId>com.google.truth</groupId>
+                <artifactId>truth</artifactId>
+                <version>0.26</version>
             </dependency>
             <dependency>
                 <groupId>xmlunit</groupId>

Modified: webservices/axiom/trunk/systests/wss4j-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/wss4j-tests/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/wss4j-tests/pom.xml (original)
+++ webservices/axiom/trunk/systests/wss4j-tests/pom.xml Sat May  9 20:16:42 2015
@@ -55,8 +55,8 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-library</artifactId>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>

Modified: webservices/axiom/trunk/systests/wss4j-tests/src/test/java/WSS4JTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/wss4j-tests/src/test/java/WSS4JTest.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/wss4j-tests/src/test/java/WSS4JTest.java (original)
+++ webservices/axiom/trunk/systests/wss4j-tests/src/test/java/WSS4JTest.java Sat May  9 20:16:42
2015
@@ -16,8 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import java.util.Vector;
 
@@ -67,7 +66,7 @@ public class WSS4JTest {
         Document signedDoc = sign.build(doc, crypto, secHeader);
         
         WSSecurityEngine secEngine = new WSSecurityEngine();
-        assertThat(secEngine.processSecurityHeader(signedDoc, null, null, crypto), hasSize(2));
+        assertThat(secEngine.processSecurityHeader(signedDoc, null, null, crypto)).hasSize(2);
     }
     
     @Test

Modified: webservices/axiom/trunk/testing/axiom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/pom.xml Sat May  9 20:16:42 2015
@@ -45,6 +45,10 @@
             <artifactId>junit</artifactId>
         </dependency>
         <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+        </dependency>
+        <dependency>
             <groupId>xmlunit</groupId>
             <artifactId>xmlunit</artifactId>
         </dependency>

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestAddChild.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestAddChild.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestAddChild.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestAddChild.java
Sat May  9 20:16:42 2015
@@ -18,11 +18,7 @@
  */
 package org.apache.axiom.ts.om.cross;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.sameInstance;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMMetaFactory;
@@ -38,7 +34,7 @@ public class TestAddChild extends CrossO
         OMElement orgChild = altMetaFactory.getOMFactory().createOMElement("child", null);
         parent.addChild(orgChild);
         OMElement child = (OMElement)parent.getFirstOMChild();
-        assertThat(child, is(not(sameInstance(orgChild))));
-        assertThat(child.getLocalName(), is(equalTo("child")));
+        assertThat(child).isNotSameAs(orgChild);
+        assertThat(child.getLocalName()).isEqualTo("child");
     }
 }

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestInsertSibling.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestInsertSibling.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestInsertSibling.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/cross/TestInsertSibling.java
Sat May  9 20:16:42 2015
@@ -18,11 +18,7 @@
  */
 package org.apache.axiom.ts.om.cross;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.sameInstance;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMElement;
@@ -51,7 +47,7 @@ public class TestInsertSibling extends C
             child.insertSiblingAfter(orgSibling);
         }
         OMComment sibling = (OMComment)(before ? child.getPreviousOMSibling() : child.getNextOMSibling());
-        assertThat(sibling, is(not(sameInstance(orgSibling))));
-        assertThat(sibling.getValue(), is(equalTo("test")));
+        assertThat(sibling).isNotSameAs(orgSibling);
+        assertThat(sibling.getValue()).isEqualTo("test");
     }
 }

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestAppendChildForbidden.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestAppendChildForbidden.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestAppendChildForbidden.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestAppendChildForbidden.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.ts.omdom.document;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import java.io.StringReader;
 
@@ -52,7 +50,7 @@ public class TestAppendChildForbidden ex
             document.appendChild(document.createElementNS(null, "test"));
             fail("Expected DOMException");
         } catch (DOMException ex) {
-            assertThat(ex.code, is(equalTo(DOMException.HIERARCHY_REQUEST_ERR)));
+            assertThat(ex.code).isEqualTo(DOMException.HIERARCHY_REQUEST_ERR);
         }
     }
 }

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestInsertBeforeForbidden.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestInsertBeforeForbidden.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestInsertBeforeForbidden.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/document/TestInsertBeforeForbidden.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.ts.omdom.document;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import java.io.StringReader;
 
@@ -54,7 +52,7 @@ public class TestInsertBeforeForbidden e
             document.insertBefore(document.createElementNS(null, "test"), comment);
             fail("Expected DOMException");
         } catch (DOMException ex) {
-            assertThat(ex.code, is(equalTo(DOMException.HIERARCHY_REQUEST_ERR)));
+            assertThat(ex.code).isEqualTo(DOMException.HIERARCHY_REQUEST_ERR);
         }
     }
 }

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/text/TestGetNodeValueBinary.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/text/TestGetNodeValueBinary.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/text/TestGetNodeValueBinary.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/text/TestGetNodeValueBinary.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.ts.omdom.text;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import java.io.ByteArrayInputStream;
 
@@ -45,7 +43,7 @@ public class TestGetNodeValueBinary exte
         DataSource ds = new RandomDataSource(666L, 1000);
         Text text = (Text)factory.createOMText(new DataHandler(ds), false);
         String nodeValue = text.getNodeValue();
-        assertThat(nodeValue, is(notNullValue()));
+        assertThat(nodeValue).isNotNull();
         IOTestUtils.compareStreams(ds.getInputStream(),
                 new ByteArrayInputStream(Base64.decodeBase64(nodeValue)));
     }

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
(original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.ts.soapdom.message;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.sameInstance;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMMetaFactory;
@@ -50,6 +48,6 @@ public class TestLazySOAPFactorySelectio
         Element element = ((Document)message).createElementNS("urn:test", "p:test");
         
         SOAPFactory soapFactoryFromNewElement = (SOAPFactory)((OMElement)element).getOMFactory();
-        assertThat(soapFactoryFromNewElement, is(sameInstance(soapFactory)));
+        assertThat(soapFactoryFromNewElement).isSameAs(soapFactory);
     }
 }

Modified: webservices/axiom/trunk/testing/dom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/dom-testsuite/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/dom-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testing/dom-testsuite/pom.xml Sat May  9 20:16:42 2015
@@ -39,6 +39,10 @@
             <artifactId>junit</artifactId>
         </dependency>
         <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+        </dependency>
+        <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>testutils</artifactId>
             <version>${project.version}</version>

Modified: webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestReplaceDataAppend.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestReplaceDataAppend.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestReplaceDataAppend.java
(original)
+++ webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestReplaceDataAppend.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.ts.dom.text;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 
@@ -37,6 +35,6 @@ public class TestReplaceDataAppend exten
         Document doc = dbf.newDocumentBuilder().newDocument();
         Text text = doc.createTextNode("AB");
         text.replaceData(2, 0, "CD");
-        assertThat(text.getData(), is(equalTo("ABCD")));
+        assertThat(text.getData()).isEqualTo("ABCD");
     }
 }

Modified: webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestSplitTextWithoutParent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestSplitTextWithoutParent.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestSplitTextWithoutParent.java
(original)
+++ webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/text/TestSplitTextWithoutParent.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.ts.dom.text;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 
@@ -41,7 +39,7 @@ public class TestSplitTextWithoutParent
         Document document = dbf.newDocumentBuilder().newDocument();
         Text text = document.createTextNode("ABCD");
         Text newText = text.splitText(2);
-        assertThat(text.getData(), is(equalTo("AB")));
-        assertThat(newText.getData(), is(equalTo("CD")));
+        assertThat(text.getData()).isEqualTo("AB");
+        assertThat(newText.getData()).isEqualTo("CD");
     }
 }

Modified: webservices/axiom/trunk/testing/saaj-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/saaj-testsuite/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/saaj-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testing/saaj-testsuite/pom.xml Sat May  9 20:16:42 2015
@@ -42,6 +42,10 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+        </dependency>
+        <dependency>
             <groupId>com.sun.xml.messaging.saaj</groupId>
             <artifactId>saaj-impl</artifactId>
             <scope>test</scope>

Modified: webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/body/TestAddChildElementReification.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/body/TestAddChildElementReification.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/body/TestAddChildElementReification.java
(original)
+++ webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/body/TestAddChildElementReification.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.axiom.ts.saaj.body;
 
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import javax.xml.soap.MessageFactory;
 import javax.xml.soap.SOAPBody;
@@ -46,6 +44,6 @@ public class TestAddChildElementReificat
         MessageFactory mf = spec.getAdapter(FactorySelector.class).newMessageFactory(saajImplementation,
false);
         SOAPBody body = mf.createMessage().getSOAPBody();
         SOAPElement child = body.addChildElement((SOAPElement)body.getOwnerDocument().createElementNS("urn:test",
"p:test"));
-        assertThat(child, is(instanceOf(SOAPBodyElement.class)));
+        assertThat(child).isInstanceOf(SOAPBodyElement.class);
     }
 }

Modified: webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/element/TestGetOwnerDocument.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/element/TestGetOwnerDocument.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/element/TestGetOwnerDocument.java
(original)
+++ webservices/axiom/trunk/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/element/TestGetOwnerDocument.java
Sat May  9 20:16:42 2015
@@ -18,10 +18,7 @@
  */
 package org.apache.axiom.ts.saaj.element;
 
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
 
 import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPElement;
@@ -50,8 +47,8 @@ public class TestGetOwnerDocument extend
     protected void runTest() throws Throwable {
         SOAPFactory factory = saajImplementation.newSOAPFactory(protocol);
         Document doc = factory.createElement(new QName("test")).getOwnerDocument();
-        assertThat(doc, is(not(instanceOf(SOAPPart.class))));
-        assertThat(doc, is(not(instanceOf(javax.xml.soap.Node.class))));
-        assertThat(doc.createElementNS(null, "test"), is(instanceOf(SOAPElement.class)));
+        assertThat(doc).isNotInstanceOf(SOAPPart.class);
+        assertThat(doc).isNotInstanceOf(javax.xml.soap.Node.class);
+        assertThat(doc.createElementNS(null, "test")).isInstanceOf(SOAPElement.class);
     }
 }

Modified: webservices/axiom/trunk/testing/testutils/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/testutils/pom.xml?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/testutils/pom.xml (original)
+++ webservices/axiom/trunk/testing/testutils/pom.xml Sat May  9 20:16:42 2015
@@ -51,8 +51,8 @@
             <artifactId>junit</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-library</artifactId>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
         </dependency>
         <dependency>
             <groupId>xmlunit</groupId>

Modified: webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java?rev=1678521&r1=1678520&r2=1678521&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java
(original)
+++ webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java
Sat May  9 20:16:42 2015
@@ -18,9 +18,8 @@
  */
 package org.apache.axiom.testutils.stax;
 
-import static org.hamcrest.Matchers.isIn;
+import static com.google.common.truth.Truth.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 
 import java.lang.reflect.InvocationTargetException;
@@ -191,7 +190,7 @@ public class XMLStreamReaderComparator {
                             expected.getPrefix(namespaceURI),
                             actual.getPrefix(namespaceURI));
                 } else {
-                    assertThat(actual.getPrefix(namespaceURI), isIn(prefixes));
+                    assertThat(actual.getPrefix(namespaceURI)).isIn(prefixes);
                 }
             }
         }



Mime
View raw message