Dear Wiki user, You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by KelvinGoodson: http://wiki.apache.org/ws/Tuscany/TuscanyJava/Tests/RogueWave/Samples New page: A place for jotting notes on how the RogueWave sample tests fit in with the current Tuscany set up. === general points === Tuscany currently expects all test case classes to end with "TestCase" We don't use the INSTANCE singletons wherever possible, sionce they can cause cross test interference especially when using maven, since maven builds an ubertest, and so there is more scope for one test changing the state of an instance prior to running another. === DataObjectListTestCase === Frank looked at this on 26th October and putt a note on Tuscany-829. Out of 23 tests, 2 end in error and 3 in failure. testAddObject ... {{{java.lang.IllegalArgumentException: Class 'AnyTypeDataObject' does not have a feature named 'product2' at org.apache.tuscany.sdo.util.DataObjectUtil.getOpenFeature(DataObjectUtil.java:1804) at org.apache.tuscany.sdo.util.DataObjectUtil.getProperty(DataObjectUtil.java:2367) at org.apache.tuscany.sdo.impl.DataObjectImpl.getProperty(DataObjectImpl.java:1287) at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.setFeatureName(DataObjectUtil.java:2054) at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.process(DataObjectUtil.java:2161) at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.init(DataObjectUtil.java:1940) at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUtil.java:1860) at org.apache.tuscany.sdo.util.DataObjectUtil.get(DataObjectUtil.java:744) at org.apache.tuscany.sdo.impl.DataObjectImpl.get(DataObjectImpl.java:216) at org.apache.tuscany.sdo.impl.DataObjectImpl.getList(DataObjectImpl.java:376) at com.roguewave.rwsf.sdo.DataObjectListTestCase.createTestObj(DataObjectListTestCase.java:138) at com.roguewave.rwsf.sdo.DataObjectListTestCase.testAddObject(DataObjectListTestCase.java:213) }}} this relates to Frank's comment ... {{{ 1. RogueWave seems to assume that TypeHelper.define() defines both a Type and corresponding global element for it. Tuscany only defines the Type and requires a global element be created separately. Although the spec doesn't spell this out exactly, I think that RW has it right because even though it doesn't say that TypeHelper.define() does this, it does say in the SDO to XSD mapping section, that an SDO Type generates both a complexType and a global element. I suggest that we open a JIRA to fix this in Tuscany. }}} since loading the document XMLDocument doc=loadDocFromString("<catalog2></catalog2>"); assumes that TypeHelper.define() on DataObject newType = createType("","catalog2"); would create a global element "catalog2" I've opened http://issues.apache.org/jira/browse/TUSCANY-887 to deal with this. {{{ 2. RogueWave seems to allow a Type to be modified (i.e., properties added) after calling TypeHelper.define(). This may be ambiguous in the spec, but the intent is to not allow this - because in general this can cause all kinds of problems, especially if instances have already been created. I suggest fixing this one in the test case - in createTestObjectTypes(), move the call to types.define(newType) after the product2 property is created/initialized. }}} Tuscany issue -- adding null to a list {{{ XMLDocument doc=loadDocFromString("<catalog2><product2/><product2/></catalog2>"); List listTest=createTestObj(doc); assertNotNull(listTest); try{ listTest.add(null); fail("no exception were thrown"); } }}} gives ... {{{ junit.framework.AssertionFailedError: no exception were thrown at junit.framework.Assert.fail(Assert.java:47) at com.roguewave.rwsf.sdo.DataObjectListTestCase.testAddNull(DataObjectListTestCase.java:224) }}} It would seem from testSubList that Tuscany's FeatureMapUtil$FeatureEList doesnt behave well when viewed through a java SubList {{{ assertEquals(3,listTest.size()); List listRes=listTest.subList(0,1); assertNotNull(listRes); assertEquals(2,listRes.size()); junit.framework.AssertionFailedError: expected:<2> but was:<1> at junit.framework.Assert.assertEquals(Assert.java:207) at com.roguewave.rwsf.sdo.DataObjectListTestCase.testSubList(DataObjectListTestCase.java:465) }}} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
