added h2 db to resources and delete test to test class
authorCherian Mathew <c.mathew@bgbm.org>
Mon, 2 Feb 2015 15:42:21 +0000 (15:42 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Mon, 2 Feb 2015 15:42:21 +0000 (15:42 +0000)
.gitattributes
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/polytomouskey/PolytomousKeyTest.java
eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db [new file with mode: 0644]

index 468b96c6d8e39546d1f2675ef5576a82e8b4f296..2602c126e6bf930ed87dbde0d230f95bf12083fb 100644 (file)
@@ -1894,6 +1894,7 @@ eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/Cl
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/NameSelectionElementTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/TaxonNodeSelectionElementTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/TaxonSelectionElementTest.java -text
+eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db -text
 eu.etaxonomy.taxeditor/.classpath -text
 eu.etaxonomy.taxeditor/.project -text
 eu.etaxonomy.taxeditor/deploy_nightly.sh -text
index d321d50078c13235300ad9fa33b343da2a75df69..ed975435392c767682f8cc6c48dfcf5ddcda25bd 100644 (file)
@@ -324,14 +324,14 @@ public class PolytomousKeyTest extends BaseRemotingTest {
         polytomousKeyService.delete(subKey);
 
         // since subKey was not initialized before the delete, an attempt
-        // to initialize it after will lead to an npe
+        // to initialize it after will lead to an NPE
         try {
             PolytomousKeyNode subKeyRootNode = subKey.getRoot();
             Assert.fail("A NullPointerException indicating null root node should be thrown here");
         } catch(NullPointerException npe) {
 
         }
-
+        // retrieving subkey shows its null
         subKey = CdmBase.deproxy(polytomousKeyService.find(subKeyUuid),PolytomousKey.class);
         Assert.assertNull(subKey);
 
@@ -341,7 +341,9 @@ public class PolytomousKeyTest extends BaseRemotingTest {
         rootNode = pKey.getRoot();
         child = rootNode.getChildAt(0);
         subKey = child.getSubkey();
-
+        // subkey will not be null, because the delete functionality of the subkey
+        // does not currently delete it from a polytomous key node
+        Assert.assertNotNull(subKey);
         // after reloading the object graph, accessing subKey should throw a null pointer exception
         try {
             PolytomousKeyNode subKeyRootNode = subKey.getRoot();
@@ -359,7 +361,7 @@ public class PolytomousKeyTest extends BaseRemotingTest {
 
         PolytomousKeyNode rootNode = pKey.getRoot();
         PolytomousKeyNode child = rootNode.getChildAt(0);
-        polytomousKeyNodeService.delete(child);
+        polytomousKeyNodeService.delete(child, true, true);
     }
 
     @Test
diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db b/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db
new file mode 100644 (file)
index 0000000..0a0ca9b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db differ