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/05/06 22:27:17 UTC
svn commit: r1678089 [1/3] - in /webservices/axiom/trunk: modules/axiom-api/
modules/axiom-api/src/test/java/org/apache/axiom/om/impl/serialize/
modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/
modules/axiom-compat/ modules/axiom-com...
Author: veithen
Date: Wed May 6 20:27:15 2015
New Revision: 1678089
URL: http://svn.apache.org/r1678089
Log:
Refactor ConformanceTestFile to make it possible to refer to particular XML samples. Also rename that class to XMLSample and move the entire stuff to a separate module.
Added:
webservices/axiom/trunk/testing/xml-testsuite/pom.xml (with props)
webservices/axiom/trunk/testing/xml-testsuite/src/
webservices/axiom/trunk/testing/xml-testsuite/src/main/
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSample.java
- copied, changed from r1677906, webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java
webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSampleProperties.java (with props)
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/org/
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/org/apache/
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/org/apache/axiom/
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/org/apache/axiom/ts/
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/org/apache/axiom/ts/xml/
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/org/apache/axiom/ts/xml/bulk/
- copied from r1677906, webservices/axiom/trunk/testing/testutils/src/main/resources/org/apache/axiom/testutils/conformance/
webservices/axiom/trunk/testing/xml-testsuite/src/main/resources/org/apache/axiom/ts/xml/large.xml (with props)
Removed:
webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/conformance/
webservices/axiom/trunk/testing/testutils/src/main/resources/
Modified:
webservices/axiom/trunk/modules/axiom-api/pom.xml
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializerTest.java
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestSuiteBuilder.java
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/TestGetNamespaceContext.java
webservices/axiom/trunk/modules/axiom-compat/pom.xml
webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/jaxp/StreamSourceToOMResultTest.java
webservices/axiom/trunk/systests/integration-tests/pom.xml
webservices/axiom/trunk/systests/integration-tests/src/test/java/org/apache/axiom/om/SAXResultSAXParserTest.java
webservices/axiom/trunk/testing/axiom-testsuite/pom.xml
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestClone.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestGetSAXResult.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java
webservices/axiom/trunk/testing/dom-testsuite/pom.xml
webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCloneNode.java
webservices/axiom/trunk/testing/pom.xml
webservices/axiom/trunk/testing/testutils/pom.xml
webservices/axiom/trunk/testing/xml-testsuite/ (props changed)
Modified: webservices/axiom/trunk/modules/axiom-api/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/pom.xml?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/pom.xml (original)
+++ webservices/axiom/trunk/modules/axiom-api/pom.xml Wed May 6 20:27:15 2015
@@ -95,6 +95,12 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>xml-testsuite</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializerTest.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializerTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializerTest.java Wed May 6 20:27:15 2015
@@ -34,14 +34,14 @@ import junit.framework.TestSuite;
import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.testing.multiton.Multiton;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
+import org.apache.axiom.ts.xml.XMLSample;
import org.apache.axiom.util.stax.dialect.StAXDialect;
import org.apache.axiom.util.stax.dialect.StAXDialectDetector;
public class StreamingOMSerializerTest extends AbstractTestCase {
- private final ConformanceTestFile file;
+ private final XMLSample file;
- public StreamingOMSerializerTest(String name, ConformanceTestFile file) {
+ public StreamingOMSerializerTest(String name, XMLSample file) {
super(name);
this.file = file;
}
@@ -68,8 +68,8 @@ public class StreamingOMSerializerTest e
public static TestSuite suite() throws Exception {
TestSuite suite = new TestSuite();
- for (Iterator it = Multiton.getInstances(ConformanceTestFile.class).iterator(); it.hasNext(); ) {
- ConformanceTestFile file = (ConformanceTestFile)it.next();
+ for (Iterator it = Multiton.getInstances(XMLSample.class).iterator(); it.hasNext(); ) {
+ XMLSample file = (XMLSample)it.next();
suite.addTest(new StreamingOMSerializerTest(file.getShortName(), file));
}
return suite;
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestSuiteBuilder.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestSuiteBuilder.java Wed May 6 20:27:15 2015
@@ -25,8 +25,8 @@ import java.util.List;
import javax.xml.stream.XMLStreamConstants;
import org.apache.axiom.testing.multiton.Multiton;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.testutils.suite.MatrixTestSuiteBuilder;
+import org.apache.axiom.ts.xml.XMLSample;
public class DialectTestSuiteBuilder extends MatrixTestSuiteBuilder {
private final List/*<StAXImplementation>*/ implementations = new ArrayList();
@@ -94,8 +94,8 @@ public class DialectTestSuiteBuilder ext
addTest(new TestGetNameIllegalStateException(staxImpl, XMLStreamConstants.DTD, true));
addTest(new TestGetNameIllegalStateException(staxImpl, XMLStreamConstants.CDATA, true));
addTest(new TestGetNamespaceContextImplicitNamespaces(staxImpl));
- for (Iterator it = Multiton.getInstances(ConformanceTestFile.class).iterator(); it.hasNext(); ) {
- ConformanceTestFile file = (ConformanceTestFile)it.next();
+ for (Iterator it = Multiton.getInstances(XMLSample.class).iterator(); it.hasNext(); ) {
+ XMLSample file = (XMLSample)it.next();
// Some parsers have problems with external subsets; anyway the test files with
// DTDs are not essential for this test.
if (!file.hasExternalSubset()) {
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/TestGetNamespaceContext.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/TestGetNamespaceContext.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/TestGetNamespaceContext.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/TestGetNamespaceContext.java Wed May 6 20:27:15 2015
@@ -27,13 +27,13 @@ import javax.xml.namespace.NamespaceCont
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
+import org.apache.axiom.ts.xml.XMLSample;
import org.apache.axiom.util.namespace.ScopedNamespaceContext;
public class TestGetNamespaceContext extends DialectTestCase {
- private final ConformanceTestFile testResource;
+ private final XMLSample testResource;
- public TestGetNamespaceContext(StAXImplementation staxImpl, ConformanceTestFile testResource) {
+ public TestGetNamespaceContext(StAXImplementation staxImpl, XMLSample testResource) {
super(staxImpl);
this.testResource = testResource;
addTestParameter("file", testResource.getShortName());
Modified: webservices/axiom/trunk/modules/axiom-compat/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-compat/pom.xml?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-compat/pom.xml (original)
+++ webservices/axiom/trunk/modules/axiom-compat/pom.xml Wed May 6 20:27:15 2015
@@ -61,6 +61,12 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>xml-testsuite</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>axiom-impl</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Modified: webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/jaxp/StreamSourceToOMResultTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/jaxp/StreamSourceToOMResultTest.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/jaxp/StreamSourceToOMResultTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/jaxp/StreamSourceToOMResultTest.java Wed May 6 20:27:15 2015
@@ -30,17 +30,17 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.testing.multiton.Multiton;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.testutils.suite.MatrixTestCase;
+import org.apache.axiom.ts.xml.XMLSample;
import org.apache.xalan.processor.TransformerFactoryImpl;
public class StreamSourceToOMResultTest extends MatrixTestCase {
private static final String[] axiomImplementations = { "default", "dom" };
private final OMMetaFactory omMetaFactory;
- private final ConformanceTestFile file;
+ private final XMLSample file;
- private StreamSourceToOMResultTest(String axiomImplementation, ConformanceTestFile file) {
+ private StreamSourceToOMResultTest(String axiomImplementation, XMLSample file) {
omMetaFactory = OMAbstractFactory.getMetaFactory(axiomImplementation);
this.file = file;
addTestParameter("axiomImplementation", axiomImplementation);
@@ -60,8 +60,8 @@ public class StreamSourceToOMResultTest
public static TestSuite suite() {
TestSuite suite = new TestSuite();
for (int i=0; i<axiomImplementations.length; i++) {
- for (Iterator it = Multiton.getInstances(ConformanceTestFile.class).iterator(); it.hasNext(); ) {
- suite.addTest(new StreamSourceToOMResultTest(axiomImplementations[i], (ConformanceTestFile)it.next()));
+ for (Iterator it = Multiton.getInstances(XMLSample.class).iterator(); it.hasNext(); ) {
+ suite.addTest(new StreamSourceToOMResultTest(axiomImplementations[i], (XMLSample)it.next()));
}
}
return suite;
Modified: webservices/axiom/trunk/systests/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/integration-tests/pom.xml?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/integration-tests/pom.xml (original)
+++ webservices/axiom/trunk/systests/integration-tests/pom.xml Wed May 6 20:27:15 2015
@@ -84,6 +84,11 @@
<artifactId>testutils</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>xml-testsuite</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
Modified: webservices/axiom/trunk/systests/integration-tests/src/test/java/org/apache/axiom/om/SAXResultSAXParserTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/integration-tests/src/test/java/org/apache/axiom/om/SAXResultSAXParserTest.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/integration-tests/src/test/java/org/apache/axiom/om/SAXResultSAXParserTest.java (original)
+++ webservices/axiom/trunk/systests/integration-tests/src/test/java/org/apache/axiom/om/SAXResultSAXParserTest.java Wed May 6 20:27:15 2015
@@ -32,7 +32,7 @@ import org.apache.axiom.om.AbstractTestC
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
+import org.apache.axiom.ts.xml.XMLSample;
import org.custommonkey.xmlunit.XMLUnit;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
@@ -41,9 +41,9 @@ import org.xml.sax.XMLReader;
public class SAXResultSAXParserTest extends AbstractTestCase {
private final SAXParserFactory factory;
- private final ConformanceTestFile file;
+ private final XMLSample file;
- public SAXResultSAXParserTest(String name, SAXParserFactory factory, ConformanceTestFile file) {
+ public SAXResultSAXParserTest(String name, SAXParserFactory factory, XMLSample file) {
super(name);
this.factory = factory;
this.file = file;
@@ -68,7 +68,7 @@ public class SAXResultSAXParserTest exte
}
private static void addTests(TestSuite suite, SAXParserFactory factory, String name) throws Exception {
- for (ConformanceTestFile file : getInstances(ConformanceTestFile.class)) {
+ for (XMLSample file : getInstances(XMLSample.class)) {
suite.addTest(new SAXResultSAXParserTest(
file.getShortName() + " - " + name, factory, file));
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/pom.xml?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/pom.xml Wed May 6 20:27:15 2015
@@ -55,6 +55,11 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>xml-testsuite</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>axiom-api</artifactId>
<classifier>tests</classifier>
<version>${project.version}</version>
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java Wed May 6 20:27:15 2015
@@ -19,17 +19,17 @@
package org.apache.axiom.ts;
import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
+import org.apache.axiom.ts.xml.XMLSample;
/**
* Base class for test cases that are executed against the files from the conformance test set.
*
- * @see ConformanceTestFile#getConformanceTestFiles()
+ * @see XMLSample#getConformanceTestFiles()
*/
public abstract class ConformanceTestCase extends AxiomTestCase {
- protected final ConformanceTestFile file;
+ protected final XMLSample file;
- public ConformanceTestCase(OMMetaFactory metaFactory, ConformanceTestFile file) {
+ public ConformanceTestCase(OMMetaFactory metaFactory, XMLSample file) {
super(metaFactory);
this.file = file;
addTestParameter("file", file.getShortName());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Wed May 6 20:27:15 2015
@@ -25,7 +25,6 @@ import java.lang.reflect.Method;
import javax.xml.namespace.QName;
import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.testutils.suite.MatrixTestSuiteBuilder;
import org.apache.axiom.testutils.suite.XSLTImplementation;
import org.apache.axiom.ts.dimension.AddAttributeStrategy;
@@ -42,6 +41,7 @@ import org.apache.axiom.ts.om.sourcedele
import org.apache.axiom.ts.om.sourcedelement.push.PushOMDataSourceScenario;
import org.apache.axiom.ts.om.xpath.AXIOMXPathTestCase;
import org.apache.axiom.ts.om.xpath.TestAXIOMXPath;
+import org.apache.axiom.ts.xml.XMLSample;
public class OMTestSuiteBuilder extends MatrixTestSuiteBuilder {
private static final OMContainerFactory[] containerFactories = {
@@ -99,7 +99,7 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.builder.TestCloseWithInputStream(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestCloseWithReader(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestCloseWithXMLStreamReader(metaFactory));
- for (ConformanceTestFile file : getInstances(ConformanceTestFile.class)) {
+ for (XMLSample file : getInstances(XMLSample.class)) {
if (file.hasEntityReferences()) {
addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOM(metaFactory, file, Boolean.TRUE));
addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOM(metaFactory, file, Boolean.FALSE));
@@ -129,7 +129,7 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.builder.TestReadAttachmentBeforeRootPartComplete(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestRootPartStreaming(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestStandaloneConfiguration(metaFactory));
- for (ConformanceTestFile file : getInstances(ConformanceTestFile.class)) {
+ for (XMLSample file : getInstances(XMLSample.class)) {
for (int j=0; j<containerFactories.length; j++) {
OMContainerFactory cf = containerFactories[j];
for (BuilderFactory bf : getInstances(BuilderFactory.class)) {
@@ -150,7 +150,7 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.document.TestAddChildIncomplete(metaFactory));
addTest(new org.apache.axiom.ts.om.document.TestAddChildWithExistingDocumentElement(metaFactory));
addTest(new org.apache.axiom.ts.om.document.TestBuild(metaFactory));
- for (ConformanceTestFile file : getInstances(ConformanceTestFile.class)) {
+ for (XMLSample file : getInstances(XMLSample.class)) {
addTest(new org.apache.axiom.ts.om.document.TestClone(metaFactory, file));
}
addTest(new org.apache.axiom.ts.om.document.TestDigest(metaFactory, "digest1.xml", "MD5", "3e5d68c6607bc56c9c171560e4f19db9"));
@@ -163,7 +163,7 @@ public class OMTestSuiteBuilder extends
for (int i=0; i<XSLTImplementation.INSTANCES.length; i++) {
XSLTImplementation xsltImplementation = XSLTImplementation.INSTANCES[i];
if (xsltImplementation.supportsLexicalHandlerWithStreamSource()) {
- for (ConformanceTestFile file : getInstances(ConformanceTestFile.class)) {
+ for (XMLSample file : getInstances(XMLSample.class)) {
addTest(new org.apache.axiom.ts.om.document.TestGetSAXResult(metaFactory, xsltImplementation, file));
}
}
@@ -213,7 +213,7 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.element.TestBuildDiscarded(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestChildReDeclaringGrandParentsDefaultNSWithPrefix(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestChildReDeclaringParentsDefaultNSWithPrefix(metaFactory));
- for (ConformanceTestFile file : getInstances(ConformanceTestFile.class)) {
+ for (XMLSample file : getInstances(XMLSample.class)) {
if (!file.hasEntityReferences()) {
addTest(new org.apache.axiom.ts.om.element.TestCloneOMElement2(metaFactory, file));
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java Wed May 6 20:27:15 2015
@@ -29,14 +29,14 @@ import org.apache.axiom.om.OMMetaFactory
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.ts.ConformanceTestCase;
+import org.apache.axiom.ts.xml.XMLSample;
import org.w3c.dom.Document;
public class TestCreateOMBuilderFromDOM extends ConformanceTestCase {
private final Boolean expandEntityReferences;
- public TestCreateOMBuilderFromDOM(OMMetaFactory metaFactory, ConformanceTestFile file,
+ public TestCreateOMBuilderFromDOM(OMMetaFactory metaFactory, XMLSample file,
Boolean expandEntityReferences) {
super(metaFactory, file);
this.expandEntityReferences = expandEntityReferences;
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java Wed May 6 20:27:15 2015
@@ -29,14 +29,14 @@ import org.apache.axiom.om.OMMetaFactory
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.ts.ConformanceTestCase;
+import org.apache.axiom.ts.xml.XMLSample;
import org.xml.sax.InputSource;
public class TestCreateOMBuilderFromSAXSource extends ConformanceTestCase {
private final Boolean expandEntityReferences;
- public TestCreateOMBuilderFromSAXSource(OMMetaFactory metaFactory, ConformanceTestFile file,
+ public TestCreateOMBuilderFromSAXSource(OMMetaFactory metaFactory, XMLSample file,
Boolean expandEntityReferences) {
super(metaFactory, file);
this.expandEntityReferences = expandEntityReferences;
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java Wed May 6 20:27:15 2015
@@ -26,10 +26,10 @@ import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.testutils.stax.XMLStreamReaderComparator;
import org.apache.axiom.ts.ConformanceTestCase;
import org.apache.axiom.ts.dimension.BuilderFactory;
+import org.apache.axiom.ts.xml.XMLSample;
import org.xml.sax.InputSource;
/**
@@ -41,7 +41,7 @@ public class TestGetXMLStreamReader exte
private final OMContainerFactory containerFactory;
private final boolean cache;
- public TestGetXMLStreamReader(OMMetaFactory metaFactory, ConformanceTestFile file,
+ public TestGetXMLStreamReader(OMMetaFactory metaFactory, XMLSample file,
BuilderFactory builderFactory, OMContainerFactory containerFactory, boolean cache) {
super(metaFactory, file);
this.builderFactory = builderFactory;
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java Wed May 6 20:27:15 2015
@@ -27,10 +27,10 @@ import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.ts.ConformanceTestCase;
import org.apache.axiom.ts.dimension.serialization.SerializationStrategy;
import org.apache.axiom.ts.dimension.serialization.XML;
+import org.apache.axiom.ts.xml.XMLSample;
import org.apache.commons.io.IOUtils;
import org.xml.sax.InputSource;
@@ -38,7 +38,7 @@ public class TestSerialize extends Confo
private final OMContainerFactory containerFactory;
private final SerializationStrategy serializationStrategy;
- public TestSerialize(OMMetaFactory metaFactory, ConformanceTestFile file,
+ public TestSerialize(OMMetaFactory metaFactory, XMLSample file,
OMContainerFactory containerFactory, SerializationStrategy serializationStrategy) {
super(metaFactory, file);
this.containerFactory = containerFactory;
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestClone.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestClone.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestClone.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestClone.java Wed May 6 20:27:15 2015
@@ -25,12 +25,12 @@ import org.apache.axiom.om.OMCloneOption
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.ts.ConformanceTestCase;
+import org.apache.axiom.ts.xml.XMLSample;
import org.xml.sax.InputSource;
public class TestClone extends ConformanceTestCase {
- public TestClone(OMMetaFactory metaFactory, ConformanceTestFile file) {
+ public TestClone(OMMetaFactory metaFactory, XMLSample file) {
super(metaFactory, file);
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestGetSAXResult.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestGetSAXResult.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestGetSAXResult.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestGetSAXResult.java Wed May 6 20:27:15 2015
@@ -28,15 +28,15 @@ import javax.xml.transform.stream.Stream
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.testutils.XMLAssertEx;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.testutils.suite.XSLTImplementation;
import org.apache.axiom.ts.ConformanceTestCase;
+import org.apache.axiom.ts.xml.XMLSample;
public class TestGetSAXResult extends ConformanceTestCase {
private final XSLTImplementation xsltImplementation;
public TestGetSAXResult(OMMetaFactory metaFactory,
- XSLTImplementation xsltImplementation, ConformanceTestFile file) {
+ XSLTImplementation xsltImplementation, XMLSample file) {
super(metaFactory, file);
this.xsltImplementation = xsltImplementation;
xsltImplementation.addTestParameters(this);
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java Wed May 6 20:27:15 2015
@@ -24,13 +24,13 @@ import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.ts.ConformanceTestCase;
+import org.apache.axiom.ts.xml.XMLSample;
import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
public class TestCloneOMElement2 extends ConformanceTestCase {
- public TestCloneOMElement2(OMMetaFactory metaFactory, ConformanceTestFile file) {
+ public TestCloneOMElement2(OMMetaFactory metaFactory, XMLSample file) {
super(metaFactory, file);
}
Modified: webservices/axiom/trunk/testing/dom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/dom-testsuite/pom.xml?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/dom-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testing/dom-testsuite/pom.xml Wed May 6 20:27:15 2015
@@ -44,6 +44,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>xml-testsuite</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</dependency>
Modified: webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java Wed May 6 20:27:15 2015
@@ -30,9 +30,9 @@ import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.testutils.suite.MatrixTestSuiteBuilder;
import org.apache.axiom.testutils.suite.XSLTImplementation;
+import org.apache.axiom.ts.xml.XMLSample;
import org.objectweb.asm.ClassReader;
import org.w3c.domts.DOMTestCase;
import org.w3c.domts.DOMTestDocumentBuilderFactory;
@@ -83,7 +83,7 @@ public final class DOMTestSuiteBuilder e
addTest(new org.apache.axiom.ts.dom.document.TestAdoptNodeWithParent(dbf));
addTest(new org.apache.axiom.ts.dom.document.TestAllowedChildren(dbf));
addTest(new org.apache.axiom.ts.dom.document.TestAppendChildWrongDocument(dbf));
- for (ConformanceTestFile file : getInstances(ConformanceTestFile.class)) {
+ for (XMLSample file : getInstances(XMLSample.class)) {
addTest(new org.apache.axiom.ts.dom.document.TestCloneNode(dbf, file));
}
addTest(new org.apache.axiom.ts.dom.document.TestCreateAttribute(dbf));
Modified: webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCloneNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCloneNode.java?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCloneNode.java (original)
+++ webservices/axiom/trunk/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCloneNode.java Wed May 6 20:27:15 2015
@@ -20,16 +20,16 @@ package org.apache.axiom.ts.dom.document
import javax.xml.parsers.DocumentBuilderFactory;
-import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.ts.dom.DOMTestCase;
+import org.apache.axiom.ts.xml.XMLSample;
import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
import org.w3c.dom.Document;
public class TestCloneNode extends DOMTestCase {
- private final ConformanceTestFile file;
+ private final XMLSample file;
- public TestCloneNode(DocumentBuilderFactory dbf, ConformanceTestFile file) {
+ public TestCloneNode(DocumentBuilderFactory dbf, XMLSample file) {
super(dbf);
this.file = file;
addTestParameter("file", file.getShortName());
Modified: webservices/axiom/trunk/testing/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/pom.xml?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/pom.xml (original)
+++ webservices/axiom/trunk/testing/pom.xml Wed May 6 20:27:15 2015
@@ -40,6 +40,7 @@
<module>soap-testsuite</module>
<module>spring-ws-testsuite</module>
<module>testutils</module>
+ <module>xml-testsuite</module>
</modules>
<build>
Modified: webservices/axiom/trunk/testing/testutils/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/testutils/pom.xml?rev=1678089&r1=1678088&r2=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/testutils/pom.xml (original)
+++ webservices/axiom/trunk/testing/testutils/pom.xml Wed May 6 20:27:15 2015
@@ -47,15 +47,6 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>${stax.impl.groupid}</groupId>
- <artifactId>${stax.impl.artifact}</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>multiton</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
@@ -86,66 +77,4 @@
<optional>true</optional>
</dependency>
</dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>${project.build.directory}/generated-resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <source>
- <!-- This generates a list of the files in src/main/resources/org/apache/axiom/testutils/conformance.
- This is useful when loading these files from the classpath. -->
- <![CDATA[
- def filelist = new File(project.build.directory, "generated-resources/org/apache/axiom/testutils/conformance/filelist");
- filelist.parentFile.mkdirs();
- filelist.delete();
- new File(project.basedir, "src/main/resources/org/apache/axiom/testutils/conformance").eachFile({
- if (it.file && it.name.endsWith(".xml")) {
- filelist.append("$it.name\n");
- }
- })
- ]]>
- </source>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>apache-release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- src/main/resources contains test files and they obviously cannot
- all contain a valid license header -->
- <exclude>src/main/resources/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
Propchange: webservices/axiom/trunk/testing/xml-testsuite/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed May 6 20:27:15 2015
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target
Added: webservices/axiom/trunk/testing/xml-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/xml-testsuite/pom.xml?rev=1678089&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/xml-testsuite/pom.xml (added)
+++ webservices/axiom/trunk/testing/xml-testsuite/pom.xml Wed May 6 20:27:15 2015
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>testing</artifactId>
+ <version>1.2.15-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>xml-testsuite</artifactId>
+
+ <name>XML Test Suite</name>
+ <description>
+ Contains XML sample messages.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>${stax.impl.groupid}</groupId>
+ <artifactId>${stax.impl.artifact}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>multiton</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>${project.build.directory}/generated-resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ <!-- This generates a list of the files in src/main/resources/org/apache/axiom/ts/xml/bulk.
+ This is useful when loading these files from the classpath. -->
+ <![CDATA[
+ def filelist = new File(project.build.directory, "generated-resources/org/apache/axiom/ts/xml/bulk/filelist");
+ filelist.parentFile.mkdirs();
+ filelist.delete();
+ new File(project.basedir, "src/main/resources/org/apache/axiom/ts/xml/bulk").eachFile({
+ if (it.file && it.name.endsWith(".xml")) {
+ filelist.append("$it.name\n");
+ }
+ })
+ ]]>
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>apache-release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- src/main/resources contains test files and they obviously cannot
+ all contain a valid license header -->
+ <exclude>src/main/resources/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Propchange: webservices/axiom/trunk/testing/xml-testsuite/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Copied: webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSample.java (from r1677906, webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSample.java?p2=webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSample.java&p1=webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java&r1=1677906&r2=1678089&rev=1678089&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java (original)
+++ webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSample.java Wed May 6 20:27:15 2015
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.testutils.conformance;
+package org.apache.axiom.ts.xml;
import java.io.BufferedReader;
import java.io.IOException;
@@ -26,102 +26,71 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.axiom.testing.multiton.Multiton;
import org.apache.axiom.testing.multiton.Instances;
-import org.codehaus.stax2.DTDInfo;
-
-import com.ctc.wstx.stax.WstxInputFactory;
+import org.apache.axiom.testing.multiton.Multiton;
-public final class ConformanceTestFile extends Multiton {
+public final class XMLSample extends Multiton {
+ /**
+ * An XML document that is larger than the input buffer of typical XML parsers.
+ */
+ // TODO: doesn't work yet; triggers a bug in the StAX and SAX builders
+// public static final XMLSample LARGE = new XMLSample("large.xml");
+
private final String resourceName;
private final String shortName;
- private final boolean hasDTD;
- private final boolean hasExternalSubset;
- private final boolean hasInternalSubset;
- private final boolean hasEntityReferences;
+ private XMLSampleProperties properties;
- private ConformanceTestFile(String resourceName, String shortName, boolean hasDTD,
- boolean hasExternalSubset, boolean hasInternalSubset, boolean hasEntityReferences) {
- this.resourceName = resourceName;
- this.shortName = shortName;
- this.hasDTD = hasDTD;
- this.hasExternalSubset = hasExternalSubset;
- this.hasInternalSubset = hasInternalSubset;
- this.hasEntityReferences = hasEntityReferences;
- }
-
- public String getResourceName() {
- return resourceName;
+ private XMLSample(String relativeResourceName) {
+ resourceName = "org/apache/axiom/ts/xml/" + relativeResourceName;
+ shortName = resourceName.substring(resourceName.lastIndexOf('/')+1);
}
public String getShortName() {
return shortName;
}
+ private synchronized XMLSampleProperties getProperties() {
+ // The purpose of this code is to defer scanning the sample until it is necessary
+ if (properties == null) {
+ properties = new XMLSampleProperties(this);
+ }
+ return properties;
+ }
+
public boolean hasDTD() {
- return hasDTD;
+ return getProperties().hasDTD();
}
public boolean hasExternalSubset() {
- return hasExternalSubset;
+ return getProperties().hasExternalSubset();
}
public boolean hasInternalSubset() {
- return hasInternalSubset;
+ return getProperties().hasInternalSubset();
}
public boolean hasEntityReferences() {
- return hasEntityReferences;
+ return getProperties().hasEntityReferences();
}
public InputStream getAsStream() {
- return ConformanceTestFile.class.getClassLoader().getResourceAsStream(resourceName);
+ return XMLSample.class.getClassLoader().getResourceAsStream(resourceName);
}
public URL getUrl() {
- return ConformanceTestFile.class.getClassLoader().getResource(resourceName);
+ return XMLSample.class.getClassLoader().getResource(resourceName);
}
@Instances
- private static ConformanceTestFile[] instances() throws IOException, XMLStreamException {
+ private static XMLSample[] instances() throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(
- ConformanceTestFile.class.getResourceAsStream("filelist")));
- List<ConformanceTestFile> result = new ArrayList<ConformanceTestFile>(10);
- // We make use of Woodstox' DTDInfo interface here, but we want to be able to use system properties
- // to specify the StAX implementation to be used by the tests. Therefore we need to create
- // an instance of the Woodstox InputFactory implementation directly.
- XMLInputFactory inputFactory = new WstxInputFactory();
- inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
+ XMLSample.class.getResourceAsStream("bulk/filelist")));
+ List<XMLSample> result = new ArrayList<XMLSample>(10);
String name;
while ((name = in.readLine()) != null) {
- String resourceName = "org/apache/axiom/testutils/conformance/" + name;
- boolean hasDTD = false;
- boolean hasExternalSubset = false;
- boolean hasInternalSubset = false;
- boolean hasEntityReferences = false;
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StreamSource(
- ConformanceTestFile.class.getResource(name).toString()));
- while (reader.hasNext()) {
- switch (reader.next()) {
- case XMLStreamReader.DTD:
- hasDTD = true;
- hasInternalSubset = reader.getText().length() > 0;
- hasExternalSubset = ((DTDInfo)reader).getDTDSystemId() != null;
- break;
- case XMLStreamReader.ENTITY_REFERENCE:
- hasEntityReferences = true;
- break;
- }
- }
- reader.close();
- result.add(new ConformanceTestFile(resourceName, name, hasDTD, hasExternalSubset, hasInternalSubset, hasEntityReferences));
+ result.add(new XMLSample("bulk/" + name));
}
in.close();
- return result.toArray(new ConformanceTestFile[result.size()]);
+ return result.toArray(new XMLSample[result.size()]);
}
}
Added: webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSampleProperties.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSampleProperties.java?rev=1678089&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSampleProperties.java (added)
+++ webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSampleProperties.java Wed May 6 20:27:15 2015
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.ts.xml;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.stream.StreamSource;
+
+import org.codehaus.stax2.DTDInfo;
+
+import com.ctc.wstx.stax.WstxInputFactory;
+
+final class XMLSampleProperties {
+ private static final XMLInputFactory inputFactory;
+
+ static {
+ // We make use of Woodstox' DTDInfo interface here, but we want to be able to use system properties
+ // to specify the StAX implementation to be used by the tests. Therefore we need to create
+ // an instance of the Woodstox InputFactory implementation directly.
+ inputFactory = new WstxInputFactory();
+ inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
+ }
+
+ private final boolean hasDTD;
+ private final boolean hasExternalSubset;
+ private final boolean hasInternalSubset;
+ private final boolean hasEntityReferences;
+
+ XMLSampleProperties(XMLSample sample) {
+ boolean hasDTD = false;
+ boolean hasExternalSubset = false;
+ boolean hasInternalSubset = false;
+ boolean hasEntityReferences = false;
+ try {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StreamSource(
+ sample.getUrl().toString()));
+ while (reader.hasNext()) {
+ switch (reader.next()) {
+ case XMLStreamReader.DTD:
+ hasDTD = true;
+ hasInternalSubset = reader.getText().length() > 0;
+ hasExternalSubset = ((DTDInfo)reader).getDTDSystemId() != null;
+ break;
+ case XMLStreamReader.ENTITY_REFERENCE:
+ hasEntityReferences = true;
+ break;
+ }
+ }
+ reader.close();
+ } catch (XMLStreamException ex) {
+ throw new Error("Unable to parse " + sample.getUrl());
+ }
+ this.hasDTD = hasDTD;
+ this.hasExternalSubset = hasExternalSubset;
+ this.hasInternalSubset = hasInternalSubset;
+ this.hasEntityReferences = hasEntityReferences;
+ }
+
+ boolean hasDTD() {
+ return hasDTD;
+ }
+
+ boolean hasExternalSubset() {
+ return hasExternalSubset;
+ }
+
+ boolean hasInternalSubset() {
+ return hasInternalSubset;
+ }
+
+ boolean hasEntityReferences() {
+ return hasEntityReferences;
+ }
+}
Propchange: webservices/axiom/trunk/testing/xml-testsuite/src/main/java/org/apache/axiom/ts/xml/XMLSampleProperties.java
------------------------------------------------------------------------------
svn:eol-style = native