예제 #1
0
  @Test
  public void testGetID() {
    assertNull(dm.getId());

    model.getFolder(FolderType.DIAGRAMS).getElements().add(dm);
    assertNotNull(dm.getId());
  }
예제 #2
0
  @Test
  public void testGetCopy() {
    dm.setName("name");
    dm.setDocumentation("doc");

    dm.getProperties().add(IArchimateFactory.eINSTANCE.createProperty());

    IDiagramModel copy = (IDiagramModel) dm.getCopy();

    assertNotSame(dm, copy);
    assertNull(copy.getId());
    assertEquals(dm.getName(), copy.getName());
    assertEquals(dm.getDocumentation(), copy.getDocumentation());
    assertNotSame(dm.getProperties(), copy.getProperties());
    assertEquals(dm.getProperties().size(), copy.getProperties().size());
    assertNotSame(dm.getChildren(), copy.getChildren());
  }