You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by vg...@apache.org on 2007/02/28 04:35:45 UTC

svn commit: r512591 - in /xml/xindice/trunk: ./ java/tests/src/org/apache/xindice/ java/tests/src/org/apache/xindice/client/xmldb/ java/tests/src/org/apache/xindice/core/filer/ java/tests/src/org/apache/xindice/core/indexer/ java/tests/src/org/apache/x...

Author: vgritsenko
Date: Tue Feb 27 19:35:44 2007
New Revision: 512591

URL: http://svn.apache.org/viewvc?view=rev&rev=512591
Log:
adding tests from bug #41605

Added:
    xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationUncompressedTests.java   (with props)
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/CompressedDOMTests.java   (with props)
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestCase.java   (with props)
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestSuite.java   (with props)
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/UncompressedDOMTests.java   (with props)
Modified:
    xml/xindice/trunk/build.xml
    xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationEmbedTests.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationXmlRpcTests.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/StressTests.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/UnitTests.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/client/xmldb/ResourceIteratorImplTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/core/filer/FilerTestBase.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/core/indexer/ValueIndexerTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/MetaTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/inline/InlineHeaderBuilderTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/IntegrationTests.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/AbstractXmlDbClientTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/XmlDbClient.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/CollectionTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/IndexTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/resources/BinaryResourceTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/IndexedSearchTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/XUpdateQueryTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/stress/filer/StressFilerTestSetup.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/util/ConfigurationTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/TextWriterTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DocumentTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeListTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/TreeWalkerTest.java
    xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/sax/SAXEventGeneratorTest.java

Modified: xml/xindice/trunk/build.xml
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/build.xml?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/build.xml (original)
+++ xml/xindice/trunk/build.xml Tue Feb 27 19:35:44 2007
@@ -196,8 +196,10 @@
             <batchtest todir="${test.result.dir}">
               <fileset dir="${test.build.dir}">
                 <include name="**/*Test.class"/>
-                <exclude name="**/*Integration*.class"/>
+                <include name="**/dom/*Tests.class"/>
+                <exclude name="**/Integration*.class"/>
                 <exclude name="**/integration/**"/>
+                <exclude name="**/dom/*Test.class"/>
               </fileset>
             </batchtest>
             <classpath>

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationEmbedTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationEmbedTests.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationEmbedTests.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationEmbedTests.java Tue Feb 27 19:35:44 2007
@@ -23,11 +23,10 @@
 import org.apache.xindice.integration.client.XmlDbClient;
 import org.apache.xindice.integration.client.XmlDbClientSetup;
 
-import org.xmldb.api.DatabaseManager;
-import org.xmldb.api.base.Database;
-
 import junit.framework.Test;
 import junitx.extensions.TestSetup;
+import org.xmldb.api.DatabaseManager;
+import org.xmldb.api.base.Database;
 
 /**
  * @version $Revision$, $Date$

Added: xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationUncompressedTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationUncompressedTests.java?view=auto&rev=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationUncompressedTests.java (added)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationUncompressedTests.java Tue Feb 27 19:35:44 2007
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.xindice;
+
+import org.apache.xindice.integration.IntegrationTests;
+import org.apache.xindice.integration.client.XmlDbClient;
+import org.apache.xindice.integration.client.XmlDbClientSetup;
+
+import junit.framework.Test;
+import junitx.extensions.TestSetup;
+import org.xmldb.api.DatabaseManager;
+import org.xmldb.api.base.Database;
+
+/**
+ * @version $Revision$, $Date$
+ */
+public class IntegrationUncompressedTests {
+
+    public static Test suite() throws Exception {
+
+        return new TestSetup(
+            new XmlDbClientSetup(
+                IntegrationTests.testSuite("Embed client uncompressed database integration tests"),
+                new XmlDbClient("xmldb:xindice-embed://", false))) {
+
+            private Database database;
+
+            public void setUp() throws Exception {
+                String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
+                Class cls = Class.forName(driver);
+
+                database = (Database) cls.newInstance();
+                DatabaseManager.registerDatabase(database);
+            }
+
+            public void tearDown() throws Exception {
+                if (database != null) {
+                    DatabaseManager.deregisterDatabase(database);
+                }
+            }
+        };
+    }
+}

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationUncompressedTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationUncompressedTests.java
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationXmlRpcTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationXmlRpcTests.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationXmlRpcTests.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/IntegrationXmlRpcTests.java Tue Feb 27 19:35:44 2007
@@ -23,11 +23,10 @@
 import org.apache.xindice.integration.client.XmlDbClient;
 import org.apache.xindice.integration.client.XmlDbClientSetup;
 
-import org.xmldb.api.DatabaseManager;
-import org.xmldb.api.base.Database;
-
 import junit.framework.Test;
 import junitx.extensions.TestSetup;
+import org.xmldb.api.DatabaseManager;
+import org.xmldb.api.base.Database;
 
 /**
  * Integration tests for the client code which communicates
@@ -56,7 +55,11 @@
             url = url + hostport;
         }
 
-        return new TestSetup(new XmlDbClientSetup(IntegrationTests.testSuite("XmlRpc client integration tests"), new XmlDbClient(url))) {
+        return new TestSetup(
+                new XmlDbClientSetup(
+                    IntegrationTests.testSuite("XmlRpc client integration tests"),
+                    new XmlDbClient(url))) {
+
             private Database database;
 
             public void setUp() throws Exception {

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/StressTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/StressTests.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/StressTests.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/StressTests.java Tue Feb 27 19:35:44 2007
@@ -22,12 +22,6 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.apache.xindice.core.filer.BTreeFiler;
-import org.apache.xindice.core.filer.FSFiler;
-import org.apache.xindice.core.filer.HashFiler;
-import org.apache.xindice.core.filer.MemFiler;
-import org.apache.xindice.stress.filer.StressFilerTestSetup;
-
 /**
  * @version $Revision$, $Date$
  * @author Vladimir R. Bossicard <vl...@apache.org>

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/UnitTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/UnitTests.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/UnitTests.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/UnitTests.java Tue Feb 27 19:35:44 2007
@@ -19,13 +19,8 @@
 
 package org.apache.xindice;
 
-import org.apache.xindice.client.xmldb.DatabaseImplTest;
-import org.apache.xindice.client.xmldb.ResourceIteratorImplTest;
 import org.apache.xindice.core.filer.Filer;
 import org.apache.xindice.core.filer.FilerTestBase;
-import org.apache.xindice.core.meta.MetaTest;
-import org.apache.xindice.tools.XMLToolsTest;
-import org.apache.xindice.util.ConfigurationTest;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/client/xmldb/ResourceIteratorImplTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/client/xmldb/ResourceIteratorImplTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/client/xmldb/ResourceIteratorImplTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/client/xmldb/ResourceIteratorImplTest.java Tue Feb 27 19:35:44 2007
@@ -19,12 +19,14 @@
 
 package org.apache.xindice.client.xmldb;
 
-import junit.framework.*;
-import org.xmldb.api.base.*;
+import junit.framework.TestCase;
 import org.xmldb.api.base.Collection;
+import org.xmldb.api.base.Resource;
+import org.xmldb.api.base.ResourceIterator;
 import org.xmldb.api.base.XMLDBException;
 
-import java.util.*;
+import java.util.List;
+import java.util.Vector;
 
 /**
  * @version $Revision$, $Date$

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/core/filer/FilerTestBase.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/core/filer/FilerTestBase.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/core/filer/FilerTestBase.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/core/filer/FilerTestBase.java Tue Feb 27 19:35:44 2007
@@ -28,9 +28,9 @@
 
 import junit.framework.TestCase;
 
+import java.io.File;
 import java.util.List;
 import java.util.Vector;
-import java.io.File;
 
 /**
  * Base class for filer test cases

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/core/indexer/ValueIndexerTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/core/indexer/ValueIndexerTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/core/indexer/ValueIndexerTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/core/indexer/ValueIndexerTest.java Tue Feb 27 19:35:44 2007
@@ -19,13 +19,14 @@
 
 package org.apache.xindice.core.indexer;
 
-import junit.framework.TestCase;
-import org.apache.xindice.core.Database;
 import org.apache.xindice.core.Collection;
-import org.apache.xindice.core.DatabaseTest;
 import org.apache.xindice.core.DBException;
+import org.apache.xindice.core.Database;
+import org.apache.xindice.core.DatabaseTest;
 import org.apache.xindice.util.Configuration;
 import org.apache.xindice.xml.dom.DOMParser;
+
+import junit.framework.TestCase;
 import org.w3c.dom.Document;
 
 /**

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/MetaTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/MetaTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/MetaTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/MetaTest.java Tue Feb 27 19:35:44 2007
@@ -19,11 +19,12 @@
 
 package org.apache.xindice.core.meta;
 
-import junit.framework.TestCase;
 import org.apache.xindice.xml.TextWriter;
-import org.apache.xindice.xml.dom.DocumentImpl;
 import org.apache.xindice.xml.dom.DOMParser;
-import org.w3c.dom.*;
+import org.apache.xindice.xml.dom.DocumentImpl;
+
+import junit.framework.TestCase;
+import org.w3c.dom.Document;
 
 /**
  * @author Dave Viner <dv...@apache.org>

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/inline/InlineHeaderBuilderTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/inline/InlineHeaderBuilderTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/inline/InlineHeaderBuilderTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/core/meta/inline/InlineHeaderBuilderTest.java Tue Feb 27 19:35:44 2007
@@ -20,7 +20,6 @@
 package org.apache.xindice.core.meta.inline;
 
 import org.apache.xindice.core.data.Value;
-import org.apache.xindice.core.meta.inline.InlineHeaderBuilder;
 
 import junit.framework.TestCase;
 

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/IntegrationTests.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/IntegrationTests.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/IntegrationTests.java Tue Feb 27 19:35:44 2007
@@ -22,11 +22,11 @@
 import org.apache.xindice.integration.client.basic.CollectionTest;
 import org.apache.xindice.integration.client.basic.DocumentTest;
 import org.apache.xindice.integration.client.basic.IndexTest;
+import org.apache.xindice.integration.client.resources.BinaryResourceTest;
 import org.apache.xindice.integration.client.services.IndexedSearchTest;
+import org.apache.xindice.integration.client.services.MetaTest;
 import org.apache.xindice.integration.client.services.XPathQueryTest;
 import org.apache.xindice.integration.client.services.XUpdateQueryTest;
-import org.apache.xindice.integration.client.services.MetaTest;
-import org.apache.xindice.integration.client.resources.BinaryResourceTest;
 
 import junit.framework.TestSuite;
 

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/AbstractXmlDbClientTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/AbstractXmlDbClientTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/AbstractXmlDbClientTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/AbstractXmlDbClientTest.java Tue Feb 27 19:35:44 2007
@@ -27,8 +27,9 @@
  */
 public abstract class AbstractXmlDbClientTest extends TestCase {
 
+    public static final String TEST_COLLECTION_PATH = XmlDbClientSetup.INSTANCE_NAME + "/" + XmlDbClientSetup.TEST_COLLECTION_NAME + "/current";
+
     protected XmlDbClient client;
-    static public final String TEST_COLLECTION_PATH = XmlDbClientSetup.INSTANCE_NAME + "/" + XmlDbClientSetup.TEST_COLLECTION_NAME + "/current";
 
     public void setXmlDbClient(XmlDbClient client) {
         this.client = client;

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/XmlDbClient.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/XmlDbClient.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/XmlDbClient.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/XmlDbClient.java Tue Feb 27 19:35:44 2007
@@ -36,15 +36,25 @@
 public class XmlDbClient {
 
     protected String driver;
+    protected String compression = "true";
 
     public XmlDbClient(String driver) throws Exception {
         this.driver = driver;
     }
 
+    public XmlDbClient(String driver, boolean compression) throws Exception {
+        this.driver = driver;
+        this.compression = Boolean.toString(compression);
+    }
+
     public String getDriver() {
         return driver;
     }
 
+    public String getCompression() {
+        return compression;
+    }
+
     public String getName(String path) throws Exception {
         Collection col = DatabaseManager.getCollection(driver + "/" + path);
         if (col == null) {
@@ -60,7 +70,7 @@
     public Collection createCollection(String parent, String path, String name) throws Exception {
         // Inline meta data is on
         String config =
-                "<collection compressed=\"true\" name=\"" + name + "\" inline-metadata=\"true\">" +
+                "<collection compressed='" + compression + "' name='" + name + "' inline-metadata='true'>" +
                 "   <filer class=\"org.apache.xindice.core.filer.BTreeFiler\" />" +
                 "</collection>";
         return createCollection(parent, path, DOMParser.toDocument(config));

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/CollectionTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/CollectionTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/CollectionTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/CollectionTest.java Tue Feb 27 19:35:44 2007
@@ -19,13 +19,13 @@
 
 package org.apache.xindice.integration.client.basic;
 
+import org.apache.xindice.core.FaultCodes;
 import org.apache.xindice.integration.client.AbstractXmlDbClientTest;
 import org.apache.xindice.integration.client.XmlDbClientSetup;
-import org.apache.xindice.core.FaultCodes;
 
-import org.xmldb.api.base.XMLDBException;
 import org.xmldb.api.base.Collection;
 import org.xmldb.api.base.ErrorCodes;
+import org.xmldb.api.base.XMLDBException;
 
 import java.util.Arrays;
 import java.util.List;
@@ -151,7 +151,6 @@
         } catch (XMLDBException e) {
             assertEquals("FaultCodes.COL_COLLECTION_NOT_FOUND",
                          FaultCodes.COL_COLLECTION_NOT_FOUND, e.vendorErrorCode);
-            return;
         }
     }
 

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java Tue Feb 27 19:35:44 2007
@@ -35,6 +35,7 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParserFactory;
+
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/IndexTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/IndexTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/IndexTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/basic/IndexTest.java Tue Feb 27 19:35:44 2007
@@ -20,6 +20,7 @@
 package org.apache.xindice.integration.client.basic;
 
 import org.apache.xindice.integration.client.AbstractXmlDbClientTest;
+
 import org.w3c.dom.Document;
 import org.xmldb.api.base.XMLDBException;
 

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/resources/BinaryResourceTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/resources/BinaryResourceTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/resources/BinaryResourceTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/resources/BinaryResourceTest.java Tue Feb 27 19:35:44 2007
@@ -19,11 +19,11 @@
 
 package org.apache.xindice.integration.client.resources;
 
+import org.apache.xindice.client.xmldb.services.MetaService;
+import org.apache.xindice.core.meta.MetaData;
 import org.apache.xindice.integration.client.AbstractXmlDbClientTest;
 import org.apache.xindice.integration.client.XmlDbClientSetup;
 import org.apache.xindice.xml.dom.DOMParser;
-import org.apache.xindice.client.xmldb.services.MetaService;
-import org.apache.xindice.core.meta.MetaData;
 
 import org.xmldb.api.base.Collection;
 import org.xmldb.api.base.Resource;
@@ -37,8 +37,8 @@
         String name = "current";
         // Override super.setUp(): Need inline meta. See client.createCollection(String, String)
         String cfg
-                = "<collection compressed=\"true\" name=\"" + name + "\" inline-metadata=\"true\">"
-                + "   <filer class=\"org.apache.xindice.core.filer.BTreeFiler\" />"
+                = "<collection compressed='" + client.getCompression() + "' name='" + name + "' inline-metadata='true'>"
+                + "   <filer class='org.apache.xindice.core.filer.BTreeFiler' />"
                 + "</collection>";
         this.client.createCollection(XmlDbClientSetup.INSTANCE_NAME + "/" + XmlDbClientSetup.TEST_COLLECTION_NAME,
                                      name, DOMParser.toDocument(cfg));

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/IndexedSearchTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/IndexedSearchTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/IndexedSearchTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/IndexedSearchTest.java Tue Feb 27 19:35:44 2007
@@ -39,6 +39,7 @@
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
+
 import java.io.StringReader;
 
 /**

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/XUpdateQueryTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/XUpdateQueryTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/XUpdateQueryTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/integration/client/services/XUpdateQueryTest.java Tue Feb 27 19:35:44 2007
@@ -19,13 +19,13 @@
 
 package org.apache.xindice.integration.client.services;
 
-import org.apache.xindice.integration.client.AbstractXmlDbClientTest;
-
-import org.xmldb.api.modules.XUpdateQueryService;
-import org.xmldb.api.base.Collection;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.xindice.integration.client.AbstractXmlDbClientTest;
+
 import org.custommonkey.xmlunit.XMLAssert;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.modules.XUpdateQueryService;
 
 /**
  * @version $Revision$, $Date$

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/stress/filer/StressFilerTestSetup.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/stress/filer/StressFilerTestSetup.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/stress/filer/StressFilerTestSetup.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/stress/filer/StressFilerTestSetup.java Tue Feb 27 19:35:44 2007
@@ -22,9 +22,6 @@
 import org.apache.xindice.core.filer.Filer;
 
 import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import com.clarkware.junitperf.LoadTest;
 
 /**
  * @version $Revision$, $Date$

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/util/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/util/ConfigurationTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/util/ConfigurationTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/util/ConfigurationTest.java Tue Feb 27 19:35:44 2007
@@ -19,11 +19,10 @@
 
 package org.apache.xindice.util;
 
-import junit.framework.TestCase;
-
-import org.apache.xindice.xml.dom.DOMParser;
 import org.apache.xindice.server.Xindice;
+import org.apache.xindice.xml.dom.DOMParser;
 
+import junit.framework.TestCase;
 import org.w3c.dom.Document;
 
 /**

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/TextWriterTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/TextWriterTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/TextWriterTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/TextWriterTest.java Tue Feb 27 19:35:44 2007
@@ -22,11 +22,11 @@
 import org.apache.xindice.xml.dom.DOMParser;
 
 import junit.framework.TestCase;
-import org.w3c.dom.Node;
 import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Node;
 
-import java.io.StringWriter;
 import java.io.ByteArrayOutputStream;
+import java.io.StringWriter;
 
 /**
  * Tests TextWriter class

Added: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/CompressedDOMTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/CompressedDOMTests.java?view=auto&rev=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/CompressedDOMTests.java (added)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/CompressedDOMTests.java Tue Feb 27 19:35:44 2007
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.xindice.xml.dom;
+
+import org.apache.xindice.xml.SymbolTable;
+
+import junit.framework.Test;
+import org.w3c.dom.Document;
+
+/**
+ * @version $Revision$, $Date$
+ */
+public class CompressedDOMTests extends DOMTestSuite {
+
+    private static class CompressedTestSetup extends DOMTestsSetup {
+        public CompressedTestSetup(Test test) {
+            super(test);
+        }
+
+        public Document getDocument(String xml) throws Exception {
+            SymbolTable symbols = new SymbolTable();
+            Document doc = DOMParser.toDocument(xml);
+            return new DocumentImpl(DOMCompressor.Compress(doc, symbols), symbols, null);
+        }
+    }
+
+    public static Test suite() throws Exception {
+        return new CompressedTestSetup(new CompressedDOMTests());
+    }
+}

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/CompressedDOMTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/CompressedDOMTests.java
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Added: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestCase.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestCase.java?view=auto&rev=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestCase.java (added)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestCase.java Tue Feb 27 19:35:44 2007
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.xindice.xml.dom;
+
+import junit.framework.TestCase;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * Base class for DOM tests.
+ *
+ * @version $Revision$, $Date$
+ */
+public abstract class DOMTestCase extends TestCase {
+
+    protected Document doc;
+    protected Node root;
+
+    public abstract String getXml();
+}

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Added: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestSuite.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestSuite.java?view=auto&rev=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestSuite.java (added)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestSuite.java Tue Feb 27 19:35:44 2007
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.xindice.xml.dom;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.w3c.dom.Document;
+
+/**
+ * @version $Revision$, $Date$
+ */
+public abstract class DOMTestSuite extends TestSuite {
+
+    public abstract static class DOMTestsSetup extends TestSetup {
+        public DOMTestsSetup(Test test) {
+            super(test);
+        }
+
+        public abstract Document getDocument(String xml) throws Exception;
+
+        protected void setUp() throws Exception {
+            super.setUp();
+
+            // now we set all tests with the doc & root
+            // we have an TestSuite of TestSuite of DOMTestCase
+            TestSuite suite = (TestSuite) getTest();
+            for (int i = 0; i < suite.testCount(); i++) {
+                TestSuite subSuite = (TestSuite) suite.testAt(i);
+                for (int j = 0; j < subSuite.testCount(); j++) {
+                    DOMTestCase domTest = (DOMTestCase) subSuite.testAt(j);
+                    domTest.doc = getDocument(domTest.getXml());
+                    domTest.root = domTest.doc.getDocumentElement();
+                }
+            }
+        }
+    }
+
+    public DOMTestSuite() {
+        super();
+        addTestSuite(NodeListTest.class);
+        addTestSuite(NodeTest.class);
+        addTestSuite(DocumentTest.class);
+    }
+}

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestSuite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DOMTestSuite.java
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DocumentTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DocumentTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DocumentTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/DocumentTest.java Tue Feb 27 19:35:44 2007
@@ -19,19 +19,18 @@
 
 package org.apache.xindice.xml.dom;
 
-import junit.framework.TestCase;
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
 import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
 
 /**
  * Tests NodeImpl class
  *
  * @version $Revision$, $Date$
  */
-public class DocumentTest extends TestCase {
+public class DocumentTest extends DOMTestCase {
 
-    private static final String XML =
+    public String getXml() {
+        return
             "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" +
             "<a xmlns:name=\"http://apache.org\">" +
                 "<b/>" +
@@ -42,27 +41,22 @@
                     "<d attr3=\"c\" attr4=\"d\" />" +
                 "</c>" +
             "</a>";
-
-    private Document dom;
-
-    public void setUp() throws Exception {
-        dom = DOMParser.toDocument(DocumentTest.XML);
     }
 
     public void testRenameNode() throws Exception {
-        Node node1 = dom.getFirstChild().getFirstChild().getNextSibling();
+        Node node1 = doc.getFirstChild().getFirstChild().getNextSibling();
 
-        node1 = ((DocumentImpl) dom).renameNode(node1, "http://xindice.org", "new:name");
+        node1 = ((DocumentImpl) doc).renameNode(node1, "http://xindice.org", "new:name");
         assertEquals(node1.getNodeName(), "new:name");
         assertEquals(node1.getNamespaceURI(), "http://xindice.org");
 
-        node1 = ((DocumentImpl) dom).renameNode(node1, "", "name");
+        node1 = ((DocumentImpl) doc).renameNode(node1, "", "name");
         assertEquals(node1.getNodeName(), "name");
         assertEquals(node1.getNamespaceURI(), null);
 
-        NamedNodeMap attrs = dom.getFirstChild().getFirstChild().getNextSibling().getAttributes();
+        NamedNodeMap attrs = doc.getFirstChild().getFirstChild().getNextSibling().getAttributes();
         node1 = attrs.getNamedItem("attr1");
-        node1 = ((DocumentImpl) dom).renameNode(node1, "http://xindice.org", "new:attr4");
+        node1 = ((DocumentImpl) doc).renameNode(node1, "http://xindice.org", "new:attr4");
         assertEquals(node1.getNodeName(), "new:attr4");
         assertEquals(node1.getNamespaceURI(), "http://xindice.org");
     }

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeListTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeListTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeListTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeListTest.java Tue Feb 27 19:35:44 2007
@@ -19,24 +19,18 @@
 
 package org.apache.xindice.xml.dom;
 
-import org.apache.xindice.xml.dom.traversal.TreeWalkerImpl;
-
-import junit.framework.TestCase;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.TreeWalker;
 
 /**
  * Tests NodeListImpl class
  *
  * @version $Revision$, $Date$
  */
-public class NodeListTest extends TestCase {
+public class NodeListTest extends DOMTestCase {
 
-    private static final String XML =
+    public String getXml() {
+        return
             "<a>" +
               "<b/>" +
               "<c>" +
@@ -44,15 +38,10 @@
               "</c>" +
               "<i/>" +
             "</a>";
-
-    private Node dom;
-
-    public void setUp() throws Exception {
-        dom = DOMParser.toDocument(XML).getDocumentElement();
     }
 
     public void testElementsByTagName() throws Exception {
-        Element element = (Element) this.dom.getFirstChild().getNextSibling();
+        Element element = (Element) root.getFirstChild().getNextSibling();
         assertEquals("c", element.getTagName());
 
         NodeList list = element.getElementsByTagName("i");

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/NodeTest.java Tue Feb 27 19:35:44 2007
@@ -19,19 +19,17 @@
 
 package org.apache.xindice.xml.dom;
 
-import junit.framework.TestCase;
 import org.w3c.dom.Node;
-import org.w3c.dom.Document;
 import org.w3c.dom.UserDataHandler;
-import org.apache.xindice.xml.SymbolTable;
 
 /**
  * Tests NodeImpl class
  * @version $Revision$, $Date$
  */
-public class NodeTest extends TestCase {
+public class NodeTest extends DOMTestCase {
 
-    private static final String XML =
+    public String getXml() {
+        return
             "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" +
             "<a xmlns:name=\"http://apache.org\">" +
                 "<b/>" +
@@ -48,41 +46,25 @@
                     "<d attr3=\"c\" attr5=\"d\" />" +
                 "</name:c>" +
                 "<d>Parent text<e>Child text</e></d>" +
+                "<cmp>" +
+                    "<b/>" +
+                    "<c attr1=\"a\" attr2=\"b\">" +
+                        "<d attr3=\"c\" attr4=\"d\">" +
+                            "<e attr=\"1\" />" +
+                        "</d>" +
+                    "</c>" +
+                    "<f attr1=\"a\" attr2=\"b\">" +
+                        "<d attr3=\"c\" attr4=\"d\" >" +
+                            "<e attr=\"2\" />" +
+                        "</d>" +
+                    "</f>" +
+                    "<d>Parent text<e>Child text</e></d>" +
+                "</cmp>" +
             "</a>";
-
-    private static final String cmpXML =
-            "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" +
-            "<a>" +
-                "<b/>" +
-                "<c attr1=\"a\" attr2=\"b\">" +
-                    "<d attr3=\"c\" attr4=\"d\">" +
-                        "<e attr=\"1\" />" +
-                    "</d>" +
-                "</c>" +
-                "<f attr1=\"a\" attr2=\"b\">" +
-                    "<d attr3=\"c\" attr4=\"d\" >" +
-                        "<e attr=\"2\" />" +
-                    "</d>" +
-                "</f>" +
-                "<d>Parent text<e>Child text</e></d>" +
-            "</a>";
-
-    private Document doc;
-    private Node dom;
-
-    private Document cmpDoc;
-    private Node cmpDom;
-
-    public void setUp() throws Exception {
-        doc = DOMParser.toDocument(NodeTest.XML);
-        dom = doc.getDocumentElement();
-
-        cmpDoc = DOMParser.toDocument(NodeTest.cmpXML);
-        cmpDom = cmpDoc.getDocumentElement();
     }
 
     public void testNodeEquality() throws Exception {
-        Node node1 = dom.getFirstChild().getNextSibling();
+        Node node1 = root.getFirstChild().getNextSibling();
         assertEquals(true, ((NodeImpl) node1).isEqualNode(node1));
         assertEquals(true, ((NodeImpl) node1).isSameNode(node1));
 
@@ -97,10 +79,10 @@
     }
 
     public void testTextContent() throws Exception {
-        Node node = dom.getFirstChild().getNextSibling().getAttributes().item(1);
+        Node node = root.getFirstChild().getNextSibling().getAttributes().item(1);
         assertEquals("b", ((NodeImpl) node).getTextContent());
 
-        Node node1 = dom.getLastChild();
+        Node node1 = root.getLastChild();
         assertEquals("Parent textChild text", ((NodeImpl) node1).getTextContent());
 
         ((NodeImpl) node1).setTextContent("");
@@ -112,47 +94,45 @@
     }
 
     public void testCloneNode() throws Exception {
-        SymbolTable symbols = new SymbolTable();
-        Document cdoc = new DocumentImpl(DOMCompressor.Compress(doc, symbols), symbols, null);
-
-        Node node1 = cdoc.getDocumentElement().getFirstChild().getNextSibling();
+        Node node1 = root.getFirstChild().getNextSibling();
         Node node2 = node1.cloneNode(true);
 
-        assertTrue("The cloned node is equal to the original node", ((NodeImpl) node1).isEqualNode(node2));
-        assertEquals(false, ((NodeImpl) node1).isSameNode(node2));
-//        assertEquals(null, node2.getParentNode());
+        assertTrue("The cloned node must be equal to the original node",
+                   ((NodeImpl) node1).isEqualNode(node2));
+        assertFalse("The cloned node must not be the same as the original node",
+                    ((NodeImpl) node1).isSameNode(node2));
+        assertNull("The duplicate node must have no parent",
+                   node2.getParentNode());
     }
 
     public void testCompareNodePosition() throws Exception {
-        Node node1 = cmpDom.getFirstChild().getNextSibling();
+        Node root = doc.getElementsByTagName("cmp").item(0);
+        Node node1 = root.getFirstChild().getNextSibling();
         assertEquals(NodeImpl.DOCUMENT_POSITION_CONTAINED_BY | NodeImpl.DOCUMENT_POSITION_FOLLOWING,
-                ((NodeImpl) cmpDoc).compareDocumentPosition(node1));
+                     ((NodeImpl) root).compareDocumentPosition(node1));
 
         assertEquals(NodeImpl.DOCUMENT_POSITION_CONTAINS | NodeImpl.DOCUMENT_POSITION_PRECEDING,
-                ((NodeImpl) node1).compareDocumentPosition(cmpDom));
+                     ((NodeImpl) node1).compareDocumentPosition(root));
 
-        node1 = cmpDom.getFirstChild().getNextSibling().getFirstChild();
-        Node node2 = cmpDom.getFirstChild().getNextSibling().getNextSibling().getFirstChild().getFirstChild();
+        node1 = root.getFirstChild().getNextSibling().getFirstChild();
+        Node node2 = root.getFirstChild().getNextSibling().getNextSibling().getFirstChild().getFirstChild();
         assertEquals(NodeImpl.DOCUMENT_POSITION_FOLLOWING, ((NodeImpl) node1).compareDocumentPosition(node2));
 
-        node1 = cmpDom.getFirstChild().getNextSibling().getAttributes().item(0);
-        node2 = cmpDom.getFirstChild().getNextSibling().getFirstChild();
+        node1 = root.getFirstChild().getNextSibling().getAttributes().item(0);
+        node2 = root.getFirstChild().getNextSibling().getFirstChild();
         assertEquals(NodeImpl.DOCUMENT_POSITION_FOLLOWING, ((NodeImpl) node1).compareDocumentPosition(node2));
 
         assertEquals(NodeImpl.DOCUMENT_POSITION_DISCONNECTED | NodeImpl.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,
-                ((NodeImpl) doc).compareDocumentPosition(cmpDoc));
+                     ((NodeImpl) doc).compareDocumentPosition(DOMParser.toDocument(getXml())));
 
-        node1 = cmpDom.getFirstChild().getNextSibling();
-        node2 = cmpDom.getFirstChild().getNextSibling().getFirstChild();
+        node1 = root.getFirstChild().getNextSibling();
+        node2 = root.getFirstChild().getNextSibling().getFirstChild();
         assertEquals(NodeImpl.DOCUMENT_POSITION_FOLLOWING | NodeImpl.DOCUMENT_POSITION_CONTAINED_BY,
-                ((NodeImpl) node1).compareDocumentPosition(node2));
+                     ((NodeImpl) node1).compareDocumentPosition(node2));
     }
 
     public void testUserDataHandler() throws Exception {
-        SymbolTable symbols = new SymbolTable();
-        Document cdoc = new DocumentImpl(DOMCompressor.Compress(doc, symbols), symbols, null);
-
-        Node node1 = cdoc.getDocumentElement().getFirstChild().getNextSibling();
+        Node node1 = root.getFirstChild().getNextSibling();
         TestDataHandler handler = new TestDataHandler();
         ((NodeImpl) node1).setUserData("key", "data", handler);
         node1.cloneNode(true);

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/TreeWalkerTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/TreeWalkerTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/TreeWalkerTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/TreeWalkerTest.java Tue Feb 27 19:35:44 2007
@@ -22,8 +22,8 @@
 import org.apache.xindice.xml.dom.traversal.TreeWalkerImpl;
 
 import junit.framework.TestCase;
-import org.w3c.dom.Node;
 import org.w3c.dom.DOMException;
+import org.w3c.dom.Node;
 import org.w3c.dom.traversal.NodeFilter;
 import org.w3c.dom.traversal.TreeWalker;
 

Added: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/UncompressedDOMTests.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/UncompressedDOMTests.java?view=auto&rev=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/UncompressedDOMTests.java (added)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/UncompressedDOMTests.java Tue Feb 27 19:35:44 2007
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ *
+ * $Id$
+ */
+
+package org.apache.xindice.xml.dom;
+
+import junit.framework.Test;
+import org.w3c.dom.Document;
+
+/**
+ * @version $Revision$, $Date$
+ */
+public class UncompressedDOMTests extends DOMTestSuite {
+
+    private static class UncompressedTestSetup extends DOMTestsSetup {
+        public UncompressedTestSetup(Test test) {
+            super(test);
+        }
+
+        public Document getDocument(String xml) throws Exception {
+            return DOMParser.toDocument(xml);
+        }
+    }
+
+    public static Test suite() throws Exception {
+        return new UncompressedTestSetup(new UncompressedDOMTests());
+    }
+}

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/UncompressedDOMTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/dom/UncompressedDOMTests.java
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Modified: xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/sax/SAXEventGeneratorTest.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/sax/SAXEventGeneratorTest.java?view=diff&rev=512591&r1=512590&r2=512591
==============================================================================
--- xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/sax/SAXEventGeneratorTest.java (original)
+++ xml/xindice/trunk/java/tests/src/org/apache/xindice/xml/sax/SAXEventGeneratorTest.java Tue Feb 27 19:35:44 2007
@@ -19,14 +19,9 @@
 
 package org.apache.xindice.xml.sax;
 
-import java.io.StringReader;
-import java.util.ArrayList;
-
-import javax.xml.parsers.SAXParserFactory;
-import junit.framework.TestCase;
-
 import org.apache.xindice.xml.dom.DOMParser;
 
+import junit.framework.TestCase;
 import org.w3c.dom.Document;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -35,6 +30,11 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.LexicalHandler;
+
+import javax.xml.parsers.SAXParserFactory;
+
+import java.io.StringReader;
+import java.util.ArrayList;
 
 /**
  * This is a simple test to verify that the output of Xindice internal SAX