ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1780746 - /webservices/axiom/trunk/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/XMLTruth.java
Date Sat, 28 Jan 2017 22:08:13 GMT
Author: veithen
Date: Sat Jan 28 22:08:13 2017
New Revision: 1780746

URL: http://svn.apache.org/viewvc?rev=1780746&view=rev
Log:
Add support for java.io.File to xml-truth.

Modified:
    webservices/axiom/trunk/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/XMLTruth.java

Modified: webservices/axiom/trunk/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/XMLTruth.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/XMLTruth.java?rev=1780746&r1=1780745&r2=1780746&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/XMLTruth.java
(original)
+++ webservices/axiom/trunk/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/XMLTruth.java
Sat Jan 28 22:08:13 2017
@@ -19,6 +19,7 @@
 package org.apache.axiom.truth.xml;
 
 import java.io.ByteArrayInputStream;
+import java.io.File;
 import java.io.InputStream;
 import java.io.Reader;
 import java.io.StringReader;
@@ -145,6 +146,17 @@ public final class XMLTruth {
                 return xml(new StreamSource(url.toString()));
             }
         });
+        factories.add(new XMLFactory<File>() {
+            @Override
+            public Class<File> getExpectedType() {
+                return File.class;
+            }
+
+            @Override
+            public XML createXML(File file) {
+                return xml(new StreamSource(file.toURI().toString()));
+            }
+        });
         factories.add(new XMLFactory<String>() {
             @Override
             public Class<String> getExpectedType() {



Mime
View raw message