Improved test

This commit is contained in:
Luca Frosini 2024-11-07 13:34:43 +01:00
parent 2ff9841de2
commit 40fa20a871
1 changed files with 10 additions and 7 deletions

View File

@ -478,14 +478,17 @@ public class ContextManagementTest extends ContextTest {
@Test
public void testGetAll() throws Exception {
List<Context> contexts = getAll();
contexts = ServerContextCache.getInstance().getContexts();
// List<Context> contexts = getAll();
// List<Context> contexts = ServerContextCache.getInstance().getContexts();
List<Context> contexts = ServerContextCache.getInstance().getFullInfoContexts();
for(Context context : contexts) {
logger.info(ElementMapper.marshal(context));
List<IsParentOf> children = context.getChildren();
for(IsParentOf child : children) {
Assert.assertTrue(child.getSource() == context);
Context childContext = child.getTarget();
logger.info("{}", context.getName());
List<IsParentOf> 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);