Fixing tests

This commit is contained in:
Luca Frosini 2024-10-31 17:42:33 +01:00
parent fb230cee94
commit cd8627cf32
3 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@ import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
import org.gcube.informationsystem.resourceregistry.ContextTest; import org.gcube.informationsystem.resourceregistry.ContextTest;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.base.ElementManagement; import org.gcube.informationsystem.resourceregistry.base.ElementManagement;
import org.gcube.informationsystem.resourceregistry.base.ElementManagementUtility; import org.gcube.informationsystem.resourceregistry.instances.model.ERManagementUtility;
import org.gcube.informationsystem.resourceregistry.instances.model.entities.FacetManagement; import org.gcube.informationsystem.resourceregistry.instances.model.entities.FacetManagement;
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement; import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
import org.gcube.informationsystem.resourceregistry.instances.model.relations.ConsistsOfManagement; import org.gcube.informationsystem.resourceregistry.instances.model.relations.ConsistsOfManagement;
@ -748,7 +748,7 @@ public class ERManagementTest extends ContextTest {
requestInfo.setOffset(offset); requestInfo.setOffset(offset);
requestInfo.setLimit(limit); requestInfo.setLimit(limit);
ElementManagement<?,?> erManagement = ElementManagementUtility.getERManagement(TypeUtility.getTypeName(clz)); ElementManagement<?,?> erManagement = ERManagementUtility.getERManagement(TypeUtility.getTypeName(clz));
String ret = erManagement.all(true); String ret = erManagement.all(true);
List<ERElement> list = ElementMapper.unmarshalList(ERElement.class, ret); List<ERElement> list = ElementMapper.unmarshalList(ERElement.class, ret);

View File

@ -18,7 +18,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.entities.reso
import org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.relations.RelationAvailableInAnotherContextException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relations.RelationAvailableInAnotherContextException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.relations.isrelatedto.IsRelatedToNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.relations.isrelatedto.IsRelatedToNotFoundException;
import org.gcube.informationsystem.resourceregistry.base.ElementManagementUtility; import org.gcube.informationsystem.resourceregistry.instances.model.ERManagementUtility;
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement; import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
import org.gcube.informationsystem.resourceregistry.instances.model.relations.IsRelatedToManagement; import org.gcube.informationsystem.resourceregistry.instances.model.relations.IsRelatedToManagement;
import org.gcube.informationsystem.serialization.ElementMapper; import org.gcube.informationsystem.serialization.ElementMapper;
@ -171,7 +171,7 @@ public class BasicTest extends MultiContextTest {
String targetContextFullName = ALTERNATIVE_TEST_SCOPE; String targetContextFullName = ALTERNATIVE_TEST_SCOPE;
ResourceManagement rm = (ResourceManagement) ElementManagementUtility.getERManagement(Resource.NAME); ResourceManagement rm = (ResourceManagement) ERManagementUtility.getERManagement(Resource.NAME);
String all = rm.all(true); String all = rm.all(true);
List<Resource> allResources = ElementMapper.unmarshalList(Resource.class, all); List<Resource> allResources = ElementMapper.unmarshalList(Resource.class, all);
Assert.assertTrue(allResources.size()==2); Assert.assertTrue(allResources.size()==2);
@ -180,7 +180,7 @@ public class BasicTest extends MultiContextTest {
deleteResource(hostingNode); deleteResource(hostingNode);
rm = (ResourceManagement) ElementManagementUtility.getERManagement(Resource.NAME); rm = (ResourceManagement) ERManagementUtility.getERManagement(Resource.NAME);
all = rm.all(true); all = rm.all(true);
allResources = ElementMapper.unmarshalList(Resource.class, all); allResources = ElementMapper.unmarshalList(Resource.class, all);
Assert.assertTrue(allResources.size()==0); Assert.assertTrue(allResources.size()==0);

View File

@ -15,8 +15,8 @@ import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo; import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException;
import org.gcube.informationsystem.resourceregistry.base.ElementManagement; import org.gcube.informationsystem.resourceregistry.base.ElementManagement;
import org.gcube.informationsystem.resourceregistry.base.ElementManagementUtility;
import org.gcube.informationsystem.resourceregistry.instances.ERManagementTest; import org.gcube.informationsystem.resourceregistry.instances.ERManagementTest;
import org.gcube.informationsystem.resourceregistry.instances.model.ERManagementUtility;
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement; import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
import org.gcube.informationsystem.resourceregistry.instances.model.relations.ConsistsOfManagement; import org.gcube.informationsystem.resourceregistry.instances.model.relations.ConsistsOfManagement;
import org.gcube.informationsystem.resourceregistry.instances.model.relations.IsRelatedToManagement; import org.gcube.informationsystem.resourceregistry.instances.model.relations.IsRelatedToManagement;
@ -90,7 +90,7 @@ public class QueryTest extends ERManagementTest {
/* Getting all instances of created specific Resources */ /* Getting all instances of created specific Resources */
for (String key : resources.keySet()) { for (String key : resources.keySet()) {
ResourceManagement resourceManagement = (ResourceManagement) ElementManagementUtility.getERManagement(key); ResourceManagement resourceManagement = (ResourceManagement) ERManagementUtility.getERManagement(key);
String json = resourceManagement.all(false); String json = resourceManagement.all(false);
List<Resource> list = ElementMapper.unmarshalList(Resource.class, json); List<Resource> list = ElementMapper.unmarshalList(Resource.class, json);
@ -100,7 +100,7 @@ public class QueryTest extends ERManagementTest {
/* Getting all Resources polymorphic and non polymorphic */ /* Getting all Resources polymorphic and non polymorphic */
ResourceManagement resourceManagement = (ResourceManagement) ElementManagementUtility ResourceManagement resourceManagement = (ResourceManagement) ERManagementUtility
.getERManagement(Resource.NAME); .getERManagement(Resource.NAME);
String json = resourceManagement.all(true); String json = resourceManagement.all(true);
@ -114,7 +114,7 @@ public class QueryTest extends ERManagementTest {
/* Getting all IsRelatedTo polymorphic and non polymorphic */ /* Getting all IsRelatedTo polymorphic and non polymorphic */
IsRelatedToManagement isRelatedToManagement = (IsRelatedToManagement) ElementManagementUtility IsRelatedToManagement isRelatedToManagement = (IsRelatedToManagement) ERManagementUtility
.getERManagement(IsRelatedTo.NAME); .getERManagement(IsRelatedTo.NAME);
json = isRelatedToManagement.all(true); json = isRelatedToManagement.all(true);
@ -130,7 +130,7 @@ public class QueryTest extends ERManagementTest {
/* Getting all ConsistsOf polymorphic and non polymorphic */ /* Getting all ConsistsOf polymorphic and non polymorphic */
ConsistsOfManagement consistsOfManagement = (ConsistsOfManagement) ElementManagementUtility ConsistsOfManagement consistsOfManagement = (ConsistsOfManagement) ERManagementUtility
.getERManagement(ConsistsOf.NAME); .getERManagement(ConsistsOf.NAME);
json = consistsOfManagement.all(true); json = consistsOfManagement.all(true);
@ -298,7 +298,7 @@ public class QueryTest extends ERManagementTest {
String type = Service.NAME; String type = Service.NAME;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
ElementManagement erManagement = ElementManagementUtility.getERManagement(type); ElementManagement erManagement = ERManagementUtility.getERManagement(type);
if (erManagement instanceof ResourceManagement) { if (erManagement instanceof ResourceManagement) {
boolean[] booleans = new boolean[] {true, false}; boolean[] booleans = new boolean[] {true, false};