public void testUndoCreateSimpleInstance() { Cls cls = createCls(); Instance instance = createSimpleInstance(cls); String name = instance.getName(); assertNotNull("name", name); Frame frame = getFrame(name); assertEquals("created", instance, frame); assertTrue("can undo", _frameStore.canUndo()); _frameStore.undo(); frame = getFrame(name); assertNull("undone", frame); _frameStore.redo(); instance = (Instance) getFrame(name); assertEquals("recreated", instance.getName(), name); }
@Override public HighLevelAbstractionDefinition convert( Instance complexAbstractionInstance, ProtegeKnowledgeSourceBackend backend) throws KnowledgeSourceReadException { HighLevelAbstractionDefinition result = new HighLevelAbstractionDefinition(complexAbstractionInstance.getName()); ConnectionManager cm = backend.getConnectionManager(); Util.setNames(complexAbstractionInstance, result, cm); Util.setInDataSource(complexAbstractionInstance, result, cm); Util.setProperties(complexAbstractionInstance, result, cm); Util.setTerms(complexAbstractionInstance, result, cm); Util.setGap(complexAbstractionInstance, result, backend, cm); Util.setSolid(complexAbstractionInstance, result, cm); Util.setConcatenable(complexAbstractionInstance, result, cm); Util.setReferences(complexAbstractionInstance, result, cm); result.setAccessed(new Date()); Map<Instance, TemporalExtendedPropositionDefinition> extendedParameterCache = new HashMap<>(); addComponentAbstractionDefinitions( complexAbstractionInstance, result, extendedParameterCache, backend); addRelationships(extendedParameterCache, complexAbstractionInstance, result, backend); Util.setInverseIsAs(complexAbstractionInstance, result, cm); result.setTemporalOffset( Util.temporalOffsets(complexAbstractionInstance, backend, extendedParameterCache)); result.setSourceId(DefaultSourceId.getInstance(backend.getId())); return result; }