Project

General

Profile

« Previous | Next » 

Revision 72aa4212

Added by Cherian Mathew about 9 years ago

added h2 db to resources and delete test to test class

View differences:

.gitattributes
1894 1894
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/NameSelectionElementTest.java -text
1895 1895
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/TaxonNodeSelectionElementTest.java -text
1896 1896
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/TaxonSelectionElementTest.java -text
1897
eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db -text
1897 1898
eu.etaxonomy.taxeditor/.classpath -text
1898 1899
eu.etaxonomy.taxeditor/.project -text
1899 1900
eu.etaxonomy.taxeditor/deploy_nightly.sh -text
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/polytomouskey/PolytomousKeyTest.java
324 324
        polytomousKeyService.delete(subKey);
325 325

  
326 326
        // since subKey was not initialized before the delete, an attempt
327
        // to initialize it after will lead to an npe
327
        // to initialize it after will lead to an NPE
328 328
        try {
329 329
            PolytomousKeyNode subKeyRootNode = subKey.getRoot();
330 330
            Assert.fail("A NullPointerException indicating null root node should be thrown here");
331 331
        } catch(NullPointerException npe) {
332 332

  
333 333
        }
334

  
334
        // retrieving subkey shows its null
335 335
        subKey = CdmBase.deproxy(polytomousKeyService.find(subKeyUuid),PolytomousKey.class);
336 336
        Assert.assertNull(subKey);
337 337

  
......
341 341
        rootNode = pKey.getRoot();
342 342
        child = rootNode.getChildAt(0);
343 343
        subKey = child.getSubkey();
344

  
344
        // subkey will not be null, because the delete functionality of the subkey
345
        // does not currently delete it from a polytomous key node
346
        Assert.assertNotNull(subKey);
345 347
        // after reloading the object graph, accessing subKey should throw a null pointer exception
346 348
        try {
347 349
            PolytomousKeyNode subKeyRootNode = subKey.getRoot();
......
359 361

  
360 362
        PolytomousKeyNode rootNode = pKey.getRoot();
361 363
        PolytomousKeyNode child = rootNode.getChildAt(0);
362
        polytomousKeyNodeService.delete(child);
364
        polytomousKeyNodeService.delete(child, true, true);
363 365
    }
364 366

  
365 367
    @Test

Also available in: Unified diff