Modified: xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltDefault.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltDefault.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltDefault.java (original) +++ xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltDefault.java Fri Dec 31 00:01:16 2021 @@ -49,10 +49,9 @@ public class GlobalEltDefault extends Ba //default value is used @Test public void testIntType() throws Throwable { - GlobalEltDefaultIntDocument testDoc - = GlobalEltDefaultIntDocument.Factory - .newInstance(); + GlobalEltDefaultIntDocument testDoc = GlobalEltDefaultIntDocument.Factory.newInstance(); assertEquals(0, testDoc.getGlobalEltDefaultInt()); + testDoc.setGlobalEltDefaultInt(5); try { assertTrue(testDoc.validate(validateOptions)); } catch (Throwable t) {
Modified: xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltNillable.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltNillable.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltNillable.java (original) +++ xmlbeans/trunk/src/test/java/scomp/elements/detailed/GlobalEltNillable.java Fri Dec 31 00:01:16 2021 @@ -56,8 +56,7 @@ public class GlobalEltNillable extends B XmlOptions options = new XmlOptions(); options.setValidateOnSet(); - GlobalEltNotNillableDocument testElt = GlobalEltNotNillableDocument - .Factory.newInstance(options); + GlobalEltNotNillableDocument testElt = GlobalEltNotNillableDocument.Factory.newInstance(options); try { testElt.setNil(); fail("Expected XmlValueNotNillableException"); @@ -72,14 +71,17 @@ public class GlobalEltNillable extends B catch (XmlValueNotNillableException e) { } + options.setValidateOnSet(false); + testElt = GlobalEltNotNillableDocument.Factory.newInstance(options); testElt.setGlobalEltNotNillable(null); + //assert that value is cleared assertEquals("<glob:GlobalEltNotNillable " + "xsi:nil=\"true\" " + "xmlns:glob=\"http://xbean/scomp/element/GlobalEltNillable\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" ,testElt.xmlText()); - assertTrue(!testElt.validate(validateOptions)); + assertFalse(testElt.validate(validateOptions)); assertEquals(1, errorList.size()); showErrors(); String[] errExpected = @@ -206,7 +208,7 @@ public class GlobalEltNillable extends B throw t; } testElt.getGlobalEltComplex().setNil(); - assertEquals("<pre:GlobalEltComplex " + + assertEquals("<pre:GlobalEltComplex " + "testattribute=\"foobar\" " + "xsi:nil=\"true\" " + "xmlns:pre=\"http://xbean/scomp/element/GlobalEltNillable\" " + Modified: xmlbeans/trunk/src/test/java/scomp/redefine/detailed/AttrGroupRedefine.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/scomp/redefine/detailed/AttrGroupRedefine.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/scomp/redefine/detailed/AttrGroupRedefine.java (original) +++ xmlbeans/trunk/src/test/java/scomp/redefine/detailed/AttrGroupRedefine.java Fri Dec 31 00:01:16 2021 @@ -18,11 +18,10 @@ 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; +import static org.junit.Assert.assertThrows; public class AttrGroupRedefine extends BaseCase{ @@ -31,26 +30,18 @@ public class AttrGroupRedefine extends B * visible anymore */ @Test - public void testCodeGeneration() { + public void testCodeGeneration() throws NoSuchMethodException { 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) { - } + assertThrows( "field should be redefined", NoSuchFieldException.class, + () -> elt.getClass().getDeclaredField("attr2")); + + + elt.getClass().getDeclaredMethod("getAttr1"); + elt.getClass().getDeclaredMethod("getAttr2A"); + + Method m = elt.getClass().getDeclaredMethod("getAttr3A"); + assertEquals(m.getReturnType(), java.lang.Integer.TYPE); } } Modified: xmlbeans/trunk/src/test/java/scomp/simple/SimplePersonTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/scomp/simple/SimplePersonTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/scomp/simple/SimplePersonTest.java (original) +++ xmlbeans/trunk/src/test/java/scomp/simple/SimplePersonTest.java Fri Dec 31 00:01:16 2021 @@ -21,9 +21,8 @@ import org.openuri.mytest.CustomerDocume import org.openuri.mytest.Person; import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; public class SimplePersonTest { @@ -54,23 +53,20 @@ public class SimplePersonTest { Person.Gender.Enum g = person.getGender(); assertEquals(Person.Gender.MALE, g); - 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())); + assertEquals("EGIQTWYZJ", new String(person.getHex(), UTF_8)); + assertEquals("This string is base64Binary encoded!", new String(person.getBase64(), UTF_8)); + + assertEquals("GGIQTWYGG", new String(person.getHexAtt(), UTF_8)); + assertEquals("This string is base64Binary encoded!", new String(person.getBase64Att(), UTF_8)); person.setFirstname("George"); assertEquals("George", person.getFirstname()); person.setHex("hex encoding".getBytes()); - assertEquals("hex encoding", new String(person.getHex())); + assertEquals("hex encoding", new String(person.getHex(), UTF_8)); person.setBase64("base64 encoded".getBytes()); - assertEquals("base64 encoded", - new String(person.getBase64())); + assertEquals("base64 encoded", new String(person.getBase64(), UTF_8)); //person.setHexAtt("hex encoding in attributes".getBytes()); //Assert.assertEquals("hex encoding in attributes", Modified: xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/BaseXPathTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/BaseXPathTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/BaseXPathTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/BaseXPathTest.java Fri Dec 31 00:01:16 2021 @@ -76,7 +76,7 @@ public abstract class BaseXPathTest exte testMap.put("testFunctionId", new String[]{ "id(\"bobdylan\")", "id(\"foobar\")", - "id(\"*\")/child::cd[position()=3]"}); + "//child::cd[position()=3]"}); testMap.put("testFunctionLast", new String[]{ "/catalog/cd[last()]"}); Modified: xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/XPathFunctionTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/XPathFunctionTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/XPathFunctionTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlcursor/xpath/common/XPathFunctionTest.java Fri Dec 31 00:01:16 2021 @@ -22,6 +22,7 @@ import org.junit.Test; import tools.util.JarUtil; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; /** * Verifies XPath using functions @@ -80,8 +81,7 @@ public abstract class XPathFunctionTest public void testFunctionId() throws Exception { XmlObject xDoc = XmlObject.Factory.parse( JarUtil.getResourceFromJar("xbean/xmlcursor/xpath/cdcatalog.xml")); - //System.out.println(xDoc.xmlText()); - String ex1Simple =getQuery("testFunctionId",0); //"id(\"bobdylan\")" + String ex1Simple = getQuery("testFunctionId",0); //"id(\"bobdylan\")" String ex1R1 = "<cd id=\"bobdylan\">" + "<title>Empire Burlesque</title>" + @@ -91,10 +91,8 @@ public abstract class XPathFunctionTest XmlObject[] exXml1 = new XmlObject[]{XmlObject.Factory.parse(ex1R1)}; String ex2Simple = getQuery("testFunctionId",1); //"id(\"foobar\")" - String ex2R1 = "<cd/>"; - XmlObject[] exXml2 = new XmlObject[]{XmlObject.Factory.parse(ex2R1)}; - String ex3Simple = getQuery("testFunctionId",2); //"id(\"*\")/child::cd[position()=3]" + String ex3Simple = getQuery("testFunctionId",2); //"//child::cd[position()=3]" String ex3R1 = "<cd id=\"id3\"><title>Greatest Hits</title><artist>Dolly Parton</artist><country>USA</country><company>RCA</company><price>9.90</price><year>1982</year></cd>"; XmlObject[] exXml3 = new XmlObject[]{XmlObject.Factory.parse(ex3R1)}; @@ -115,7 +113,7 @@ public abstract class XPathFunctionTest XmlCursor x2 = xDoc.newCursor(); x2.selectPath(ex2Simple); XPathCommon.display(x2); - XPathCommon.compare(x2, exXml2); + assertFalse(x2.toNextSelection()); x2.dispose(); System.out.println("Test 3: " + ex3Simple); Modified: xmlbeans/trunk/src/test/java/xmlcursor/xpath/complex/detailed/XPathFunctionTestImpl.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlcursor/xpath/complex/detailed/XPathFunctionTestImpl.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlcursor/xpath/complex/detailed/XPathFunctionTestImpl.java (original) +++ xmlbeans/trunk/src/test/java/xmlcursor/xpath/complex/detailed/XPathFunctionTestImpl.java Fri Dec 31 00:01:16 2021 @@ -101,8 +101,8 @@ public class XPathFunctionTestImpl exten @Test public void testExternalFunction() throws Exception { String query = "" + - "declare function local:toc($book-or-section as element()) as element()*;" + - " local:toc($book-or-section/section)"; + "declare function local:toc($book-or-section as element()) as element()* { $book-or-section/section }; " + + "local:toc(book)"; String input = "<book>\n" + " <title>Data on the Web</title>\n" + @@ -153,8 +153,7 @@ public class XPathFunctionTestImpl exten " </section>\n" + "</book>"; XmlObject o = XmlObject.Factory.parse(input); - XmlObject[] res = o.selectPath(query); - assertEquals(1, res.length); - assertEquals("", res[0].xmlText()); + XmlObject[] res = o.execQuery(query); + assertEquals(2, res.length); } } Modified: xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/StoreTestsXqrl.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/StoreTestsXqrl.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/StoreTestsXqrl.java (original) +++ xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/StoreTestsXqrl.java Fri Dec 31 00:01:16 2021 @@ -70,8 +70,7 @@ public class StoreTestsXqrl { assertEquals("<bar xmlns:a=\"a.com\"/>", c.xmlText()); } - @Test - private void testTextFrag(String actual, String expected) { + public void testTextFrag(String actual, String expected) { String pre = "<xml-fragment>"; String post = "</xml-fragment>"; Modified: xmlbeans/trunk/src/test/java/xmlobject/common/StringXmlReader.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/common/StringXmlReader.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/common/StringXmlReader.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/common/StringXmlReader.java Fri Dec 31 00:01:16 2021 @@ -16,11 +16,9 @@ package xmlobject.common; -import org.apache.xmlbeans.XmlBeans; -import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlCursor; import org.apache.xmlbeans.XmlException; -import org.apache.xmlbeans.XmlCursor.TokenType; +import org.apache.xmlbeans.XmlObject; /** * StringXmlReader: A class that implements Runnable. It creates an XMLBean for a given XML @@ -45,7 +43,7 @@ public class StringXmlReader implements } /** - * Implements the <code>Runnable</code> Interface + * Implements the {@code Runnable} Interface */ public void run() { // Read in the xml file Modified: xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/averageCase/checkin/AverageTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/averageCase/checkin/AverageTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/averageCase/checkin/AverageTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/averageCase/checkin/AverageTest.java Fri Dec 31 00:01:16 2021 @@ -15,22 +15,19 @@ package xmlobject.extensions.interfaceFeature.averageCase.checkin; -import interfaceFeature.xbean.averageCase.purchaseOrder.PurchaseOrderDocument ; -import interfaceFeature.xbean.averageCase.purchaseOrder.PurchaseOrderType; import interfaceFeature.xbean.averageCase.purchaseOrder.Items; - -import junit.framework.*; +import interfaceFeature.xbean.averageCase.purchaseOrder.PurchaseOrderDocument; +import interfaceFeature.xbean.averageCase.purchaseOrder.PurchaseOrderType; +import org.junit.Test; import java.math.BigDecimal; +import static org.junit.Assert.assertEquals; -public class AverageTest extends TestCase{ - - public AverageTest(String s){ - super(s); - } +public class AverageTest { + @Test public void test(){ PurchaseOrderDocument poDoc ; Modified: xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/methodNameCollision/checkin/NameCollisionTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/methodNameCollision/checkin/NameCollisionTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/methodNameCollision/checkin/NameCollisionTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/methodNameCollision/checkin/NameCollisionTest.java Fri Dec 31 00:01:16 2021 @@ -14,21 +14,20 @@ */ package xmlobject.extensions.interfaceFeature.methodNameCollision.checkin; -import junit.framework.TestCase; import interfaceFeature.xbean.methodNameCollision.company.CompanyDocument; import interfaceFeature.xbean.methodNameCollision.company.CompanyType; -import interfaceFeature.xbean.methodNameCollision.company.DepartmentType; import interfaceFeature.xbean.methodNameCollision.company.ConsultantType; -import xmlobject.extensions.interfaceFeature.methodNameCollision.existing.IFoo; - +import interfaceFeature.xbean.methodNameCollision.company.DepartmentType; import org.apache.xmlbeans.XmlString; +import org.junit.Test; +import xmlobject.extensions.interfaceFeature.methodNameCollision.existing.IFoo; -public class NameCollisionTest extends TestCase { +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; - public NameCollisionTest(String s) { - super(s); - } +public class NameCollisionTest { + @Test public void test() { CompanyDocument poDoc; Modified: xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/multInterfaces/checkin/MultInterfacesTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/multInterfaces/checkin/MultInterfacesTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/multInterfaces/checkin/MultInterfacesTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/multInterfaces/checkin/MultInterfacesTest.java Fri Dec 31 00:01:16 2021 @@ -14,27 +14,21 @@ */ package xmlobject.extensions.interfaceFeature.multInterfaces.checkin; -import interfaceFeature.xbean.multInterfaces.purchaseOrder.PurchaseOrderDocument; -import interfaceFeature.xbean.multInterfaces.purchaseOrder.PurchaseOrderType; import interfaceFeature.xbean.multInterfaces.purchaseOrder.Items; import interfaceFeature.xbean.multInterfaces.purchaseOrder.Items.Item; - -import java.math.BigDecimal; - +import interfaceFeature.xbean.multInterfaces.purchaseOrder.PurchaseOrderDocument; +import interfaceFeature.xbean.multInterfaces.purchaseOrder.PurchaseOrderType; import org.apache.xmlbeans.XmlObject; +import org.junit.Test; +import java.math.BigDecimal; -import junit.framework.*; - -public class MultInterfacesTest extends TestCase { +import static org.junit.Assert.assertEquals; - public MultInterfacesTest(String s) { - super(s); - } +public class MultInterfacesTest { + @Test public void test() { - - PurchaseOrderDocument poDoc = null; poDoc = PurchaseOrderDocument.Factory.newInstance(); Modified: xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/readOnlyBean/checkin/ReadOnlyTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/readOnlyBean/checkin/ReadOnlyTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/readOnlyBean/checkin/ReadOnlyTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/extensions/interfaceFeature/readOnlyBean/checkin/ReadOnlyTest.java Fri Dec 31 00:01:16 2021 @@ -15,22 +15,18 @@ package xmlobject.extensions.interfaceFeature.readOnlyBean.checkin; +import interfaceFeature.xbean.readOnlyBean.purchaseOrder.Items; import interfaceFeature.xbean.readOnlyBean.purchaseOrder.PurchaseOrderDocument; import interfaceFeature.xbean.readOnlyBean.purchaseOrder.PurchaseOrderType; -import interfaceFeature.xbean.readOnlyBean.purchaseOrder.Items; - +import org.junit.Test; import java.math.BigDecimal; -import junit.framework.*; - -public class ReadOnlyTest extends TestCase { - - - public ReadOnlyTest(String s) { - super(s); - } +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +public class ReadOnlyTest { + @Test public void test() { PurchaseOrderDocument poDoc; @@ -75,8 +71,6 @@ public class ReadOnlyTest extends TestCa System.exit(-1); } - assertTrue(!poDoc.validate()); } - } Modified: xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/ValueRestriction/checkin/ValueRestrictionTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/ValueRestriction/checkin/ValueRestrictionTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/ValueRestriction/checkin/ValueRestrictionTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/ValueRestriction/checkin/ValueRestrictionTest.java Fri Dec 31 00:01:16 2021 @@ -14,17 +14,20 @@ */ package xmlobject.extensions.prePostFeature.ValueRestriction.checkin; -import junit.framework.TestCase; -import prePostFeature.xbean.valueRestriction.company.*; import org.apache.xmlbeans.XmlString; +import org.junit.Test; +import prePostFeature.xbean.valueRestriction.company.CompanyDocument; +import prePostFeature.xbean.valueRestriction.company.CompanyType; +import prePostFeature.xbean.valueRestriction.company.ConsultantType; +import prePostFeature.xbean.valueRestriction.company.DepartmentType; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; -public class ValueRestrictionTest extends TestCase { - public ValueRestrictionTest(String s) { - super(s); - } +public class ValueRestrictionTest { + @Test public void test() throws Exception { CompanyDocument poDoc; Modified: xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/readOnlyBean/checkin/ReadOnlyTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/readOnlyBean/checkin/ReadOnlyTest.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/readOnlyBean/checkin/ReadOnlyTest.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/extensions/prePostFeature/readOnlyBean/checkin/ReadOnlyTest.java Fri Dec 31 00:01:16 2021 @@ -15,20 +15,18 @@ package xmlobject.extensions.prePostFeature.readOnlyBean.checkin; -import prePostFeature.xbean.readOnlyBean.purchaseOrder.PurchaseOrderDocument ; -import prePostFeature.xbean.readOnlyBean.purchaseOrder.PurchaseOrderType; +import org.junit.Test; import prePostFeature.xbean.readOnlyBean.purchaseOrder.Items; - +import prePostFeature.xbean.readOnlyBean.purchaseOrder.PurchaseOrderDocument; +import prePostFeature.xbean.readOnlyBean.purchaseOrder.PurchaseOrderType; import java.math.BigDecimal; -import junit.framework.*; - -public class ReadOnlyTest extends TestCase{ +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; - public ReadOnlyTest(String s){ - super(s); - } +public class ReadOnlyTest { + @Test public void test(){ PurchaseOrderDocument poDoc ; Modified: xmlbeans/trunk/src/test/java/xmlobject/schematypes/checkin/SchemaTypesTests.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/schematypes/checkin/SchemaTypesTests.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/schematypes/checkin/SchemaTypesTests.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/schematypes/checkin/SchemaTypesTests.java Fri Dec 31 00:01:16 2021 @@ -28,6 +28,7 @@ import javax.xml.namespace.QName; import java.io.IOException; import java.io.InputStream; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -81,13 +82,11 @@ public class SchemaTypesTests { Person.Gender.Enum g = person.getGender(); assertEquals(Person.Gender.MALE, g); - 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())); + assertEquals("EGIQTWYZJ", new String(person.getHex(), UTF_8)); + assertEquals("This string is base64Binary encoded!", new String(person.getBase64(), UTF_8)); + + assertEquals("GGIQTWYGG", new String(person.getHexAtt(), UTF_8)); + assertEquals("This string is base64Binary encoded!", new String(person.getBase64Att(), UTF_8)); assertEquals("{some_uri}localname", person.getQnameAtt().toString()); assertEquals("{http://openuri.org/xstypes/test}openuri_org_localname", person.getQname().toString()); @@ -109,20 +108,17 @@ public class SchemaTypesTests { person.setFirstname("George"); assertEquals("George", person.getFirstname()); - person.setHex("hex encoding".getBytes()); - assertEquals("hex encoding", new String(person.getHex())); + person.setHex("hex encoding".getBytes(UTF_8)); + assertEquals("hex encoding", new String(person.getHex(), UTF_8)); + + person.setBase64("base64 encoded".getBytes(UTF_8)); + assertEquals("base64 encoded", new String(person.getBase64(), UTF_8)); + + person.setHexAtt("hex encoding in attributes".getBytes(UTF_8)); + assertEquals("hex encoding in attributes", new String(person.getHexAtt(), UTF_8)); - person.setBase64("base64 encoded".getBytes()); - assertEquals("base64 encoded", - new String(person.getBase64())); - - person.setHexAtt("hex encoding in attributes".getBytes()); - assertEquals("hex encoding in attributes", - new String(person.getHexAtt())); - - person.setBase64Att("This string is base64Binary encoded!".getBytes()); - assertEquals("This string is base64Binary encoded!", - new String(person.getBase64Att())); + person.setBase64Att("This string is base64Binary encoded!".getBytes(UTF_8)); + assertEquals("This string is base64Binary encoded!", new String(person.getBase64Att(), UTF_8)); person.setAnyuri("a.c:7001"); assertEquals("a.c:7001", person.getAnyuri()); Modified: xmlbeans/trunk/src/test/java/xmlobject/xmlloader/detailed/XmlStreamBeanReader.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlobject/xmlloader/detailed/XmlStreamBeanReader.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/xmlobject/xmlloader/detailed/XmlStreamBeanReader.java (original) +++ xmlbeans/trunk/src/test/java/xmlobject/xmlloader/detailed/XmlStreamBeanReader.java Fri Dec 31 00:01:16 2021 @@ -25,6 +25,7 @@ import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; import static org.junit.Assert.assertEquals; @@ -56,7 +57,7 @@ public class XmlStreamBeanReader { " </cc:customer>\n" + " </cc:credit-card-data>"; - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(creditCardXmlwPrefix.getBytes())); + XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(creditCardXmlwPrefix.getBytes(StandardCharsets.UTF_8))); CreditCardDataDocument ccdoc = (CreditCardDataDocument) XmlObject.Factory.parse(reader, new XmlOptions().setDocumentType(CreditCardDataDocument.type)); assertEquals(1, ccdoc.getCreditCardData().getCustomerArray(0).getId()); } Modified: xmlbeans/trunk/src/test/resources/xbean/compile/scomp/partials/impl/RootDocumentImpl.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/resources/xbean/compile/scomp/partials/impl/RootDocumentImpl.java?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/resources/xbean/compile/scomp/partials/impl/RootDocumentImpl.java (original) +++ xmlbeans/trunk/src/test/resources/xbean/compile/scomp/partials/impl/RootDocumentImpl.java Fri Dec 31 00:01:16 2021 @@ -10,6 +10,7 @@ package partials.impl; import javax.xml.namespace.QName; import org.apache.xmlbeans.QNameSet; +import org.apache.xmlbeans.XmlObject; /** * A document containing one root(@partials) element. Modified: xmlbeans/trunk/src/test/resources/xbean/scomp/redefine/AttrRedefineSuper.xsd URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/resources/xbean/scomp/redefine/AttrRedefineSuper.xsd?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/src/test/resources/xbean/scomp/redefine/AttrRedefineSuper.xsd (original) +++ xmlbeans/trunk/src/test/resources/xbean/scomp/redefine/AttrRedefineSuper.xsd Fri Dec 31 00:01:16 2021 @@ -23,7 +23,7 @@ <xs:attributeGroup name="AttrGroup"> <xs:attribute name="attr1" type="xs:string"/> <xs:attribute name="attr2a" type="xs:date"/> - <xs:attribute name="attr3" type="xs:int"/> + <xs:attribute name="attr3a" type="xs:int"/> </xs:attributeGroup> </xs:redefine> Modified: xmlbeans/trunk/xkit/doap_XMLBeans.rdf URL: http://svn.apache.org/viewvc/xmlbeans/trunk/xkit/doap_XMLBeans.rdf?rev=1896561&r1=1896560&r2=1896561&view=diff ============================================================================== --- xmlbeans/trunk/xkit/doap_XMLBeans.rdf (original) +++ xmlbeans/trunk/xkit/doap_XMLBeans.rdf Fri Dec 31 00:01:16 2021 @@ -1,5 +1,22 @@ <?xml version="1.0"?> <?xml-stylesheet type="text/xsl"?> + +<!-- +Copyright 2004 The Apache Software Foundation + +Licensed 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. + --> + <rdf:RDF xml:lang="en" xmlns="http://usefulinc.com/ns/doap#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
