From 40fa20a87124af20dc7540651402811189dbeddd Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 7 Nov 2024 13:34:43 +0100 Subject: [PATCH] Improved test --- .../contexts/ContextManagementTest.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/contexts/ContextManagementTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/contexts/ContextManagementTest.java index 79be898..c6f3c89 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/contexts/ContextManagementTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/contexts/ContextManagementTest.java @@ -478,14 +478,17 @@ public class ContextManagementTest extends ContextTest { @Test public void testGetAll() throws Exception { - List contexts = getAll(); - contexts = ServerContextCache.getInstance().getContexts(); + // List contexts = getAll(); + // List contexts = ServerContextCache.getInstance().getContexts(); + List contexts = ServerContextCache.getInstance().getFullInfoContexts(); for(Context context : contexts) { - logger.info(ElementMapper.marshal(context)); - List children = context.getChildren(); - for(IsParentOf child : children) { - Assert.assertTrue(child.getSource() == context); - Context childContext = child.getTarget(); + logger.info("{}", context.getName()); + List childrenIsParentOf = context.getChildren(); + for(IsParentOf childIsParentOf : childrenIsParentOf) { + Assert.assertTrue(childIsParentOf.getSource() == context); + Context childContext = childIsParentOf.getTarget(); + logger.info(" --- Child {}", childContext.getName()); + Assert.assertTrue(childContext.getParent() == childIsParentOf); Assert.assertTrue(childContext.getParent().getSource() == context); } roleUserAssertions(context.getID(), null, false);