Project

General

Profile

« Previous | Next » 

Revision 91a8d98c

Added by Cherian Mathew almost 9 years ago

#5009 Add operations and corresponding tests for delete / update nodes actions

#5009 : missed in last commit

View differences:

eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/PolytomousKeyViewPartTest.java
15 15

  
16 16
import org.eclipse.core.commands.ExecutionException;
17 17
import org.junit.Assert;
18
import org.junit.Ignore;
18 19
import org.junit.Test;
19 20
import org.unitils.dbunit.annotation.DataSet;
20 21

  
21 22
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
22 23
import eu.etaxonomy.cdm.model.description.PolytomousKey;
23 24
import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RemotingPolytomousKeyDeleteOperation;
25
import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RemotingPolytomousKeyUpdateAllNodesOperation;
24 26
import eu.etaxonomy.taxeditor.operations.BaseOperationTest;
25 27

  
26 28
/**
......
32 34
public class PolytomousKeyViewPartTest extends BaseOperationTest {
33 35

  
34 36
    IPolytomousKeyService polytomousKeyService = getRemoteApplicationController().getPolytomousKeyService();
37
    private static UUID pkey1Uuid = UUID.fromString("f82cef88-5a9e-4917-9938-d08bda40836f");
38
    private static UUID pkey2Uuid = UUID.fromString("a00ca7ec-b660-433c-bd14-596826ab2243");
39
    private static UUID pkey3Uuid = UUID.fromString("197bc542-bf5b-4a52-aa66-c65df32c196b");
35 40

  
41
    @Ignore // waiting for #3998 to be fixed
36 42
    @Test
37 43
    public void testDeletePolytomousKey() throws ExecutionException {
38 44
        List<PolytomousKey> pKeysBeforeDelete = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
39 45
        int initialCount = pKeysBeforeDelete.size();
40 46

  
41 47
        List<PolytomousKey> keysToDelete = new ArrayList<PolytomousKey>();
42
        keysToDelete.add(polytomousKeyService.load(UUID.fromString("f82cef88-5a9e-4917-9938-d08bda40836f")));
43
        keysToDelete.add(polytomousKeyService.load(UUID.fromString("a00ca7ec-b660-433c-bd14-596826ab2243")));
44
        keysToDelete.add(polytomousKeyService.load(UUID.fromString("197bc542-bf5b-4a52-aa66-c65df32c196b")));
48
        keysToDelete.add(polytomousKeyService.load(pkey1Uuid));
49
        keysToDelete.add(polytomousKeyService.load(pkey2Uuid));
50
        keysToDelete.add(polytomousKeyService.load(pkey3Uuid));
51

  
52
        List<UUID> uuids = new ArrayList<UUID>();
53
        uuids.add(pkey1Uuid);
54
        uuids.add(pkey2Uuid);
55
        uuids.add(pkey3Uuid);
45 56

  
46 57
        int keysToDeleteCount = keysToDelete.size();
47 58
        operation = new RemotingPolytomousKeyDeleteOperation(sessionOwner,
48 59
                false,
49
                keysToDelete);
60
                uuids);
50 61
        operation.execute(monitor, info);
51 62

  
52 63
        List<PolytomousKey> pKeysAfterDelete = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
......
57 68

  
58 69
    }
59 70

  
71
    @Test
72
    public void testUpdateAllNodes() throws ExecutionException {
73
        operation = new RemotingPolytomousKeyUpdateAllNodesOperation(sessionOwner,
74
                false,
75
                pkey1Uuid);
76
        operation.execute(monitor, info);
77
    }
78

  
60 79
}

Also available in: Unified diff