@Test public void testFeatureMap() { assertEquals(0L, support.dataStoreSize()); PrimaryObject object = ModelFactory.eINSTANCE.createPrimaryObject(); object.setId(6); object.setName("foo"); object.getFeatureMapAttributeType1().add("Hello"); object.getFeatureMapAttributeType2().add("World"); assertEquals(2, object.getFeatureMapAttributeCollection().size()); assertEquals(1, object.getFeatureMapAttributeType1().size()); assertEquals(1, object.getFeatureMapAttributeType2().size()); support.saveObject(object); assertEquals(5L, support.dataStoreSize()); support.checkObject(object); }
@Test public void testUnsettableAttributeSetToNull() throws IOException { assertEquals(0L, support.dataStoreSize()); PrimaryObject object = ModelFactory.eINSTANCE.createPrimaryObject(); object.setId(5); object.setUnsettableAttribute(null); support.saveObject(object); assertEquals(2L, support.dataStoreSize()); Resource resource = support.createResource("uri=" + ETripleEcoreUtil.getID(object)); resource.load(null); PrimaryObject loaded = (PrimaryObject) resource.getContents().get(0); assertTrue(loaded.isSetUnsettableAttribute()); assertEquals(loaded.getUnsettableAttribute(), null); }