You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by da...@apache.org on 2004/07/23 01:54:00 UTC
cvs commit: xml-xmlbeans/v2/test/src/xmlobject/xmlloader/detailed ParseTest.java XmlLoaderBvtTest.java XmlLoaderMiscTest.java
daveremy 2004/07/22 16:53:59
Modified: v2/test/src/ValidatingXSRTests/detailed
ValidatingXmlStreamReaderTests.java
v2/test/src/xmlcursor/detailed CursorLocations.java
GetTextTest.java SetTextValueTest.java
v2/test/src/xmlcursor/jsr173/common NamespaceTest.java
v2/test/src/xmlobject/detailed CompareToTest.java
v2/test/src/xmlobject/xmlloader/detailed ParseTest.java
XmlLoaderBvtTest.java XmlLoaderMiscTest.java
Log:
Contributed by:Yana Kadiyska. Fixing detailed tests
Revision Changes Path
1.4 +2 -0 xml-xmlbeans/v2/test/src/ValidatingXSRTests/detailed/ValidatingXmlStreamReaderTests.java
Index: ValidatingXmlStreamReaderTests.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/ValidatingXSRTests/detailed/ValidatingXmlStreamReaderTests.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ValidatingXmlStreamReaderTests.java 1 Jul 2004 00:01:29 -0000 1.3
+++ ValidatingXmlStreamReaderTests.java 22 Jul 2004 23:53:59 -0000 1.4
@@ -392,6 +392,8 @@
private static File getCasesFile(String path)
throws java.io.IOException
{
+ if (path.length()==0)
+ throw new IOException("getCasesFile was called with path of len 0");
return JarUtil.getResourceFromJarasFile(path);
//return new File(casesRoot + path);
}
1.4 +14 -20 xml-xmlbeans/v2/test/src/xmlcursor/detailed/CursorLocations.java
Index: CursorLocations.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlcursor/detailed/CursorLocations.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CursorLocations.java 1 Jul 2004 00:01:29 -0000 1.3
+++ CursorLocations.java 22 Jul 2004 23:53:59 -0000 1.4
@@ -16,25 +16,19 @@
package xmlcursor.detailed;
-import org.apache.xmlbeans.XmlOptions;
-import junit.framework.*;
-import junit.framework.Assert.*;
-
-import java.io.*;
-
-import org.apache.xmlbeans.XmlObject;
+import junit.framework.Test;
+import junit.framework.TestSuite;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlCursor.TokenType;
-
-
-import xmlcursor.common.*;
-import tools.util.JarUtil;
-
-import java.math.BigDecimal;
-
+import org.apache.xmlbeans.XmlObject;
import test.xbean.xmlcursor.purchaseOrder.PurchaseOrderDocument;
import test.xbean.xmlcursor.purchaseOrder.PurchaseOrderType;
import test.xbean.xmlcursor.purchaseOrder.USAddress;
+import tools.util.JarUtil;
+import xmlcursor.common.BasicCursorTestCase;
+import xmlcursor.common.Common;
+
+import java.math.BigDecimal;
/**
*
@@ -52,7 +46,7 @@
return new TestSuite(CursorLocations.class);
}
- public void LocationTest() throws Exception {
+ public void testLocation() throws Exception {
XmlCursor xc1, xc2, xc3, xc4;
XmlObject m_xo1;
@@ -67,7 +61,7 @@
xc3 = m_xo1.newCursor();
- toNextTokenOfType(xc2, TokenType.COMMENT);
+ toNextTokenOfType(xc2, TokenType.END);
toNextTokenOfType(xc3, TokenType.START);
@@ -84,7 +78,7 @@
xc2.toPrevToken();
}
- //System.out.println("Current Token Type " + xc1.currentTokenType() + " " + xc2.currentTokenType());
+ System.out.println("Current Token Type " + xc1.currentTokenType() + " " + xc2.currentTokenType());
assertEquals(xc1.getChars(), xc2.getTextValue());
//System.out.println(xc2.getTextValue());
xc2.toNextToken();
@@ -143,7 +137,7 @@
}
- public void TestLocationATTR() throws Exception {
+ public void testLocationATTR() throws Exception {
XmlCursor xc1, xc2;
m_xo = XmlObject.Factory.parse(Common.XML_FOO_5ATTR_TEXT);
@@ -189,7 +183,7 @@
}
- public void TestLocationTEXTMiddle() throws Exception {
+ public void testLocationTEXTMiddle() throws Exception {
XmlCursor xc1, xc2, xc3;
m_xo = XmlObject.Factory.parse(Common.XML_TEXT_MIDDLE);
@@ -243,7 +237,7 @@
}
- public void XmlObjectUsingCursor() throws Exception {
+ public void testXmlObjectUsingCursor() throws Exception {
XmlCursor xc1, xc2, xc3;
//PurchaseOrderDocument pod = (PurchaseOrderDocument)XmlObject.Factory.parse(Common.XML_PURCHASEORDER);
1.4 +2 -1 xml-xmlbeans/v2/test/src/xmlcursor/detailed/GetTextTest.java
Index: GetTextTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlcursor/detailed/GetTextTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GetTextTest.java 1 Jul 2004 00:01:29 -0000 1.3
+++ GetTextTest.java 22 Jul 2004 23:53:59 -0000 1.4
@@ -163,7 +163,8 @@
m_xo = XmlObject.Factory.parse(
JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
m_xc = m_xo.newCursor();
- m_xc.selectPath("$this//billTo");
+ m_xc.selectPath(".//po:billTo");
+ assertEquals(1,m_xc.getSelectionCount());
m_xc.toNextSelection();
toNextTokenOfType(m_xc, TokenType.ATTR);
assertEquals("US", m_xc.getTextValue());
1.3 +2 -0 xml-xmlbeans/v2/test/src/xmlcursor/detailed/SetTextValueTest.java
Index: SetTextValueTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlcursor/detailed/SetTextValueTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SetTextValueTest.java 17 Jun 2004 16:29:39 -0000 1.2
+++ SetTextValueTest.java 22 Jul 2004 23:53:59 -0000 1.3
@@ -18,6 +18,7 @@
import junit.framework.*;
import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlCursor.TokenType;
import xmlcursor.common.BasicCursorTestCase;
import xmlcursor.common.Common;
@@ -158,6 +159,7 @@
public void testZeroCharCount() {
char[] buffer = new char[100];
String sExpected = m_xc.xmlText();
+ assertEquals(XmlCursor.TokenType.STARTDOC,m_xc.currentTokenType());
toNextTokenOfType(m_xc, TokenType.START);
m_xc.setTextValue(buffer, 0, 0);
1.3 +2 -1 xml-xmlbeans/v2/test/src/xmlcursor/jsr173/common/NamespaceTest.java
Index: NamespaceTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlcursor/jsr173/common/NamespaceTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NamespaceTest.java 17 Jun 2004 16:29:40 -0000 1.2
+++ NamespaceTest.java 22 Jul 2004 23:53:59 -0000 1.3
@@ -131,7 +131,8 @@
assertEquals(XMLStreamConstants.CHARACTERS, m_stream.next());
// assertEquals("", m_stream.getNamespaceContext().getNamespaceURI("")) ;
- assertEquals("", m_stream.getNamespaceContext().getPrefix("foo.bar")) ;
+ //assertEquals("", m_stream.getNamespaceContext().getPrefix("foo.bar")) ;
+ assertEquals(null, m_stream.getNamespaceContext().getPrefix("foo.bar")) ;
java.util.Iterator it= m_stream.getNamespaceContext().getPrefixes("foo.bar") ;
}
1.4 +8 -4 xml-xmlbeans/v2/test/src/xmlobject/detailed/CompareToTest.java
Index: CompareToTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlobject/detailed/CompareToTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CompareToTest.java 1 Jul 2004 00:01:30 -0000 1.3
+++ CompareToTest.java 22 Jul 2004 23:53:59 -0000 1.4
@@ -21,8 +21,9 @@
import java.math.BigDecimal;
import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlCursor;
-import xmlcursor.common.BasicCursorTestCase;
+//import xmlcursor.common.BasicCursorTestCase;
import xmlcursor.common.Common;
import org.tranxml.tranXML.version40.CarLocationMessageDocument;
@@ -39,7 +40,7 @@
*
*
*/
-public class CompareToTest extends BasicCursorTestCase {
+public class CompareToTest extends TestCase {
public CompareToTest(String sName) {
super(sName);
}
@@ -48,14 +49,14 @@
return new TestSuite(CompareToTest.class);
}
- public void testClassPath() throws Exception {
+ /*public void testClassPath() throws Exception {
String sClassPath = System.getProperty("java.class.path");
int i = sClassPath.indexOf(Common.CARLOCATIONMESSAGE_JAR);
assertTrue(i >= 0);
i = sClassPath.indexOf(Common.XMLCURSOR_JAR);
assertTrue(i >= 0);
}
-
+ */
public void testCompareToEquals() throws Exception {
CarLocationMessageDocument clmDoc = (CarLocationMessageDocument) XmlObject.Factory.parse(
JarUtil.getResourceFromJar(Common.TRANXML_FILE_CLM));
@@ -153,6 +154,9 @@
XmlObject xo = m_xc.getObject();
assertEquals(XmlObject.NOT_EQUAL, m_xo.compareValue(xo));
}
+
+ private XmlObject m_xo;
+ private XmlCursor m_xc;
}
1.3 +2 -2 xml-xmlbeans/v2/test/src/xmlobject/xmlloader/detailed/ParseTest.java
Index: ParseTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlobject/xmlloader/detailed/ParseTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ParseTest.java 17 Jun 2004 16:29:43 -0000 1.2
+++ ParseTest.java 22 Jul 2004 23:53:59 -0000 1.3
@@ -15,11 +15,11 @@
package xmlobject.xmlloader.detailed;
+import junit.framework.Test;
+import junit.framework.TestSuite;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
import xmlcursor.common.BasicCursorTestCase;
-import junit.framework.Test;
-import junit.framework.TestSuite;
import javax.xml.namespace.QName;
import java.util.Vector;
1.4 +3 -5 xml-xmlbeans/v2/test/src/xmlobject/xmlloader/detailed/XmlLoaderBvtTest.java
Index: XmlLoaderBvtTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlobject/xmlloader/detailed/XmlLoaderBvtTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XmlLoaderBvtTest.java 1 Jul 2004 00:01:30 -0000 1.3
+++ XmlLoaderBvtTest.java 22 Jul 2004 23:53:59 -0000 1.4
@@ -15,15 +15,13 @@
package xmlobject.xmlloader.detailed;
+import junit.framework.Test;
+import junit.framework.TestSuite;
import org.apache.xmlbeans.XmlObject;
+import org.tranxml.tranXML.version40.CarLocationMessageDocument;
import tools.util.JarUtil;
-import tools.util.ResourceUtil;
-import tools.util.Util;
import xmlcursor.common.BasicCursorTestCase;
import xmlcursor.common.Common;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.tranxml.tranXML.version40.*;
1.4 +4 -5 xml-xmlbeans/v2/test/src/xmlobject/xmlloader/detailed/XmlLoaderMiscTest.java
Index: XmlLoaderMiscTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/test/src/xmlobject/xmlloader/detailed/XmlLoaderMiscTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XmlLoaderMiscTest.java 1 Jul 2004 00:01:30 -0000 1.3
+++ XmlLoaderMiscTest.java 22 Jul 2004 23:53:59 -0000 1.4
@@ -16,16 +16,15 @@
package xmlobject.xmlloader.detailed;
+import junit.framework.Test;
+import junit.framework.TestSuite;
import org.apache.xmlbeans.*;
import org.apache.xmlbeans.XmlCursor.TokenType;
+import org.tranxml.tranXML.version40.CarLocationMessageDocument;
+import org.tranxml.tranXML.version40.GeographicLocationDocument.GeographicLocation;
import tools.util.JarUtil;
-import tools.util.Util;
import xmlcursor.common.BasicCursorTestCase;
import xmlcursor.common.Common;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.tranxml.tranXML.version40.CarLocationMessageDocument;
-import org.tranxml.tranXML.version40.GeographicLocationDocument.GeographicLocation;
import javax.xml.namespace.QName;
import java.util.Collections;
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org