Porting code to redesigned E/R format
This commit is contained in:
parent
79c0c9a0ab
commit
5c3735d669
|
@ -354,7 +354,7 @@ public abstract class ElementManagement<El extends OElement, T extends Type> {
|
|||
UUID resourceUUID = UUID.fromString(jsonNode.get(IdentifiableElement.UUID_PROPERTY).asText());
|
||||
if(resourceUUID.compareTo(uuid) != 0) {
|
||||
String error = String.format(
|
||||
"UUID provided in header (%s) differs from the one (%s) used to identify the %s instance",
|
||||
"UUID provided in the instance (%s) differs from UUID (%s) used to identify the %s instance",
|
||||
resourceUUID.toString(), uuid.toString(), typeName);
|
||||
throw new ResourceRegistryException(error);
|
||||
|
||||
|
@ -1149,9 +1149,9 @@ public abstract class ElementManagement<El extends OElement, T extends Type> {
|
|||
|
||||
TypesCache typesCache = TypesCache.getInstance();
|
||||
@SuppressWarnings("unchecked")
|
||||
CachedType<PropertyType<Property>> headerType = (CachedType<PropertyType<Property>>) typesCache.getCachedType(Metadata.NAME);
|
||||
CachedType<PropertyType<Property>> metadataType = (CachedType<PropertyType<Property>>) typesCache.getCachedType(Metadata.NAME);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
Collection<String> superClasses = headerType.getSuperTypes();
|
||||
Collection<String> superClasses = metadataType.getSuperTypes();
|
||||
ArrayNode arrayNode = objectMapper.valueToTree(superClasses);
|
||||
((ObjectNode) metadataJson).replace(Element.SUPERCLASSES_PROPERTY, arrayNode);
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ public abstract class EntityManagement<E extends Entity, ET extends EntityType>
|
|||
* DO NOT UNCOMMENT
|
||||
* // affectedInstances.put(uuid, serializeSelfOnly());
|
||||
* the instance is added in internalAddToContext() function after
|
||||
* the update of Header metadata i.e. modifiedBy, lastUpdateTime
|
||||
* the update of Metadata i.e. modifiedBy, lastUpdateTime
|
||||
*/
|
||||
if(honourPropagationConstraintsInContextSharing) {
|
||||
Iterable<OEdge> edges = getElement().getEdges(ODirection.OUT);
|
||||
|
@ -439,7 +439,7 @@ public abstract class EntityManagement<E extends Entity, ET extends EntityType>
|
|||
/*
|
||||
* DO NOT UNCOMMENT
|
||||
* the instance is added internalAddToContext() function after
|
||||
* the update of Header metadata i.e. modifiedBy, lastUpdateTime
|
||||
* the update of Metadata i.e. modifiedBy, lastUpdateTime
|
||||
* affectedInstances.put(uuid, serializeSelfOnly());
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ public class ResourceManagement extends EntityManagement<Resource, ResourceType>
|
|||
* DO NOT UNCOMMENT
|
||||
* // affectedInstances.put(uuid, serializeSelfOnly());
|
||||
* the instance is added in internalAddToContext() function after
|
||||
* the update of Header metadata i.e. modifiedBy, lastUpdateTime
|
||||
* the update of Metadata i.e. modifiedBy, lastUpdateTime
|
||||
*/
|
||||
|
||||
if(honourPropagationConstraintsInContextSharing) {
|
||||
|
@ -413,7 +413,7 @@ public class ResourceManagement extends EntityManagement<Resource, ResourceType>
|
|||
/**
|
||||
* The default sanity check is not valid for resources which do not have properties
|
||||
* and instead must be validated in terms of facets.
|
||||
* The Resource Header is managed with dedicated code for all instaces.
|
||||
* The Resource Metadata is managed with dedicated code for all instaces.
|
||||
*/
|
||||
@Override
|
||||
public void sanityCheck() throws SchemaViolationException, ResourceRegistryException {
|
||||
|
|
|
@ -444,7 +444,7 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
|
|||
* DO NOT UNCOMMENT
|
||||
* // affectedInstances.put(uuid, serializeSelfOnly());
|
||||
* the relation instance is added in internalAddToContext() function after
|
||||
* the update of Header metadata i.e. modifiedBy, lastUpdateTime
|
||||
* the update of Metadata i.e. modifiedBy, lastUpdateTime
|
||||
*/
|
||||
|
||||
break;
|
||||
|
@ -461,7 +461,7 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
|
|||
* DO NOT UNCOMMENT
|
||||
* // affectedInstances.put(uuid, serializeSelfOnly());
|
||||
* the relation instance is added in internalAddToContext() function after
|
||||
* the update of Header metadata i.e. modifiedBy, lastUpdateTime
|
||||
* the update of Metadata i.e. modifiedBy, lastUpdateTime
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,13 +54,13 @@ public class BaseRest {
|
|||
|
||||
protected void checkIncludeInstancesContexts() {
|
||||
try {
|
||||
List<String> includeContextsQueryParameterList = uriInfo.getQueryParameters().get(InstancePath.INCLUDE_CONTEXTS_IN_HEADER_QUERY_PARAMETER);
|
||||
List<String> includeContextsQueryParameterList = uriInfo.getQueryParameters().get(InstancePath.INCLUDE_CONTEXTS_QUERY_PARAMETER);
|
||||
if(includeContextsQueryParameterList!=null && includeContextsQueryParameterList.size()>0) {
|
||||
String includeContextsBooleanString = includeContextsQueryParameterList.get(0);
|
||||
boolean includeContexts = Boolean.valueOf(includeContextsBooleanString);
|
||||
boolean i = includeContexts && isRequesterAllowedToRequestInstancesContexts();
|
||||
if(i) {
|
||||
logger.info("The requet to include the contexts in header is allowed.");
|
||||
logger.info("The requet to include the contexts is allowed.");
|
||||
ContextUtility.getIncludeInstanceContexts().set(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,9 +64,9 @@ public class SharingManager {
|
|||
* The the body is the following
|
||||
*
|
||||
* [
|
||||
* {"@class" : "HostingNode", header : { "uuid" : "16032d09-3823-444e-a1ff-a67de4f350a8"}},
|
||||
* {"@class" : "Hosts", header : { "uuid" : "97ab8a6b-6b1b-4868-b8fc-ba48d0439ba9"}},
|
||||
* {"@class" : "EService", header : { "uuid" : "d3b1a29b-aa70-4a5a-be83-361a4209dd3e"}}
|
||||
* {"@class" : "HostingNode", "@uuid" : "16032d09-3823-444e-a1ff-a67de4f350a8" },
|
||||
* {"@class" : "Hosts", "@uuid" : "97ab8a6b-6b1b-4868-b8fc-ba48d0439ba9"},
|
||||
* {"@class" : "EService", "@uuid" : "d3b1a29b-aa70-4a5a-be83-361a4209dd3e"}
|
||||
* ]
|
||||
*
|
||||
*
|
||||
|
|
|
@ -37,20 +37,20 @@ public class MetadataUtility {
|
|||
}
|
||||
|
||||
public static Metadata createMetadata() {
|
||||
MetadataOrient header = new MetadataOrient();
|
||||
MetadataOrient metadata = new MetadataOrient();
|
||||
|
||||
String creator = getUser();
|
||||
header.setCreatedBy(creator);
|
||||
header.setLastUpdateBy(creator);
|
||||
metadata.setCreatedBy(creator);
|
||||
metadata.setLastUpdateBy(creator);
|
||||
|
||||
Date date = Calendar.getInstance().getTime();
|
||||
SimpleDateFormat ft = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
|
||||
logger.trace("Setting Last Update and Creation Time to " + ft.format(date));
|
||||
|
||||
header.setCreationTime(date);
|
||||
header.setLastUpdateTime(date);
|
||||
metadata.setCreationTime(date);
|
||||
metadata.setLastUpdateTime(date);
|
||||
|
||||
return header;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public static Metadata getMetadata(JsonNode jsonNode)
|
||||
|
@ -82,7 +82,7 @@ public class MetadataUtility {
|
|||
return metadataOrient;
|
||||
} catch(Exception e) {
|
||||
throw new ResourceRegistryException(
|
||||
"Unable to recreate Header. " + Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
||||
"Unable to recreate Metadata. " + Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class MetadataUtility {
|
|||
return metadata;
|
||||
}
|
||||
|
||||
public static Metadata getHeader(OElement element) throws ResourceRegistryException {
|
||||
public static Metadata getMetadata(OElement element) throws ResourceRegistryException {
|
||||
return Utility.getPropertyDocument(Metadata.class, element, IdentifiableElement.METADATA_PROPERTY);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.common.authorization.utils.secret.SecretUtility;
|
|||
import org.gcube.common.keycloak.KeycloakClientFactory;
|
||||
import org.gcube.common.keycloak.model.TokenResponse;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.informationsystem.model.reference.properties.Header;
|
||||
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -111,7 +111,7 @@ public class ContextTest {
|
|||
}
|
||||
|
||||
public static String getUser() {
|
||||
String user = Header.UNKNOWN_USER;
|
||||
String user = Metadata.UNKNOWN_USER;
|
||||
try {
|
||||
user = SecretManagerProvider.instance.get().getUser().getUsername();
|
||||
} catch(Exception e) {
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
|||
import org.gcube.informationsystem.contexts.impl.entities.ContextImpl;
|
||||
import org.gcube.informationsystem.contexts.reference.entities.Context;
|
||||
import org.gcube.informationsystem.contexts.reference.relations.IsParentOf;
|
||||
import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
|
||||
import org.gcube.informationsystem.resourceregistry.ContextTest;
|
||||
import org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
|
@ -46,32 +45,32 @@ public class ContextManagementTest extends ContextTest {
|
|||
public static final String CTX_NAME_B = "B";
|
||||
public static final String CTX_NAME_C = "C";
|
||||
|
||||
public static void checkHeader(IdentifiableElement er, UUID uuid, boolean create) {
|
||||
Assert.assertTrue(er.getHeader() != null);
|
||||
Assert.assertTrue(er.getHeader().getUUID() != null);
|
||||
public static void checkUUUIDAndMetadata(IdentifiableElement er, UUID uuid, boolean create) {
|
||||
Assert.assertTrue(er.getMetadata() != null);
|
||||
Assert.assertTrue(er.getUUID() != null);
|
||||
|
||||
if(uuid != null) {
|
||||
Assert.assertTrue(er.getHeader().getUUID().compareTo(uuid) == 0);
|
||||
Assert.assertTrue(er.getUUID().compareTo(uuid) == 0);
|
||||
}
|
||||
|
||||
String user = MetadataUtility.getUser();
|
||||
Assert.assertTrue(er.getHeader().getLastUpdateBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(er.getMetadata().getLastUpdateBy().compareTo(user) == 0);
|
||||
|
||||
if(create) {
|
||||
Assert.assertTrue(er.getHeader().getCreatedBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(er.getHeader().getCreationTime().compareTo(er.getHeader().getLastUpdateTime()) == 0);
|
||||
Assert.assertTrue(er.getMetadata().getCreatedBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(er.getMetadata().getCreationTime().compareTo(er.getMetadata().getLastUpdateTime()) == 0);
|
||||
} else {
|
||||
Assert.assertTrue(er.getHeader().getCreationTime().before(er.getHeader().getLastUpdateTime()));
|
||||
Assert.assertTrue(er.getMetadata().getCreationTime().before(er.getMetadata().getLastUpdateTime()));
|
||||
}
|
||||
}
|
||||
|
||||
protected void assertions(Context pre, Context post, boolean checkParent, boolean create)
|
||||
throws ResourceRegistryException {
|
||||
if(checkParent) {
|
||||
if(pre.getHeader() != null) {
|
||||
checkHeader(post, pre.getHeader().getUUID(), create);
|
||||
if(pre.getMetadata() != null) {
|
||||
checkUUUIDAndMetadata(post, pre.getUUID(), create);
|
||||
} else {
|
||||
checkHeader(post, null, create);
|
||||
checkUUUIDAndMetadata(post, null, create);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +148,7 @@ public class ContextManagementTest extends ContextTest {
|
|||
logger.debug("Created {}", contextString);
|
||||
Context c = ElementMapper.unmarshal(Context.class, contextString);
|
||||
assertions(context, c, true, true);
|
||||
roleUserAssertions(c.getHeader().getUUID(), null, false);
|
||||
roleUserAssertions(c.getUUID(), null, false);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -160,7 +159,7 @@ public class ContextManagementTest extends ContextTest {
|
|||
logger.debug("Updated {}", contextString);
|
||||
Context c = ElementMapper.unmarshal(Context.class, contextString);
|
||||
assertions(context, c, true, false);
|
||||
roleUserAssertions(c.getHeader().getUUID(), null, false);
|
||||
roleUserAssertions(c.getUUID(), null, false);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -181,7 +180,7 @@ public class ContextManagementTest extends ContextTest {
|
|||
}
|
||||
|
||||
protected void delete(Context context) throws ResourceRegistryException {
|
||||
delete(context.getHeader().getUUID());
|
||||
delete(context.getUUID());
|
||||
}
|
||||
|
||||
protected void invalidCreate(Context context) throws ResourceRegistryException, IOException {
|
||||
|
@ -421,7 +420,7 @@ public class ContextManagementTest extends ContextTest {
|
|||
delete(contextA5);
|
||||
} catch(ContextNotFoundException e) {
|
||||
logger.debug("The context with uuid {} was not found. (Was already deleted)",
|
||||
contextA5.getHeader().getUUID());
|
||||
contextA5.getUUID());
|
||||
}
|
||||
|
||||
delete(contextB3);
|
||||
|
@ -436,7 +435,7 @@ public class ContextManagementTest extends ContextTest {
|
|||
// ________A1________
|
||||
|
||||
Context contextC = new ContextImpl(CTX_NAME_C);
|
||||
contextC.setHeader(new HeaderImpl(contextA1.getHeader().getUUID()));
|
||||
contextC.setUUID(contextA1.getUUID());
|
||||
invalidCreate(contextC);
|
||||
|
||||
delete(contextA1);
|
||||
|
@ -481,7 +480,7 @@ public class ContextManagementTest extends ContextTest {
|
|||
Context childContext = child.getTarget();
|
||||
Assert.assertTrue(childContext.getParent().getSource() == context);
|
||||
}
|
||||
roleUserAssertions(context.getHeader().getUUID(), null, false);
|
||||
roleUserAssertions(context.getUUID(), null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -510,11 +509,11 @@ public class ContextManagementTest extends ContextTest {
|
|||
|
||||
List<Context> contextsFromCache = contextCache.getContexts();
|
||||
for(Context c : contextsFromCache) {
|
||||
UUID uuid = c.getHeader().getUUID();
|
||||
UUID uuid = c.getUUID();
|
||||
if(c.getParent()!=null) {
|
||||
IsParentOf isParentOf = c.getParent();
|
||||
Context parentContext = isParentOf.getSource();
|
||||
UUID parentUUID = parentContext.getHeader().getUUID();
|
||||
UUID parentUUID = parentContext.getUUID();
|
||||
Assert.assertTrue(parentContext.getName().compareTo(contextCache.getContextByUUID(parentUUID).getName())==0);
|
||||
List<IsParentOf> children = parentContext.getChildren();
|
||||
boolean found = false;
|
||||
|
@ -525,9 +524,9 @@ public class ContextManagementTest extends ContextTest {
|
|||
}
|
||||
}
|
||||
Assert.assertTrue(found);
|
||||
logger.debug("{} : {} (parent {} : {})", c.getHeader().getUUID(), contextCache.getContextFullNameByUUID(uuid), parentUUID, contextCache.getContextFullNameByUUID(parentUUID));
|
||||
logger.debug("{} : {} (parent {} : {})", c.getUUID(), contextCache.getContextFullNameByUUID(uuid), parentUUID, contextCache.getContextFullNameByUUID(parentUUID));
|
||||
}else {
|
||||
logger.debug("{} : {}", c.getHeader().getUUID(), contextCache.getContextFullNameByUUID(uuid));
|
||||
logger.debug("{} : {}", c.getUUID(), contextCache.getContextFullNameByUUID(uuid));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -535,7 +534,7 @@ public class ContextManagementTest extends ContextTest {
|
|||
logger.debug("Current context : {}", currentContext);
|
||||
|
||||
for(Context c : contexts) {
|
||||
UUID uuid = c.getHeader().getUUID();
|
||||
UUID uuid = c.getUUID();
|
||||
Context context = read(uuid);
|
||||
String fullName = ContextCache.getInstance().getContextFullNameByUUID(uuid);
|
||||
logger.debug("{} - {} : {}", uuid, fullName, context);
|
||||
|
|
|
@ -15,17 +15,17 @@ import java.util.UUID;
|
|||
import org.gcube.common.encryption.encrypter.StringEncrypter;
|
||||
import org.gcube.informationsystem.base.reference.Element;
|
||||
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
||||
import org.gcube.informationsystem.model.impl.properties.EncryptedImpl;
|
||||
import org.gcube.informationsystem.model.impl.properties.PropagationConstraintImpl;
|
||||
import org.gcube.informationsystem.model.impl.properties.VaultImpl;
|
||||
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.Header;
|
||||
import org.gcube.informationsystem.model.reference.properties.Encrypted;
|
||||
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;
|
||||
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.DeleteConstraint;
|
||||
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.RemoveConstraint;
|
||||
import org.gcube.informationsystem.model.reference.properties.Vault;
|
||||
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
||||
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
||||
import org.gcube.informationsystem.resourceregistry.ContextTest;
|
||||
|
@ -218,46 +218,47 @@ public class ERManagementTest extends ContextTest {
|
|||
return hostingNode;
|
||||
}
|
||||
|
||||
public static void checkHeader(IdentifiableElement identifiableElement, IdentifiableElement createdIdentifiableElement) {
|
||||
Header createdHeader = createdIdentifiableElement.getHeader();
|
||||
Assert.assertTrue(createdHeader!=null);
|
||||
|
||||
UUID createdUUID = createdHeader.getUUID();
|
||||
public static void checkUUIDAndMetadata(IdentifiableElement identifiableElement, IdentifiableElement createdIdentifiableElement) {
|
||||
UUID createdUUID = createdIdentifiableElement.getUUID();
|
||||
Assert.assertTrue(createdUUID!=null);
|
||||
|
||||
String createdBy = createdHeader.getCreatedBy();
|
||||
if(identifiableElement.getUUID()!=null) {
|
||||
Assert.assertTrue(createdUUID.compareTo(identifiableElement.getUUID())==0);
|
||||
}
|
||||
|
||||
Metadata createdMetadata = createdIdentifiableElement.getMetadata();
|
||||
Assert.assertTrue(createdMetadata!=null);
|
||||
|
||||
String createdBy = createdMetadata.getCreatedBy();
|
||||
Assert.assertTrue(createdBy!=null);
|
||||
|
||||
String lastUpdateBy = createdHeader.getLastUpdateBy();
|
||||
String lastUpdateBy = createdMetadata.getLastUpdateBy();
|
||||
Assert.assertTrue(lastUpdateBy!=null);
|
||||
|
||||
Date creationTime = createdHeader.getCreationTime();
|
||||
Date creationTime = createdMetadata.getCreationTime();
|
||||
Assert.assertTrue(creationTime!=null);
|
||||
|
||||
Date lastUpdateTime = createdHeader.getLastUpdateTime();
|
||||
Date lastUpdateTime = createdMetadata.getLastUpdateTime();
|
||||
Assert.assertTrue(lastUpdateTime!=null);
|
||||
Assert.assertTrue(lastUpdateTime.equals(creationTime) || lastUpdateTime.equals(lastUpdateTime));
|
||||
|
||||
Header header = identifiableElement.getHeader();
|
||||
if(header!=null) {
|
||||
if(header.getUUID()!=null) {
|
||||
Assert.assertTrue(createdUUID.compareTo(header.getUUID())==0);
|
||||
}
|
||||
Metadata metadata = identifiableElement.getMetadata();
|
||||
if(metadata!=null) {
|
||||
|
||||
if(header.getCreatedBy()!=null) {
|
||||
Assert.assertTrue(createdBy.compareTo(header.getCreatedBy())==0);
|
||||
if(metadata.getCreatedBy()!=null) {
|
||||
Assert.assertTrue(createdBy.compareTo(metadata.getCreatedBy())==0);
|
||||
}else {
|
||||
Assert.assertTrue(createdBy.compareTo(MetadataUtility.getUser())==0);
|
||||
}
|
||||
|
||||
if(header.getLastUpdateBy()!=null) {
|
||||
Assert.assertTrue(lastUpdateBy.compareTo(header.getLastUpdateBy())==0);
|
||||
if(metadata.getLastUpdateBy()!=null) {
|
||||
Assert.assertTrue(lastUpdateBy.compareTo(metadata.getLastUpdateBy())==0);
|
||||
}else {
|
||||
Assert.assertTrue(lastUpdateBy.compareTo(MetadataUtility.getUser())==0);
|
||||
}
|
||||
|
||||
if(header.getLastUpdateTime()!=null) {
|
||||
Assert.assertTrue(lastUpdateTime.after(header.getLastUpdateTime()));
|
||||
if(metadata.getLastUpdateTime()!=null) {
|
||||
Assert.assertTrue(lastUpdateTime.after(metadata.getLastUpdateTime()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,7 +270,7 @@ public class ERManagementTest extends ContextTest {
|
|||
}
|
||||
|
||||
public static void checkConsistOf(ConsistsOf<? extends Resource, ? extends Facet> consistsOf, ConsistsOf<? extends Resource, ? extends Facet> gotConsistsOf) {
|
||||
checkHeader(consistsOf, gotConsistsOf);
|
||||
checkUUIDAndMetadata(consistsOf, gotConsistsOf);
|
||||
|
||||
if(consistsOf.getPropagationConstraint()==null) {
|
||||
PropagationConstraint propagationConstraint = gotConsistsOf.getPropagationConstraint();
|
||||
|
@ -295,7 +296,7 @@ public class ERManagementTest extends ContextTest {
|
|||
}
|
||||
|
||||
public static void checkFacet(Facet facet, Facet gotFacet) throws Exception {
|
||||
checkHeader(facet, gotFacet);
|
||||
checkUUIDAndMetadata(facet, gotFacet);
|
||||
Class<? extends Facet> clz = facet.getClass();
|
||||
Class<? extends Facet> gotClz = gotFacet.getClass();
|
||||
Assert.assertTrue(clz==gotClz);
|
||||
|
@ -307,7 +308,7 @@ public class ERManagementTest extends ContextTest {
|
|||
|
||||
protected static <R extends Resource> void checkResource(R resource, R gotResource) throws Exception {
|
||||
Assert.assertTrue(resource.getClass() == gotResource.getClass());
|
||||
checkHeader(resource, gotResource);
|
||||
checkUUIDAndMetadata(resource, gotResource);
|
||||
|
||||
List<ConsistsOf<? extends Resource, ? extends Facet>> resourceConsistsOf = resource.getConsistsOf();
|
||||
List<ConsistsOf<? extends Resource, ? extends Facet>> gotResourceConsistsOf = gotResource.getConsistsOf();
|
||||
|
@ -329,8 +330,8 @@ public class ERManagementTest extends ContextTest {
|
|||
ResourceManagement resourceManagement = new ResourceManagement();
|
||||
resourceManagement.setElementType(Utility.getTypeName(r));
|
||||
resourceManagement.setJson(ElementMapper.marshal(r));
|
||||
if(r.getHeader()!=null && r.getHeader().getUUID()!=null) {
|
||||
resourceManagement.setUUID(r.getHeader().getUUID());
|
||||
if(r.getUUID()!=null) {
|
||||
resourceManagement.setUUID(r.getUUID());
|
||||
}
|
||||
return resourceManagement;
|
||||
}
|
||||
|
@ -339,8 +340,8 @@ public class ERManagementTest extends ContextTest {
|
|||
IsRelatedToManagement isRelatedToManagement = new IsRelatedToManagement();
|
||||
isRelatedToManagement.setElementType(Utility.getTypeName(isRelatedTo));
|
||||
isRelatedToManagement.setJson(ElementMapper.marshal(isRelatedTo));
|
||||
if(isRelatedTo.getHeader()!=null && isRelatedTo.getHeader().getUUID()!=null) {
|
||||
isRelatedToManagement.setUUID(isRelatedTo.getHeader().getUUID());
|
||||
if(isRelatedTo.getUUID()!=null) {
|
||||
isRelatedToManagement.setUUID(isRelatedTo.getUUID());
|
||||
}
|
||||
return isRelatedToManagement;
|
||||
}
|
||||
|
@ -484,7 +485,7 @@ public class ERManagementTest extends ContextTest {
|
|||
Assert.assertTrue(cpuFacet.getModel().compareTo(createdCpuFacet.getModel()) == 0);
|
||||
Assert.assertTrue(cpuFacet.getVendor().compareTo(createdCpuFacet.getVendor()) == 0);
|
||||
|
||||
UUID uuid = createdCpuFacet.getHeader().getUUID();
|
||||
UUID uuid = createdCpuFacet.getUUID();
|
||||
|
||||
FacetManagement facetManagement = new FacetManagement();
|
||||
facetManagement.setElementType(Utility.getTypeName(createdCpuFacet));
|
||||
|
@ -496,7 +497,7 @@ public class ERManagementTest extends ContextTest {
|
|||
Assert.assertTrue(cpuFacet.getClockSpeed().compareTo(readCpuFacet.getClockSpeed()) == 0);
|
||||
Assert.assertTrue(cpuFacet.getModel().compareTo(readCpuFacet.getModel()) == 0);
|
||||
Assert.assertTrue(cpuFacet.getVendor().compareTo(readCpuFacet.getVendor()) == 0);
|
||||
Assert.assertTrue(uuid.compareTo(readCpuFacet.getHeader().getUUID()) == 0);
|
||||
Assert.assertTrue(uuid.compareTo(readCpuFacet.getUUID()) == 0);
|
||||
|
||||
String newVendor = "Intel";
|
||||
String newClockSpeed = "2 GHz";
|
||||
|
@ -520,9 +521,9 @@ public class ERManagementTest extends ContextTest {
|
|||
Assert.assertTrue(updatedCpuFacet.getVendor().compareTo(newVendor) == 0);
|
||||
Assert.assertTrue(((String) updatedCpuFacet.getAdditionalProperty(additionPropertyKey))
|
||||
.compareTo((String) readCpuFacet.getAdditionalProperty(additionPropertyKey)) == 0);
|
||||
Assert.assertTrue(uuid.compareTo(updatedCpuFacet.getHeader().getUUID()) == 0);
|
||||
Assert.assertTrue(uuid.compareTo(updatedCpuFacet.getUUID()) == 0);
|
||||
String user = ContextTest.getUser();
|
||||
Assert.assertTrue(updatedCpuFacet.getHeader().getLastUpdateBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(updatedCpuFacet.getMetadata().getLastUpdateBy().compareTo(user) == 0);
|
||||
|
||||
facetManagement = new FacetManagement();
|
||||
facetManagement.setElementType(Utility.getTypeName(updatedCpuFacet));
|
||||
|
@ -536,7 +537,7 @@ public class ERManagementTest extends ContextTest {
|
|||
Assert.assertTrue(updatedCpuFacet.getVendor().compareTo(readUpdatedCpuFacet.getVendor()) == 0);
|
||||
Assert.assertTrue(((String) updatedCpuFacet.getAdditionalProperty(additionPropertyKey))
|
||||
.compareTo((String) readUpdatedCpuFacet.getAdditionalProperty(additionPropertyKey)) == 0);
|
||||
Assert.assertTrue(uuid.compareTo(updatedCpuFacet.getHeader().getUUID()) == 0);
|
||||
Assert.assertTrue(uuid.compareTo(updatedCpuFacet.getUUID()) == 0);
|
||||
|
||||
facetManagement = new FacetManagement();
|
||||
facetManagement.setElementType(Utility.getTypeName(readCpuFacet));
|
||||
|
@ -570,12 +571,12 @@ public class ERManagementTest extends ContextTest {
|
|||
String additionlaPropertyValue = "MyTest";
|
||||
accessPointFacet.setAdditionalProperty(additionlaPropertyKey, additionlaPropertyValue);
|
||||
|
||||
Vault vault = new VaultImpl();
|
||||
Encrypted encrypted = new EncryptedImpl();
|
||||
String plainValue = "Encrypted";
|
||||
String encryptedValue = StringEncrypter.getEncrypter().encrypt(plainValue);
|
||||
vault.setValue(encryptedValue);
|
||||
encrypted.setValue(encryptedValue);
|
||||
String encryptedKey = "Enc";
|
||||
accessPointFacet.setAdditionalProperty(encryptedKey, vault);
|
||||
accessPointFacet.setAdditionalProperty(encryptedKey, encrypted);
|
||||
|
||||
configuration.addFacet(accessPointFacet);
|
||||
|
||||
|
@ -587,9 +588,9 @@ public class ERManagementTest extends ContextTest {
|
|||
AccessPointFacet apf = configuration.getFacets(AccessPointFacet.class).get(0);
|
||||
|
||||
Assert.assertTrue(apf.getAuthorization() instanceof ValueSchema);
|
||||
Assert.assertTrue(apf.getAdditionalProperty(encryptedKey) instanceof Vault);
|
||||
Vault vlt = (Vault) apf.getAdditionalProperty(encryptedKey);
|
||||
String encValue = vlt.getValue();
|
||||
Assert.assertTrue(apf.getAdditionalProperty(encryptedKey) instanceof Encrypted);
|
||||
Encrypted enc = (Encrypted) apf.getAdditionalProperty(encryptedKey);
|
||||
String encValue = enc.getValue();
|
||||
Assert.assertTrue(encValue.compareTo(encryptedValue) == 0);
|
||||
String decryptedValue = StringEncrypter.getEncrypter().decrypt(encValue);
|
||||
Assert.assertTrue(decryptedValue.compareTo(plainValue) == 0);
|
||||
|
@ -636,7 +637,7 @@ public class ERManagementTest extends ContextTest {
|
|||
// EService eService = ElementMapper.unmarshal(EService.class, fileInputStream);
|
||||
//
|
||||
// ResourceManagement resourceManagement = new ResourceManagement();
|
||||
// resourceManagement.setUUID(eService.getHeader().getUUID());
|
||||
// resourceManagement.setUUID(eService.getUUID());
|
||||
// resourceManagement.setJson(ElementMapper.marshal(eService));
|
||||
//
|
||||
// resourceManagement.update();
|
||||
|
|
|
@ -3,8 +3,8 @@ package org.gcube.informationsystem.resourceregistry.instances;
|
|||
import java.security.Key;
|
||||
|
||||
import org.gcube.common.encryption.encrypter.StringEncrypter;
|
||||
import org.gcube.informationsystem.model.impl.properties.VaultImpl;
|
||||
import org.gcube.informationsystem.model.reference.properties.Vault;
|
||||
import org.gcube.informationsystem.model.impl.properties.EncryptedImpl;
|
||||
import org.gcube.informationsystem.model.reference.properties.Encrypted;
|
||||
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
||||
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
|
||||
import org.gcube.informationsystem.serialization.ElementMapper;
|
||||
|
@ -30,11 +30,11 @@ public class EncryptionTest extends ERManagementTest {
|
|||
@Test
|
||||
public void test() throws Exception {
|
||||
|
||||
Vault vault = new VaultImpl();
|
||||
Encrypted encrypted = new EncryptedImpl();
|
||||
String contextEncryptedValue = StringEncrypter.getEncrypter().encrypt(PLAIN_VALUE);
|
||||
vault.setValue(contextEncryptedValue);
|
||||
encrypted.setValue(contextEncryptedValue);
|
||||
|
||||
String getContextEncryptedValue = vault.getValue();
|
||||
String getContextEncryptedValue = encrypted.getValue();
|
||||
Assert.assertTrue(getContextEncryptedValue.compareTo(getContextEncryptedValue)==0);
|
||||
|
||||
|
||||
|
@ -47,9 +47,9 @@ public class EncryptionTest extends ERManagementTest {
|
|||
String dbEncryptedValue = StringEncrypter.getEncrypter().encrypt(decryptedValue, databaseKey);
|
||||
|
||||
// Setting the value encrypted with DB key
|
||||
vault.setValue(dbEncryptedValue);
|
||||
encrypted.setValue(dbEncryptedValue);
|
||||
|
||||
String getDBEncryptedValue = vault.getValue();
|
||||
String getDBEncryptedValue = encrypted.getValue();
|
||||
Assert.assertTrue(getDBEncryptedValue.compareTo(dbEncryptedValue)==0);
|
||||
|
||||
decryptedValue = StringEncrypter.getEncrypter().decrypt(getDBEncryptedValue, databaseKey);
|
||||
|
@ -69,11 +69,11 @@ public class EncryptionTest extends ERManagementTest {
|
|||
cpuFacet.setClockSpeed("1 GHz");
|
||||
cpuFacet.setModel("Opteron");
|
||||
cpuFacet.setVendor("AMD");
|
||||
Vault vault = new VaultImpl();
|
||||
Encrypted encrypted = new EncryptedImpl();
|
||||
String encryptedValue = StringEncrypter.getEncrypter().encrypt(PLAIN_VALUE);
|
||||
vault.setValue(encryptedValue);
|
||||
encrypted.setValue(encryptedValue);
|
||||
String additionalKey = "test";
|
||||
cpuFacet.setAdditionalProperty(additionalKey, vault);
|
||||
cpuFacet.setAdditionalProperty(additionalKey, encrypted);
|
||||
configuration.addFacet(cpuFacet);
|
||||
|
||||
ResourceManagement resourceManagement = new ResourceManagement();
|
||||
|
@ -86,7 +86,7 @@ public class EncryptionTest extends ERManagementTest {
|
|||
Configuration createdConfiguration = ElementMapper.unmarshal(Configuration.class, configurationJsonString);
|
||||
|
||||
CPUFacet readCpuFacet = createdConfiguration.getFacets(CPUFacet.class).get(0);
|
||||
String gotEncryptedValue = ((Vault) readCpuFacet.getAdditionalProperty(additionalKey)).getValue();
|
||||
String gotEncryptedValue = ((Encrypted) readCpuFacet.getAdditionalProperty(additionalKey)).getValue();
|
||||
Assert.assertTrue(gotEncryptedValue.compareTo(encryptedValue) == 0);
|
||||
String gotPlainValue = StringEncrypter.getEncrypter().decrypt(gotEncryptedValue);
|
||||
Assert.assertTrue(gotPlainValue.compareTo(PLAIN_VALUE) == 0);
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.gcube.informationsystem.resourceregistry.instances;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
|
||||
import org.gcube.informationsystem.model.impl.relations.ConsistsOfImpl;
|
||||
import org.gcube.informationsystem.model.reference.entities.Facet;
|
||||
import org.gcube.informationsystem.model.reference.entities.Resource;
|
||||
|
@ -43,7 +42,7 @@ public class InvalidOperationTest extends ERManagementTest {
|
|||
private static Logger logger = LoggerFactory.getLogger(InvalidOperationTest.class);
|
||||
|
||||
public static final String ACTIVATES = "{\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"add\":\"propagate\",\"remove\":\"cascade\"},\"@class\":\"Activates\",\"source\":{\"header\":{\"@class\":\"Header\",\"uuid\":\"CONFIGURATION_UUID\"},\"@class\":\"Configuration\"},\"target\":{\"header\":{\"@class\":\"Header\",\"uuid\":\"ESERVICE_UUID\"},\"@class\":\"EService\"}}";
|
||||
public static final String ACTOR = "{\"@class\":\"Actor\",\"header\":null,\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"remove\":\"cascadeWhenOrphan\",\"add\":\"propagate\"},\"source\":{\"@class\":\"Actor\",\"header\":null},\"target\":{\"@class\":\"ContactFacet\",\"header\":null,\"title\":\"Dr.\",\"name\":\"Frosini\",\"middleName\":null,\"surname\":null,\"eMail\":\"luca.frosini@isti.cnr.it\"}}],\"isRelatedTo\":[]}";
|
||||
public static final String ACTOR = "{\"@class\":\"Actor\",\"@metadata\":null,\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"@metadata\":null,\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"remove\":\"cascadeWhenOrphan\",\"add\":\"propagate\"},\"source\":{\"@class\":\"Actor\",\"header\":null},\"target\":{\"@class\":\"ContactFacet\",\"header\":null,\"title\":\"Dr.\",\"name\":\"Frosini\",\"middleName\":null,\"surname\":null,\"eMail\":\"luca.frosini@isti.cnr.it\"}}],\"isRelatedTo\":[]}";
|
||||
|
||||
@Test(expected = SchemaViolationException.class)
|
||||
public void createInvalidIsRealtedTo() throws Exception {
|
||||
|
@ -62,8 +61,8 @@ public class InvalidOperationTest extends ERManagementTest {
|
|||
*/
|
||||
IsRelatedToManagement isRelatedToManagement = new IsRelatedToManagement();
|
||||
isRelatedToManagement.setElementType(Activates.NAME);
|
||||
String json = ACTIVATES.replace("CONFIGURATION_UUID", configuration.getHeader().getUUID().toString());
|
||||
json = json.replace("ESERVICE_UUID", eService.getHeader().getUUID().toString());
|
||||
String json = ACTIVATES.replace("CONFIGURATION_UUID", configuration.getUUID().toString());
|
||||
json = json.replace("ESERVICE_UUID", eService.getUUID().toString());
|
||||
isRelatedToManagement.setJson(json);
|
||||
isRelatedToManagement.create();
|
||||
}finally {
|
||||
|
@ -168,7 +167,7 @@ public class InvalidOperationTest extends ERManagementTest {
|
|||
|
||||
ConsistsOfManagement consistsOfManagement = new ConsistsOfManagement();
|
||||
consistsOfManagement.setElementType(Utility.getTypeName(isIdentifiedBy));
|
||||
consistsOfManagement.setUUID(isIdentifiedBy.getHeader().getUUID());
|
||||
consistsOfManagement.setUUID(isIdentifiedBy.getUUID());
|
||||
consistsOfManagement.delete();
|
||||
}finally {
|
||||
ERManagementTest.deleteResource(eService);
|
||||
|
@ -183,12 +182,12 @@ public class InvalidOperationTest extends ERManagementTest {
|
|||
IsIdentifiedBy<EService, SoftwareFacet> isIdentifiedBy = (IsIdentifiedBy<EService, SoftwareFacet>) eService.getConsistsOf(IsIdentifiedBy.class).get(0);
|
||||
ConsistsOfManagement consistsOfManagement = new ConsistsOfManagement();
|
||||
consistsOfManagement.setElementType(IsIdentifiedBy.NAME);
|
||||
consistsOfManagement.setUUID(isIdentifiedBy.getHeader().getUUID());
|
||||
consistsOfManagement.setUUID(isIdentifiedBy.getUUID());
|
||||
|
||||
SoftwareFacet softwareFacet = isIdentifiedBy.getTarget();
|
||||
FacetManagement facetManagement = new FacetManagement();
|
||||
facetManagement.setElementType(SoftwareFacet.NAME);
|
||||
facetManagement.setUUID(softwareFacet.getHeader().getUUID());
|
||||
facetManagement.setUUID(softwareFacet.getUUID());
|
||||
|
||||
try {
|
||||
facetManagement.delete();
|
||||
|
@ -202,14 +201,14 @@ public class InvalidOperationTest extends ERManagementTest {
|
|||
public void testCreateConsistsOfBeetweenResources() throws Exception {
|
||||
Map<String, Resource> map = ERManagementTest.createHostingNodeAndEService();
|
||||
|
||||
UUID hostingNodeUUID = map.get(HostingNode.NAME).getHeader().getUUID();
|
||||
UUID eServiceUUID = map.get(EService.NAME).getHeader().getUUID();
|
||||
UUID hostingNodeUUID = map.get(HostingNode.NAME).getUUID();
|
||||
UUID eServiceUUID = map.get(EService.NAME).getUUID();
|
||||
|
||||
HostingNode hostingNode = new HostingNodeImpl();
|
||||
hostingNode.setHeader(new HeaderImpl(hostingNodeUUID));
|
||||
hostingNode.setUUID(hostingNodeUUID);
|
||||
|
||||
SimpleFacet fakeEServiceAsSimpleFacet = new SimpleFacetImpl();
|
||||
fakeEServiceAsSimpleFacet.setHeader(new HeaderImpl(eServiceUUID));
|
||||
fakeEServiceAsSimpleFacet.setUUID(eServiceUUID);
|
||||
|
||||
ConsistsOf<HostingNode, SimpleFacet> consistsOf = new ConsistsOfImpl<HostingNode, SimpleFacet>(hostingNode, fakeEServiceAsSimpleFacet);
|
||||
|
||||
|
|
|
@ -33,18 +33,17 @@ import javax.management.MalformedObjectNameException;
|
|||
import javax.management.ObjectName;
|
||||
import javax.management.ReflectionException;
|
||||
|
||||
import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
|
||||
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.Header;
|
||||
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;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
|
||||
import org.gcube.informationsystem.serialization.ElementMapper;
|
||||
import org.gcube.informationsystem.utils.UUIDManager;
|
||||
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.MemoryFacetImpl;
|
||||
|
@ -91,11 +90,10 @@ public class SmartgearResourcesTest extends ERManagementTest {
|
|||
@Test
|
||||
public void testHostingNodeOperations() throws ResourceRegistryException,
|
||||
IOException, URISyntaxException {
|
||||
UUID uuid = UUID.randomUUID();
|
||||
UUID uuid = UUIDManager.getInstance().generateValidRandomUUID();
|
||||
|
||||
HostingNode hostingNode = new HostingNodeImpl();
|
||||
Header header = new HeaderImpl(uuid);
|
||||
hostingNode.setHeader(header);
|
||||
hostingNode.setUUID(uuid);
|
||||
|
||||
NetworkingFacet networkingFacet = new NetworkingFacetImpl();
|
||||
try {
|
||||
|
|
|
@ -6,9 +6,8 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
|
||||
import org.gcube.informationsystem.model.impl.properties.PropagationConstraintImpl;
|
||||
import org.gcube.informationsystem.model.reference.properties.Header;
|
||||
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;
|
||||
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.RemoveConstraint;
|
||||
|
@ -60,7 +59,7 @@ public class AddToContextTest extends MultiContextTest {
|
|||
IsIdentifiedBy<EService, SoftwareFacet> isIdentifiedBy = (IsIdentifiedBy<EService, SoftwareFacet>) eService.getConsistsOf(IsIdentifiedBy.class).get(0);
|
||||
ConsistsOfManagement consistsOfManagement = new ConsistsOfManagement();
|
||||
consistsOfManagement.setElementType(IsIdentifiedBy.NAME);
|
||||
consistsOfManagement.setUUID(isIdentifiedBy.getHeader().getUUID());
|
||||
consistsOfManagement.setUUID(isIdentifiedBy.getUUID());
|
||||
|
||||
try {
|
||||
consistsOfManagement.removeFromContext(ContextUtility.getCurrentSecurityContext().getUUID());
|
||||
|
@ -75,7 +74,7 @@ public class AddToContextTest extends MultiContextTest {
|
|||
SoftwareFacet softwareFacet = isIdentifiedBy.getTarget();
|
||||
FacetManagement facetManagement = new FacetManagement();
|
||||
facetManagement.setElementType(SoftwareFacet.NAME);
|
||||
facetManagement.setUUID(softwareFacet.getHeader().getUUID());
|
||||
facetManagement.setUUID(softwareFacet.getUUID());
|
||||
|
||||
try {
|
||||
facetManagement.removeFromContext(ContextUtility.getCurrentSecurityContext().getUUID());
|
||||
|
@ -93,7 +92,7 @@ public class AddToContextTest extends MultiContextTest {
|
|||
|
||||
protected Dataset createDataset(String id, String uuidString) throws Exception {
|
||||
Dataset dataset = new DatasetImpl();
|
||||
dataset.setHeader(new HeaderImpl(UUID.fromString(uuidString)));
|
||||
dataset.setUUID(UUID.fromString(uuidString));
|
||||
|
||||
IdentifierFacet identifierFacet = new IdentifierFacetImpl();
|
||||
identifierFacet.setValue(id);
|
||||
|
@ -139,7 +138,7 @@ public class AddToContextTest extends MultiContextTest {
|
|||
protected IsCorrelatedTo<Dataset, Dataset> createIsCorrelatedTo(Dataset source, Dataset target, String uuid) throws Exception {
|
||||
PropagationConstraint propagationConstraint = getPropagationConstraint();
|
||||
IsCorrelatedTo<Dataset, Dataset> isCorrelatedTo = new IsCorrelatedToImpl<Dataset, Dataset>(source, target, propagationConstraint);
|
||||
isCorrelatedTo.setHeader(new HeaderImpl(UUID.fromString(uuid)));
|
||||
isCorrelatedTo.setUUID(UUID.fromString(uuid));
|
||||
|
||||
IsRelatedToManagement isRelatedToManagement = getIsRelatedToManagement(isCorrelatedTo);
|
||||
String json = isRelatedToManagement.create();
|
||||
|
@ -160,9 +159,9 @@ public class AddToContextTest extends MultiContextTest {
|
|||
Dataset r1 = ElementMapper.unmarshal(Dataset.class, json);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String,String> contextsR1 = (Map<String, String>) r1.getHeader().getAdditionalProperty(Header.__CONTEXTS);
|
||||
Map<String,String> contextsR1 = (Map<String, String>) r1.getMetadata().getAdditionalProperty(Metadata.__CONTEXTS);
|
||||
Set<String> contextsR1Fullname = new HashSet<>(contextsR1.values());
|
||||
logger.info("Contexts of {} with UUID {} and Id {} are {}", Dataset.NAME, r1.getHeader().getUUID(), ((IdentifierFacet)r1.getIdentificationFacets().get(0)).getValue(), contextsR1Fullname);
|
||||
logger.info("Contexts of {} with UUID {} and Id {} are {}", Dataset.NAME, r1.getUUID(), ((IdentifierFacet)r1.getIdentificationFacets().get(0)).getValue(), contextsR1Fullname);
|
||||
Assert.assertTrue(contextsR1.size()==expectedContextSize);
|
||||
|
||||
ContextUtility.getHierarchicalMode().set(false);
|
||||
|
@ -308,8 +307,7 @@ public class AddToContextTest extends MultiContextTest {
|
|||
// public void testAddToContext() throws Exception {
|
||||
// ContextCache contextCache = ContextCache.getInstance();
|
||||
// HostingNode hostingNode = new HostingNodeImpl();
|
||||
// Header header = new HeaderImpl(UUID.fromString("a87bb07e-5320-4fd8-a48d-bf3cc55756c4"));
|
||||
// hostingNode.setHeader(header);
|
||||
// hostingNode.setUUID(UUID.fromString("a87bb07e-5320-4fd8-a48d-bf3cc55756c4"));
|
||||
// ResourceManagement resourceManagement = ERManagementTest.getResourceManagement(hostingNode);
|
||||
// resourceManagement.setDryRun(false);
|
||||
// UUID contextUUID = ContextUtility.getInstance().getSecurityContextByFullName("/gcube/devsec").getUUID();
|
||||
|
|
|
@ -57,7 +57,7 @@ public class BasicTest extends MultiContextTest {
|
|||
logger.debug("Created : {}", json);
|
||||
|
||||
CPUFacet createdCPUFacet = ElementMapper.unmarshal(CPUFacet.class, json);
|
||||
UUID uuid = createdCPUFacet.getHeader().getUUID();
|
||||
UUID uuid = createdCPUFacet.getUUID();
|
||||
|
||||
facetManagement = new FacetManagement();
|
||||
facetManagement.setUUID(uuid);
|
||||
|
@ -151,21 +151,21 @@ public class BasicTest extends MultiContextTest {
|
|||
EService eService = ERManagementTest.createEService();
|
||||
|
||||
Map<UUID, IdentifiableElement> eServiceInstances = new HashMap<>();
|
||||
eServiceInstances.put(eService.getHeader().getUUID(), eService);
|
||||
eServiceInstances.put(eService.getUUID(), eService);
|
||||
for(ConsistsOf<?,?> consistsOf : eService.getConsistsOf()) {
|
||||
eServiceInstances.put(consistsOf.getHeader().getUUID(), consistsOf);
|
||||
eServiceInstances.put(consistsOf.getTarget().getHeader().getUUID(), consistsOf.getTarget());
|
||||
eServiceInstances.put(consistsOf.getUUID(), consistsOf);
|
||||
eServiceInstances.put(consistsOf.getTarget().getUUID(), consistsOf.getTarget());
|
||||
}
|
||||
|
||||
HostingNode hostingNode = ERManagementTest.createHostingNode(eService);
|
||||
UUID hostingNodeUUID = hostingNode.getHeader().getUUID();
|
||||
UUID hostingNodeUUID = hostingNode.getUUID();
|
||||
|
||||
Map<UUID, IdentifiableElement> hostingNodeInstances = new HashMap<>();
|
||||
hostingNodeInstances.put(hostingNodeUUID, hostingNode);
|
||||
|
||||
for(ConsistsOf<?,?> consistsOf : hostingNode.getConsistsOf()) {
|
||||
hostingNodeInstances.put(consistsOf.getHeader().getUUID(), consistsOf);
|
||||
hostingNodeInstances.put(consistsOf.getTarget().getHeader().getUUID(), consistsOf.getTarget());
|
||||
hostingNodeInstances.put(consistsOf.getUUID(), consistsOf);
|
||||
hostingNodeInstances.put(consistsOf.getTarget().getUUID(), consistsOf.getTarget());
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
@ -236,7 +236,7 @@ public class BasicTest extends MultiContextTest {
|
|||
ResourceManagement resourceManagement = ERManagementTest.getResourceManagement(hostingNode);
|
||||
try {
|
||||
resourceManagement.read();
|
||||
String error = String.format("{} with UUID {} should not be visible.", HostingNode.NAME, hostingNode.getHeader().getUUID());
|
||||
String error = String.format("{} with UUID {} should not be visible.", HostingNode.NAME, hostingNode.getUUID());
|
||||
logger.trace(error);
|
||||
throw new Exception(error);
|
||||
}catch (ResourceAvailableInAnotherContextException e) {
|
||||
|
@ -246,7 +246,7 @@ public class BasicTest extends MultiContextTest {
|
|||
isRelatedToManagement = ERManagementTest.getIsRelatedToManagement(activates);
|
||||
try {
|
||||
isRelatedToManagement.read();
|
||||
String error = String.format("{} with UUID {} should not be visible.", Activates.NAME, activates.getHeader().getUUID());
|
||||
String error = String.format("{} with UUID {} should not be visible.", Activates.NAME, activates.getUUID());
|
||||
logger.trace(error);
|
||||
throw new Exception(error);
|
||||
}catch (RelationAvailableInAnotherContextException e) {
|
||||
|
@ -256,7 +256,7 @@ public class BasicTest extends MultiContextTest {
|
|||
resourceManagement = ERManagementTest.getResourceManagement(eService);
|
||||
try {
|
||||
resourceManagement.read();
|
||||
String error = String.format("{} with UUID {} should not be visible.", EService.NAME, eService.getHeader().getUUID());
|
||||
String error = String.format("{} with UUID {} should not be visible.", EService.NAME, eService.getUUID());
|
||||
logger.trace(error);
|
||||
throw new Exception(error);
|
||||
}catch (ResourceAvailableInAnotherContextException e) {
|
||||
|
@ -287,7 +287,7 @@ public class BasicTest extends MultiContextTest {
|
|||
|
||||
try {
|
||||
resourceManagement.read();
|
||||
String error = String.format("{} with UUID {} should not be found.", HostingNode.NAME, hostingNode.getHeader().getUUID());
|
||||
String error = String.format("{} with UUID {} should not be found.", HostingNode.NAME, hostingNode.getUUID());
|
||||
logger.trace(error);
|
||||
throw new Exception(error);
|
||||
}catch (ResourceNotFoundException e) {
|
||||
|
@ -297,7 +297,7 @@ public class BasicTest extends MultiContextTest {
|
|||
IsRelatedToManagement isRelatedToManagement = ERManagementTest.getIsRelatedToManagement(activates);
|
||||
try {
|
||||
isRelatedToManagement.read();
|
||||
String error = String.format("{} with UUID {} should not be found.", Activates.NAME, activates.getHeader().getUUID());
|
||||
String error = String.format("{} with UUID {} should not be found.", Activates.NAME, activates.getUUID());
|
||||
logger.trace(error);
|
||||
throw new Exception(error);
|
||||
}catch (IsRelatedToNotFoundException e) {
|
||||
|
@ -307,7 +307,7 @@ public class BasicTest extends MultiContextTest {
|
|||
resourceManagement = ERManagementTest.getResourceManagement(eService);
|
||||
try {
|
||||
resourceManagement.read();
|
||||
String error = String.format("{} with UUID {} should not be found.", EService.NAME, eService.getHeader().getUUID());
|
||||
String error = String.format("{} with UUID {} should not be found.", EService.NAME, eService.getUUID());
|
||||
logger.trace(error);
|
||||
throw new Exception(error);
|
||||
}catch (ResourceNotFoundException e) {
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ComplexTest extends MultiContextTest {
|
|||
|
||||
for(Facet facet : hostingNode.getFacets()) {
|
||||
FacetManagement facetManagement = new FacetManagement();
|
||||
facetManagement.setUUID(facet.getHeader().getUUID());
|
||||
facetManagement.setUUID(facet.getUUID());
|
||||
String typeName = Utility.getTypeName(facet.getClass());
|
||||
facetManagement.setElementType(typeName);
|
||||
String facetContexts = facetManagement.getContexts();
|
||||
|
@ -97,7 +97,7 @@ public class ComplexTest extends MultiContextTest {
|
|||
}
|
||||
|
||||
activatesManagement = new IsRelatedToManagement();
|
||||
activatesManagement.setUUID(createdActivates.getHeader().getUUID());
|
||||
activatesManagement.setUUID(createdActivates.getUUID());
|
||||
activatesManagement.setElementType(Utility.getTypeName(createdActivates.getClass()));
|
||||
String isRelatedToContexts = activatesManagement.getContexts();
|
||||
logger.debug("Contexts of {} with UUID {} have the following UUID {}", Activates.NAME, activatesManagement.getUUID(), isRelatedToContexts);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class MultiContextTest extends ERManagementTest {
|
|||
@SuppressWarnings({ "unchecked", "unused" })
|
||||
private Map<UUID, Element> getRemovedExpectedInstances(Resource r) throws Exception {
|
||||
Map<UUID, Element> expected = new HashMap<>();
|
||||
expected.put(r.getHeader().getUUID(), r);
|
||||
expected.put(r.getUUID(), r);
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
List<IsRelatedTo> list = getOutcomingIsRelatedTo(r);
|
||||
|
@ -50,16 +50,16 @@ public class MultiContextTest extends ERManagementTest {
|
|||
|
||||
for (IsRelatedTo<? extends Resource, ? extends Resource> isRelatedTo : list) {
|
||||
if (isRelatedTo.getPropagationConstraint().getRemoveConstraint() == RemoveConstraint.cascade) {
|
||||
expected.put(isRelatedTo.getHeader().getUUID(), isRelatedTo);
|
||||
expected.put(isRelatedTo.getUUID(), isRelatedTo);
|
||||
expected.putAll(getRemovedExpectedInstances(isRelatedTo.getTarget()));
|
||||
}
|
||||
|
||||
if (isRelatedTo.getPropagationConstraint().getRemoveConstraint() == RemoveConstraint.cascadeWhenOrphan) {
|
||||
expected.put(isRelatedTo.getHeader().getUUID(), isRelatedTo);
|
||||
expected.put(isRelatedTo.getUUID(), isRelatedTo);
|
||||
@SuppressWarnings("rawtypes")
|
||||
List<IsRelatedTo> incoming = getIncomingIsRelatedTo(r);
|
||||
if(incoming.size()==1) {
|
||||
Assert.assertTrue(incoming.get(0).getHeader().getUUID().compareTo(isRelatedTo.getHeader().getUUID())==0);
|
||||
Assert.assertTrue(incoming.get(0).getUUID().compareTo(isRelatedTo.getUUID())==0);
|
||||
expected.putAll(getRemovedExpectedInstances(isRelatedTo.getTarget()));
|
||||
}
|
||||
|
||||
|
@ -69,9 +69,9 @@ public class MultiContextTest extends ERManagementTest {
|
|||
for (ConsistsOf<? extends Resource, ? extends Facet> consistsOf : r.getConsistsOf()) {
|
||||
if (consistsOf.getPropagationConstraint().getRemoveConstraint() == RemoveConstraint.cascade || consistsOf
|
||||
.getPropagationConstraint().getRemoveConstraint() == RemoveConstraint.cascadeWhenOrphan) {
|
||||
expected.put(consistsOf.getHeader().getUUID(), consistsOf);
|
||||
expected.put(consistsOf.getUUID(), consistsOf);
|
||||
Facet facet = consistsOf.getTarget();
|
||||
expected.put(facet.getHeader().getUUID(), facet);
|
||||
expected.put(facet.getUUID(), facet);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class MultiContextTest extends ERManagementTest {
|
|||
// resourceManagement = ERManagementTest.getResourceManagement(r);
|
||||
// try {
|
||||
// resourceManagement.read();
|
||||
// String error = String.format("{} with UUID {} should not be visible.", Utility.getTypeName(r), r.getHeader().getUUID());
|
||||
// String error = String.format("{} with UUID {} should not be visible.", Utility.getTypeName(r), r.getUUID());
|
||||
// logger.trace(error);
|
||||
// throw new Exception(error);
|
||||
// }catch (ResourceAvailableInAnotherContextException e) {
|
||||
|
@ -153,7 +153,7 @@ public class MultiContextTest extends ERManagementTest {
|
|||
resourceManagement.setElementType(Resource.NAME);
|
||||
|
||||
String resourceType = TypeMapper.getType(r);
|
||||
UUID resourceUUID = r.getHeader().getUUID();
|
||||
UUID resourceUUID = r.getUUID();
|
||||
|
||||
// resourceManagement.setUUID(resourceUUID);
|
||||
String ret = resourceManagement.query(IsRelatedTo.NAME, resourceType, resourceUUID, oDirection, true,
|
||||
|
@ -182,7 +182,7 @@ public class MultiContextTest extends ERManagementTest {
|
|||
Resource r = ElementMapper.unmarshal(resource.getClass(), json);
|
||||
|
||||
Map<UUID, Element> expected = new HashMap<>();
|
||||
expected.put(r.getHeader().getUUID(), r);
|
||||
expected.put(r.getUUID(), r);
|
||||
|
||||
RelationConstraintEvaluator relationConstraintEvaluator = new RelationConstraintEvaluator() {
|
||||
|
||||
|
@ -202,15 +202,15 @@ public class MultiContextTest extends ERManagementTest {
|
|||
|
||||
for (IsRelatedTo<? extends Resource, ? extends Resource> isRelatedTo : r.getIsRelatedTo()) {
|
||||
if (isRelatedTo.getPropagationConstraint().getAddConstraint() == AddConstraint.propagate) {
|
||||
expected.put(isRelatedTo.getHeader().getUUID(), isRelatedTo);
|
||||
expected.put(isRelatedTo.getUUID(), isRelatedTo);
|
||||
expected.putAll(getExpectedInstancesAddToContext(isRelatedTo.getTarget()));
|
||||
}
|
||||
}
|
||||
for (ConsistsOf<? extends Resource, ? extends Facet> consistsOf : r.getConsistsOf()) {
|
||||
if (consistsOf.getPropagationConstraint().getAddConstraint() == AddConstraint.propagate) {
|
||||
expected.put(consistsOf.getHeader().getUUID(), consistsOf);
|
||||
expected.put(consistsOf.getUUID(), consistsOf);
|
||||
Facet facet = consistsOf.getTarget();
|
||||
expected.put(facet.getHeader().getUUID(), facet);
|
||||
expected.put(facet.getUUID(), facet);
|
||||
}
|
||||
}
|
||||
return expected;
|
||||
|
@ -236,7 +236,7 @@ public class MultiContextTest extends ERManagementTest {
|
|||
String json = resourceManagement.read();
|
||||
Resource resource = ElementMapper.unmarshal(r.getClass(), json);
|
||||
Assert.assertTrue(resource.getClass() == r.getClass());
|
||||
Assert.assertTrue(resource.getHeader().getUUID().compareTo(r.getHeader().getUUID())==0);
|
||||
Assert.assertTrue(resource.getUUID().compareTo(r.getUUID())==0);
|
||||
ContextTest.setContextByName(currentContext);
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class MultiContextTest extends ERManagementTest {
|
|||
// Must be investigated cause infinite recursion to Jackson
|
||||
// Map<UUID, Element> expectedInstances = getExpectedInstancesAddToContext(isRelatedTo.getSource());
|
||||
// expectedInstances.putAll(getExpectedInstancesAddToContext(isRelatedTo.getTarget()));
|
||||
// expectedInstances.put(isRelatedTo.getHeader().getUUID(), isRelatedTo);
|
||||
// expectedInstances.put(isRelatedTo.getUUID(), isRelatedTo);
|
||||
|
||||
IsRelatedToManagement isRelatedToManagement = ERManagementTest.getIsRelatedToManagement(isRelatedTo);
|
||||
isRelatedToManagement.setDryRun(dryRun);
|
||||
|
@ -297,21 +297,21 @@ public class MultiContextTest extends ERManagementTest {
|
|||
// @SuppressWarnings("unchecked")
|
||||
// IsRelatedTo<Resource, Resource> irt = ElementMapper.unmarshal(isRelatedTo.getClass(), json);
|
||||
// Assert.assertTrue(isRelatedTo.getClass() == irt.getClass());
|
||||
// Assert.assertTrue(isRelatedTo.getHeader().getUUID().compareTo(irt.getHeader().getUUID())==0);
|
||||
// Assert.assertTrue(isRelatedTo.getUUID().compareTo(irt.getUUID())==0);
|
||||
//
|
||||
// Resource source = irt.getSource();
|
||||
// ResourceManagement resourceManagement = ERManagementTest.getResourceManagement(source);
|
||||
// json = resourceManagement.read();
|
||||
// Resource resource = ElementMapper.unmarshal(source.getClass(), json);
|
||||
// Assert.assertTrue(resource.getClass() == source.getClass());
|
||||
// Assert.assertTrue(resource.getHeader().getUUID().compareTo(source.getHeader().getUUID())==0);
|
||||
// Assert.assertTrue(resource.getUUID().compareTo(source.getUUID())==0);
|
||||
//
|
||||
// Resource target = irt.getTarget();
|
||||
// resourceManagement = ERManagementTest.getResourceManagement(target);
|
||||
// json = resourceManagement.read();
|
||||
// resource = ElementMapper.unmarshal(target.getClass(), json);
|
||||
// Assert.assertTrue(resource.getClass() == target.getClass());
|
||||
// Assert.assertTrue(resource.getHeader().getUUID().compareTo(target.getHeader().getUUID())==0);
|
||||
// Assert.assertTrue(resource.getUUID().compareTo(target.getUUID())==0);
|
||||
//
|
||||
// ContextTest.setContextByName(currentContext);
|
||||
// }
|
||||
|
|
|
@ -162,8 +162,8 @@ public class QueryTest extends ERManagementTest {
|
|||
HostingNode hostingNode = (HostingNode) map.get(HostingNode.NAME);
|
||||
|
||||
try {
|
||||
UUID eServiceUUID = eService.getHeader().getUUID();
|
||||
UUID hostingNodeUUID = hostingNode.getHeader().getUUID();
|
||||
UUID eServiceUUID = eService.getUUID();
|
||||
UUID hostingNodeUUID = hostingNode.getUUID();
|
||||
|
||||
ResourceManagement resourceManagement = new ResourceManagement();
|
||||
resourceManagement.setElementType(Service.NAME);
|
||||
|
@ -174,13 +174,13 @@ public class QueryTest extends ERManagementTest {
|
|||
List<Resource> resourceList = ElementMapper.unmarshalList(Resource.class, json);
|
||||
Assert.assertTrue(resourceList.size() == 1);
|
||||
Resource resource = resourceList.get(0);
|
||||
Assert.assertTrue(resource.getHeader().getUUID().compareTo(hostingNodeUUID) == 0);
|
||||
Assert.assertTrue(resource.getUUID().compareTo(hostingNodeUUID) == 0);
|
||||
|
||||
json = resourceManagement.query(IsRelatedTo.NAME, EService.NAME, eServiceUUID, ODirection.OUT, true, null);
|
||||
resourceList = ElementMapper.unmarshalList(Resource.class, json);
|
||||
Assert.assertTrue(resourceList.size() == 1);
|
||||
resource = resourceList.get(0);
|
||||
Assert.assertTrue(resource.getHeader().getUUID().compareTo(hostingNodeUUID) == 0);
|
||||
Assert.assertTrue(resource.getUUID().compareTo(hostingNodeUUID) == 0);
|
||||
|
||||
json = resourceManagement.query(IsRelatedTo.NAME, EService.NAME, eServiceUUID, ODirection.IN, true, null);
|
||||
resourceList = ElementMapper.unmarshalList(Resource.class, json);
|
||||
|
@ -202,7 +202,7 @@ public class QueryTest extends ERManagementTest {
|
|||
null);
|
||||
resourceList = ElementMapper.unmarshalList(Resource.class, json);
|
||||
Assert.assertTrue(resourceList.size() == 1);
|
||||
Assert.assertTrue(resourceList.get(0).getHeader().getUUID().compareTo(eServiceUUID) == 0);
|
||||
Assert.assertTrue(resourceList.get(0).getUUID().compareTo(eServiceUUID) == 0);
|
||||
|
||||
json = resourceManagement.query(IsRelatedTo.NAME, HostingNode.NAME, hostingNodeUUID, ODirection.OUT, true, null);
|
||||
resourceList = ElementMapper.unmarshalList(Resource.class, json);
|
||||
|
@ -211,7 +211,7 @@ public class QueryTest extends ERManagementTest {
|
|||
json = resourceManagement.query(IsRelatedTo.NAME, HostingNode.NAME, hostingNodeUUID, ODirection.IN, true, null);
|
||||
resourceList = ElementMapper.unmarshalList(Resource.class, json);
|
||||
Assert.assertTrue(resourceList.size() == 1);
|
||||
Assert.assertTrue(resourceList.get(0).getHeader().getUUID().compareTo(eServiceUUID) == 0);
|
||||
Assert.assertTrue(resourceList.get(0).getUUID().compareTo(eServiceUUID) == 0);
|
||||
|
||||
json = resourceManagement.query(IsRelatedTo.NAME, HostingNode.NAME, hostingNodeUUID, ODirection.BOTH, false,
|
||||
null);
|
||||
|
@ -229,7 +229,7 @@ public class QueryTest extends ERManagementTest {
|
|||
/* END Getting HostingNode */
|
||||
|
||||
Facet identificationFacet = eService.getIdentificationFacets().get(0);
|
||||
UUID identificationFacetUUID = identificationFacet.getHeader().getUUID();
|
||||
UUID identificationFacetUUID = identificationFacet.getUUID();
|
||||
|
||||
/* EService --ConsistsOf--> SoftwareFacet */
|
||||
try {
|
||||
|
@ -245,8 +245,8 @@ public class QueryTest extends ERManagementTest {
|
|||
Assert.assertTrue(resourceList.size() == 1);
|
||||
resource = resourceList.get(0);
|
||||
Facet targetIdentificationFacet = ((GCubeResource) resource).getIdentificationFacets().get(0);
|
||||
Assert.assertTrue(resource.getHeader().getUUID().compareTo(eServiceUUID) == 0);
|
||||
Assert.assertTrue(targetIdentificationFacet.getHeader().getUUID().compareTo(identificationFacetUUID) == 0);
|
||||
Assert.assertTrue(resource.getUUID().compareTo(eServiceUUID) == 0);
|
||||
Assert.assertTrue(targetIdentificationFacet.getUUID().compareTo(identificationFacetUUID) == 0);
|
||||
|
||||
try {
|
||||
json = resourceManagement.query(ConsistsOf.NAME, SoftwareFacet.NAME, identificationFacetUUID, ODirection.IN,
|
||||
|
@ -366,8 +366,8 @@ public class QueryTest extends ERManagementTest {
|
|||
int expectedSize = 1;
|
||||
|
||||
Set<UUID> expectedUUIDFor2Results = new HashSet<>();
|
||||
expectedUUIDFor2Results.add(createdConfigurations.get(3).getHeader().getUUID());
|
||||
expectedUUIDFor2Results.add(createdConfigurations.get(4).getHeader().getUUID());
|
||||
expectedUUIDFor2Results.add(createdConfigurations.get(3).getUUID());
|
||||
expectedUUIDFor2Results.add(createdConfigurations.get(4).getUUID());
|
||||
|
||||
for(int i=0; i<names.length; i++) {
|
||||
|
||||
|
@ -377,7 +377,7 @@ public class QueryTest extends ERManagementTest {
|
|||
}
|
||||
|
||||
Configuration expected = createdConfigurations.get(i);
|
||||
UUID expectedUUID = expected.getHeader().getUUID();
|
||||
UUID expectedUUID = expected.getUUID();
|
||||
|
||||
for(Boolean polymorphic : polymorphics) {
|
||||
|
||||
|
@ -398,12 +398,12 @@ public class QueryTest extends ERManagementTest {
|
|||
Assert.assertTrue(list.size()==expectedSize);
|
||||
if(expectedSize==1) {
|
||||
Configuration configuration = list.get(0);
|
||||
UUID gotUUID = configuration.getHeader().getUUID();
|
||||
UUID gotUUID = configuration.getUUID();
|
||||
Assert.assertTrue(gotUUID.compareTo(expectedUUID)==0);
|
||||
}else {
|
||||
Set<UUID> gotUUIDs = new HashSet<>();
|
||||
for(Configuration c : list) {
|
||||
gotUUIDs.add(c.getHeader().getUUID());
|
||||
gotUUIDs.add(c.getUUID());
|
||||
}
|
||||
|
||||
Assert.assertTrue(gotUUIDs.containsAll(expectedUUIDFor2Results));
|
||||
|
@ -425,13 +425,13 @@ public class QueryTest extends ERManagementTest {
|
|||
if(expectedSize==1) {
|
||||
ConfigurationTemplate configurationTemplate = listPolimorphic.get(0);
|
||||
Assert.assertTrue(configurationTemplate instanceof Configuration);
|
||||
UUID gotPolimorphicUUID = configurationTemplate.getHeader().getUUID();
|
||||
UUID gotPolimorphicUUID = configurationTemplate.getUUID();
|
||||
Assert.assertTrue(gotPolimorphicUUID.compareTo(expectedUUID)==0);
|
||||
}else {
|
||||
Set<UUID> gotUUIDs = new HashSet<>();
|
||||
for(ConfigurationTemplate c : listPolimorphic) {
|
||||
Assert.assertTrue(c instanceof Configuration);
|
||||
gotUUIDs.add(c.getHeader().getUUID());
|
||||
gotUUIDs.add(c.getUUID());
|
||||
}
|
||||
|
||||
Assert.assertTrue(gotUUIDs.containsAll(expectedUUIDFor2Results));
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
|||
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
||||
import org.gcube.informationsystem.model.reference.properties.Header;
|
||||
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
||||
import org.gcube.informationsystem.queries.templates.impl.entities.QueryTemplateImpl;
|
||||
import org.gcube.informationsystem.queries.templates.impl.properties.TemplateVariableImpl;
|
||||
import org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate;
|
||||
|
@ -37,29 +37,31 @@ public class QueryTemplateManagementTest extends ContextTest {
|
|||
public static final String NAME_VARIABLE_NAME = "$name";
|
||||
public static final String GROUP_VARIABLE_NAME = "$group";
|
||||
|
||||
public static void checkHeader(IdentifiableElement previous, IdentifiableElement got) {
|
||||
Header gotHeader = got.getHeader();
|
||||
Header previousHeader = previous.getHeader();
|
||||
public static void checkUUIDAndMetadata(IdentifiableElement previous, IdentifiableElement got) {
|
||||
Assert.assertTrue(got.getUUID()!= null);
|
||||
Assert.assertTrue(got.getUUID().compareTo(previous.getUUID()) == 0);
|
||||
|
||||
Assert.assertTrue(gotHeader != null);
|
||||
Assert.assertTrue(gotHeader.getUUID() != null);
|
||||
Metadata gotMetadata = got.getMetadata();
|
||||
Metadata previousMetadata = previous.getMetadata();
|
||||
|
||||
Assert.assertTrue(gotMetadata != null);
|
||||
|
||||
String user = ContextTest.getUser();
|
||||
Assert.assertTrue(gotHeader.getLastUpdateBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(gotMetadata.getLastUpdateBy().compareTo(user) == 0);
|
||||
|
||||
if(previousHeader != null) {
|
||||
Assert.assertTrue(gotHeader.getUUID().compareTo(previousHeader.getUUID()) == 0);
|
||||
Assert.assertTrue(gotHeader.getCreatedBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(gotHeader.getCreatedBy().compareTo(previousHeader.getCreatedBy()) == 0);
|
||||
Assert.assertTrue(gotHeader.getCreationTime().compareTo(previousHeader.getCreationTime()) == 0);
|
||||
if(previousMetadata != null) {
|
||||
|
||||
Assert.assertTrue(gotMetadata.getCreatedBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(gotMetadata.getCreatedBy().compareTo(previousMetadata.getCreatedBy()) == 0);
|
||||
Assert.assertTrue(gotMetadata.getCreationTime().compareTo(previousMetadata.getCreationTime()) == 0);
|
||||
}
|
||||
|
||||
Assert.assertFalse(gotHeader.getCreationTime().after(gotHeader.getLastUpdateTime()));
|
||||
Assert.assertFalse(gotMetadata.getCreationTime().after(gotMetadata.getLastUpdateTime()));
|
||||
|
||||
}
|
||||
|
||||
protected void assertions(QueryTemplate expected, QueryTemplate got) {
|
||||
checkHeader(expected, got);
|
||||
checkUUIDAndMetadata(expected, got);
|
||||
Assert.assertTrue(expected.getName().compareTo(got.getName()) == 0);
|
||||
Assert.assertTrue(expected.getDescription().compareTo(got.getDescription()) == 0);
|
||||
// Template and TemplateVariable should be compared
|
||||
|
|
|
@ -31,7 +31,7 @@ public class AnotherEnhancedTest extends MultiContextTest {
|
|||
// JsonNode jsonNode = ElementMapper.getObjectMapper().readTree(json);
|
||||
//
|
||||
// Map<UUID, JsonNode> expectedInstances = new HashMap<>();
|
||||
// expectedInstances.put(eService.getHeader().getUUID(), jsonNode);
|
||||
// expectedInstances.put(eService.getUUID(), jsonNode);
|
||||
//
|
||||
// UUID contextUUID = ContextUtility.getInstance().getSecurityContextByFullName(ALTERNATIVE_TEST_SCOPE).getUUID();
|
||||
//
|
||||
|
@ -45,7 +45,7 @@ public class AnotherEnhancedTest extends MultiContextTest {
|
|||
// IsIdentifiedBy<EService, Facet> gotIsIdentifiedBy = (IsIdentifiedBy<EService, Facet>) eService.getConsistsOf(IsIdentifiedBy.class).get(0);
|
||||
//
|
||||
// JsonNode gotIsIdentifiedByJsonNode = ElementMapper.getObjectMapper().readTree(ElementMapper.marshal(gotIsIdentifiedBy));
|
||||
// expectedInstances.put(gotIsIdentifiedBy.getHeader().getUUID(), gotIsIdentifiedByJsonNode);
|
||||
// expectedInstances.put(gotIsIdentifiedBy.getUUID(), gotIsIdentifiedByJsonNode);
|
||||
//
|
||||
// try {
|
||||
// ERManagementUtility.addToContextNoPropagationConstraint(expectedInstances, contextUUID, true);
|
||||
|
|
|
@ -40,27 +40,28 @@ public class FacetManagementTest extends MultiContextTest {
|
|||
Assert.assertTrue(softwareFacet.getVersion().compareTo(version) == 0);
|
||||
}
|
||||
|
||||
public static void checkHeader(IdentifiableElement er, UUID uuid, boolean create) {
|
||||
Assert.assertTrue(er.getHeader() != null);
|
||||
Assert.assertTrue(er.getHeader().getUUID() != null);
|
||||
public static void checkUUIDAndMetadata(IdentifiableElement er, UUID uuid, boolean create) {
|
||||
Assert.assertTrue(er.getUUID() != null);
|
||||
|
||||
if(uuid != null) {
|
||||
Assert.assertTrue(er.getHeader().getUUID().compareTo(uuid) == 0);
|
||||
Assert.assertTrue(er.getUUID().compareTo(uuid) == 0);
|
||||
}
|
||||
|
||||
Assert.assertTrue(er.getMetadata() != null);
|
||||
|
||||
String user = MetadataUtility.getUser();
|
||||
Assert.assertTrue(er.getHeader().getLastUpdateBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(er.getMetadata().getLastUpdateBy().compareTo(user) == 0);
|
||||
|
||||
if(create) {
|
||||
Assert.assertTrue(er.getHeader().getCreatedBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(er.getHeader().getCreationTime().compareTo(er.getHeader().getLastUpdateTime()) == 0);
|
||||
Assert.assertTrue(er.getMetadata().getCreatedBy().compareTo(user) == 0);
|
||||
Assert.assertTrue(er.getMetadata().getCreationTime().compareTo(er.getMetadata().getLastUpdateTime()) == 0);
|
||||
} else {
|
||||
Assert.assertTrue(er.getHeader().getCreationTime().before(er.getHeader().getLastUpdateTime()));
|
||||
Assert.assertTrue(er.getMetadata().getCreationTime().before(er.getMetadata().getLastUpdateTime()));
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkAssertion(Facet facet, UUID uuid, boolean create) {
|
||||
checkHeader(facet, uuid, create);
|
||||
checkUUIDAndMetadata(facet, uuid, create);
|
||||
}
|
||||
//
|
||||
// protected <F extends Facet> F create(F facet) throws Exception {
|
||||
|
@ -75,10 +76,7 @@ public class FacetManagementTest extends MultiContextTest {
|
|||
// F createdFacet = (F) ElementMapper.unmarshal(facet.getClass(), json);
|
||||
// logger.debug("Unmarshalled {}", createdFacet);
|
||||
//
|
||||
// UUID uuid = null;
|
||||
// if(facet.getHeader() != null) {
|
||||
// uuid = facet.getHeader().getUUID();
|
||||
// }
|
||||
// UUID uuid = facet.getUUID();
|
||||
// checkAssertion(createdFacet, uuid, true);
|
||||
// return createdFacet;
|
||||
// }
|
||||
|
@ -95,14 +93,14 @@ public class FacetManagementTest extends MultiContextTest {
|
|||
// F updatedFacet = (F) ElementMapper.unmarshal(facet.getClass(), json);
|
||||
// logger.debug("Unmarshalled {}", updatedFacet);
|
||||
//
|
||||
// UUID uuid = facet.getHeader().getUUID();
|
||||
// UUID uuid = facet.getUUID();
|
||||
// checkAssertion(updatedFacet, uuid, false);
|
||||
//
|
||||
// return updatedFacet;
|
||||
// }
|
||||
//
|
||||
// protected <F extends Facet> F read(F facet) throws Exception {
|
||||
// UUID uuid = facet.getHeader().getUUID();
|
||||
// UUID uuid = facet.getUUID();
|
||||
//
|
||||
// FacetManagement facetManagement = new FacetManagement();
|
||||
// String facetType = Utility.getTypeName(facet);
|
||||
|
@ -124,7 +122,7 @@ public class FacetManagementTest extends MultiContextTest {
|
|||
// FacetManagement facetManagement = new FacetManagement();
|
||||
// String facetType = Utility.getTypeName(facet);
|
||||
// facetManagement.setElementType(facetType);
|
||||
// facetManagement.setUUID(facet.getHeader().getUUID());
|
||||
// facetManagement.setUUID(facet.getUUID());
|
||||
//
|
||||
// facetManagement.delete();
|
||||
//
|
||||
|
@ -139,11 +137,11 @@ public class FacetManagementTest extends MultiContextTest {
|
|||
// FacetManagement facetManagement = new FacetManagement();
|
||||
// String facetType = Utility.getTypeName(facet);
|
||||
// facetManagement.setElementType(facetType);
|
||||
// facetManagement.setUUID(facet.getHeader().getUUID());
|
||||
// facetManagement.setUUID(facet.getUUID());
|
||||
//
|
||||
// facetManagement.addToContext(ContextUtility.getCurrentSecurityContext().getUUID());
|
||||
// Map<UUID,JsonNode> affectedInstances = facetManagement.getAffectedInstances();
|
||||
// Assert.assertTrue(affectedInstances.containsKey(facet.getHeader().getUUID()));
|
||||
// Assert.assertTrue(affectedInstances.containsKey(facet.getUUID()));
|
||||
// Assert.assertTrue(affectedInstances.size()==1);
|
||||
//
|
||||
// return affectedInstances;
|
||||
|
@ -153,11 +151,11 @@ public class FacetManagementTest extends MultiContextTest {
|
|||
// FacetManagement facetManagement = new FacetManagement();
|
||||
// String facetType = Utility.getTypeName(facet);
|
||||
// facetManagement.setElementType(facetType);
|
||||
// facetManagement.setUUID(facet.getHeader().getUUID());
|
||||
// facetManagement.setUUID(facet.getUUID());
|
||||
//
|
||||
// facetManagement.removeFromContext(ContextUtility.getCurrentSecurityContext().getUUID());
|
||||
// Map<UUID,JsonNode> affectedInstances = facetManagement.getAffectedInstances();
|
||||
// Assert.assertTrue(affectedInstances.containsKey(facet.getHeader().getUUID()));
|
||||
// Assert.assertTrue(affectedInstances.containsKey(facet.getUUID()));
|
||||
// Assert.assertTrue(affectedInstances.size()==1);
|
||||
//
|
||||
// return affectedInstances;
|
||||
|
|
|
@ -13,10 +13,10 @@ import org.gcube.informationsystem.contexts.reference.entities.Context;
|
|||
import org.gcube.informationsystem.model.reference.entities.Entity;
|
||||
import org.gcube.informationsystem.model.reference.entities.Facet;
|
||||
import org.gcube.informationsystem.model.reference.entities.Resource;
|
||||
import org.gcube.informationsystem.model.reference.properties.Header;
|
||||
import org.gcube.informationsystem.model.reference.properties.Encrypted;
|
||||
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
||||
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint;
|
||||
import org.gcube.informationsystem.model.reference.properties.Property;
|
||||
import org.gcube.informationsystem.model.reference.properties.Vault;
|
||||
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
||||
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
||||
import org.gcube.informationsystem.model.reference.relations.Relation;
|
||||
|
@ -53,7 +53,7 @@ public class SchemaManagementImplTest extends ContextTest {
|
|||
|
||||
@Test
|
||||
public void registerPropertyTypeSchema() throws Exception {
|
||||
Class<? extends PropertyElement> clz = Header.class;
|
||||
Class<? extends PropertyElement> clz = Metadata.class;
|
||||
String json = TypeMapper.serializeType(clz);
|
||||
logger.debug(json);
|
||||
//new SchemaManagementImpl().create(json, AccessType.PROPERTY);
|
||||
|
@ -243,8 +243,8 @@ public class SchemaManagementImplTest extends ContextTest {
|
|||
}
|
||||
|
||||
@Test(expected=SchemaAlreadyPresentException.class)
|
||||
public void createVaultType() throws Exception {
|
||||
create(Vault.class);
|
||||
public void createEncryptedType() throws Exception {
|
||||
create(Encrypted.class);
|
||||
}
|
||||
|
||||
@Test(expected=SchemaAlreadyPresentException.class)
|
||||
|
|
|
@ -30,14 +30,10 @@
|
|||
"isRelatedTo" : [
|
||||
{
|
||||
"@class": "Activates",
|
||||
"header": {
|
||||
"uuid": "d3f58e52-5346-47bc-b736-9d77a0b554ce"
|
||||
},
|
||||
"@uuid": "d3f58e52-5346-47bc-b736-9d77a0b554ce",
|
||||
"source": {
|
||||
"@class": "HostingNode",
|
||||
"header": {
|
||||
"uuid" : "5fbc1a56-d450-4f0f-85c1-9b1684581717"
|
||||
}
|
||||
"@uuid" : "5fbc1a56-d450-4f0f-85c1-9b1684581717"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1 +1 @@
|
|||
TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("SoftwareFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE outV("EService") FROM ( SELECT FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( SELECT FROM Activates WHERE header.uuid = "d3f58e52-5346-47bc-b736-9d77a0b554ce")) WHERE header.uuid = "5fbc1a56-d450-4f0f-85c1-9b1684581717"))))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))
|
||||
TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("SoftwareFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE outV("EService") FROM ( SELECT FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( SELECT FROM Activates WHERE uuid = "d3f58e52-5346-47bc-b736-9d77a0b554ce")) WHERE uuid = "5fbc1a56-d450-4f0f-85c1-9b1684581717"))))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))
|
|
@ -5,9 +5,7 @@
|
|||
"@class": "ConsistsOf",
|
||||
"source" : {
|
||||
"@class" : "EService",
|
||||
"header": {
|
||||
"uuid": "0255b7ec-e3da-4071-b456-9a2907ece1db"
|
||||
}
|
||||
"@uuid": "0255b7ec-e3da-4071-b456-9a2907ece1db"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db"))) WHERE value = "down"
|
||||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE @uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db"))) WHERE value = "down"
|
|
@ -1 +1 @@
|
|||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((header.uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND header.createdBy <> "luca.frosini") OR (header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND header.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"))))) WHERE value = "down"
|
||||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((@uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND header.createdBy <> "luca.frosini") OR (header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080"))))) WHERE value = "down"
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@class": "EService",
|
||||
"header": {
|
||||
"uuid": "0255b7ec-e3da-4071-b456-9a2907ece1db"
|
||||
},
|
||||
"@uuid": "0255b7ec-e3da-4071-b456-9a2907ece1db",
|
||||
"consistsOf": [
|
||||
{
|
||||
"@class": "ConsistsOf",
|
||||
|
|
|
@ -1 +1 @@
|
|||
SELECT FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("SoftwareFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE outV("EService") FROM ( SELECT FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("CPUFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("HostingNode") FROM ( SELECT FROM Activates WHERE header.uuid = "d3f58e52-5346-47bc-b736-9d77a0b554ce")))) WHERE vendor = "GenuineIntel"))) WHERE header.uuid = "5fbc1a56-d450-4f0f-85c1-9b1684581717"))))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))) WHERE header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db"
|
||||
SELECT FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("AccessPointFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("EService") FROM ( TRAVERSE inE("IsIdentifiedBy") FROM ( SELECT FROM ( TRAVERSE inV("SoftwareFacet") FROM ( TRAVERSE outE("IsIdentifiedBy") FROM ( TRAVERSE outV("EService") FROM ( SELECT FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE inV("EService") FROM ( TRAVERSE outE("Activates") FROM ( SELECT FROM ( TRAVERSE outV("HostingNode") FROM ( TRAVERSE inE("ConsistsOf") FROM ( SELECT FROM ( TRAVERSE inV("CPUFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( TRAVERSE outV("HostingNode") FROM ( SELECT FROM Activates WHERE @uuid = "d3f58e52-5346-47bc-b736-9d77a0b554ce")))) WHERE vendor = "GenuineIntel"))) WHERE header.uuid = "5fbc1a56-d450-4f0f-85c1-9b1684581717"))))) WHERE value = "down")) WHERE propagationConstraint.add = "propagate")))) WHERE name = "data-transfer-service" AND group = "DataTransfer"))))) WHERE endpoint = "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service"))) WHERE header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db"
|
|
@ -1 +1 @@
|
|||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((header.uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND header.createdBy <> "luca.frosini") OR (header.uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND header.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080")))))
|
||||
SELECT FROM ( TRAVERSE inV("StateFacet") FROM ( TRAVERSE outE("ConsistsOf") FROM ( SELECT FROM ( SELECT FROM EService) WHERE ((@uuid = "aec0ef31-c735-4a4c-b2f4-57dfbd2fe925" AND header.createdBy <> "luca.frosini") OR (@uuid = "0255b7ec-e3da-4071-b456-9a2907ece1db" AND metadata.createdBy = "DataTransfer:data-transfer-service:pc-frosini.isti.cnr.it_8080")))))
|
Loading…
Reference in New Issue