Project

General

Profile

« Previous | Next » 

Revision 52c57094

Added by Cherian Mathew almost 9 years ago

Fix duplicate entity issue with newly created cdm entities

View differences:

eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java
164 164
    }
165 165

  
166 166
    @Test
167
    public void addGrandChildPolytomousKeyNode() {
167
    public void addGreatGrandChildPolytomousKeyNode() {
168

  
168 169
        PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
169
        PolytomousKeyNode rootNode = pKey.getRoot();
170
        PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
171
        rootNode.addChild(childNode);
170
        PolytomousKeyNode rootChildNode = pKey.getRoot().getChildAt(0);
171
        PolytomousKeyNode grandChildNode = PolytomousKeyNode.NewInstance();
172
        rootChildNode.addChild(grandChildNode);
172 173

  
173
        polytomousKeyService.merge(pKey);
174
        grandChildNode = polytomousKeyNodeService.merge(grandChildNode);
174 175

  
175
        PolytomousKeyNode grandChildNode = PolytomousKeyNode.NewInstance();
176
        childNode.addChild(grandChildNode);
176
        PolytomousKeyNode greatGrandChildNode = PolytomousKeyNode.NewInstance();
177
        grandChildNode.addChild(greatGrandChildNode);
177 178

  
178
        polytomousKeyService.merge(pKey);
179
        Assert.assertFalse(pKey.getRoot().getChildAt(0).getChildAt(0).getId() == 0);
179 180
    }
180 181

  
181 182
    @Test

Also available in: Unified diff