xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r159438 - in xmlbeans/trunk/test/src: scomp/contentType/complex/detailed/AnonymousTest.java scomp/derivation/restriction/facets/detailed/UnionRestriction.java xmlcursor/detailed/GetTextValueTest.java xmlcursor/xquery/detailed/NISTSuiteRunner.java xmlcursor/xquery/detailed/NISTTest.java
Date Tue, 29 Mar 2005 22:33:40 GMT
Author: cezar
Date: Tue Mar 29 14:33:38 2005
New Revision: 159438

URL: http://svn.apache.org/viewcvs?view=rev&rev=159438
Log:
Contributed by: Yana Kadiyska. Test fixes

Modified:
    xmlbeans/trunk/test/src/scomp/contentType/complex/detailed/AnonymousTest.java
    xmlbeans/trunk/test/src/scomp/derivation/restriction/facets/detailed/UnionRestriction.java
    xmlbeans/trunk/test/src/xmlcursor/detailed/GetTextValueTest.java
    xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTSuiteRunner.java
    xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTTest.java

Modified: xmlbeans/trunk/test/src/scomp/contentType/complex/detailed/AnonymousTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/scomp/contentType/complex/detailed/AnonymousTest.java?view=diff&r1=159437&r2=159438
==============================================================================
--- xmlbeans/trunk/test/src/scomp/contentType/complex/detailed/AnonymousTest.java (original)
+++ xmlbeans/trunk/test/src/scomp/contentType/complex/detailed/AnonymousTest.java Tue Mar
29 14:33:38 2005
@@ -33,62 +33,79 @@
 /**
  * testing anonymous complex types
  */
-public class AnonymousTest extends BaseCase {
+public class AnonymousTest
+    extends BaseCase
+{
 
 
-    public void testSimpleAnonymous() throws Throwable {
+    public void testSimpleAnonymous()
+        throws Throwable
+    {
         AnonymousElt testElt = AnonymousElt.Factory.newInstance();
         assertEquals(null, testElt.getChild1());
         assertEquals(null, testElt.xgetChild1());
-        XmlInteger ival=XmlInteger.Factory.newInstance();
+        XmlInteger ival = XmlInteger.Factory.newInstance();
         testElt.xsetChild1(ival);
         testElt.setChild2(new BigInteger("5"));
         testElt.setChild3(new BigInteger("1"));
         assertEquals("<xml-fragment><child1/><child2>5</child2>"
+
-                "<child3>1</child3></xml-fragment>",
-                testElt.xmlText());
+            "<child3>1</child3></xml-fragment>",
+            testElt.xmlText());
 
         testElt.xsetChild2(
-                XmlInteger.Factory.parse("<xml-fragment>3</xml-fragment>"));
+            XmlInteger.Factory.parse("<xml-fragment>3</xml-fragment>"));
         ival.setBigIntegerValue(new BigInteger("10"));
         testElt.xsetChild1(ival);
         assertEquals("<xml-fragment><child1>10</child1><child2>3</child2>"
+
-                "<child3>1</child3></xml-fragment>",
-                testElt.xmlText());
-           try {
+            "<child3>1</child3></xml-fragment>",
+            testElt.xmlText());
+        try
+        {
             assertTrue(testElt.validate(validateOptions));
         }
-        catch (Throwable t) {
+        catch (Throwable t)
+        {
             showErrors();
             throw t;
         }
     }
 
-    public void testMixedAnonymous() throws Exception {
+    public void testMixedAnonymous()
+        throws Throwable
+    {
         AnonymousMixedElt testElt = AnonymousMixedElt.Factory.newInstance();
         assertEquals(null, testElt.getChild1());
         assertEquals(null, testElt.xgetChild1());
         testElt.setChild2(new BigInteger("5"));
         assertEquals(5, testElt.getChild2().intValue());
-        assertTrue(
-                XmlInteger.Factory.parse("<xml-fragment>5</xml-fragment>")
-                    .valueEquals(
-                        testElt.xgetChild2())
-        );
+        assertTrue(XmlInteger.Factory.parse("<xml-fragment>5</xml-fragment>")
+            .valueEquals(testElt.xgetChild2()));
         XmlCursor cur = testElt.newCursor();
         cur.toFirstContentToken();
         cur.insertChars("Random mixed content");
         testElt.setChild3(new BigInteger("1"));
         assertEquals("<xml-fragment>Random mixed content" +
-                "<child2>5</child2>" +
-                "<child3>1</child3>" +
-                "</xml-fragment>",
-                testElt.xmlText());
-
-        testElt.xsetChild2(XmlInteger.Factory.parse("3"));
-        assertEquals("", testElt.xmlText());
-        assertTrue(testElt.validate());
+            "<child2>5</child2>" +
+            "<child3>1</child3>" +
+            "</xml-fragment>",
+            testElt.xmlText());
 
+        testElt.xsetChild1(
+            XmlInteger.Factory.parse("<xml-fragment>3</xml-fragment>"));
+        assertEquals("<xml-fragment>Random mixed content" +
+            "<child1>3</child1>" +
+            "<child2>5</child2>" +
+            "<child3>1</child3>" +
+            "</xml-fragment>", testElt.xmlText());
+        try
+        {
+            assertTrue(testElt.validate(validateOptions));
+        }
+        catch (Throwable t)
+        {
+            showErrors();
+            throw t;
+        }
 
     }
 }

Modified: xmlbeans/trunk/test/src/scomp/derivation/restriction/facets/detailed/UnionRestriction.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/scomp/derivation/restriction/facets/detailed/UnionRestriction.java?view=diff&r1=159437&r2=159438
==============================================================================
--- xmlbeans/trunk/test/src/scomp/derivation/restriction/facets/detailed/UnionRestriction.java
(original)
+++ xmlbeans/trunk/test/src/scomp/derivation/restriction/facets/detailed/UnionRestriction.java
Tue Mar 29 14:33:38 2005
@@ -20,6 +20,7 @@
 import xbean.scomp.derivation.facets.union.SmallPatternUnion;
 import xbean.scomp.derivation.facets.union.UnionEnumEltDocument;
 import xbean.scomp.derivation.facets.union.SmallEnumUnion;
+import org.apache.xmlbeans.XmlErrorCodes;
 
 /**
  * Only pattern and enumeration restrictions possible
@@ -56,7 +57,9 @@
         doc.setUnionPatternElt(new Integer(-1));
         assertTrue(!doc.validate(validateOptions));
         showErrors();
-        String[] errExpected = new String[]{"cvc-attribute"};
+        String[] errExpected = new String[]{
+            XmlErrorCodes.DATATYPE_VALID$PATTERN_VALID
+        };
         assertTrue(compareErrorCodes(errExpected));
 
 
@@ -90,7 +93,9 @@
         doc.setUnionEnumElt(new Integer(2));
         assertTrue(!doc.validate(validateOptions));
         showErrors();
-        String[] errExpected = new String[]{"cvc-attribute"};
+        String[] errExpected = new String[]{
+            XmlErrorCodes.DATATYPE_ENUM_VALID
+        };
         assertTrue(compareErrorCodes(errExpected));
 
 

Modified: xmlbeans/trunk/test/src/xmlcursor/detailed/GetTextValueTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/detailed/GetTextValueTest.java?view=diff&r1=159437&r2=159438
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/detailed/GetTextValueTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/detailed/GetTextValueTest.java Tue Mar 29 14:33:38 2005
@@ -121,12 +121,12 @@
 
     //offset+selection>buffer
     public void testSelectionPastEnd() {
-        String sExpected = " 32";
+        String sExpected = "  3";
         char[] buffer = new char[100];
         int nCopied = m_xc.getTextValue(buffer, 97, 4);
         assertEquals(sExpected.length(), nCopied);
-        assertEquals(sExpected, new String(buffer).substring(97, nCopied));
-        assertEquals("", new String(buffer).substring(0, 97));
+        assertEquals(sExpected, new String(buffer,97, nCopied) );
+        assertEquals("", new String(buffer,0, 97).trim());
     }
 
 

Modified: xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTSuiteRunner.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTSuiteRunner.java?view=diff&r1=159437&r2=159438
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTSuiteRunner.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTSuiteRunner.java Tue Mar 29 14:33:38
2005
@@ -28,7 +28,7 @@
 
 /**
  *
- */
+
 public class NISTSuiteRunner extends AbstractRunner
 
 
@@ -101,3 +101,4 @@
     TestSuiteDocument.TestSuite.TestGroup[] group;
 
 }
+*/
\ No newline at end of file

Modified: xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTTest.java?view=diff&r1=159437&r2=159438
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/xquery/detailed/NISTTest.java Tue Mar 29 14:33:38 2005
@@ -51,7 +51,7 @@
     {
         String query=null;
         String outFile=null;
-        XmlObject obj=XmlObject.Factory.newInstance();
+        XmlObject obj=XmlObject.Factory.parse("<xml-fragment/>");
 
 
             //NIST BUG: folder is called testSuite but appears
@@ -79,7 +79,9 @@
 //               assertEquals(inFiles.length, outFiles.length);
 
                 XmlObject[] queryRes = obj.execQuery(query);
-                XmlObject expRes=XmlObject.Factory.parse(outFiles[i].getStringValue());
+                String input = ZipUtil.getStringFromZip(
+                    pathToZip,zipName,temp+outFiles[i].getStringValue());
+                XmlObject expRes=XmlObject.Factory.parse( input );
                 XPathCommon.compare(queryRes,new XmlObject[]{expRes});
             }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message