chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1448971 - /chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
Date Fri, 22 Feb 2013 10:00:14 GMT
Author: fmui
Date: Fri Feb 22 10:00:13 2013
New Revision: 1448971

URL: http://svn.apache.org/r1448971
Log:
yet another attempt to fix the Jenkins build

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java?rev=1448971&r1=1448970&r2=1448971&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
Fri Feb 22 10:00:13 2013
@@ -23,13 +23,13 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.io.ByteArrayInputStream;
-import java.io.InputStream;
+import java.io.IOException;
 import java.io.OutputStream;
 import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.net.URL;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 import java.util.List;
@@ -98,21 +98,23 @@ public abstract class AbstractXMLConvert
      * Sets up the schema.
      */
     @Before
-    public void init() throws SAXException, UnsupportedEncodingException {
+    public void init() throws SAXException, IOException {
         SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
 
-        InputStream schema10stream = this.getClass().getClassLoader().getResourceAsStream("schema/cmis10/CMIS-core.xsd");
-        if (schema10stream == null) {
+        System.out.println(this.getClass().getResource("/"));
+
+        URL schema10url = this.getClass().getResource("/schema/cmis10/CMIS-core.xsd");
+        if (schema10url == null) {
             throw new RuntimeException("Cannot find CMIS 1.0 schema file!");
         }
-        StreamSource core10 = new StreamSource(schema10stream);
+        StreamSource core10 = new StreamSource(schema10url.openStream());
         StreamSource test10 = new StreamSource(new ByteArrayInputStream(TEST_SCHEMA.getBytes("UTF-8")));
 
-        InputStream schema11stream = this.getClass().getClassLoader().getResourceAsStream("schema/cmis11/CMIS-core.xsd");
-        if (schema11stream == null) {
+        URL schema11url = this.getClass().getResource("/schema/cmis11/CMIS-core.xsd");
+        if (schema11url == null) {
             throw new RuntimeException("Cannot find CMIS 1.1 schema file!");
         }
-        StreamSource core11 = new StreamSource(schema11stream);
+        StreamSource core11 = new StreamSource(schema11url.openStream());
         StreamSource test11 = new StreamSource(new ByteArrayInputStream(TEST_SCHEMA.getBytes("UTF-8")));
 
         schema10 = sf.newSchema(new Source[] { core10, test10 });



Mime
View raw message