[
https://issues.apache.org/jira/browse/TUSCANY-1093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470606
]
Robbie Minshall commented on TUSCANY-1093:
------------------------------------------
I updated my tuscany version and it seems that some changes were made to modify
this behavior. Setting boolean attribute when the type is defined in an XSD is
now working. Setting dynamically defined Boolean property still seems to fail.
Can you see anything wrong with the following test case ?
public void testIsSet_DynamicTypeDef_commonjSdoBoolean_false() throws Exception
{
// define a type with two properties
DataObject typeDef = DataFactory.INSTANCE.create("commonj.sdo", "Type");
typeDef.set("uri", "");
typeDef.set("name", "myBooleanType");
typeDef.set("open", true);
DataObject propertyDef = typeDef.createDataObject("property");
propertyDef.set("name", "b1");
Type propertyType = TypeHelper.INSTANCE.getType("commonj.sdo",
"Boolean");
propertyDef.set("type",propertyType );
propertyDef.set("many", false);
propertyDef.set("containment", false);
TypeHelper.INSTANCE.define( typeDef );
// create a DataObject that uses this type
DataObject testDO = DataFactory.INSTANCE.create( "", "myBooleanType" );
Property p = testDO.getProperty("b1");
System.out.println("testIsSet_DynamicTypeDef_Boolean_false: sdoBoolean
field type : " + p.getType());
testDO.unset(p);
assertFalse("testing that property is unset after unset is called",
testDO.isSet(p));
testDO.set(p, false);
System.out.println("Set booleanField via property: " + testDO.get(p) +
", isSet " + testDO.isSet(p) + " default " + p.getDefault());
assertTrue(
"testing that property is set after setting to false, value
of property is "
+ testDO.get(p), testDO.isSet(p));
}
> isSet returning false when boolean set to false, or int set to 0
> ----------------------------------------------------------------
>
> Key: TUSCANY-1093
> URL: https://issues.apache.org/jira/browse/TUSCANY-1093
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Reporter: Robbie Minshall
> Priority: Critical
>
> when boolean property is set to false a call to isSet returns false ( should
> return true ).
> when an int property is set to 0 a call to isSet returns false ( should
> return true ).
> This causes DataObject serialization ( our scenario involves using the sca ws
> binding ) to be missing values that have been set.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]