Fixed test classes
This commit is contained in:
parent
ea2156d0d5
commit
acdd43f7ef
|
@ -37,7 +37,6 @@ public class ContextTest {
|
|||
|
||||
public static final String DEFAULT_TEST_SCOPE_ANOTHER_USER;
|
||||
|
||||
protected static final String REGISTRY_PROPERTIES_FILENAME = "registry.properties";
|
||||
public static final String RESOURCE_REGISTRY_URL_PROPERTY = "RESOURCE_REGISTRY_URL";
|
||||
public static final String RESOURCE_REGISTRY_URL;
|
||||
|
||||
|
@ -70,16 +69,7 @@ public class ContextTest {
|
|||
}
|
||||
|
||||
|
||||
Properties registryProperties = new Properties();
|
||||
input = ContextTest.class.getClassLoader().getResourceAsStream(REGISTRY_PROPERTIES_FILENAME);
|
||||
try {
|
||||
// load the properties file
|
||||
registryProperties.load(input);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
RESOURCE_REGISTRY_URL = registryProperties.getProperty(RESOURCE_REGISTRY_URL_PROPERTY);
|
||||
RESOURCE_REGISTRY_URL = properties.getProperty(RESOURCE_REGISTRY_URL_PROPERTY);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,11 @@ import org.gcube.informationsystem.model.reference.relations.Relation;
|
|||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientFactory;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientImpl;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ContextTest;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherFactory;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherImpl;
|
||||
import org.gcube.informationsystem.utils.ElementMapper;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.AccessPointFacetImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
||||
|
@ -73,8 +75,13 @@ public class ERManagementTest extends ContextTest {
|
|||
protected ResourceRegistryClient resourceRegistryClient;
|
||||
|
||||
public ERManagementTest() {
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||
if(ContextTest.RESOURCE_REGISTRY_URL !=null && !ContextTest.RESOURCE_REGISTRY_URL.isEmpty()) {
|
||||
resourceRegistryPublisher = new ResourceRegistryPublisherImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||
resourceRegistryClient = new ResourceRegistryClientImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||
}else {
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
|||
import org.gcube.informationsystem.resourceregistry.publisher.ContextTest;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherFactory;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherImpl;
|
||||
import org.gcube.informationsystem.utils.ElementMapper;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
|
||||
|
@ -41,7 +42,11 @@ public class EntityManagementTest extends ContextTest {
|
|||
protected ResourceRegistryPublisher resourceRegistryPublisher;
|
||||
|
||||
public EntityManagementTest(){
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
if(ContextTest.RESOURCE_REGISTRY_URL !=null && !ContextTest.RESOURCE_REGISTRY_URL.isEmpty()) {
|
||||
resourceRegistryPublisher = new ResourceRegistryPublisherImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||
}else {
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
}
|
||||
}
|
||||
|
||||
//@Test
|
||||
|
|
|
@ -20,9 +20,11 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExcep
|
|||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientFactory;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientImpl;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ContextTest;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherFactory;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.AccessPointFacetImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.EventFacetImpl;
|
||||
|
@ -71,8 +73,13 @@ public class MultiContextTest extends ContextTest {
|
|||
|
||||
public MultiContextTest() throws Exception {
|
||||
ContextTest.setContextByName(PARENT_DEFAULT_TEST_SCOPE);
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||
if(ContextTest.RESOURCE_REGISTRY_URL !=null && !ContextTest.RESOURCE_REGISTRY_URL.isEmpty()) {
|
||||
resourceRegistryPublisher = new ResourceRegistryPublisherImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||
resourceRegistryClient = new ResourceRegistryClientImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||
}else {
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -13,9 +13,11 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.entities.face
|
|||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientFactory;
|
||||
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientImpl;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ContextTest;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherFactory;
|
||||
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisherImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
|
||||
import org.gcube.resourcemanagement.model.impl.entities.resources.EServiceImpl;
|
||||
|
@ -41,8 +43,13 @@ public class RRClientTest extends ContextTest {
|
|||
protected ResourceRegistryClient resourceRegistryClient;
|
||||
|
||||
public RRClientTest(){
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||
if(ContextTest.RESOURCE_REGISTRY_URL !=null && !ContextTest.RESOURCE_REGISTRY_URL.isEmpty()) {
|
||||
resourceRegistryPublisher = new ResourceRegistryPublisherImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||
resourceRegistryClient = new ResourceRegistryClientImpl(ContextTest.RESOURCE_REGISTRY_URL);
|
||||
}else {
|
||||
resourceRegistryPublisher = ResourceRegistryPublisherFactory.create();
|
||||
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
||||
}
|
||||
logger.trace("{} and {} created",
|
||||
ResourceRegistryPublisher.class.getSimpleName(),
|
||||
ResourceRegistryClient.class.getSimpleName());
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue