Author: ggregory
Date: Wed Sep 13 16:19:08 2017
New Revision: 1808254

URL: http://svn.apache.org/viewvc?rev=1808254&view=rev
Log:
Add tests to parse XML files while validating with XSD files within the same 
zip file. I am seeing a closed input stream bug in an application that I am 
trying to reproduce.

Added:
    
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ParseXmlInZipTestCase.java
    
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestEntityResolver.java
    
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestErrorHandler.java
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests.zip
   (with props)
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/address.xsd
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file1.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file2.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file3-bigger.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/name-invalid.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/name-not-well-formed.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/name-with-xsd-ref.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/name.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/name.xsd
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/person.xml
    
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/person.xsd
Modified:
    
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ZipFileObjectTestCase.java

Added: 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ParseXmlInZipTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ParseXmlInZipTestCase.java?rev=1808254&view=auto
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ParseXmlInZipTestCase.java
 (added)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ParseXmlInZipTestCase.java
 Wed Sep 13 16:19:08 2017
@@ -0,0 +1,155 @@
+/*
+ * 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.commons.vfs2.provider.zip.test;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.VFS;
+import org.junit.Assert;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * Tests that we can use JAXP to parse an input stream living inside a Zip 
file.
+ */
+public class ParseXmlInZipTestCase {
+
+    private File createTempFile() throws IOException {
+        final File zipFile = new 
File("src/test/resources/test-data/read-xml-tests.zip");
+        final File newZipFile = 
File.createTempFile(getClass().getSimpleName(), ".zip");
+        newZipFile.deleteOnExit();
+        FileUtils.copyFile(zipFile, newZipFile);
+        return newZipFile;
+    }
+
+    private DocumentBuilder newDocumentBuilder(final FileObject sourceFile, 
final String pathToXsdInZip)
+            throws IOException {
+        final DocumentBuilderFactory documentBuilderFactory = 
DocumentBuilderFactory.newInstance();
+        final boolean validate = pathToXsdInZip != null;
+        documentBuilderFactory.setValidating(validate);
+        documentBuilderFactory.setNamespaceAware(true);
+        if (validate) {
+            
documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage";,
+                    "http://www.w3.org/2001/XMLSchema";);
+            @SuppressWarnings("resource")
+            final FileObject schema = sourceFile.resolveFile(pathToXsdInZip);
+            if (schema.exists()) {
+                
documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource";,
+                        schema.getContent().getInputStream());
+            } else {
+                schema.close();
+                throw new FileNotFoundException(schema.toString());
+            }
+        }
+        DocumentBuilder documentBuilder = null;
+        try {
+            documentBuilder = documentBuilderFactory.newDocumentBuilder();
+            documentBuilder.setEntityResolver(new 
TestEntityResolver(sourceFile));
+        } catch (final ParserConfigurationException e) {
+            throw new IOException("Cannot read Java Connector configuration: " 
+ e, e);
+        }
+        documentBuilder.setErrorHandler(new 
TestErrorHandler(sourceFile.toString()));
+        return documentBuilder;
+    }
+
+    @Test
+    public void testParseXmlInZip() throws IOException, SAXException {
+        final File newZipFile = createTempFile();
+        final String xmlFilePath = "zip:file:" + newZipFile.getAbsolutePath() 
+ "!/read-xml-tests/file1.xml";
+        final FileSystemManager manager = VFS.getManager();
+        try (final FileObject zipFileObject = 
manager.resolveFile(xmlFilePath)) {
+            try (final InputStream inputStream = 
zipFileObject.getContent().getInputStream()) {
+                final Document document = newDocumentBuilder(zipFileObject, 
null).parse(inputStream);
+                Assert.assertNotNull(document);
+            }
+        }
+    }
+
+    @Test
+    public void testResolveAndParseBiggerXmlInZip() throws IOException, 
SAXException {
+        // File is > 64 bytes
+        // In this case, we want to make sure that the XML document does NOT 
fit in the internal buffer used to parse
+        // the XML declaration and see if that affects JAXP when it uses its 
"rewind" input stream.
+        testResolveAndParseXmlInZip("read-xml-tests/file3-bigger.xml", null);
+    }
+
+    @Test
+    public void testResolveAndParseInvalidXml() throws IOException, 
SAXException {
+        try {
+            testResolveAndParseXmlInZip("read-xml-tests/name-invalid.xml", 
"/read-xml-tests/name.xsd");
+        } catch (final SAXException e) {
+            Assert.assertTrue(e.toString().contains("Invalid content was found 
starting with element 'FOO'."));
+        }
+    }
+
+    @Test
+    public void testResolveAndParseNotWellFormedXml() throws IOException {
+        try {
+            
testResolveAndParseXmlInZip("read-xml-tests/name-not-well-formed.xml", 
"/read-xml-tests/name.xsd");
+        } catch (final SAXException e) {
+            Assert.assertTrue(
+                    e.toString().contains("XML document structures must start 
and end within the same entity."));
+        }
+    }
+
+    @Test
+    public void testResolveAndParseXmlInZip() throws IOException, SAXException 
{
+        // File is < 64 bytes
+        // In this case, we want to make sure that the XML document DOES fit 
in the internal buffer used to parse
+        // the XML declaration and see if that affects JAXP when it uses its 
"rewind" input stream.
+        testResolveAndParseXmlInZip("read-xml-tests/file1.xml", null);
+    }
+
+    private void testResolveAndParseXmlInZip(final String path, final String 
xsdPathInZip)
+            throws IOException, FileSystemException, SAXException {
+        final File newZipFile = createTempFile();
+        final String zipFilePath = "zip:file:" + newZipFile.getAbsolutePath();
+        final FileSystemManager manager = VFS.getManager();
+        try (final FileObject zipFileObject = 
manager.resolveFile(zipFilePath)) {
+            try (final FileObject xmlFileObject = 
zipFileObject.resolveFile(path)) {
+                try (final InputStream inputStream = 
xmlFileObject.getContent().getInputStream()) {
+                    final Document document = 
newDocumentBuilder(zipFileObject, xsdPathInZip).parse(inputStream);
+                    Assert.assertNotNull(document);
+                }
+            }
+        }
+    }
+
+    @Test
+    public void testResolveAndParseXmlInZipWithOneXmlSchema() throws 
IOException, SAXException {
+        testResolveAndParseXmlInZip("read-xml-tests/name-with-xsd-ref.xml", 
"/read-xml-tests/name.xsd");
+    }
+
+    @Test
+    public void testResolveAndParseXmlInZipWithTwoXmlSchema() throws 
IOException, SAXException {
+        testResolveAndParseXmlInZip("read-xml-tests/person.xml", 
"/read-xml-tests/person.xsd");
+    }
+
+}

Added: 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestEntityResolver.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestEntityResolver.java?rev=1808254&view=auto
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestEntityResolver.java
 (added)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestEntityResolver.java
 Wed Sep 13 16:19:08 2017
@@ -0,0 +1,38 @@
+package org.apache.commons.vfs2.provider.zip.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+
+import org.apache.commons.vfs2.FileObject;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * This SAX resolver opens VFS objects (FileObject, FileContent, InputStream) 
but does not close them.
+ */
+public class TestEntityResolver implements EntityResolver {
+
+    private final FileObject sourceFile;
+
+    public TestEntityResolver(final FileObject sourceFile) {
+        this.sourceFile = sourceFile;
+    }
+
+    @Override
+    public InputSource resolveEntity(final String publicId, final String 
systemId) throws SAXException, IOException {
+        System.out.println("resolving publicId=" + publicId + ", systemId=" + 
systemId);
+        final String fileName = new 
File(URI.create(systemId).getPath()).getName();
+        if (/*fileName.equals("person.xsd") || */fileName.equals("name.xsd") 
|| fileName.equals("address.xsd")) {
+            final String path = "/read-xml-tests/" + fileName;
+            final FileObject xsdFileObject = sourceFile.resolveFile(path);
+            if (!xsdFileObject.exists()) {
+                throw new IllegalStateException("Schema " + path + " not found 
in file " + sourceFile);
+            }
+            return new 
InputSource(xsdFileObject.getContent().getInputStream());
+        }
+        return null;
+    }
+
+}

Added: 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestErrorHandler.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestErrorHandler.java?rev=1808254&view=auto
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestErrorHandler.java
 (added)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/TestErrorHandler.java
 Wed Sep 13 16:19:08 2017
@@ -0,0 +1,54 @@
+/*
+ * 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.commons.vfs2.provider.zip.test;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * A simple SAX {@link ErrorHandler} for unit testing, just throws exceptions 
on all errors. Logs warnings to the
+ * standard error console.
+ */
+public class TestErrorHandler implements ErrorHandler {
+
+    private final String header;
+
+    public TestErrorHandler(final String header) {
+        super();
+        this.header = header;
+    }
+
+    @Override
+    public void error(final SAXParseException exception) throws SAXException {
+        throw new SAXException(header, exception);
+    }
+
+    @Override
+    public void fatalError(final SAXParseException exception) throws 
SAXException {
+        throw new SAXException(header, exception);
+    }
+
+    @Override
+    public void warning(final SAXParseException exception) throws SAXException 
{
+        System.err.println(header);
+        exception.printStackTrace(System.err);
+
+    }
+
+}

Modified: 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ZipFileObjectTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ZipFileObjectTestCase.java?rev=1808254&r1=1808253&r2=1808254&view=diff
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ZipFileObjectTestCase.java
 (original)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/test/ZipFileObjectTestCase.java
 Wed Sep 13 16:19:08 2017
@@ -24,13 +24,61 @@ import java.io.InputStream;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileSystemException;
 import org.apache.commons.vfs2.FileSystemManager;
 import org.apache.commons.vfs2.VFS;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class ZipFileObjectTestCase {
 
+    private static final String NESTED_FILE_1 = "/read-xml-tests/file1.xml";
+    private static final String NESTED_FILE_2 = "/read-xml-tests/file2.xml";
+
+    private void assertDelete(final File fileObject) {
+        Assert.assertTrue("Could not delete file", fileObject.delete());
+    }
+
+    private File createTempFile() throws IOException {
+        final File zipFile = new 
File("src/test/resources/test-data/read-xml-tests.zip");
+        final File newZipFile = 
File.createTempFile(getClass().getSimpleName(), ".zip");
+        newZipFile.deleteOnExit();
+        FileUtils.copyFile(zipFile, newZipFile);
+        return newZipFile;
+    }
+
+    private void getInputStreamAndAssert(final FileObject fileObject, final 
String expectedId)
+            throws FileSystemException, IOException {
+        readAndAssert(fileObject.getContent().getInputStream(), expectedId);
+    }
+
+    private void readAndAssert(final InputStream inputStream, final String 
expectedId) throws IOException {
+        final String string = IOUtils.toString(inputStream, "UTF-8");
+        Assert.assertNotNull(string);
+        Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + 
System.lineSeparator() + "<Root" + expectedId
+                + ">foo" + expectedId + "</Root" + expectedId + ">" + 
System.lineSeparator(), string);
+    }
+
+    /**
+     * Tests that when we read a file inside a file Zip and leave it open, we 
can still delete the Zip after we clean up
+     * the Zip file.
+     * 
+     * @throws IOException
+     */
+    @Test
+    @Ignore("Should this be made to work?")
+    public void testLeaveNestedFileOpen() throws IOException {
+        final File newZipFile = createTempFile();
+        final FileSystemManager manager = VFS.getManager();
+        try (final FileObject zipFileObject = manager.resolveFile("zip:file:" 
+ newZipFile.getAbsolutePath())) {
+            @SuppressWarnings({ "resource" })
+            final FileObject zipFileObject1 = 
zipFileObject.resolveFile(NESTED_FILE_1);
+            getInputStreamAndAssert(zipFileObject1, "1");
+        }
+        assertDelete(newZipFile);
+    }
+
     /**
      * Tests that we can read more than one file within a Zip file, especially 
after closing each FileObject.
      * 
@@ -38,34 +86,93 @@ public class ZipFileObjectTestCase {
      */
     @Test
     public void testReadingFilesInZipFile() throws IOException {
-        final File zipFile = new 
File("src/test/resources/test-data/read-xml-tests.zip");
-        final File newZipFile = 
File.createTempFile(getClass().getSimpleName(), ".zip");
-        newZipFile.deleteOnExit();
-        FileUtils.copyFile(zipFile, newZipFile);
+        final File newZipFile = createTempFile();
         final FileSystemManager manager = VFS.getManager();
         try (final FileObject zipFileObject = manager.resolveFile("zip:file:" 
+ newZipFile.getAbsolutePath())) {
-            try (final FileObject zipFileObject1 = 
zipFileObject.resolveFile("/read-xml-tests/file1.xml")) {
+            try (final FileObject zipFileObject1 = 
zipFileObject.resolveFile(NESTED_FILE_1)) {
                 try (final InputStream inputStream = 
zipFileObject1.getContent().getInputStream()) {
                     readAndAssert(inputStream, "1");
                 }
             }
-            try (final FileObject zipFileObject2 = 
zipFileObject.resolveFile("/read-xml-tests/file2.xml")) {
-                try (final InputStream inputStream = 
zipFileObject2.getContent().getInputStream()) {
-                    readAndAssert(inputStream, "2");
-                }
+            resolveReadAssert(zipFileObject, NESTED_FILE_2);
+        }
+        assertDelete(newZipFile);
+    }
+
+    private void resolveReadAssert(final FileObject zipFileObject, final 
String path)
+            throws IOException, FileSystemException {
+        try (final FileObject zipFileObject2 = 
zipFileObject.resolveFile(path)) {
+            try (final InputStream inputStream = 
zipFileObject2.getContent().getInputStream()) {
+                readAndAssert(inputStream, "2");
             }
         }
+    }
+
+    /**
+     * Tests that we can get a stream from one file in a zip file, then close 
another file from the same zip, then
+     * process the initial input stream.
+     * 
+     * @throws IOException
+     */
+    @Test
+    public void testReadingOneAfterClosingAnotherFile() throws IOException {
+        final File newZipFile = createTempFile();
+        final FileSystemManager manager = VFS.getManager();
+        final FileObject zipFileObject1;
+        final InputStream inputStream1;
+        try (final FileObject zipFileObject = manager.resolveFile("zip:file:" 
+ newZipFile.getAbsolutePath())) {
+            // leave resources open
+            zipFileObject1 = zipFileObject.resolveFile(NESTED_FILE_1);
+            inputStream1 = zipFileObject1.getContent().getInputStream();
+        }
+        // The zip file is "closed", but we read from the stream now.
+        readAndAssert(inputStream1, "1");
+        // clean up
+        zipFileObject1.close();
         assertDelete(newZipFile);
     }
 
-    private void assertDelete(final File fileObject) {
-        Assert.assertTrue("Could not delete file", fileObject.delete());
+    /**
+     * Tests that we can get a stream from one file in a zip file, then close 
another file from the same zip, then
+     * process the initial input stream.
+     * 
+     * @throws IOException
+     */
+    @Test
+    @Ignore("Trying to duplicate what I seeing using JAXP")
+    public void testReadingOneAfterClosingAnotherStream() throws IOException {
+        final File newZipFile = createTempFile();
+        final FileSystemManager manager = VFS.getManager();
+        final FileObject zipFileObject1;
+        final InputStream inputStream1;
+        try (final FileObject zipFileObject = manager.resolveFile("zip:file:" 
+ newZipFile.getAbsolutePath())) {
+            // leave resources open
+            zipFileObject1 = zipFileObject.resolveFile(NESTED_FILE_1);
+            inputStream1 = zipFileObject1.getContent().getInputStream();
+            resolveReadAssert(zipFileObject, NESTED_FILE_2);
+        }
+        // The zip file is "closed", but we read from the stream now.
+        readAndAssert(inputStream1, "1");
+        // clean up
+        zipFileObject1.close();
+        assertDelete(newZipFile);
     }
 
-    private void readAndAssert(final InputStream inputStream, final String 
expectedId) throws IOException {
-        final String string = IOUtils.toString(inputStream, "UTF-8");
-        Assert.assertNotNull(string);
-        Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + 
System.lineSeparator() + "<Root" + expectedId
-                + ">foo" + expectedId + "</Root" + expectedId + ">" + 
System.lineSeparator(), string);
+    /**
+     * Tests that we can resolve a file in a Zip file, then close the 
container zip, which should still let us delete
+     * the Zip file.
+     * 
+     * @throws IOException
+     */
+    @Test
+    public void testResolveNestedFileWithoutCleanup() throws IOException {
+        final File newZipFile = createTempFile();
+        final FileSystemManager manager = VFS.getManager();
+        try (final FileObject zipFileObject = manager.resolveFile("zip:file:" 
+ newZipFile.getAbsolutePath())) {
+            @SuppressWarnings({ "unused", "resource" })
+            // We resolve a nested file and do nothing else.
+            final FileObject zipFileObject1 = 
zipFileObject.resolveFile(NESTED_FILE_1);
+        }
+        assertDelete(newZipFile);
     }
 }

Added: 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests.zip
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests.zip?rev=1808254&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/address.xsd
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/address.xsd?rev=1808254&view=auto
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/address.xsd
 (added)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/address.xsd
 Wed Sep 13 16:19:08 2017
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xs:schema
+  xmlns:xs="http://www.w3.org/2001/XMLSchema";
+  targetNamespace="https://www.apache.org/vfs/example/address";
+  xmlns="https://www.apache.org/vfs/example/address";
+  elementFormDefault="qualified">
+
+  <xs:element
+    name="address"
+    type="addressType" />
+
+  <xs:complexType name="addressType">
+    <xs:sequence>
+      <xs:element
+        name="street"
+        type="xs:string" />
+      <xs:element
+        name="city"
+        type="xs:string" />
+      <xs:element
+        name="state"
+        type="xs:string" />
+      <xs:element
+        name="zip"
+        type="xs:string" />
+    </xs:sequence>
+  </xs:complexType>
+
+</xs:schema> 

Added: 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file1.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file1.xml?rev=1808254&view=auto
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file1.xml
 (added)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file1.xml
 Wed Sep 13 16:19:08 2017
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Root1>foo1</Root1>

Added: 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file2.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file2.xml?rev=1808254&view=auto
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file2.xml
 (added)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/test/resources/test-data/read-xml-tests/file2.xml
 Wed Sep 13 16:19:08 2017
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Root2>foo2</Root2>


Reply via email to