Search in sources :

Example 1 with Animal

use of org.camunda.bpm.model.xml.testmodel.instance.Animal in project camunda-xml-model by camunda.

the class TestModelInstanceTest method testClone.

@Test
public void testClone() throws Exception {
    ModelInstance modelInstance = new TestModelParser().getEmptyModel();
    Animals animals = modelInstance.newInstance(Animals.class);
    modelInstance.setDocumentElement(animals);
    Animal animal = modelInstance.newInstance(Bird.class);
    animal.setId("TestId");
    animals.addChildElement(animal);
    ModelInstance cloneInstance = modelInstance.clone();
    getFirstAnimal(cloneInstance).setId("TestId2");
    assertThat(getFirstAnimal(modelInstance).getId(), is(equalTo("TestId")));
    assertThat(getFirstAnimal(cloneInstance).getId(), is(equalTo("TestId2")));
}
Also used : ModelInstance(org.camunda.bpm.model.xml.ModelInstance) Animals(org.camunda.bpm.model.xml.testmodel.instance.Animals) Animal(org.camunda.bpm.model.xml.testmodel.instance.Animal) Test(org.junit.Test)

Aggregations

ModelInstance (org.camunda.bpm.model.xml.ModelInstance)1 Animal (org.camunda.bpm.model.xml.testmodel.instance.Animal)1 Animals (org.camunda.bpm.model.xml.testmodel.instance.Animals)1 Test (org.junit.Test)1