removing unnecessary class parameters from deproxy and remove usage of load(cdmBase...
authorAndreas Müller <a.mueller@bgbm.org>
Fri, 26 Jun 2020 17:35:06 +0000 (19:35 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 26 Jun 2020 17:35:06 +0000 (19:35 +0200)
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java

index 290ea0a8d0fffb2927fd5d2a2e9507fbbb418b76..47e09af4a34763fb96661358401f65fd59e36176 100644 (file)
@@ -82,7 +82,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        // polytomous key
        //      |- root : polytomous key node
        // in a recursive call
-        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY));
 
         // checking to make sure the root object is in the session cache
         Assert.assertSame(CdmBase.deproxy(pkey1.getRoot(),PolytomousKeyNode.class), cacher.getFromCache(pkey1.getRoot()));
@@ -99,12 +99,12 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
        // in a recursive call
-        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+        PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
         CdmTransientEntityCacher cacher = getCacher(sessionOwner);
         // checking to make sure the root object is in the session cache
-        Assert.assertSame(CdmBase.deproxy(pkey.getRoot(),PolytomousKeyNode.class), cacher.getFromCache(pkey.getRoot()));
-        Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getStatement(),KeyStatement.class), cacher.getFromCache(pkey.getRoot().getStatement()));
-        Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getQuestion(),KeyStatement.class), cacher.getFromCache(pkey.getRoot().getQuestion()));
+        Assert.assertSame(CdmBase.deproxy(pkey.getRoot()), cacher.getFromCache(pkey.getRoot()));
+        Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getStatement()), cacher.getFromCache(pkey.getRoot().getStatement()));
+        Assert.assertSame(CdmBase.deproxy(pkey.getRoot().getQuestion()), cacher.getFromCache(pkey.getRoot().getQuestion()));
 
     }
 
@@ -120,7 +120,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //      |- root : polytomous key node
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
-        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid));
 
         CdmTransientEntityCacher cacher = getCacher(sessionOwner);
     }
@@ -136,8 +136,8 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        // polytomous key
        //      |- root : polytomous key node
        // in a recursive call
-        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
-        KeyStatement ks1 = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY));
+        KeyStatement ks1 = CdmBase.deproxy(pkey1.getRoot().getStatement());
 
         CdmTransientEntityCacher cacher = getCacher(sessionOwner);
 
@@ -146,9 +146,9 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //      |- root : polytomous key node
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
-        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY),PolytomousKey.class);
+        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY));
 
-        KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class);
+        KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement());
 
         Assert.assertSame(ks2, cacher.getFromCache(ks2));
         Assert.assertSame(cacher.getFromCache(ks1), cacher.getFromCache(ks2));
@@ -167,7 +167,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //      |- root : polytomous key node
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
-        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
         KeyStatement ks1 = pkey1.getRoot().getStatement();
         Assert.assertSame(ks1, pkey1.getRoot().getStatement());
         CdmTransientEntityCacher cacher = getCacher(sessionOwner);
@@ -175,7 +175,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        // this call will load into the session cache the graph and update the objects in the sub-graph for a
        // polytomous key
        //      |- root : polytomous key node
-        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY));
 
         Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
         pkey2.getRoot().getStatement().getCreatedBy();
@@ -194,7 +194,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //      |- root : polytomous key node
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
-        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+        PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
 
 
         CdmTransientEntityCacher cacher = getCacher(sessionOwner);
@@ -203,15 +203,15 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
         // that it exists in the cache and
         // that both the original object and the
         // cached object are the same
-        Assert.assertNotNull(CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class));
+        Assert.assertNotNull(CdmBase.deproxy(pkey1.getRoot().getStatement()));
         Assert.assertNotNull(cacher.getFromCache(pkey1.getRoot().getStatement()));
 
        // this call will load into the session cache the graph and update the objects in the sub-graph for a
        // polytomous key
        //      |- root : polytomous key node
-        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+        PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid));
 
-        KeyStatement ks2 =  CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class);
+        KeyStatement ks2 =  CdmBase.deproxy(pkey2.getRoot().getStatement());
         Assert.assertSame(ks2, cacher.getFromCache(pkey2.getRoot().getStatement()));
 
         Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
@@ -229,10 +229,10 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        // polytomous key
        //      |- root : polytomous key node
 
-       PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+       PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid));
 
         // lazy initialising root.statement
-        KeyStatement st = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
+        KeyStatement st = CdmBase.deproxy(pkey1.getRoot().getStatement());
         st.getLabel();
 
         // checking that the root is not null and
@@ -240,8 +240,8 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
         // that both the original object and the
         // cached object are the same
        Assert.assertNotNull(pkey1.getRoot().getStatement());
-       Assert.assertSame(CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class),
-                       cacher.getFromCache(pkey1.getRoot().getStatement(), KeyStatement.class));
+       Assert.assertSame(CdmBase.deproxy(pkey1.getRoot().getStatement()),
+                       cacher.getFromCache(pkey1.getRoot().getStatement()));
 
        // this call will load into the session cache the graph and update the objects in the sub-graph for a
        // polytomous key
@@ -249,11 +249,11 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
 
-       PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+       PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
 
-       Assert.assertSame(CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
-       Assert.assertSame(st, CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class));
-       Assert.assertSame(cacher.getFromCache(st), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
+       Assert.assertSame(CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class), cacher.getFromCache(pkey2.getRoot().getStatement()));
+       Assert.assertSame(st, CdmBase.deproxy(pkey2.getRoot().getStatement()));
+       Assert.assertSame(cacher.getFromCache(st), cacher.getFromCache(pkey2.getRoot().getStatement()));
     }
 
 
@@ -265,12 +265,12 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
     public void subGraphObjectLoadTest1() {
 
        // this call will load into the session cache a polytomous key node object
-       PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
+       PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1));
 
        Assert.assertNotNull(rootPKNode);
        Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
 
-       PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
+       PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2));
 
        Assert.assertNotNull(childOfRootPKNode);
        Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
@@ -281,7 +281,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
 
-       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
 
        Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
        Assert.assertSame(pkey.getRoot().getChildAt(1), childOfRootPKNode);
@@ -300,15 +300,15 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
 
-       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
 
        // this call will load into the session cache a polytomous key node object
-       PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1),PolytomousKeyNode.class);
+       PolytomousKeyNode rootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid1));
 
        Assert.assertNotNull(rootPKNode);
        Assert.assertSame(rootPKNode, cacher.getFromCache(rootPKNode));
 
-       PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2),PolytomousKeyNode.class);
+       PolytomousKeyNode childOfRootPKNode = CdmBase.deproxy(polytomousKeyNodeService.find(polytomousKeyNodeUuid2));
 
        Assert.assertNotNull(childOfRootPKNode);
        Assert.assertSame(childOfRootPKNode, cacher.getFromCache(childOfRootPKNode));
@@ -331,7 +331,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
 
-       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY));
 
 
        PolytomousKeyNode childOfRootPKNode = pkey.getRoot().getChildAt(1);
@@ -367,7 +367,7 @@ public class CdmClientCachingTest extends RemotingSessionAwareTest {
        //              |- question : KeyStatement
        //              |- statement : KeyStatement
 
-       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY),PolytomousKey.class);
+       PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH3_INIT_STRATEGY));
 
 
        Map<Language, LanguageString> labelMap = pkey.getRoot().getStatement().getLabel();