Modified: xmlbeans/trunk/test/src/scomp/namespace/checkin/PreserveNamespaces.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/namespace/checkin/PreserveNamespaces.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/namespace/checkin/PreserveNamespaces.java (original) +++ xmlbeans/trunk/test/src/scomp/namespace/checkin/PreserveNamespaces.java Fri Jan 18 23:08:44 2019 @@ -15,27 +15,32 @@ package scomp.namespace.checkin; -import junit.framework.TestCase; -import org.apache.xmlbeans.XmlOptions; import org.apache.xmlbeans.XmlCursor; +import org.apache.xmlbeans.XmlOptions; +import org.junit.Before; +import org.junit.Test; import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument; import tools.xml.XmlComparator; + import javax.xml.namespace.QName; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + -public class PreserveNamespaces extends TestCase +public class PreserveNamespaces { public static XmlOptions options; public static final String EOL = System.getProperty("line.separator"); - public void setUp() - { + @Before + public void setUp() { options = new XmlOptions().setSavePrettyPrint().setSaveOuter(); } //tests for preserving/copying namespace declarations when doing an XmlObject.set() - public void testDroppedXsdNSDecl() throws Exception - { + @Test + public void testDroppedXsdNSDecl() throws Exception { // Test for XSD namespace declaration dropped EnvelopeDocument env1 = EnvelopeDocument.Factory.parse("<soap:Envelope \n" + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" + @@ -63,15 +68,15 @@ public class PreserveNamespaces extends assertTrue(env2Cursor.toFirstChild()); // <ConvertTemperature> if (env2Cursor.toFirstChild()) // <dFahrenheit> { - assertTrue("Element name mismatch!", env2Cursor.getName().equals(new QName("","dFahrenheit"))); + assertEquals("Element name mismatch!", env2Cursor.getName(), new QName("", "dFahrenheit")); assertEquals("Element val mismatch!", "88", env2Cursor.getTextValue()); assertEquals("XSD Namespace has been dropped", "http://www.w3.org/2001/XMLSchema", env2Cursor.namespaceForPrefix("xsd")); } } - public void testsModifiedXsdNSPrefix() throws Exception - { + @Test + public void testsModifiedXsdNSPrefix() throws Exception { // XSD namespace used in QName values and elements EnvelopeDocument env1 = EnvelopeDocument.Factory.parse("<soap:Envelope \n" + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" + @@ -96,14 +101,14 @@ public class PreserveNamespaces extends assertTrue(env2Cursor.toFirstChild()); // <Body> if (env2Cursor.toFirstChild()) // <element> { - assertTrue("Element name mismatch!", env2Cursor.getName().equals(new QName("http://www.w3.org/2001/XMLSchema","element"))); + assertEquals("Element name mismatch!", env2Cursor.getName(), new QName("http://www.w3.org/2001/XMLSchema", "element")); assertEquals("XSD Namespace has been dropped", "http://www.w3.org/2001/XMLSchema", env2Cursor.namespaceForPrefix("xsd")); } } - public void testsFaultCodeNSUpdate() throws Exception - { + @Test + public void testsFaultCodeNSUpdate() throws Exception { EnvelopeDocument env1 = EnvelopeDocument.Factory.parse("<soap:Envelope \n" + "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" + " <soap:Body>\n" + @@ -129,7 +134,7 @@ public class PreserveNamespaces extends assertTrue(env2Cursor.toFirstChild()); // <Fault> if (env2Cursor.toFirstChild()) // <faultcode> { - assertTrue("Element name mismatch!", env2Cursor.getName().equals(new QName("","faultcode"))); + assertEquals("Element name mismatch!", env2Cursor.getName(), new QName("", "faultcode")); assertEquals("soap Namespace has been dropped", "http://schemas.xmlsoap.org/soap/envelope/", env2Cursor.namespaceForPrefix("soap")); }
Modified: xmlbeans/trunk/test/src/scomp/namespace/detailed/AttrFormDefault.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/namespace/detailed/AttrFormDefault.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/namespace/detailed/AttrFormDefault.java (original) +++ xmlbeans/trunk/test/src/scomp/namespace/detailed/AttrFormDefault.java Fri Jan 18 23:08:44 2019 @@ -15,16 +15,20 @@ package scomp.namespace.detailed; +import org.apache.xmlbeans.XmlAnySimpleType; +import org.apache.xmlbeans.XmlErrorCodes; +import org.junit.Test; import scomp.common.BaseCase; import xbean.scomp.namespace.attributeFormDefault.AttributeFormDefaultEltDocument; import xbean.scomp.namespace.attributeFormDefault.ElementT; -import org.apache.xmlbeans.XmlAnySimpleType; -import org.apache.xmlbeans.XmlErrorCodes; + +import static org.junit.Assert.assertTrue; /** * */ public class AttrFormDefault extends BaseCase { + @Test public void testValid() throws Throwable { AttributeFormDefaultEltDocument doc = AttributeFormDefaultEltDocument.Factory.parse("<ns:AttributeFormDefaultElt " + @@ -40,31 +44,31 @@ public class AttrFormDefault extends Bas } } - public void testInvalid() throws Throwable { + @Test + public void testInvalid() throws Throwable { AttributeFormDefaultEltDocument doc = - AttributeFormDefaultEltDocument.Factory.newInstance(); - ElementT elt=doc.addNewAttributeFormDefaultElt(); - XmlAnySimpleType val=XmlAnySimpleType.Factory.newInstance(); - val.setStringValue("345"); - elt.setLocalAttr(val); + AttributeFormDefaultEltDocument.Factory.newInstance(); + ElementT elt = doc.addNewAttributeFormDefaultElt(); + XmlAnySimpleType val = XmlAnySimpleType.Factory.newInstance(); + val.setStringValue("345"); + elt.setLocalAttr(val); try { - assertTrue( doc.validate(validateOptions) ); - } - catch (Throwable t) { + assertTrue(doc.validate(validateOptions)); + } catch (Throwable t) { showErrors(); throw t; } - doc = - AttributeFormDefaultEltDocument.Factory.parse("<ns:AttributeFormDefaultElt " + - "xmlns:ns=\"http://xbean/scomp/namespace/AttributeFormDefault\"" + - " localAttr=\"foobar\"/>"); - assertTrue( ! doc.validate(validateOptions)); - showErrors(); - String[] errExpected = new String[]{ - XmlErrorCodes.ELEM_COMPLEX_TYPE_LOCALLY_VALID$NO_WILDCARD - }; - assertTrue(compareErrorCodes(errExpected)); + doc = + AttributeFormDefaultEltDocument.Factory.parse("<ns:AttributeFormDefaultElt " + + "xmlns:ns=\"http://xbean/scomp/namespace/AttributeFormDefault\"" + + " localAttr=\"foobar\"/>"); + assertTrue(!doc.validate(validateOptions)); + showErrors(); + String[] errExpected = new String[]{ + XmlErrorCodes.ELEM_COMPLEX_TYPE_LOCALLY_VALID$NO_WILDCARD + }; + assertTrue(compareErrorCodes(errExpected)); } } Modified: xmlbeans/trunk/test/src/scomp/namespace/detailed/AttributeWC.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/namespace/detailed/AttributeWC.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/namespace/detailed/AttributeWC.java (original) +++ xmlbeans/trunk/test/src/scomp/namespace/detailed/AttributeWC.java Fri Jan 18 23:08:44 2019 @@ -15,28 +15,31 @@ package scomp.namespace.detailed; +import org.apache.xmlbeans.XmlErrorCodes; +import org.junit.Ignore; +import org.junit.Test; import scomp.common.BaseCase; import xbean.scomp.namespace.attributeWC.*; -import org.apache.xmlbeans.XmlErrorCodes; -/** - * - * - * - */ +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + public class AttributeWC extends BaseCase { + @Test public void testAnyLaxLegal() throws Throwable { AnyLaxDocument doc = AnyLaxDocument.Factory.parse("<AnyLax xmlns=\"http://xbean/scomp/namespace/AttributeWC\" " + "attr1=\"val1\"/>"); assertTrue(doc.validate(validateOptions)); } + @Test public void testAnyLaxIllegal() throws Throwable { AnyLaxDocument doc = AnyLaxDocument.Factory.parse("<AnyLax xmlns=\"http://xbean/scomp/namespace/AttributeWC\" " + "attr1=\"val1\"/>"); assertTrue(doc.validate(validateOptions)); } + @Test public void testAnySkipLegal() throws Throwable { AnySkipDocument doc = AnySkipDocument.Factory.parse("<AnySkip xmlns=\"http://xbean/scomp/namespace/AttributeWC\" " + "attr1=\"val1\"/>"); @@ -49,6 +52,7 @@ public class AttributeWC extends BaseCas * } */ //no NS is legal too + @Test public void testAnyStrictLegal() throws Throwable { AnyStrictDocument doc = AnyStrictDocument.Factory .parse("<ns:AnyStrict" + @@ -58,6 +62,7 @@ public class AttributeWC extends BaseCas assertTrue(doc.validate(validateOptions)); } + @Test public void testAnyStrictIllegal() throws Throwable { AnyStrictDocument doc = AnyStrictDocument.Factory.parse("<AnyStrict xmlns=\"http://xbean/scomp/namespace/AttributeWC\" " + "attr1=\"val1\"/>"); @@ -70,6 +75,7 @@ public class AttributeWC extends BaseCas } + @Test public void testOtherLaxLegal() throws Throwable { OtherLaxDocument doc = OtherLaxDocument.Factory .parse("<foo:OtherLax " + @@ -81,6 +87,7 @@ public class AttributeWC extends BaseCas //can not be in target NS //cannot be in noNS + @Test public void testOtherLaxIllegal() throws Throwable { OtherLaxDocument doc = OtherLaxDocument.Factory .parse("<foo:OtherLax xmlns:foo=\"http://xbean/scomp/namespace/AttributeWC\" " + @@ -105,6 +112,7 @@ public class AttributeWC extends BaseCas } + @Test public void testOtherSkipLegal() throws Throwable { OtherSkipDocument doc = OtherSkipDocument.Factory .parse("<foo:OtherSkip xmlns:foo=\"http://xbean/scomp/namespace/AttributeWC\" " + @@ -114,6 +122,7 @@ public class AttributeWC extends BaseCas } //ns not allowed by the wc + @Test public void testOtherSkipIllegal() throws Throwable { OtherSkipDocument doc = OtherSkipDocument.Factory .parse("<foo:OtherSkip xmlns:foo=\"http://xbean/scomp/namespace/AttributeWC\" " + @@ -127,6 +136,7 @@ public class AttributeWC extends BaseCas } + @Test public void testOtherStrictLegal() throws Throwable { OtherStrictDocument doc = OtherStrictDocument.Factory .parse("<foo:OtherStrict xmlns:foo=\"http://xbean/scomp/namespace/AttributeWC\"" + @@ -136,6 +146,7 @@ public class AttributeWC extends BaseCas } + @Test public void testOtherStrictIllegal() throws Throwable { OtherStrictDocument doc = OtherStrictDocument.Factory .parse("<foo:OtherStrict xmlns:foo=\"http://xbean/scomp/namespace/AttributeWC\"" + @@ -151,6 +162,7 @@ public class AttributeWC extends BaseCas } //no declaration for this attr, no error on Lax + @Test public void testListLaxLegal() throws Throwable { ListLaxDocument doc = ListLaxDocument.Factory .parse("<foo:ListLax " + @@ -160,6 +172,7 @@ public class AttributeWC extends BaseCas assertTrue(doc.validate(validateOptions)); } + @Test public void testListLaxIllegal() throws Throwable { ListLaxDocument doc = ListLaxDocument.Factory.parse("<foo:ListLax " + " xmlns:foo=\"http://xbean/scomp/namespace/AttributeWC\"" + @@ -175,6 +188,7 @@ public class AttributeWC extends BaseCas } + @Test public void testListSkipLegal() throws Throwable { ListSkipDocument doc = ListSkipDocument.Factory .parse("<foo:ListSkip " + @@ -184,6 +198,7 @@ public class AttributeWC extends BaseCas assertTrue(doc.validate(validateOptions)); } + @Test public void testListSkipIllegal() throws Throwable { ListSkipDocument doc = ListSkipDocument.Factory .parse("<foo:ListSkip " + @@ -199,7 +214,8 @@ public class AttributeWC extends BaseCas } - // " xmlns:pre=\"http://xbean/scomp/attribute/GlobalAttrDefault\" + // " xmlns:pre=\"http://xbean/scomp/attribute/GlobalAttrDefault\" + @Test public void testListStrictLegal() throws Throwable { ListStrictDocument doc = ListStrictDocument.Factory .parse("<foo:ListStrict " + @@ -214,6 +230,7 @@ public class AttributeWC extends BaseCas } + @Test public void testListStrictIllegal() throws Throwable { ListStrictDocument doc = ListStrictDocument.Factory .parse("<foo:ListStrict " + @@ -229,6 +246,7 @@ public class AttributeWC extends BaseCas } + @Test public void testTargetLaxLegal() throws Throwable { TargetLaxDocument doc = TargetLaxDocument.Factory .parse("<foo:TargetLax " + @@ -237,6 +255,7 @@ public class AttributeWC extends BaseCas assertTrue(doc.validate(validateOptions)); } + @Test public void testTargetLaxIllegal() throws Throwable { TargetLaxDocument doc = TargetLaxDocument.Factory .parse("<foo:TargetLax " + @@ -252,6 +271,7 @@ public class AttributeWC extends BaseCas } + @Test public void testTargetSkipLegal() throws Throwable { TargetSkipDocument doc = TargetSkipDocument.Factory .parse("<foo:TargetSkip " + @@ -262,7 +282,9 @@ public class AttributeWC extends BaseCas /** * can a test ever be illegal here? - + */ + @Ignore + @Test public void testTargetSkipIllegal() throws Throwable { TargetSkipDocument doc = TargetSkipDocument.Factory .parse("<foo:TargetSkip " + @@ -274,8 +296,8 @@ public class AttributeWC extends BaseCas assertTrue(compareErrorCodes(errExpected)); } - */ + @Test public void testTargetStrictLegal() throws Throwable { TargetStrictDocument doc = TargetStrictDocument.Factory .parse("<foo:TargetStrict " + @@ -284,6 +306,7 @@ public class AttributeWC extends BaseCas assertTrue(doc.validate(validateOptions)); } + @Test public void testTargetStrictIllegal() throws Throwable { TargetStrictDocument doc = TargetStrictDocument.Factory .parse("<foo:TargetStrict " + @@ -298,6 +321,7 @@ public class AttributeWC extends BaseCas } + @Test public void testLocalLaxLegal() throws Throwable { LocalLaxDocument doc = LocalLaxDocument.Factory .parse("<foo:LocalLax " + @@ -306,6 +330,7 @@ public class AttributeWC extends BaseCas assertTrue(doc.validate(validateOptions)); } + @Test public void testLocalLaxIllegal() throws Throwable { LocalLaxDocument doc = LocalLaxDocument.Factory .parse("<foo:LocalLax " + @@ -320,6 +345,7 @@ public class AttributeWC extends BaseCas } + @Test public void testLocalSkipLegal() throws Throwable { LocalSkipDocument doc = LocalSkipDocument.Factory .parse("<foo:LocalSkip " + @@ -330,7 +356,9 @@ public class AttributeWC extends BaseCas /** * can a test ever be illegal here? - + */ + @Ignore + @Test public void testLocalSkipIllegal() throws Throwable { LocalSkipDocument doc = LocalSkipDocument.Factory .parse("<foo:LocalSkip " + @@ -342,7 +370,8 @@ public class AttributeWC extends BaseCas assertTrue(compareErrorCodes(errExpected)); } - */ + + @Test public void testLocalStrictIllegal() throws Throwable { LocalStrictDocument doc = LocalStrictDocument.Factory .parse("<foo:LocalStrict " + @@ -357,6 +386,7 @@ public class AttributeWC extends BaseCas } + @Test public void testLocalStrictLegal() throws Throwable { LocalStrictDocument doc = LocalStrictDocument.Factory .parse("<foo:LocalStrict " + Modified: xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementFormDefault.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementFormDefault.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementFormDefault.java (original) +++ xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementFormDefault.java Fri Jan 18 23:08:44 2019 @@ -16,6 +16,7 @@ package scomp.namespace.detailed; +import org.junit.Test; import scomp.common.BaseCase; import xbean.scomp.namespace.elementFormDefault.ElementFormDefaultEltDocument; import xbean.scomp.namespace.elementFormDefault.ElementT; @@ -23,10 +24,11 @@ import org.apache.xmlbeans.XmlAnySimpleT import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlErrorCodes; -/** - */ +import static org.junit.Assert.assertTrue; + public class ElementFormDefault extends BaseCase { + @Test public void testValid() throws Throwable { ElementFormDefaultEltDocument doc = ElementFormDefaultEltDocument.Factory.parse("<ns:ElementFormDefaultElt " + @@ -43,6 +45,7 @@ public class ElementFormDefault extends } } + @Test public void testInvalid() throws Throwable { ElementFormDefaultEltDocument doc = ElementFormDefaultEltDocument.Factory.parse("<ns:ElementFormDefaultElt " + Modified: xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementWC.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementWC.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementWC.java (original) +++ xmlbeans/trunk/test/src/scomp/namespace/detailed/ElementWC.java Fri Jan 18 23:08:44 2019 @@ -15,17 +15,24 @@ package scomp.namespace.detailed; +import org.apache.xmlbeans.XmlErrorCodes; +import org.apache.xmlbeans.XmlInt; +import org.apache.xmlbeans.XmlObject; +import org.apache.xmlbeans.XmlString; +import org.junit.Ignore; +import org.junit.Test; import scomp.common.BaseCase; import xbean.scomp.namespace.elementWC.*; import javax.xml.namespace.QName; -import org.apache.xmlbeans.*; +import static org.junit.Assert.*; /** */ //TODO: no test on minOccurs maxOccurs here public class ElementWC extends BaseCase { + @Test public void testAnyLaxLegal() throws Throwable { AnyLaxDocument doc = AnyLaxDocument.Factory .parse("<AnyLax " + @@ -37,9 +44,9 @@ public class ElementWC extends BaseCase /** * Is it possible to have an illegal LAX/Any--think not - * - * @throws Throwable - + */ + @Ignore + @Test public void testAnyLaxIllegal() throws Throwable { AnyLaxDocument doc = AnyLaxDocument.Factory .parse("<AnyLax " + @@ -50,8 +57,8 @@ public class ElementWC extends BaseCase assertTrue(compareErrorCodes(errExpected)); } - */ + @Test public void testAnySkipLegal() throws Throwable { AnySkipDocument doc = AnySkipDocument.Factory .parse("<AnySkip " + @@ -67,6 +74,7 @@ public class ElementWC extends BaseCase * } */ //no NS is legal too + @Test public void testAnyStrictLegal() throws Throwable { AnyStrictDocument doc = AnyStrictDocument.Factory .parse("<ns:AnyStrict" + @@ -87,6 +95,7 @@ public class ElementWC extends BaseCase assertEquals(arr[0].schemaType(),XmlString.type); } + @Test public void testAnyStrictIllegal() throws Throwable { AnyStrictDocument doc = AnyStrictDocument.Factory .parse("<AnyStrict " + @@ -102,6 +111,7 @@ public class ElementWC extends BaseCase } + @Test public void testOtherLaxLegal() throws Throwable { OtherLaxDocument doc = OtherLaxDocument.Factory .parse("<foo:OtherLax " + @@ -113,6 +123,7 @@ public class ElementWC extends BaseCase //can not be in target NS //cannot be in noNS + @Test public void testOtherLaxIllegal() throws Throwable { OtherLaxDocument doc = OtherLaxDocument.Factory .parse("<foo:OtherLax " + @@ -128,6 +139,7 @@ public class ElementWC extends BaseCase showErrors(); } + @Test public void testOtherSkipLegal() throws Throwable { OtherSkipDocument doc = OtherSkipDocument.Factory .parse("<foo:OtherSkip " + @@ -138,6 +150,7 @@ public class ElementWC extends BaseCase } //no ns not allowed by the wc + @Test public void testOtherSkipIllegal() throws Throwable { OtherSkipDocument doc = OtherSkipDocument.Factory .parse("<foo:OtherSkip " + @@ -147,6 +160,7 @@ public class ElementWC extends BaseCase showErrors(); } //"http://xbean/scomp/element/GlobalEltDefault" + @Test public void testOtherStrictLegal() throws Throwable { OtherStrictDocument doc = OtherStrictDocument.Factory .parse("<foo:OtherStrict xmlns:foo=\"http://xbean/scomp/namespace/ElementWC\"" + @@ -158,6 +172,7 @@ public class ElementWC extends BaseCase } + @Test public void testOtherStrictIllegal() throws Throwable { OtherStrictDocument doc = OtherStrictDocument.Factory .parse("<foo:OtherStrict " + @@ -173,6 +188,7 @@ public class ElementWC extends BaseCase } //no declaration for this attr, no error on Lax + @Test public void testListLaxLegal() throws Throwable { ListLaxDocument doc = ListLaxDocument.Factory .parse("<foo:ListLax " + @@ -182,6 +198,7 @@ public class ElementWC extends BaseCase assertTrue(doc.validate(validateOptions)); } + @Test public void testListLaxIllegal() throws Throwable { ListLaxDocument doc = ListLaxDocument.Factory .parse("<foo:ListLax " + @@ -192,7 +209,7 @@ public class ElementWC extends BaseCase showErrors(); } - + @Test public void testListSkipLegal() throws Throwable { ListSkipDocument doc = ListSkipDocument.Factory .parse("<foo:ListSkip " + @@ -202,6 +219,7 @@ public class ElementWC extends BaseCase assertTrue(doc.validate(validateOptions)); } + @Test public void testListSkipIllegal() throws Throwable { ListSkipDocument doc = ListSkipDocument.Factory .parse("<foo:ListSkip " + @@ -212,6 +230,7 @@ public class ElementWC extends BaseCase showErrors(); } + @Test public void testListStrictLegal() throws Throwable { ListStrictDocument doc = ListStrictDocument.Factory .parse("<foo:ListStrict " + @@ -226,7 +245,8 @@ public class ElementWC extends BaseCase } - //element will not be found + //element will not be found + @Test public void testListStrictIllegal() throws Throwable { ListStrictDocument doc = ListStrictDocument.Factory .parse("<foo:ListStrict " + @@ -245,6 +265,7 @@ public class ElementWC extends BaseCase //replacement elements MUST be in the // current target NS + @Test public void testTargetLaxLegal() throws Throwable { TargetLaxDocument doc = TargetLaxDocument.Factory .parse("<foo:TargetLax" + @@ -258,6 +279,7 @@ public class ElementWC extends BaseCase } //no such element in the NS + @Test public void testTargetLaxIllegal() throws Throwable { TargetLaxDocument doc = TargetLaxDocument.Factory .parse("<foo:TargetLax " + @@ -274,6 +296,7 @@ public class ElementWC extends BaseCase } + @Test public void testTargetSkipLegal() throws Throwable { TargetSkipDocument doc = TargetSkipDocument.Factory .parse("<foo:TargetSkip " + @@ -285,6 +308,7 @@ public class ElementWC extends BaseCase /** * can a test ever be illegal here? */ + @Test public void testTargetSkipIllegal() throws Throwable { TargetSkipDocument doc = TargetSkipDocument.Factory .parse("<foo:TargetSkip " + @@ -300,6 +324,7 @@ public class ElementWC extends BaseCase } + @Test public void testTargetStrictLegal() throws Throwable { TargetStrictDocument doc = TargetStrictDocument.Factory .parse("<foo:TargetStrict " + @@ -313,6 +338,7 @@ public class ElementWC extends BaseCase } } + @Test public void testTargetStrictIllegal() throws Throwable { TargetStrictDocument doc = TargetStrictDocument.Factory .parse("<foo:TargetStrict " + @@ -327,6 +353,7 @@ public class ElementWC extends BaseCase } + @Test public void testLocalLaxLegal() throws Throwable { LocalLaxDocument doc = LocalLaxDocument.Factory .parse("<foo:LocalLax " + @@ -336,6 +363,7 @@ public class ElementWC extends BaseCase } //no such child in current NS + @Test public void testLocalLaxIllegal() throws Throwable { LocalLaxDocument doc = LocalLaxDocument.Factory .parse("<foo:LocalLax " + @@ -351,6 +379,7 @@ public class ElementWC extends BaseCase } + @Test public void testLocalSkipLegal() throws Throwable { LocalSkipDocument doc = LocalSkipDocument.Factory .parse("<foo:LocalSkip " + @@ -361,7 +390,9 @@ public class ElementWC extends BaseCase /** * can a test ever be illegal here? - + */ + @Ignore + @Test public void testLocalSkipIllegal() throws Throwable { LocalSkipDocument doc = LocalSkipDocument.Factory .parse("<foo:LocalSkip " + @@ -373,7 +404,8 @@ public class ElementWC extends BaseCase assertTrue(compareErrorCodes(errExpected)); } - */ + + @Test public void testLocalStrictIllegal() throws Throwable { LocalStrictDocument doc = LocalStrictDocument.Factory .parse("<foo:LocalStrict " + @@ -388,6 +420,7 @@ public class ElementWC extends BaseCase } + @Test public void testLocalStrictLegal() throws Throwable { LocalStrictDocument doc = LocalStrictDocument.Factory .parse("<foo:LocalStrict " + Modified: xmlbeans/trunk/test/src/scomp/redefine/detailed/AttrGroupRedefine.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/redefine/detailed/AttrGroupRedefine.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/redefine/detailed/AttrGroupRedefine.java (original) +++ xmlbeans/trunk/test/src/scomp/redefine/detailed/AttrGroupRedefine.java Fri Jan 18 23:08:44 2019 @@ -14,36 +14,43 @@ */ package scomp.redefine.detailed; +import org.junit.Test; import scomp.common.BaseCase; import xbean.scomp.redefine.attrGroupRedefine.AttrGroupEltDocument; import java.lang.reflect.Method; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + public class AttrGroupRedefine extends BaseCase{ /** * test that fields from the old type def are not * visible anymore */ - public void testCodeGeneration(){ - AttrGroupEltDocument doc=AttrGroupEltDocument.Factory.newInstance(); - AttrGroupEltDocument.AttrGroupElt elt=doc.addNewAttrGroupElt(); - - try{ - elt.getClass().getDeclaredField("attr2"); - fail("field should be redefined"); - }catch(NoSuchFieldException e){} - - - try{ - elt.getClass().getDeclaredMethod("getAttr1",null); - elt.getClass().getDeclaredMethod("getAttr2A",null); - - Method m=elt.getClass().getDeclaredMethod("getAttr3A",null); - assertEquals(m.getReturnType(),Class.forName("java.lang.Integer.TYPE") ); - }catch(NoSuchMethodException e){ + @Test + public void testCodeGeneration() { + AttrGroupEltDocument doc = AttrGroupEltDocument.Factory.newInstance(); + AttrGroupEltDocument.AttrGroupElt elt = doc.addNewAttrGroupElt(); + + try { + elt.getClass().getDeclaredField("attr2"); + fail("field should be redefined"); + } catch (NoSuchFieldException e) { + } + + + try { + elt.getClass().getDeclaredMethod("getAttr1"); + elt.getClass().getDeclaredMethod("getAttr2A"); + + Method m = elt.getClass().getDeclaredMethod("getAttr3A"); + assertEquals(m.getReturnType(), Class.forName("java.lang.Integer.TYPE")); + } catch (NoSuchMethodException e) { fail("Fields not redefined"); - } catch (ClassNotFoundException e1){} + } catch (ClassNotFoundException e1) { + } } } Modified: xmlbeans/trunk/test/src/scomp/redefine/detailed/MultipleRedefines.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/redefine/detailed/MultipleRedefines.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/redefine/detailed/MultipleRedefines.java (original) +++ xmlbeans/trunk/test/src/scomp/redefine/detailed/MultipleRedefines.java Fri Jan 18 23:08:44 2019 @@ -14,16 +14,18 @@ */ package scomp.redefine.detailed; -import scomp.common.BaseCase; -import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument; import org.apache.xmlbeans.*; -import junit.framework.Assert; +import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument; +import org.junit.Assert; +import org.junit.Test; +import scomp.common.BaseCase; import javax.xml.namespace.QName; import java.util.Iterator; -public class MultipleRedefines extends BaseCase -{ +import static org.junit.Assert.*; + +public class MultipleRedefines extends BaseCase { private static final String[] MULTIPLE_SCHEMAS = { "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" + " <xs:complexType name=\"T\">" + @@ -163,8 +165,8 @@ public class MultipleRedefines extends B private static final String[] CIRCULAR_SCHEMAS_NAME = { "A.xsd", "B.xsd", "C.xsd", "D.xsd"}; - public void testMultipleRedefines() throws Exception - { + @Test + public void testMultipleRedefines() throws Exception { int N = MULTIPLE_SCHEMAS.length; SchemaDocument[] sdocs = new SchemaDocument[N]; for (int i = 0; i < N; i++) @@ -175,25 +177,26 @@ public class MultipleRedefines extends B SchemaTypeSystem ts = XmlBeans.compileXsd(sdocs, XmlBeans.getBuiltinTypeSystem(), validateOptions); - Assert.assertNotNull(ts); + assertNotNull(ts); SchemaType t = ts.findType(new QName("", "T")); - Assert.assertNotNull(t); + assertNotNull(t); SchemaParticle p = t.getContentModel(); - Assert.assertNotNull(p); - Assert.assertEquals(p.getParticleType(), SchemaParticle.SEQUENCE); + assertNotNull(p); + assertEquals(p.getParticleType(), SchemaParticle.SEQUENCE); SchemaParticle[] elts = p.getParticleChildren(); - Assert.assertEquals(elts.length, 4); + assertEquals(elts.length, 4); for (int i = 0; i < elts.length; i++) - Assert.assertEquals(elts[i].getParticleType(), SchemaParticle.ELEMENT); + assertEquals(elts[i].getParticleType(), SchemaParticle.ELEMENT); - Assert.assertEquals("A", elts[0].getName().getLocalPart()); - Assert.assertEquals("B", elts[1].getName().getLocalPart()); - Assert.assertEquals("D", elts[2].getName().getLocalPart()); - Assert.assertEquals("E", elts[3].getName().getLocalPart()); + assertEquals("A", elts[0].getName().getLocalPart()); + assertEquals("B", elts[1].getName().getLocalPart()); + assertEquals("D", elts[2].getName().getLocalPart()); + assertEquals("E", elts[3].getName().getLocalPart()); } + @Test public void testCircularRedefines() throws Exception { int N =CIRCULAR_SCHEMAS.length; @@ -219,9 +222,9 @@ public class MultipleRedefines extends B Assert.assertFalse(it.hasNext()); String message = err.getMessage(); // TODO check an error code instead - Assert.assertTrue(message.toLowerCase().indexOf("circular") >= 0); + assertTrue(message.toLowerCase().indexOf("circular") >= 0); } clearErrors(); - Assert.assertTrue("Compilation should fail", caught); + assertTrue("Compilation should fail", caught); } } Modified: xmlbeans/trunk/test/src/scomp/redefine/detailed/SimpleRedefine.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/redefine/detailed/SimpleRedefine.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/redefine/detailed/SimpleRedefine.java (original) +++ xmlbeans/trunk/test/src/scomp/redefine/detailed/SimpleRedefine.java Fri Jan 18 23:08:44 2019 @@ -14,50 +14,51 @@ */ package scomp.redefine.detailed; +import org.junit.Test; +import scomp.common.BaseCase; import xbean.scomp.redefine.simpleRedefined.NewSizeEltDocument; import xbean.scomp.redefine.simpleRedefined.OldColorEltDocument; import xbean.scomp.redefine.simpleRedefined.OldSizeEltDocument; -import scomp.common.BaseCase; -/** - */ -public class SimpleRedefine extends BaseCase - { +import static org.junit.Assert.assertTrue; + +public class SimpleRedefine extends BaseCase { - /** + /** * test that fields from the old type def are not * visible anymore: only valid range for sizeT should be 3-20 */ + @Test public void testCodeGeneration() throws Throwable{ - NewSizeEltDocument doc=NewSizeEltDocument.Factory.newInstance(); - OldColorEltDocument doc1=OldColorEltDocument.Factory.newInstance(); - OldSizeEltDocument doc2=OldSizeEltDocument.Factory.newInstance(); + NewSizeEltDocument doc = NewSizeEltDocument.Factory.newInstance(); + OldColorEltDocument doc1 = OldColorEltDocument.Factory.newInstance(); + OldSizeEltDocument doc2 = OldSizeEltDocument.Factory.newInstance(); doc.setNewSizeElt(3); - try{ - assertTrue(doc.validate(validateOptions)); - }catch(Throwable t){ - showErrors(); - throw t; - } - doc.setNewSizeElt(21); - assertTrue( !doc.validate(validateOptions)); + try { + assertTrue(doc.validate(validateOptions)); + } catch (Throwable t) { + showErrors(); + throw t; + } + doc.setNewSizeElt(21); + assertTrue(!doc.validate(validateOptions)); showErrors(); clearErrors(); doc2.setOldSizeElt(21); - assertTrue( !doc.validate(validateOptions)); + assertTrue(!doc.validate(validateOptions)); showErrors(); clearErrors(); doc1.setOldColorElt("white"); - try{ - assertTrue(doc1.validate(validateOptions)); - }catch(Throwable t){ - showErrors(); - throw t; - } + try { + assertTrue(doc1.validate(validateOptions)); + } catch (Throwable t) { + showErrors(); + throw t; + } } } Modified: xmlbeans/trunk/test/src/scomp/simple/SimplePersonTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/simple/SimplePersonTest.java?rev=1851656&r1=1851645&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/simple/SimplePersonTest.java (original) +++ xmlbeans/trunk/test/src/scomp/simple/SimplePersonTest.java Fri Jan 18 23:08:44 2019 @@ -13,59 +13,64 @@ * limitations under the License. */ -import org.openuri.mytest.Person; +package scomp.simple; + +import common.Common; +import org.junit.Test; import org.openuri.mytest.CustomerDocument; +import org.openuri.mytest.Person; +import java.util.Calendar; import java.util.Date; -import org.apache.xmlbeans.XmlBeans; -import org.apache.xmlbeans.XmlCursor; -import drtcases.TestEnv; -import junit.framework.Assert; - -public class SimplePersonTest -{ - public static void main(String args[]) throws Exception - { - test(); - } +import java.util.TimeZone; + +import static org.junit.Assert.assertEquals; - public static void test() throws Exception - { +public class SimplePersonTest { + @Test + public void test() throws Exception { CustomerDocument doc = CustomerDocument.Factory.parse( - TestEnv.xbeanCase("schema/simple/person.xml"), null); + Common.xbeanCase("xbean/simple/person/person.xml"), null); // Move from the root to the root customer element Person person = doc.getCustomer(); - Assert.assertEquals("Howdy", person.getFirstname()); - Assert.assertEquals(4, person.sizeOfNumberArray()); - Assert.assertEquals(436, person.getNumberArray(0)); - Assert.assertEquals(123, person.getNumberArray(1)); - Assert.assertEquals(44, person.getNumberArray(2)); - Assert.assertEquals(933, person.getNumberArray(3)); - Assert.assertEquals(2, person.sizeOfBirthdayArray()); - Assert.assertEquals(new Date("Tue Aug 25 17:00:00 PDT 1998"), person.getBirthdayArray(0)); + assertEquals("Howdy", person.getFirstname()); + assertEquals(4, person.sizeOfNumberArray()); + assertEquals(436, person.getNumberArray(0)); + assertEquals(123, person.getNumberArray(1)); + assertEquals(44, person.getNumberArray(2)); + assertEquals(933, person.getNumberArray(3)); + assertEquals(2, person.sizeOfBirthdayArray()); + Calendar cal = person.getBirthdayArray(0); + cal.set(1998, 7, 25, 17, 0); + assertEquals(1998, cal.get(Calendar.YEAR)); + assertEquals(7, cal.get(Calendar.MONTH)); + assertEquals(25, cal.get(Calendar.DATE)); + assertEquals(17, cal.get(Calendar.HOUR_OF_DAY)); + assertEquals(0, cal.get(Calendar.MINUTE)); + assertEquals(0, cal.get(Calendar.SECOND)); Person.Gender.Enum g = person.getGender(); - Assert.assertEquals(Person.Gender.MALE, g); + assertEquals(Person.Gender.MALE, g); - Assert.assertEquals("EGIQTWYZJ", new String(person.getHex())); - Assert.assertEquals("This string is base64Binary encoded!", - new String(person.getBase64())); - - Assert.assertEquals("GGIQTWYGG", new String(person.getHexAtt())); - Assert.assertEquals("This string is base64Binary encoded!", - new String(person.getBase64Att())); + assertEquals("EGIQTWYZJ", new String(person.getHex())); + assertEquals("This string is base64Binary encoded!", + new String(person.getBase64())); + + assertEquals("GGIQTWYGG", new String(person.getHexAtt())); + assertEquals("This string is base64Binary encoded!", + new String(person.getBase64Att())); person.setFirstname("George"); - Assert.assertEquals("George", person.getFirstname()); + assertEquals("George", person.getFirstname()); person.setHex("hex encoding".getBytes()); - Assert.assertEquals("hex encoding", new String(person.getHex())); + assertEquals("hex encoding", new String(person.getHex())); person.setBase64("base64 encoded".getBytes()); - Assert.assertEquals("base64 encoded", - new String(person.getBase64())); + assertEquals("base64 encoded", + new String(person.getBase64())); //person.setHexAtt("hex encoding in attributes".getBytes()); //Assert.assertEquals("hex encoding in attributes", Modified: xmlbeans/trunk/test/src/scomp/substGroup/detailed/Deep.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/substGroup/detailed/Deep.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/substGroup/detailed/Deep.java (original) +++ xmlbeans/trunk/test/src/scomp/substGroup/detailed/Deep.java Fri Jan 18 23:08:44 2019 @@ -22,6 +22,8 @@ import scomp.common.BaseCase; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlErrorCodes; +import static org.junit.Assert.assertTrue; + /** */ public class Deep extends BaseCase { Modified: xmlbeans/trunk/test/src/scomp/substGroup/detailed/OneLevel.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/substGroup/detailed/OneLevel.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/substGroup/detailed/OneLevel.java (original) +++ xmlbeans/trunk/test/src/scomp/substGroup/detailed/OneLevel.java Fri Jan 18 23:08:44 2019 @@ -14,18 +14,18 @@ */ package scomp.substGroup.detailed; +import org.apache.xmlbeans.XmlErrorCodes; +import org.junit.Test; import scomp.common.BaseCase; import xbean.scomp.substGroup.oneLevel.*; import java.math.BigInteger; -import org.apache.xmlbeans.XmlObject; -import org.apache.xmlbeans.XmlErrorCodes; +import static org.junit.Assert.assertTrue; -/** - */ public class OneLevel extends BaseCase { + @Test public void testValidSubstParse() throws Throwable { String input = "<items xmlns=\"http://xbean/scomp/substGroup/OneLevel\">" + @@ -61,9 +61,8 @@ public class OneLevel extends BaseCase { /** * Test error message. 1 product too many - * - * @throws Throwable */ + @Test public void testValidSubstParseInvalid() throws Throwable { String input = "<items xmlns=\"http://xbean/scomp/substGroup/OneLevel\">" + @@ -100,9 +99,9 @@ public class OneLevel extends BaseCase { }; assertTrue(compareErrorCodes( errExpected)); - } + @Test public void testValidSubstBuild() throws Throwable { ItemsDocument doc = ItemsDocument.Factory.newInstance(); ItemType items = doc.addNewItems(); Modified: xmlbeans/trunk/test/src/scomp/substGroup/detailed/UserReportedTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/substGroup/detailed/UserReportedTest.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/substGroup/detailed/UserReportedTest.java (original) +++ xmlbeans/trunk/test/src/scomp/substGroup/detailed/UserReportedTest.java Fri Jan 18 23:08:44 2019 @@ -15,17 +15,17 @@ package scomp.substGroup.detailed; +import org.junit.Test; import scomp.common.BaseCase; -import xbean.scomp.substGroup.userReported.RootDocument; -import xbean.scomp.substGroup.userReported.T; import xbean.scomp.substGroup.userReported.ADocument; import xbean.scomp.substGroup.userReported.BDocument; -import org.apache.xmlbeans.XmlObject; +import xbean.scomp.substGroup.userReported.RootDocument; +import xbean.scomp.substGroup.userReported.T; import javax.xml.namespace.QName; -/** - */ +import static org.junit.Assert.assertTrue; + public class UserReportedTest extends BaseCase{ String input="<Root xmlns=\"http://xbean/scomp/substGroup/UserReported\">" + " <a/>" + @@ -34,7 +34,8 @@ public class UserReportedTest extends Ba " <a/>" + " <b/>" + "</Root>"; - public void testGoal()throws Throwable{ + @Test + public void testGoal()throws Throwable{ RootDocument doc=RootDocument.Factory.parse(input); try{ @@ -45,6 +46,7 @@ public class UserReportedTest extends Ba } } + @Test public void testBuild()throws Throwable{ T[] arr = new T[5]; Modified: xmlbeans/trunk/test/src/scomp/substGroup/detailed/Wide.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/substGroup/detailed/Wide.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/substGroup/detailed/Wide.java (original) +++ xmlbeans/trunk/test/src/scomp/substGroup/detailed/Wide.java Fri Jan 18 23:08:44 2019 @@ -15,20 +15,21 @@ package scomp.substGroup.detailed; +import org.apache.xmlbeans.XmlErrorCodes; +import org.junit.Test; import scomp.common.BaseCase; -import xbean.scomp.substGroup.wide.*; import xbean.scomp.substGroup.deep.ItemType; -import xbean.scomp.substGroup.deep.ProductType; import xbean.scomp.substGroup.deep.ItemsDocument; +import xbean.scomp.substGroup.deep.ProductType; +import xbean.scomp.substGroup.wide.BeachUmbrellaT; +import xbean.scomp.substGroup.wide.BusinessShirtType; import java.math.BigInteger; -import org.apache.xmlbeans.XmlErrorCodes; +import static org.junit.Assert.assertTrue; -/** - */ public class Wide extends BaseCase { - + @Test public void testValidSubstParse() throws Throwable { String input = "<base:items xmlns:pre=\"http://xbean/scomp/substGroup/Wide\"" + Modified: xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Abstract.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Abstract.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Abstract.java (original) +++ xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Abstract.java Fri Jan 18 23:08:44 2019 @@ -15,26 +15,28 @@ package scomp.substGroup.restriction.detailed; +import org.apache.xmlbeans.XmlErrorCodes; +import org.apache.xmlbeans.XmlString; +import org.junit.Test; import scomp.common.BaseCase; -import xbean.scomp.substGroup.deep.ItemsDocument; import xbean.scomp.substGroup.deep.BusinessShirtType; import xbean.scomp.substGroup.deep.ItemType; +import xbean.scomp.substGroup.deep.ItemsDocument; import xbean.scomp.substGroup.deep.ProductType; -import xbean.scomp.substGroup.xabstract.BeachUmbrellaT; -import xbean.scomp.substGroup.userAbstract.RootDocument; -import xbean.scomp.substGroup.userAbstract.Bar; import xbean.scomp.substGroup.userAbstract.AbstractFoo; +import xbean.scomp.substGroup.userAbstract.Bar; import xbean.scomp.substGroup.userAbstract.GenericFoo; - +import xbean.scomp.substGroup.userAbstract.RootDocument; +import xbean.scomp.substGroup.xabstract.BeachUmbrellaT; import java.math.BigInteger; -import org.apache.xmlbeans.XmlString; -import org.apache.xmlbeans.XmlErrorCodes; +import static org.junit.Assert.assertTrue; /** */ public class Abstract extends BaseCase { + @Test public void testAbstractInvalid() throws Throwable { //umbrella not OK here String input = @@ -62,6 +64,7 @@ public class Abstract extends BaseCase { } + @Test public void testParseValid() throws Throwable { String input = "<base:items xmlns:pre=\"http://xbean/scomp/substGroup/Abstract\"" + @@ -93,6 +96,7 @@ public class Abstract extends BaseCase { } + @Test public void testBuildValid() throws Throwable { ItemsDocument doc = ItemsDocument.Factory.newInstance(); BusinessShirtType bs = BusinessShirtType.Factory.newInstance(); @@ -122,6 +126,7 @@ public class Abstract extends BaseCase { } //user described problem + @Test public void testUserAbstract(){ RootDocument doc=RootDocument.Factory Modified: xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Block.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Block.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Block.java (original) +++ xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Block.java Fri Jan 18 23:08:44 2019 @@ -15,19 +15,19 @@ package scomp.substGroup.restriction.detailed; +import org.apache.xmlbeans.XmlCursor; +import org.apache.xmlbeans.XmlErrorCodes; +import org.junit.Test; import scomp.common.BaseCase; import xbean.scomp.substGroup.block.BeachUmbrellaT; import xbean.scomp.substGroup.deep.*; +import javax.xml.namespace.QName; import java.math.BigInteger; -import org.apache.xmlbeans.XmlErrorCodes; -import org.apache.xmlbeans.XmlCursor; - -import javax.xml.namespace.QName; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; -/** - */ public class Block extends BaseCase { /** * TODO: verify that w/ respect to substitution @@ -36,6 +36,7 @@ public class Block extends BaseCase { * * @throws Throwable */ + @Test public void testBlockAllInvalid() throws Throwable { //should not be able to use CasualBusinessShirt instead of shirt //but BusinessShirt instead of shirt should be OK @@ -103,6 +104,7 @@ public class Block extends BaseCase { } + @Test public void testBlockAllValidParse() throws Throwable { String input = "<base:items xmlns:pre=\"http://xbean/scomp/substGroup/Block\"" + @@ -133,6 +135,7 @@ public class Block extends BaseCase { } + @Test public void testBlockAllValidBuild() throws Throwable { ItemsDocument doc = ItemsDocument.Factory.newInstance(); BusinessShirtType bs = BusinessShirtType.Factory.newInstance(); @@ -156,6 +159,7 @@ public class Block extends BaseCase { * even though umbrella has subst. blocked, beachumbrella * is a valid product substitution */ + @Test public void testBlockSubst() throws Throwable { ItemsDocument doc = ItemsDocument.Factory.newInstance(); ItemType items = doc.addNewItems(); Modified: xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Final.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Final.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Final.java (original) +++ xmlbeans/trunk/test/src/scomp/substGroup/restriction/detailed/Final.java Fri Jan 18 23:08:44 2019 @@ -15,43 +15,39 @@ package scomp.substGroup.restriction.detailed; import org.apache.xmlbeans.*; +import org.junit.Test; import scomp.common.BaseCase; -import java.util.List; import java.util.Iterator; -import java.util.Collection; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; -/** - */ public class Final extends BaseCase { /** * The follwing are test for the 'final' attribute used in a base in substitution groups * They are negative tests and test for #all, restriction, extenstion and 'extenstion restriction' values */ + @Test public void testFinalAll() { - parseXsdDoc(constructInputXsdString("#all")); - } + @Test public void testFinalExtRestr() { - parseXsdDoc(constructInputXsdString("extension restriction")); - } + @Test public void testFinalRestriction() { - parseXsdDoc(constructInputXsdString("restriction")); - } + @Test public void testFinalExtension() { - parseXsdDoc(constructInputXsdString("extension")); - } // helper function for this class Modified: xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdAttrTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdAttrTest.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdAttrTest.java (original) +++ xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdAttrTest.java Fri Jan 18 23:08:44 2019 @@ -14,14 +14,11 @@ */ package tools.inst2xsd.checkin; +import org.junit.Test; import tools.inst2xsd.common.Inst2XsdTestBase; public class Inst2XsdAttrTest extends Inst2XsdTestBase { - public Inst2XsdAttrTest(String name) { - super(name); - } - // List of precedence for smart simple primitive type determination // byte, short, int, long, integer, float, double, decimal, // boolean @@ -30,12 +27,14 @@ public class Inst2XsdAttrTest extends In // anyUri ? - triggered only for http:// or www. constructs, // list types ? // string + @Test public void test_attrstring() throws Exception { runAttrTypeChecking(getAttrTypeXml("a"), "string"); runAttrTypeChecking(getAttrTypeXml("a2a"), "string"); runAttrTypeChecking(getAttrTypeXml("a b c\n hello\t from\n\txmlbeans"), "string"); } + @Test public void test_attrshort() throws Exception { runAttrTypeChecking(getAttrTypeXml("-129"), "short"); runAttrTypeChecking(getAttrTypeXml("128"), "short"); @@ -45,6 +44,7 @@ public class Inst2XsdAttrTest extends In runAttrTypeChecking(getAttrTypeXml("32767"), "short"); } + @Test public void test_attrint() throws Exception { runAttrTypeChecking(getAttrTypeXml("39000"), "int"); runAttrTypeChecking(getAttrTypeXml("32768"), "int"); @@ -55,6 +55,7 @@ public class Inst2XsdAttrTest extends In runAttrTypeChecking(getAttrTypeXml("-2147483648"), "int"); } + @Test public void test_attrlong() throws Exception { runAttrTypeChecking(getAttrTypeXml("2147483648"), "long"); runAttrTypeChecking(getAttrTypeXml("-2147483649"), "long"); @@ -64,6 +65,7 @@ public class Inst2XsdAttrTest extends In runAttrTypeChecking(getAttrTypeXml("9223372036854775807"), "long"); } + @Test public void test_attrinteger() throws Exception { runAttrTypeChecking(getAttrTypeXml("9300000000000000000"), "integer"); runAttrTypeChecking(getAttrTypeXml("-9300000000000000000"), "integer"); @@ -71,6 +73,7 @@ public class Inst2XsdAttrTest extends In runAttrTypeChecking(getAttrTypeXml("9223372036854775808"), "integer"); } + @Test public void test_attrfloat() throws Exception { runAttrTypeChecking(getAttrTypeXml("12.78e-2"), "float"); runAttrTypeChecking(getAttrTypeXml("1267.43233E12"), "float"); @@ -83,23 +86,26 @@ public class Inst2XsdAttrTest extends In runAttrTypeChecking(getAttrTypeXml("+100000.00"), "float"); } - + @Test public void test_attrdate() throws Exception { runAttrTypeChecking(getAttrTypeXml("1999-05-31"), "date"); } + @Test public void test_attrdateTime() throws Exception { runAttrTypeChecking(getAttrTypeXml("1999-05-31T13:20:00-05:00"), "dateTime"); runAttrTypeChecking(getAttrTypeXml("2000-03-04T20:00:00Z"), "dateTime"); runAttrTypeChecking(getAttrTypeXml("2000-03-04T23:00:00+03:00"), "dateTime"); } + @Test public void test_attrtime() throws Exception { runAttrTypeChecking(getAttrTypeXml("13:20:00-05:00"), "time"); runAttrTypeChecking(getAttrTypeXml("00:00:00"), "time"); runAttrTypeChecking(getAttrTypeXml("13:20:00Z"), "time"); } + @Test public void test_attrbyte() throws Exception { runAttrTypeChecking(getAttrTypeXml("123"), "byte"); runAttrTypeChecking(getAttrTypeXml("+100"), "byte"); @@ -109,6 +115,7 @@ public class Inst2XsdAttrTest extends In runAttrTypeChecking(getAttrTypeXml("-128"), "byte"); } + @Test public void test_attrduration() throws Exception { runAttrTypeChecking(getAttrTypeXml("P1347Y"), "duration"); runAttrTypeChecking(getAttrTypeXml("P1347M"), "duration"); @@ -117,9 +124,4 @@ public class Inst2XsdAttrTest extends In runAttrTypeChecking(getAttrTypeXml("P0Y1347M0D"), "duration"); runAttrTypeChecking(getAttrTypeXml("-P1347M"), "duration"); } - - //public void test_attr() throws Exception { - // runAttrTypeChecking(getAttrTypeXml(""), ""); - //} - } Modified: xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java (original) +++ xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java Fri Jan 18 23:08:44 2019 @@ -14,20 +14,16 @@ */ package tools.inst2xsd.checkin; +import org.apache.xmlbeans.XmlObject; +import org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions; +import org.junit.Test; import tools.inst2xsd.common.Inst2XsdTestBase; import java.io.File; -import java.io.IOException; - -import org.apache.xmlbeans.XmlObject; -import org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions; public class Inst2XsdCheckinTest extends Inst2XsdTestBase { - public Inst2XsdCheckinTest(String name) { - super(name); - } - + @Test public void test_simpleName() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "simpleName.xml")); runSchemaBuild(inst, common.getRussianOptions(), @@ -39,6 +35,7 @@ public class Inst2XsdCheckinTest extends } + @Test public void test_ns_duplicate_russian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "duplicatedNS.xml")); runSchemaBuild(inst, common.getRussianOptions(), @@ -46,6 +43,7 @@ public class Inst2XsdCheckinTest extends } + @Test public void test_ns_multipleNested_russian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "multipleNestedNS.xml")); runSchemaBuild(inst, common.getRussianOptions(), new XmlObject[]{ @@ -56,6 +54,7 @@ public class Inst2XsdCheckinTest extends }); } + @Test public void test_ns_multipleNested_salami() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "multipleNestedNS.xml")); @@ -67,6 +66,7 @@ public class Inst2XsdCheckinTest extends }); } + @Test public void test_ns_multipleNested_venetian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "multipleNestedNS.xml")); @@ -78,6 +78,7 @@ public class Inst2XsdCheckinTest extends }); } + @Test public void test_ns_multiple_russian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "multipleNS.xml")); @@ -89,6 +90,7 @@ public class Inst2XsdCheckinTest extends }); } + @Test public void test_ns_multiple_salami() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "multipleNS.xml")); @@ -100,7 +102,7 @@ public class Inst2XsdCheckinTest extends }); } - + @Test public void test_ns_multiple_venetian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "multipleNS.xml")); @@ -112,6 +114,7 @@ public class Inst2XsdCheckinTest extends }); } + @Test public void test_ns_simple_russian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "simple.xml")); @@ -119,6 +122,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "simple_rd0.xsd"))); } + @Test public void test_ns_simple_salami() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "simple.xml")); @@ -126,6 +130,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "simple_ss0.xsd"))); } + @Test public void test_ns_simple_venetian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "simple.xml")); @@ -133,6 +138,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "simple_vb0.xsd"))); } + @Test public void test_ns_must_venetian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "must.xml")); @@ -141,6 +147,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "must_vb1.xsd"))}); } + @Test public void test_ns_must_russian() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "must.xml")); @@ -149,6 +156,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "must_rd1.xsd"))}); } + @Test public void test_ns_must_salami() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "must.xml")); @@ -157,6 +165,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "namespaces" + P + "must_ss1.xsd"))}); } + @Test public void test_examples_cd_catalog() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "cd_catalog.xml")); @@ -172,7 +181,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "cd_catalog_ss0.xsd"))); } - + @Test public void test_examples_cdcatalog() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "cdcatalog.xml")); @@ -188,6 +197,7 @@ public class Inst2XsdCheckinTest extends } //component + @Test public void test_examples_component() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "component.xml")); @@ -202,7 +212,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "component_ss0.xsd"))); } - + @Test public void test_examples_htmlexample() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "html_example.xml")); @@ -217,7 +227,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "html_example_ss0.xsd"))); } - + @Test public void test_examples_slashdotxml_neverenum() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "slashdot.xml")); Inst2XsdOptions opt = common.getSalamiOptions(); @@ -227,7 +237,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "slashdotxml_neverenum_ss0.xsd"))); } - + @Test public void test_examples_slashdotxml() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "slashdot.xml")); @@ -242,11 +252,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "slashdotxml_ss0.xsd"))); } - - - - - + @Test public void test_examples_rss2_vb_contentsmart_4enum() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample.xml")); Inst2XsdOptions opt = common.getVenetianOptions(); @@ -257,6 +263,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample_contentsmart_4enum_vb0.xsd"))); } + @Test public void test_examples_rss2_vb_contentsmart_nevereum() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample.xml")); Inst2XsdOptions opt = common.getVenetianOptions(); @@ -267,6 +274,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample_contentsmart_neverenum_vb0.xsd"))); } + @Test public void test_examples_rss2_vb_contentstring_nevereum() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample.xml")); Inst2XsdOptions opt = common.getVenetianOptions(); @@ -277,6 +285,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample_contentstring_neverenum_vb0.xsd"))); } + @Test public void test_examples_rss2_vb_contentstring_4enum() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample.xml")); Inst2XsdOptions opt = common.getVenetianOptions(); @@ -287,6 +296,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample_contentstring_4enum_vb0.xsd"))); } + @Test public void test_examples_rss2_vb_contentstring() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample.xml")); Inst2XsdOptions opt = common.getVenetianOptions(); @@ -296,7 +306,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample_contentstring_vb0.xsd"))); } - + @Test public void test_examples_rss2_vb_neverenum() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample.xml")); Inst2XsdOptions opt = common.getVenetianOptions(); @@ -306,6 +316,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample_neverenum_vb0.xsd"))); } + @Test public void test_examples_rss2() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample.xml")); @@ -320,6 +331,7 @@ public class Inst2XsdCheckinTest extends XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "rss2sample_ss0.xsd"))); } + @Test public void test_examples_rss091() throws Exception { XmlObject inst = XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "sampleRss091.xml")); Modified: xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdOptionsTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdOptionsTest.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdOptionsTest.java (original) +++ xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdOptionsTest.java Fri Jan 18 23:08:44 2019 @@ -14,38 +14,14 @@ */ package tools.inst2xsd.checkin; +import org.junit.Test; import tools.inst2xsd.common.Inst2XsdTestBase; -import tools.xml.XmlComparator; -import org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions; -import org.apache.xmlbeans.impl.inst2xsd.Inst2Xsd; - - -import java.io.File; -import java.io.IOException; - -import org.apache.xmlbeans.XmlObject; -import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument; public class Inst2XsdOptionsTest extends Inst2XsdTestBase { - public Inst2XsdOptionsTest(String name) { - super(name); - } - /** Move tests from Detailed back once cursor bug gets fixed */ + @Test public void test_move() throws Exception{ System.out.println("Move tests from Detailed back once cursor bug gets fixed"); } - - - - - - - - - - - - } Modified: xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdTypeTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdTypeTest.java?rev=1851656&r1=1851655&r2=1851656&view=diff ============================================================================== --- xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdTypeTest.java (original) +++ xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdTypeTest.java Fri Jan 18 23:08:44 2019 @@ -14,14 +14,11 @@ */ package tools.inst2xsd.checkin; +import org.junit.Test; import tools.inst2xsd.common.Inst2XsdTestBase; public class Inst2XsdTypeTest extends Inst2XsdTestBase { - public Inst2XsdTypeTest(String name) { - super(name); - } - // List of precedence for smart simple primitive type determination // byte, short, int, long, integer, float, double, decimal, // boolean @@ -30,12 +27,14 @@ public class Inst2XsdTypeTest extends In // anyUri ? - triggered only for http:// or www. constructs, // list types ? // string + @Test public void test_string() throws Exception { runTypeChecking(getTypeXml("a"), "string"); runTypeChecking(getTypeXml("a2a"), "string"); runTypeChecking(getTypeXml("a b c\n hello\t from\n\txmlbeans"), "string"); } + @Test public void test_byte() throws Exception { runTypeChecking(getTypeXml("123"), "byte"); runTypeChecking(getTypeXml("+100"), "byte"); @@ -45,6 +44,7 @@ public class Inst2XsdTypeTest extends In runTypeChecking(getTypeXml("-128"), "byte"); } + @Test public void test_short() throws Exception { runTypeChecking(getTypeXml("-129"), "short"); runTypeChecking(getTypeXml("128"), "short"); @@ -54,6 +54,7 @@ public class Inst2XsdTypeTest extends In runTypeChecking(getTypeXml("32767"), "short"); } + @Test public void test_int() throws Exception { runTypeChecking(getTypeXml("39000"), "int"); runTypeChecking(getTypeXml("32768"), "int"); @@ -64,6 +65,7 @@ public class Inst2XsdTypeTest extends In runTypeChecking(getTypeXml("-2147483648"), "int"); } + @Test public void test_long() throws Exception { runTypeChecking(getTypeXml("2147483648"), "long"); runTypeChecking(getTypeXml("-2147483649"), "long"); @@ -73,6 +75,7 @@ public class Inst2XsdTypeTest extends In runTypeChecking(getTypeXml("9223372036854775807"), "long"); } + @Test public void test_integer() throws Exception { runTypeChecking(getTypeXml("9300000000000000000"), "integer"); runTypeChecking(getTypeXml("-9300000000000000000"), "integer"); @@ -80,6 +83,7 @@ public class Inst2XsdTypeTest extends In runTypeChecking(getTypeXml("9223372036854775808"), "integer"); } + @Test public void test_float() throws Exception { runTypeChecking(getTypeXml("12.78e-2"), "float"); runTypeChecking(getTypeXml("1267.43233E12"), "float"); @@ -106,22 +110,26 @@ public class Inst2XsdTypeTest extends In //runTypeChecking(getTypeXml("1999"), "gYear"); //} - + @Test public void test_date() throws Exception { runTypeChecking(getTypeXml("1999-05-31"), "date"); } + @Test public void test_dateTime() throws Exception { runTypeChecking(getTypeXml("1999-05-31T13:20:00-05:00"), "dateTime"); runTypeChecking(getTypeXml("2000-03-04T20:00:00Z"), "dateTime"); runTypeChecking(getTypeXml("2000-03-04T23:00:00+03:00"), "dateTime"); } + + @Test public void test_time() throws Exception { runTypeChecking(getTypeXml("13:20:00-05:00"), "time"); runTypeChecking(getTypeXml("00:00:00"), "time"); runTypeChecking(getTypeXml("13:20:00Z"), "time"); } - + + @Test public void test_CDATA() throws Exception { runTypeChecking(getTypeXml("<![CDATA[ " + "function matchwo(a, b) {" + --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
