Cleaning the env before launching the test
This commit is contained in:
parent
f80eec0301
commit
71ad45f72b
|
@ -14,7 +14,6 @@ import org.gcube.informationsystem.model.reference.entities.Resource;
|
|||
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
||||
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
||||
import org.gcube.informationsystem.resourceregistry.ContextTest;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.utils.Utility;
|
||||
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement;
|
||||
|
@ -54,7 +53,6 @@ public class QueryTest extends ContextTest {
|
|||
|
||||
private static final String EXTRA = "EXTRA";
|
||||
|
||||
|
||||
@Test
|
||||
public void testGetAll() throws Exception {
|
||||
|
||||
|
@ -152,6 +150,14 @@ public class QueryTest extends ContextTest {
|
|||
@Test
|
||||
public void testGetAllFrom() throws Exception {
|
||||
|
||||
// Clean the environment first to avoid error if a previous tests fails without cleaning the env
|
||||
ResourceManagement rm = (ResourceManagement) ElementManagementUtility.getERManagement(Resource.NAME);
|
||||
String all = rm.all(true);
|
||||
List<Resource> allResources = ElementMapper.unmarshalList(Resource.class, all);
|
||||
for(Resource r : allResources) {
|
||||
ERManagementTest.deleteResource(r);
|
||||
}
|
||||
|
||||
Map<String, Resource> map = ERManagementTest.createHostingNodeAndEService();
|
||||
EService eService = (EService) map.get(EService.NAME);
|
||||
HostingNode hostingNode = (HostingNode) map.get(HostingNode.NAME);
|
||||
|
@ -292,7 +298,15 @@ public class QueryTest extends ContextTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testQuery() throws ResourceRegistryException {
|
||||
public void testQuery() throws Exception {
|
||||
// Clean the environment first to avoid error if a previous tests fails without cleaning the env
|
||||
ResourceManagement rm = (ResourceManagement) ElementManagementUtility.getERManagement(Resource.NAME);
|
||||
String all = rm.all(true);
|
||||
List<Resource> allResources = ElementMapper.unmarshalList(Resource.class, all);
|
||||
for(Resource r : allResources) {
|
||||
ERManagementTest.deleteResource(r);
|
||||
}
|
||||
|
||||
String relationType = ConsistsOf.NAME;
|
||||
String facetType = SoftwareFacet.NAME;
|
||||
|
||||
|
@ -343,6 +357,14 @@ public class QueryTest extends ContextTest {
|
|||
|
||||
@Test
|
||||
public void getAllResourcesHavingFacet() throws ObjectNotFound, Exception {
|
||||
// Clean the environment first to avoid error if a previous tests fails without cleaning the env
|
||||
ResourceManagement rm = (ResourceManagement) ElementManagementUtility.getERManagement(Resource.NAME);
|
||||
String all = rm.all(true);
|
||||
List<Resource> allResources = ElementMapper.unmarshalList(Resource.class, all);
|
||||
for(Resource r : allResources) {
|
||||
ERManagementTest.deleteResource(r);
|
||||
}
|
||||
|
||||
|
||||
String[] names = new String[]{"MyTest", "MyTest", "Aux", "MyID", "MyID"};
|
||||
Object[] additionalProperties = new Object[] {5, 5.0, false, "test", null};
|
||||
|
|
Loading…
Reference in New Issue