Merge remote-tracking branch 'origin/feature/20367' into feature/20298
This commit is contained in:
commit
18a552a3b7
|
@ -46,7 +46,6 @@ import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.EventFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.EventFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.LicenseFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.LicenseFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.ServiceStateFacetImpl;
|
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.SimpleFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.SimpleFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.StateFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.StateFacetImpl;
|
||||||
|
@ -61,7 +60,6 @@ import org.gcube.resourcemanagement.model.reference.entities.facets.ContactFacet
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.EventFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.EventFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.LicenseFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.LicenseFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.ServiceStateFacet;
|
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.SimpleFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.SimpleFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.StateFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.StateFacet;
|
||||||
|
@ -128,7 +126,7 @@ public class ERManagementTest extends ContextTest {
|
||||||
ValueSchema authorization = new ValueSchemaImpl();
|
ValueSchema authorization = new ValueSchemaImpl();
|
||||||
authorization.setValue("pwd");
|
authorization.setValue("pwd");
|
||||||
URI uri = new URI("http://www.gcube-system.org");
|
URI uri = new URI("http://www.gcube-system.org");
|
||||||
authorization.setType(uri);
|
authorization.setSchema(uri);
|
||||||
accessPointFacet.setAuthorization(authorization);
|
accessPointFacet.setAuthorization(authorization);
|
||||||
|
|
||||||
accessPointFacet.setAdditionalProperty("Test", "MyTest");
|
accessPointFacet.setAdditionalProperty("Test", "MyTest");
|
||||||
|
@ -187,11 +185,14 @@ public class ERManagementTest extends ContextTest {
|
||||||
|
|
||||||
EventFacet eventFacet = new EventFacetImpl();
|
EventFacet eventFacet = new EventFacetImpl();
|
||||||
eventFacet.setDate(Calendar.getInstance().getTime());
|
eventFacet.setDate(Calendar.getInstance().getTime());
|
||||||
eventFacet.setValue("Created");
|
ValueSchema event = new ValueSchemaImpl();
|
||||||
|
event.setValue("Created");
|
||||||
|
event.setSchema(new URI(""));
|
||||||
|
eventFacet.setEvent(event);
|
||||||
eService.addFacet(eventFacet);
|
eService.addFacet(eventFacet);
|
||||||
|
|
||||||
ServiceStateFacet serviceStateFacet = new ServiceStateFacetImpl();
|
StateFacet stateFacet = new StateFacetImpl();
|
||||||
serviceStateFacet.setValue("ready");
|
stateFacet.setValue("ready");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
List<Map<String, String>> list = new ArrayList<>();
|
List<Map<String, String>> list = new ArrayList<>();
|
||||||
|
@ -205,7 +206,7 @@ public class ERManagementTest extends ContextTest {
|
||||||
serviceStateFacet.setAdditionalProperty("MY-TEST", list);
|
serviceStateFacet.setAdditionalProperty("MY-TEST", list);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
eService.addFacet(serviceStateFacet);
|
eService.addFacet(stateFacet);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,22 +46,22 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegis
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
|
||||||
import org.gcube.informationsystem.utils.ElementMapper;
|
import org.gcube.informationsystem.utils.ElementMapper;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.ContainerStateFacetImpl;
|
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.MemoryFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.MemoryFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.SimplePropertyFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.SimplePropertyFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entities.facets.StateFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasPersistentMemoryImpl;
|
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasPersistentMemoryImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasVolatileMemoryImpl;
|
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasVolatileMemoryImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl;
|
import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.CPUFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.CPUFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.ContainerStateFacet;
|
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet.MemoryUnit;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet.MemoryUnit;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.SimplePropertyFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.SimplePropertyFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entities.facets.StateFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.resources.EService;
|
import org.gcube.resourcemanagement.model.reference.entities.resources.EService;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode;
|
import org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode;
|
||||||
import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasPersistentMemory;
|
import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasPersistentMemory;
|
||||||
|
@ -214,8 +214,8 @@ public class SmartgearResourcesTest extends ContextTest {
|
||||||
hostingNode, simplePropertyFacet, propagationConstraint);
|
hostingNode, simplePropertyFacet, propagationConstraint);
|
||||||
hostingNode.addFacet(spfR);
|
hostingNode.addFacet(spfR);
|
||||||
|
|
||||||
ContainerStateFacet containerStateFacet = getContainerStateFacet(null);
|
StateFacet stateFacet = getStateFacet(null);
|
||||||
hostingNode.addFacet(containerStateFacet);
|
hostingNode.addFacet(stateFacet);
|
||||||
|
|
||||||
MemoryFacet ramFacet = getRamInfo(null);
|
MemoryFacet ramFacet = getRamInfo(null);
|
||||||
HasVolatileMemory<HostingNode, MemoryFacet> hasVolatileRAMMemory = new HasVolatileMemoryImpl<HostingNode, MemoryFacet>(
|
HasVolatileMemory<HostingNode, MemoryFacet> hasVolatileRAMMemory = new HasVolatileMemoryImpl<HostingNode, MemoryFacet>(
|
||||||
|
@ -259,7 +259,7 @@ public class SmartgearResourcesTest extends ContextTest {
|
||||||
List<? extends ConsistsOf<? extends Resource, MemoryFacet>> memoryList = hostingNodeToUpdate.getConsistsOf(ConsistsOf.class, MemoryFacet.class);
|
List<? extends ConsistsOf<? extends Resource, MemoryFacet>> memoryList = hostingNodeToUpdate.getConsistsOf(ConsistsOf.class, MemoryFacet.class);
|
||||||
Assert.assertTrue(memoryList.size()==3);
|
Assert.assertTrue(memoryList.size()==3);
|
||||||
|
|
||||||
List<ContainerStateFacet> csfList = hostingNodeToUpdate.getFacets(ContainerStateFacet.class);
|
List<StateFacet> csfList = hostingNodeToUpdate.getFacets(StateFacet.class);
|
||||||
Assert.assertTrue(csfList.size()==1);
|
Assert.assertTrue(csfList.size()==1);
|
||||||
|
|
||||||
List<SimplePropertyFacet> spfList = hostingNodeToUpdate.getFacets(SimplePropertyFacet.class);
|
List<SimplePropertyFacet> spfList = hostingNodeToUpdate.getFacets(SimplePropertyFacet.class);
|
||||||
|
@ -287,9 +287,9 @@ public class SmartgearResourcesTest extends ContextTest {
|
||||||
.getConsistsOf();
|
.getConsistsOf();
|
||||||
for (ConsistsOf<? extends Resource, ? extends Facet> c : consistsOfList) {
|
for (ConsistsOf<? extends Resource, ? extends Facet> c : consistsOfList) {
|
||||||
|
|
||||||
if (c.getTarget() instanceof ContainerStateFacet) {
|
if (c.getTarget() instanceof StateFacet) {
|
||||||
containerStateFacet = (ContainerStateFacet) c.getTarget();
|
stateFacet = (StateFacet) c.getTarget();
|
||||||
containerStateFacet = getContainerStateFacet(containerStateFacet);
|
stateFacet = getStateFacet(stateFacet);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,13 +340,12 @@ public class SmartgearResourcesTest extends ContextTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContainerStateFacet getContainerStateFacet(
|
private StateFacet getStateFacet(StateFacet stateFacet) {
|
||||||
ContainerStateFacet containerStateFacet) {
|
if (stateFacet == null) {
|
||||||
if (containerStateFacet == null) {
|
stateFacet = new StateFacetImpl();
|
||||||
containerStateFacet = new ContainerStateFacetImpl();
|
|
||||||
}
|
}
|
||||||
containerStateFacet.setValue("ready");
|
stateFacet.setValue("ready");
|
||||||
return containerStateFacet;
|
return stateFacet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String MESSAGE = "message";
|
public static final String MESSAGE = "message";
|
||||||
|
|
|
@ -46,10 +46,11 @@ import org.gcube.resourcemanagement.model.impl.entities.facets.EventFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.LicenseFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.LicenseFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.MemoryFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.MemoryFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.ServiceStateFacetImpl;
|
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entities.facets.StateFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.resources.EServiceImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.resources.EServiceImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.properties.ValueSchemaImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasPersistentMemoryImpl;
|
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasPersistentMemoryImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasVolatileMemoryImpl;
|
import org.gcube.resourcemanagement.model.impl.relations.consistsof.HasVolatileMemoryImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl;
|
import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl;
|
||||||
|
@ -61,10 +62,11 @@ import org.gcube.resourcemanagement.model.reference.entities.facets.LicenseFacet
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet.MemoryUnit;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet.MemoryUnit;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.ServiceStateFacet;
|
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet;
|
import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entities.facets.StateFacet;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.resources.EService;
|
import org.gcube.resourcemanagement.model.reference.entities.resources.EService;
|
||||||
import org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode;
|
import org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.properties.ValueSchema;
|
||||||
import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasPersistentMemory;
|
import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasPersistentMemory;
|
||||||
import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasVolatileMemory;
|
import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasVolatileMemory;
|
||||||
import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy;
|
import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy;
|
||||||
|
@ -194,12 +196,14 @@ public class BasicTest extends ContextTest {
|
||||||
|
|
||||||
EventFacet eventFacet = new EventFacetImpl();
|
EventFacet eventFacet = new EventFacetImpl();
|
||||||
eventFacet.setDate(Calendar.getInstance().getTime());
|
eventFacet.setDate(Calendar.getInstance().getTime());
|
||||||
eventFacet.setValue("Created");
|
ValueSchema event = new ValueSchemaImpl();
|
||||||
|
event.setValue("Created");
|
||||||
|
eventFacet.setEvent(event);
|
||||||
eService.addFacet(eventFacet);
|
eService.addFacet(eventFacet);
|
||||||
|
|
||||||
ServiceStateFacet serviceStateFacet = new ServiceStateFacetImpl();
|
StateFacet stateFacet = new StateFacetImpl();
|
||||||
serviceStateFacet.setValue("ready");
|
stateFacet.setValue("ready");
|
||||||
eService.addFacet(serviceStateFacet);
|
eService.addFacet(stateFacet);
|
||||||
|
|
||||||
LicenseFacet licenseFacet = new LicenseFacetImpl();
|
LicenseFacet licenseFacet = new LicenseFacetImpl();
|
||||||
licenseFacet.setName("EUPL");
|
licenseFacet.setName("EUPL");
|
||||||
|
|
Loading…
Reference in New Issue