From: <bo...@us...> - 2008-03-06 08:49:46
|
Revision: 245 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=245&view=rev Author: bodewig Date: 2008-03-06 00:49:51 -0800 (Thu, 06 Mar 2008) Log Message: ----------- simplify Modified Paths: -------------- trunk/xmlunit/src/java/org/custommonkey/xmlunit/jaxp13/Validator.java trunk/xmlunit/tests/java/org/custommonkey/xmlunit/jaxp13/test_Validator.java Modified: trunk/xmlunit/src/java/org/custommonkey/xmlunit/jaxp13/Validator.java =================================================================== --- trunk/xmlunit/src/java/org/custommonkey/xmlunit/jaxp13/Validator.java 2008-03-05 16:42:35 UTC (rev 244) +++ trunk/xmlunit/src/java/org/custommonkey/xmlunit/jaxp13/Validator.java 2008-03-06 08:49:51 UTC (rev 245) @@ -37,7 +37,6 @@ package org.custommonkey.xmlunit.jaxp13; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import javax.xml.XMLConstants; import javax.xml.transform.Source; @@ -114,7 +113,7 @@ } catch (SAXException e) { // error has been recorded in our ErrorHandler anyway } - return Collections.unmodifiableList(l); + return l; } private Schema parseSchema(ErrorHandler h) throws SAXException { Modified: trunk/xmlunit/tests/java/org/custommonkey/xmlunit/jaxp13/test_Validator.java =================================================================== --- trunk/xmlunit/tests/java/org/custommonkey/xmlunit/jaxp13/test_Validator.java 2008-03-05 16:42:35 UTC (rev 244) +++ trunk/xmlunit/tests/java/org/custommonkey/xmlunit/jaxp13/test_Validator.java 2008-03-06 08:49:51 UTC (rev 245) @@ -36,7 +36,7 @@ package org.custommonkey.xmlunit.jaxp13; -import java.io.FileInputStream; +import java.io.File; import java.util.Iterator; import java.util.List; import javax.xml.transform.stream.StreamSource; @@ -49,41 +49,29 @@ public void testGoodSchemaIsValid() throws Exception { Validator v = new Validator(); - v.addSchemaSource(new StreamSource( - new FileInputStream(test_Constants.BASEDIR - + "/tests/etc/Book.xsd") - ) - ); + v.addSchemaSource(new StreamSource(new File(test_Constants.BASEDIR + + "/tests/etc/Book.xsd"))); assertTrue(v.isSchemaValid()); } public void testGoodSchemaHasNoErrors() throws Exception { Validator v = new Validator(); - v.addSchemaSource(new StreamSource( - new FileInputStream(test_Constants.BASEDIR - + "/tests/etc/Book.xsd") - ) - ); + v.addSchemaSource(new StreamSource(new File(test_Constants.BASEDIR + + "/tests/etc/Book.xsd"))); assertEquals(0, v.getSchemaErrors().size()); } public void testBrokenSchemaIsInvalid() throws Exception { Validator v = new Validator(); - v.addSchemaSource(new StreamSource( - new FileInputStream(test_Constants.BASEDIR - + "/tests/etc/broken.xsd") - ) - ); + v.addSchemaSource(new StreamSource(new File(test_Constants.BASEDIR + + "/tests/etc/broken.xsd"))); assertFalse(v.isSchemaValid()); } public void testBrokenSchemaHasErrors() throws Exception { Validator v = new Validator(); - v.addSchemaSource(new StreamSource( - new FileInputStream(test_Constants.BASEDIR - + "/tests/etc/broken.xsd") - ) - ); + v.addSchemaSource(new StreamSource(new File(test_Constants.BASEDIR + + "/tests/etc/broken.xsd"))); List l = v.getSchemaErrors(); /* for (Iterator i = l.iterator(); i.hasNext(); ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |