diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/instances/ERManagementTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/instances/ERManagementTest.java index 8a437d1..9c2786a 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/instances/ERManagementTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/instances/ERManagementTest.java @@ -17,6 +17,7 @@ import java.util.UUID; import org.gcube.common.encryption.encrypter.StringEncrypter; import org.gcube.informationsystem.base.reference.IdentifiableElement; import org.gcube.informationsystem.model.impl.properties.EncryptedImpl; +import org.gcube.informationsystem.model.impl.properties.EventImpl; import org.gcube.informationsystem.model.impl.properties.PropagationConstraintImpl; import org.gcube.informationsystem.model.impl.relations.ConsistsOfImpl; import org.gcube.informationsystem.model.reference.ERElement; @@ -24,6 +25,7 @@ import org.gcube.informationsystem.model.reference.ModelElement; import org.gcube.informationsystem.model.reference.entities.Facet; import org.gcube.informationsystem.model.reference.entities.Resource; import org.gcube.informationsystem.model.reference.properties.Encrypted; +import org.gcube.informationsystem.model.reference.properties.Event; import org.gcube.informationsystem.model.reference.properties.Metadata; import org.gcube.informationsystem.model.reference.properties.PropagationConstraint; import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.AddConstraint; @@ -169,8 +171,10 @@ public class ERManagementTest extends ContextTest { eService.addFacet(accessPointFacet); EventFacet eventFacet = new EventFacetImpl(); - eventFacet.setDate(Calendar.getInstance().getTime()); - eventFacet.setEvent("Created"); + Event event = new EventImpl(); + event.setWhen(Calendar.getInstance().getTime()); + event.setWhat("Created"); + eventFacet.setEvent(event); eService.addFacet(eventFacet); StateFacet stateFacet = new StateFacetImpl(); @@ -227,8 +231,10 @@ public class ERManagementTest extends ContextTest { hostingNode.addFacet(hnStateFacet); EventFacet hnEventFacet = new EventFacetImpl(); - hnEventFacet.setDate(Calendar.getInstance().getTime()); - hnEventFacet.setEvent("Created"); + Event event = new EventImpl(); + event.setWhen(Calendar.getInstance().getTime()); + event.setWhat("Created"); + hnEventFacet.setEvent(event); hostingNode.addFacet(hnEventFacet); return hostingNode; diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/instances/SmartgearResourcesTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/instances/SmartgearResourcesTest.java index bdcaade..4516c44 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/instances/SmartgearResourcesTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/instances/SmartgearResourcesTest.java @@ -10,7 +10,6 @@ import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.OperatingSystemMXBean; import java.net.InetAddress; -import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import java.nio.file.FileStore; @@ -33,10 +32,12 @@ import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import javax.management.ReflectionException; +import org.gcube.informationsystem.model.impl.properties.EventImpl; import org.gcube.informationsystem.model.impl.properties.PropagationConstraintImpl; import org.gcube.informationsystem.model.impl.relations.ConsistsOfImpl; import org.gcube.informationsystem.model.reference.entities.Facet; import org.gcube.informationsystem.model.reference.entities.Resource; +import org.gcube.informationsystem.model.reference.properties.Event; import org.gcube.informationsystem.model.reference.properties.PropagationConstraint; import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.RemoveConstraint; import org.gcube.informationsystem.model.reference.relations.ConsistsOf; @@ -52,7 +53,6 @@ import org.gcube.resourcemanagement.model.impl.entities.facets.SimplePropertyFac 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.properties.ValueSchemaImpl; 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.IsIdentifiedByImpl; @@ -65,7 +65,6 @@ import org.gcube.resourcemanagement.model.reference.entities.facets.SimpleProper 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.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.HasVolatileMemory; import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; @@ -159,10 +158,12 @@ public class SmartgearResourcesTest extends ERManagementTest { hostingNode.addFacet(hasPersistentMemory); EventFacet hnEventFacet = new EventFacetImpl(); - hnEventFacet.setDate(Calendar.getInstance().getTime()); - ValueSchema hnEvent = new ValueSchemaImpl(); - hnEvent.setSchema(new URI("Schema")); - hnEventFacet.setEvent("Created"); + Event event = new EventImpl(); + event.setWhen(Calendar.getInstance().getTime()); + event.setWhat("Created"); + hnEventFacet.setEvent(event); + + hostingNode.addFacet(hnEventFacet);