From 72aa421210920a2c0d8979548401c97b5f807570 Mon Sep 17 00:00:00 2001 From: Cherian Mathew Date: Mon, 2 Feb 2015 15:42:21 +0000 Subject: [PATCH] added h2 db to resources and delete test to test class --- .gitattributes | 1 + .../cdm/polytomouskey/PolytomousKeyTest.java | 10 ++++++---- .../src/test/resources/h2/cdmTest.h2.db | Bin 0 -> 26624 bytes 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db diff --git a/.gitattributes b/.gitattributes index 468b96c6d..2602c126e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/polytomouskey/PolytomousKeyTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/polytomouskey/PolytomousKeyTest.java index d321d5007..ed9754353 100644 --- a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/polytomouskey/PolytomousKeyTest.java +++ b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/polytomouskey/PolytomousKeyTest.java @@ -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 index 0000000000000000000000000000000000000000..0a0ca9bbae8f5bd9ba75b515883d76dfdd1412d2 GIT binary patch literal 26624 zcmeI(OK;Oy7zW^^xwuV00Izzz?{HNzDfhL*W(4ApJ+mr zs>QuM0~VoFYIJ)lK2$@5P$##AOL|C5y)NfU)X2xH-HscaFhuF2tWV=5MTmZKRogr zHh=*E2tWV=5P-ny2yFf6-~YMQsTh?)00Izz00bbAyXwFHpH6`S0uX=z1Rwx`l@Zwb z$$$Ni+yBa}I0}UT1Rwwb2*hH!YyRv1HT?e{(f|PnKmY;|SRH{Jx9Jy~jAi58+cj>S zNdKEm-%F+bNvA9>`DQ(Ndn558len|F_VUu&t!(`H>ezfmmDZ?`eG>0ln(SzFU~3lX zJu*y(v_su?Y_etcHE^gjIv!2LsUSASZQ*1*l}gl??LL(z)7JF3)vTXPrBQP{nzp36 zAhm?LBu(0*>B;eUR~ogYrZ670n#U*gNn7kl?ao;0w0E0geRonKSsm&IPutnw<7^~0 z14mW{8tF#Qw1%>yn}%z5``S>xIWQGhl^vO#qEgp1Y{!yy!}(;&3r_sl*6q-~r4ME6 zi1xIjvNABcdlfd8svRyGF>LFywr*#K^4a?#)m$fM4}Yo`GL1zeMYV-fsuE?NM(fg* zS^a9{a%z1R6g%rF!#N~O%=@W(Q7VCP*V4UJQ2 zU?cNnYd4NP$LfA%7=%YK8(4VI8+OC-d;NIb+-@zB*JgCSmL0QW8$4Ds{9 zu*+;N1(t`$=gxy2gh5vqXF)k~G`DLWus8%+2^K$kYIbI8ou}fVtvM7_>naEOK&84Q F{12fH^^O1l literal 0 HcmV?d00001 -- 2.34.1