diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/er/ERManagementTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/er/ERManagementTest.java index 5a78d28..3f52971 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/er/ERManagementTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/er/ERManagementTest.java @@ -319,7 +319,7 @@ public class ERManagementTest extends ScopedTest { isIdentifiedBy = new IsIdentifiedByImpl(hostingNode, networkingFacet, null); - hostingNode.attachFacet(isIdentifiedBy); + hostingNode.addFacet(isIdentifiedBy); PropagationConstraint propagationConstraint = new PropagationConstraintImpl(); diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java index 6ddd223..e5c5fc0 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/er/SmartgearResourcesTest.java @@ -238,6 +238,42 @@ public class SmartgearResourcesTest extends ScopedTest { HostingNode hostingNodeToUpdate = ISMapper.unmarshal(HostingNode.class, json); + + /* Testing convenient methods */ + @SuppressWarnings("unchecked") + List> hasVolatileMemoryList = hostingNodeToUpdate.getConsistsOf(HasVolatileMemory.class); + Assert.assertTrue(hasVolatileMemoryList.size()==2); + + @SuppressWarnings("unchecked") + List> hasPeristentMemoryList = hostingNodeToUpdate.getConsistsOf(HasPersistentMemory.class); + Assert.assertTrue(hasPeristentMemoryList.size()==1); + + @SuppressWarnings("unchecked") + List> memoryList = hostingNodeToUpdate.getConsistsOf(ConsistsOf.class, MemoryFacet.class); + Assert.assertTrue(memoryList.size()==3); + + List csfList = hostingNodeToUpdate.getFacets(ContainerStateFacet.class); + Assert.assertTrue(csfList.size()==1); + + List spfList = hostingNodeToUpdate.getFacets(SimplePropertyFacet.class); + Assert.assertTrue(spfList.size()==1); + + List sfList = hostingNodeToUpdate.getFacets(SoftwareFacet.class); + Assert.assertTrue(sfList.size()==1); + + List cfList = hostingNodeToUpdate.getFacets(CPUFacet.class); + Assert.assertTrue(cfList.size()==4); + + List nfList = hostingNodeToUpdate.getFacets(NetworkingFacet.class); + Assert.assertTrue(nfList.size()==1); + + @SuppressWarnings("unchecked") + List> isbnfList = hostingNodeToUpdate.getConsistsOf(IsIdentifiedBy.class, NetworkingFacet.class); + Assert.assertTrue(isbnfList.size()==1); + + /* Testing convenient methods */ + + List> consistsOfToRemove = new ArrayList<>(); List> consistsOfList = hostingNodeToUpdate