ref #10067, ref #3722 reenable and adapt readPolytomousKeyDataFromNodes() test
authorAndreas Müller <a.mueller@bgbm.org>
Fri, 17 Jun 2022 13:15:36 +0000 (15:15 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 17 Jun 2022 17:46:31 +0000 (19:46 +0200)
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java

index 8423c28b1efc4b42c9b5e10c648ebb4d46806fe3..6911e896f4bb975c1d29d4ebfc5554a6f68013fc 100644 (file)
@@ -131,7 +131,6 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest {
     }
 
     @Test
-    @Ignore  //ignore preliminary to allow full build
     public void readPolytomousKeyDataFromNodes() {
         PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
         PolytomousKeyNode rootNode = pKey.getRoot();
@@ -141,24 +140,24 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest {
         Assert.assertEquals(2751, rootNode.getChildAt(0).getId());
         Assert.assertEquals(rootNode.getId(), rootNode.getChildAt(0).getParent().getId());
         Assert.assertEquals(pKey.getId(), rootNode.getKey().getId());
-        Integer sortIndex = (Integer)getFieldValueViaReflection(rootNode.getChildAt(0), "sortIndex");
-        Assert.assertEquals(new Integer(0), sortIndex);
+        //here was the explicit sortindex field test before, but this field does not exist anymore since #3722 and #10067 was fixed
+        Assert.assertEquals(0, rootNode.getIndex(rootNode.getChildAt(0)));
         String statement = "Capitula without ligulate ray-florets; leaves entire or subentire";
         Assert.assertEquals(statement, rootNode.getChildAt(0).getStatement().getLabelText(Language.ENGLISH()));
 
         Assert.assertEquals(2753, rootNode.getChildAt(1).getId());
         Assert.assertEquals(rootNode.getId(), rootNode.getChildAt(1).getParent().getId());
         Assert.assertEquals(pKey.getId(), rootNode.getChildAt(1).getKey().getId());
-        sortIndex = (Integer)getFieldValueViaReflection(rootNode.getChildAt(1), "sortIndex");
-        Assert.assertEquals(new Integer(1), sortIndex);
+        //here was the explicit sortindex field test before, but this field does not exist anymore since #3722 and #10067 was fixed
+        Assert.assertEquals(1, rootNode.getIndex(rootNode.getChildAt(1)));
         statement = "Capitula with ligulate ray-florets; leaves pinnatisect";
         Assert.assertEquals(statement, rootNode.getChildAt(1).getStatement().getLabelText(Language.ENGLISH()));
 
         Assert.assertEquals(2754, rootNode.getChildAt(1).getChildAt(0).getId());
         Assert.assertEquals(rootNode.getChildAt(1).getId(), rootNode.getChildAt(1).getChildAt(0).getParent().getId());
         Assert.assertEquals(pKey.getId(), rootNode.getChildAt(1).getChildAt(0).getKey().getId());
-        sortIndex = (Integer)getFieldValueViaReflection(rootNode.getChildAt(1).getChildAt(0), "sortIndex");
-        Assert.assertEquals(new Integer(0), sortIndex);
+        //here was the explicit sortindex field test before, but this field does not exist anymore since #3722 and #10067 was fixed
+        Assert.assertEquals(0, rootNode.getChildAt(1).getIndex(rootNode.getChildAt(1).getChildAt(0)));
         statement = "Ray-florets yellow";
         Assert.assertEquals(statement, rootNode.getChildAt(1).getChildAt(0).getStatement().getLabelText(Language.ENGLISH()));
         Assert.assertEquals("Achillea arabica Kotschy sec. Cyprus", rootNode.getChildAt(1).getChildAt(0).getChildAt(0).getTaxon().getTitleCache());