You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2007/07/13 17:20:56 UTC
svn commit: r556034 - in
/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests:
general/XMLHelperTest.java scenarios/DataObjectListTest.java
Author: kelvingoodson
Date: Fri Jul 13 08:20:55 2007
New Revision: 556034
URL: http://svn.apache.org/viewvc?view=rev&rev=556034
Log:
The spec isn't clear whether a Property created by the dynamic api should be an element by default or an attribute. This alterations to these tests make this specific in the test code.
Modified:
incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XMLHelperTest.java
incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java
Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XMLHelperTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XMLHelperTest.java?view=diff&rev=556034&r1=556033&r2=556034
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XMLHelperTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XMLHelperTest.java Fri Jul 13 08:20:55 2007
@@ -261,7 +261,7 @@
XMLHelper xmlHelper = getScope().getXMLHelper();
Type intType = types.getType("commonj.sdo", "Int");
- assertNotNull( intType );
+ assertNotNull( intType );
Type stringType = types.getType("commonj.sdo", "String");
// create a new Type for Customers
@@ -269,20 +269,26 @@
customerType.set("uri", "http://example.com/customer");
customerType.set("name", "Customer");
+ Property xmlElementProp = getScope().getXSDHelper().getGlobalProperty("commonj.sdo/xml", "xmlElement", false);
+
+
// create a customer number property
DataObject custNumProperty = customerType.createDataObject("property");
custNumProperty.set("name", "custNum");
custNumProperty.set("type", intType);
+ custNumProperty.setBoolean(xmlElementProp, false);
// create a first name property
DataObject firstNameProperty = customerType.createDataObject("property");
firstNameProperty.set("name", "firstName");
firstNameProperty.set("type", stringType);
+ firstNameProperty.setBoolean(xmlElementProp, false);
// create a last name property
DataObject lastNameProperty = customerType.createDataObject("property");
lastNameProperty.set("name", "lastName");
lastNameProperty.set("type", stringType);
+ lastNameProperty.setBoolean(xmlElementProp, false);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
xmlHelper.save(customerType, "commonj.sdo", "type", baos);
@@ -373,20 +379,25 @@
customerType.set("uri", "http://example.com/customer");
customerType.set("name", "Customer");
+ Property xmlElementProp = getScope().getXSDHelper().getGlobalProperty("commonj.sdo/xml", "xmlElement", false);
+
// create a customer number property
DataObject custNumProperty = customerType.createDataObject("property");
custNumProperty.set("name", "custNum");
custNumProperty.set("type", intType);
+ custNumProperty.setBoolean(xmlElementProp, false);
// create a first name property
DataObject firstNameProperty = customerType.createDataObject("property");
firstNameProperty.set("name", "firstName");
firstNameProperty.set("type", stringType);
+ firstNameProperty.setBoolean(xmlElementProp, false);
// create a last name property
DataObject lastNameProperty = customerType.createDataObject("property");
lastNameProperty.set("name", "lastName");
lastNameProperty.set("type", stringType);
+ lastNameProperty.setBoolean(xmlElementProp, false);
// now define the Customer type so that customers can be made
types.define(customerType);
Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java?view=diff&rev=556034&r1=556033&r2=556034
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java Fri Jul 13 08:20:55 2007
@@ -29,6 +29,7 @@
import test.sdo21.framework.junit3_8.CTSTestCase;
import commonj.sdo.DataObject;
+import commonj.sdo.Property;
import commonj.sdo.Type;
import commonj.sdo.helper.DataFactory;
import commonj.sdo.helper.TypeHelper;
@@ -115,6 +116,7 @@
*/
public void testGetInvalidInstanceProperty() {
createTestObjectType();
+
DataObject testObj = createTestObject();
assertNotNull(testObj);
commonj.sdo.Property property = testObj.getInstanceProperty("aaa[1]");
@@ -135,9 +137,12 @@
DataObject newType2 = createType("", "product2");
+ Property xmlElementProp = getScope().getXSDHelper().getGlobalProperty("commonj.sdo/xml", "xmlElement", false);
DataObject property = newType2.createDataObject("property");
property.set("name", "name");
property.set("type", TypeHelper.INSTANCE.getType("commonj.sdo", "String"));
+ property.setBoolean(xmlElementProp, false);
+
Type nt2 = types.define(newType2);
@@ -188,7 +193,7 @@
public void testToArray() {
String xmldoc =
- "<catalog2><product2><name>name1</name></product2><product2><name>name2</name></product2></catalog2>";
+ "<catalog2><product2 name=\"name1\"/><product2 name=\"name2\"/></catalog2>";
// "<catalog2><product2 nameTest=\"name1\"/><product2
// nameTest=\"name2\"/></catalog2>"
XMLDocument doc = loadDocFromString(xmldoc);
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org