public void setUp() { super.setUp(); Type stringType = typeHelper.getType("commonj.sdo", "String"); DataObject rootType = defineType("my.uri", "root"); addProperty(rootType, "rootProp1", stringType); addProperty(rootType, "rootProp2", stringType); addProperty(rootType, "rootProp3", stringType); rootSDOType = (SDOType) typeHelper.define(rootType); DataObject child1Type = defineType("my.uri", "child1"); addProperty(child1Type, "child1Prop1", stringType); addProperty(child1Type, "child1Prop2", stringType); addProperty(child1Type, "child1Prop3", stringType); child1SDOType = (SDOType) typeHelper.define(child1Type); DataObject child2Type = defineType("my.uri", "child2"); addProperty(child2Type, "child2Prop1", stringType); addProperty(child2Type, "child2Prop2", stringType); addProperty(child2Type, "child2Prop3", stringType); child2SDOType = (SDOType) typeHelper.define(child2Type); DataObject child3Type = defineType("my.uri", "child3"); addProperty(child3Type, "child3Prop1", stringType); addProperty(child3Type, "child3Prop2", stringType); addProperty(child3Type, "child3Prop3", stringType); child3SDOType = (SDOType) typeHelper.define(child3Type); }
public void setUp() { super.setUp(); Type stringType = SDOConstants.SDO_STRING; DataObject addressType = defineType("my.uri", "address"); addProperty(addressType, "city", stringType, false, false, true); addProperty(addressType, "street", stringType, false, false, true); Type addressSDOType = typeHelper.define(addressType); DataObject empType = defineType("my.uri", "employee"); addProperty(empType, "name", stringType, false, false, true); addProperty(empType, "address", addressSDOType, true, false, true); empType.set("open", true); Type empSDOType = typeHelper.define(empType); rootDataObject = dataFactory.create(empSDOType); rootDataObject.set("name", "Bob Smith"); rootDataObject2 = dataFactory.create(empSDOType); rootDataObject2.set("name", "JaneDoe"); childDataObject = dataFactory.create(addressSDOType); childDataObject2 = dataFactory.create(addressSDOType); }
public void setUp() { super.setUp(); secondChildType = getSecondChildType(); secondChildDataObject = dataFactory.create(secondChildType); firstChildType = getFirstChildType(); firstChildDataObject = dataFactory.create(firstChildType); rootType = getRootSDOType(); rootDataObject = dataFactory.create(rootType); }
public void setUp() { super.setUp(); SDOType changeSummaryType = (SDOType) typeHelper.getType(SDOConstants.SDO_URL, SDOConstants.CHANGESUMMARY); DataObject rootPropertyTypeDO = defineType("rootPropertyTypeUri", "rootPropertyType"); SDOType rootPropertyType = (SDOType) typeHelper.define(rootPropertyTypeDO); DataObject rootTypeDO = defineType(URINAME, TYPENAME); DataObject changeSumPropertyDO = addProperty(rootTypeDO, "csmProp", changeSummaryType); changeSumPropertyDO.set("containment", true); DataObject rootPropertyDO = addProperty(rootTypeDO, "property-Containment", rootPropertyType); rootPropertyDO.set("containment", true); DataObject rootProperty1DO = addProperty(rootTypeDO, "property1-Containment", SDOConstants.SDO_STRING); rootType = (SDOType) typeHelper.define(rootTypeDO); rootProperty = (SDOProperty) rootType.getDeclaredPropertiesMap().get("property-Containment"); rootProperty1 = (SDOProperty) rootType.getDeclaredPropertiesMap().get("property1-Containment"); rootProperty1.setNullable(true); DataObject contained_typeDO = defineType("containedUri", "containedType"); DataObject containedPropertyDO = addProperty(contained_typeDO, "containedProperty", SDOConstants.SDO_STRING); contained_type = (SDOType) typeHelper.define(contained_typeDO); containedDataObject = (SDODataObject) dataFactory.create(contained_type); root = (SDODataObject) dataFactory.create(rootType); root.set(rootProperty, containedDataObject); changeSummary = (SDOChangeSummary) root.getChangeSummary(); }
public void setUp() { // set up as a/b/c super.setUp(); type_a = new SDOType(URINAME, TYPENAME_A); type_b = new SDOType(URINAME, TYPENAME_B); type_c = new SDOType(URINAME, TYPENAME_C); type_c_bNotSDODataOject = new SDOType(URINAME, TYPENAME_C); type_a_bNotSDODataOject = new SDOType(URINAME, TYPENAME_A); type_b_bNotSDODataOject = new SDOType(URINAME, TYPENAME_B); property_a = new SDOProperty(aHelperContext); property_a.setContainment(true); property_a.setName(PROPERTY_NAME_A); property_a.setType(type_b); type_a.addDeclaredProperty(property_a); dataObject_a = (SDODataObject) dataFactory.create(type_a); property_b = new SDOProperty(aHelperContext); property_b.setContainment(true); property_b.setMany(true); property_b.setType(type_c); property_b.setName(PROPERTY_NAME_B); type_b.addDeclaredProperty(property_b); dataObject_b = (SDODataObject) dataFactory.create(type_b); dataObject_c = (SDODataObject) dataFactory.create(type_c); dataObject_a.set(property_a, dataObject_b); // a dataobject's a property has value b dataobject List objects = new ArrayList(); objects.add(dataObject_c); dataObject_b.set(property_b, objects); // b dataobject's b property has value c dataobject property_a_bNotSDODataOject = new SDOProperty(aHelperContext); property_a_bNotSDODataOject.setName(PROPERTY_NAME_A); property_a_bNotSDODataOject.setType(type_b_bNotSDODataOject); type_a_bNotSDODataOject.addDeclaredProperty(property_a_bNotSDODataOject); dataObject_a_bNotSDODataOject = (SDODataObject) dataFactory.create(type_a_bNotSDODataOject); property_b_bNotSDODataOject = new SDOProperty(aHelperContext); property_b_bNotSDODataOject.setName(PROPERTY_NAME_B); property_b_bNotSDODataOject.setType(SDOConstants.SDO_STRING); type_b_bNotSDODataOject.addDeclaredProperty(property_b_bNotSDODataOject); dataObject_b_bNotSDODataOject = (SDODataObject) dataFactory.create(type_b_bNotSDODataOject); dataObject_c_bNotSDODataOject = (SDODataObject) dataFactory.create(type_c_bNotSDODataOject); dataObject_a_bNotSDODataOject.set( property_a_bNotSDODataOject, dataObject_b_bNotSDODataOject); // a dataobject's a property has value b dataobject dataObject_b_bNotSDODataOject.set( property_b_bNotSDODataOject, "test"); // b dataobject's b property has value c dataobject /*List basTypes_a = new ArrayList(); basTypes_a.add(type_b); basTypes_a.add(type_c); List basTypes_b = new ArrayList(); basTypes_b.add(type_c); type_a.setBaseTypes(basTypes_a); type_b.setBaseTypes(basTypes_b);*/ type_a_pathLength_1 = new SDOType(URINAME, TYPENAME_A); property_a_pathLength_1 = new SDOProperty(aHelperContext); property_a_pathLength_1.setName(PROPERTY_NAME_A_LENGTH_1); type_a_pathLength_1.addDeclaredProperty(property_a_pathLength_1); dataObject_a_pathLength_1 = (SDODataObject) dataFactory.create(type_a_pathLength_1); }
public void setUp() { super.setUp(); InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD); this.aHelperContext.getXSDHelper().define(xsdInputStream, null); }