Fixing test
This commit is contained in:
parent
71ad45f72b
commit
945a58a3fc
|
@ -14,6 +14,7 @@ import org.gcube.informationsystem.model.reference.entities.Resource;
|
||||||
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
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.ContextTest;
|
import org.gcube.informationsystem.resourceregistry.ContextTest;
|
||||||
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.utils.Utility;
|
import org.gcube.informationsystem.resourceregistry.api.utils.Utility;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement;
|
||||||
|
@ -61,7 +62,11 @@ public class QueryTest extends ContextTest {
|
||||||
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);
|
||||||
for(Resource r : allResources) {
|
for(Resource r : allResources) {
|
||||||
ERManagementTest.deleteResource(r);
|
try {
|
||||||
|
ERManagementTest.deleteResource(r);
|
||||||
|
}catch (ResourceNotFoundException e) {
|
||||||
|
// A resource could be already deleted deleting another resource giving the propagation constraint
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, List<Resource>> resources = new HashMap<>();
|
Map<String, List<Resource>> resources = new HashMap<>();
|
||||||
|
@ -155,7 +160,11 @@ public class QueryTest extends ContextTest {
|
||||||
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);
|
||||||
for(Resource r : allResources) {
|
for(Resource r : allResources) {
|
||||||
ERManagementTest.deleteResource(r);
|
try {
|
||||||
|
ERManagementTest.deleteResource(r);
|
||||||
|
}catch (ResourceNotFoundException e) {
|
||||||
|
// A resource could be already deleted deleting another resource giving the propagation constraint
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Resource> map = ERManagementTest.createHostingNodeAndEService();
|
Map<String, Resource> map = ERManagementTest.createHostingNodeAndEService();
|
||||||
|
@ -304,7 +313,11 @@ public class QueryTest extends ContextTest {
|
||||||
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);
|
||||||
for(Resource r : allResources) {
|
for(Resource r : allResources) {
|
||||||
ERManagementTest.deleteResource(r);
|
try {
|
||||||
|
ERManagementTest.deleteResource(r);
|
||||||
|
}catch (ResourceNotFoundException e) {
|
||||||
|
// A resource could be already deleted deleting another resource giving the propagation constraint
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String relationType = ConsistsOf.NAME;
|
String relationType = ConsistsOf.NAME;
|
||||||
|
@ -362,7 +375,11 @@ public class QueryTest extends ContextTest {
|
||||||
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);
|
||||||
for(Resource r : allResources) {
|
for(Resource r : allResources) {
|
||||||
ERManagementTest.deleteResource(r);
|
try {
|
||||||
|
ERManagementTest.deleteResource(r);
|
||||||
|
}catch (ResourceNotFoundException e) {
|
||||||
|
// A resource could be already deleted deleting another resource giving the propagation constraint
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue