private static Feature feature;
- private DescriptionElementBase[] arrayType = new DescriptionElementBase[0];
-
+ private final DescriptionElementBase[] arrayType = new DescriptionElementBase[0];
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
taxon = Taxon.NewInstance(null, null);
description = TaxonDescription.NewInstance();
feature = Feature.NewInstance();
-
- operation = new CreateDescriptionElementOperation("Add Element", null, taxon, description, feature, postOperation);
+
+ operation = new CreateDescriptionElementOperation("Add Element", null, description, feature, postOperation);
}
@Test
public void testExecute() throws ExecutionException {
operation.execute(monitor, info);
-
+
Assert.assertTrue(description.getElements().size() > 0);
Assert.assertEquals(feature, description.getElements().toArray(arrayType)[0].getFeature());
}
@Test
public void testUndo() throws ExecutionException {
operation.undo(monitor, info);
-
+
Assert.assertTrue(description.getElements().size() == 0);
}
-
+
@Test
public void testRedo() throws ExecutionException {
operation.redo(monitor, info);
-
+
Assert.assertTrue(description.getElements().size() > 0);
Assert.assertEquals(feature, description.getElements().toArray(arrayType)[0].getFeature());
}