Reorganizing code

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@141409 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-12-27 10:27:01 +00:00
parent 8ddd4bd3db
commit 92c081a8d8
22 changed files with 37 additions and 572 deletions

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement; package org.gcube.informationsystem.resourceregistry.er;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement; package org.gcube.informationsystem.resourceregistry.er;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement.entity; package org.gcube.informationsystem.resourceregistry.er.entity;
import java.io.IOException; import java.io.IOException;
import java.util.HashSet; import java.util.HashSet;
@ -23,8 +23,8 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema
import org.gcube.informationsystem.resourceregistry.context.ContextUtility; import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper; import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper;
import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper.PermissionMode; import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper.PermissionMode;
import org.gcube.informationsystem.resourceregistry.ermanagement.ERManagement; import org.gcube.informationsystem.resourceregistry.er.ERManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.relation.RelationManagement; import org.gcube.informationsystem.resourceregistry.er.relation.RelationManagement;
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl; import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
import org.gcube.informationsystem.resourceregistry.utils.HeaderUtility; import org.gcube.informationsystem.resourceregistry.utils.HeaderUtility;
import org.gcube.informationsystem.resourceregistry.utils.Utility; import org.gcube.informationsystem.resourceregistry.utils.Utility;

View File

@ -1,14 +1,14 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement.entity; package org.gcube.informationsystem.resourceregistry.er.entity;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
import org.gcube.informationsystem.model.entity.Facet; import org.gcube.informationsystem.model.entity.Facet;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException;
import org.gcube.informationsystem.resourceregistry.ermanagement.ERManagement; import org.gcube.informationsystem.resourceregistry.er.ERManagement;
import org.gcube.informationsystem.resourceregistry.utils.Utility; import org.gcube.informationsystem.resourceregistry.utils.Utility;
import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.Vertex;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement.entity; package org.gcube.informationsystem.resourceregistry.er.entity;
import java.util.Iterator; import java.util.Iterator;
@ -14,10 +14,10 @@ import org.gcube.informationsystem.model.relation.IsRelatedTo;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityAlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityAlreadyPresentException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
import org.gcube.informationsystem.resourceregistry.ermanagement.ERManagement; import org.gcube.informationsystem.resourceregistry.er.ERManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.relation.ConsistsOfManagement; import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.relation.IsRelatedToManagement; import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.relation.RelationManagement; import org.gcube.informationsystem.resourceregistry.er.relation.RelationManagement;
import org.gcube.informationsystem.resourceregistry.utils.Utility; import org.gcube.informationsystem.resourceregistry.utils.Utility;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement.relation; package org.gcube.informationsystem.resourceregistry.er.relation;
import org.gcube.informationsystem.model.relation.ConsistsOf; import org.gcube.informationsystem.model.relation.ConsistsOf;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement.relation; package org.gcube.informationsystem.resourceregistry.er.relation;
import org.gcube.informationsystem.model.relation.IsRelatedTo; import org.gcube.informationsystem.model.relation.IsRelatedTo;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.ermanagement.relation; package org.gcube.informationsystem.resourceregistry.er.relation;
import java.io.IOException; import java.io.IOException;
import java.util.HashSet; import java.util.HashSet;
@ -28,10 +28,10 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema
import org.gcube.informationsystem.resourceregistry.context.ContextUtility; import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper; import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper;
import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper.PermissionMode; import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper.PermissionMode;
import org.gcube.informationsystem.resourceregistry.ermanagement.ERManagement; import org.gcube.informationsystem.resourceregistry.er.ERManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.EntityManagement; import org.gcube.informationsystem.resourceregistry.er.entity.EntityManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.FacetManagement; import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.ResourceManagement; import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl; import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
import org.gcube.informationsystem.resourceregistry.utils.HeaderUtility; import org.gcube.informationsystem.resourceregistry.utils.HeaderUtility;
import org.gcube.informationsystem.resourceregistry.utils.Utility; import org.gcube.informationsystem.resourceregistry.utils.Utility;

View File

@ -16,8 +16,8 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resour
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath; import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.FacetManagement; import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.ResourceManagement; import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
import org.gcube.informationsystem.resourceregistry.query.Query; import org.gcube.informationsystem.resourceregistry.query.Query;
import org.gcube.informationsystem.resourceregistry.query.QueryImpl; import org.gcube.informationsystem.resourceregistry.query.QueryImpl;
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement; import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;

View File

@ -22,10 +22,10 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.rest.EntityPath; import org.gcube.informationsystem.resourceregistry.api.rest.EntityPath;
import org.gcube.informationsystem.resourceregistry.context.ContextUtility; import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.FacetManagement; import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.ResourceManagement; import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.relation.ConsistsOfManagement; import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.relation.IsRelatedToManagement; import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -1,28 +0,0 @@
package org.gcube.informationsystem.resourceregistry;
import org.gcube.informationsystem.resourceregistry.api.exceptions.InvalidQueryException;
import org.gcube.informationsystem.resourceregistry.rest.Access;
import org.glassfish.hk2.api.Factory;
public class AccessManagerFactory implements Factory<Access>{
@Override
public void dispose(Access arg0) {
// TODO Auto-generated method stub
}
@Override
public Access provide() {
return new Access() {
@Override
public String query(String query, int limit, String fetchPlan) throws InvalidQueryException {
if (query.equals("error"))
throw new InvalidQueryException("error in query");
return "result";
}
};
}
}

View File

@ -1,57 +0,0 @@
package org.gcube.informationsystem.resourceregistry;
import java.util.UUID;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextCreationException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
import org.gcube.informationsystem.resourceregistry.context.ContextManagement;
import org.glassfish.hk2.api.Factory;
public class ContextManagerFactory implements Factory<ContextManagement> {
@Override
public void dispose(ContextManagement arg0) {
}
@Override
public ContextManagement provide() {
return new ContextManagement() {
@Override
public boolean delete(UUID uuid) throws ContextNotFoundException {
return false;
}
@Override
public String create(UUID parentContextUUID, String name)
throws ContextCreationException {
return "{}";
}
@Override
public String rename(UUID contextUUID, String name)
throws ContextNotFoundException {
return "{}";
}
@Override
public String move(UUID newParentUUID, UUID contextToMoveUUID)
throws ContextNotFoundException {
return "{}";
}
@Override
public String read(UUID contextUUID)
throws ContextNotFoundException, ContextException {
return "{}";
}
};
}
}

View File

@ -1,280 +0,0 @@
package org.gcube.informationsystem.resourceregistry;
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
import org.glassfish.hk2.api.Factory;
public class SchemaManagerFactory implements Factory<SchemaManagement>{
@Override
public void dispose(SchemaManagement arg0) {
// TODO Auto-generated method stub
}
@Override
public SchemaManagement provide() {
return new SchemaManagement() {
@Override
public String registerEntitySchema(String jsonSchema)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getEntitySchema(String entityType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String updateEntitySchema(String entityType,
String jsonSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String deleteEntitySchema(String entityType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String registerFacetSchema(String jsonSchema)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getFacetSchema(String facetType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String updateFacetSchema(String facetType, String jsonSchema)
throws SchemaNotFoundException, SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String deleteFacetSchema(String facetType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String registerResourceSchema(String jsonSchema)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getResourceSchema(String resourceType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String updateResourceSchema(String resourceType,
String jsonSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String deleteResourceSchema(String resourceType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String registerEmbeddedTypeSchema(String jsonSchema)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getEmbeddedTypeSchema(String embeddedType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String updateEmbeddedTypeSchema(String embeddedType,
String jsonSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String deleteEmbeddedTypeSchema(String embeddedType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String registerRelationSchema(String jsonSchema)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getRelationSchema(String relationType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String updateRelationSchema(String relationType,
String jsonSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String deleteRelationSchema(String relationType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String registerConsistsOfSchema(String jsonSchema)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getConsistsOfSchema(String consistsOfType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String updateConsistsOfSchema(String consistsOfType,
String jsonSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String deleteConsistsOfSchema(String consistsOfType)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String registerIsRelatedToSchema(String jsonSchema)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getIsRelatedToSchema(String isRelatedToType)
throws SchemaNotFoundException {
// TODO Auto-generated method stub
return null;
}
@Override
public String updateIsRelatedToSchema(String isRelatedToType,
String jsonSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String deleteIsRelatedToSchema(String isRelatedToType)
throws SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getEntityTypes(String entityType,
boolean includeSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getFacetTypes(String facetType, boolean includeSchema)
throws SchemaNotFoundException, SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getResourceTypes(String resourceType,
boolean includeSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getEmbeddedTypes(String embeddedType,
boolean includeSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getRelationTypes(String relationType,
boolean includeSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getConsistsOfTypes(String consistsOfType,
boolean includeSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getIsRelatedToTypes(String isRelatedToType,
boolean includeSchema) throws SchemaNotFoundException,
SchemaException {
// TODO Auto-generated method stub
return null;
}
};
}
}

View File

@ -1,73 +0,0 @@
package org.gcube.informationsystem.resourceregistry.access;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.Response;
import org.gcube.informationsystem.resourceregistry.AccessManagerFactory;
import org.gcube.informationsystem.resourceregistry.ContextManagerFactory;
import org.gcube.informationsystem.resourceregistry.SchemaManagerFactory;
import org.gcube.informationsystem.resourceregistry.context.ContextManagement;
import org.gcube.informationsystem.resourceregistry.rest.Access;
import org.gcube.informationsystem.resourceregistry.rest.ResourceRegistryExceptionMapper;
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.junit.Assert;
import org.junit.Test;
public class AccessTest extends JerseyTest{
@Override
protected Application configure() {
AbstractBinder binder = new AbstractBinder() {
@Override
protected void configure() {
bindFactory(ContextManagerFactory.class).to(ContextManagement.class);
bindFactory(AccessManagerFactory.class).to(Access.class);
bindFactory(SchemaManagerFactory.class).to(SchemaManagement.class);
}
};
ResourceConfig config = new ResourceConfig(Access.class, ResourceRegistryExceptionMapper.class);
config.register(binder);
return config;
}
@Test
public void validQuery(){
Response response = target("access").queryParam("query", "select * from test").request().get(Response.class);
Assert.assertEquals(200, response.getStatus());
}
@Test
public void invalidQuery(){
Response response = target("access").queryParam("query", "error").request().get(Response.class);
Assert.assertEquals(400, response.getStatus());
}
@Test
public void getfacet(){
Response response = target("access").path("facet").path("facetId").request().get(Response.class);
Assert.assertEquals(200, response.getStatus());
}
@Test
public void getResource(){
Response response = target("access").path("resource").path("resourceId").request().get(Response.class);
Assert.assertEquals(200, response.getStatus());
}
@Test
public void getfacetSchema(){
Response response = target("access").path("facet").path("schema").path("facetType").request().get(Response.class);
Assert.assertEquals(200, response.getStatus());
}
@Test
public void getResourceSchema(){
Response response = target("access").path("resource").path("schema").path("resourceType").request().get(Response.class);
Assert.assertEquals(200, response.getStatus());
}
}

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.resources.impl; package org.gcube.informationsystem.resourceregistry.access;
import org.gcube.informationsystem.resourceregistry.ScopedTest; import org.gcube.informationsystem.resourceregistry.ScopedTest;
import org.gcube.informationsystem.resourceregistry.api.exceptions.InvalidQueryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.InvalidQueryException;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.resources.impl; package org.gcube.informationsystem.resourceregistry.context;
import java.util.UUID; import java.util.UUID;
@ -11,7 +11,6 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegis
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextCreationException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextCreationException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
import org.gcube.informationsystem.resourceregistry.context.ContextManagementImpl;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -1,56 +0,0 @@
package org.gcube.informationsystem.resourceregistry.context;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.Response;
import org.gcube.informationsystem.resourceregistry.ContextManagerFactory;
import org.gcube.informationsystem.resourceregistry.rest.ContextManager;
import org.gcube.informationsystem.resourceregistry.rest.ResourceRegistryExceptionMapper;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.junit.Assert;
import org.junit.Test;
public class ContextManagementTest extends JerseyTest {
@Override
protected Application configure() {
AbstractBinder binder = new AbstractBinder() {
@Override
protected void configure() {
bindFactory(ContextManagerFactory.class)
.to(ContextManagement.class);
}
};
ResourceConfig config = new ResourceConfig(ContextManager.class, ResourceRegistryExceptionMapper.class);
config.register(binder);
return config;
}
@Test
public void create(){
Response response = target("context").path("parentContextId").request().put(Entity.text(new String("{fake context creation}")), Response.class);
Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
}
@Test
public void delete(){
Response response = target("context").path("contextID").request().delete(Response.class);
Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
}
@Test
public void move(){
Response response = target("context").path("Move").path("contextID").request().put(Entity.text(new String("{newContextParentId}")), Response.class);
Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
}
@Test
public void rename(){
Response response = target("context").path("Rename").path("contextID").request().put(Entity.text(new String("{newName}")), Response.class);
Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
}
}

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.resources.impl; package org.gcube.informationsystem.resourceregistry.context;
import java.net.URI; import java.net.URI;
import java.net.URL; import java.net.URL;
@ -47,8 +47,8 @@ import org.gcube.informationsystem.resourceregistry.ScopedTest;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.FacetManagement; import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.ResourceManagement; import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -1,40 +0,0 @@
/**
*
*/
package org.gcube.informationsystem.resourceregistry.dbinitialization;
import org.gcube.informationsystem.impl.utils.discovery.ERDiscovery;
import org.gcube.informationsystem.model.embedded.Embedded;
import org.gcube.informationsystem.model.entity.Entity;
import org.gcube.informationsystem.model.relation.Relation;
import org.junit.Test;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
/**
* @author Luca Frosini (ISTI - CNR)
*
*/
public class ContextCreation {
@Test
public void aux() throws Exception{
OrientGraphFactory factory = new OrientGraphFactory("remote:pc-frosini.isti.cnr.it", "admin", "admin").setupPool(1, 10);
factory.getTx();
}
@Test
public void test() throws Exception{
ERDiscovery.addPackage(Embedded.class.getPackage());
ERDiscovery.addPackage(Entity.class.getPackage());
ERDiscovery.addPackage(Relation.class.getPackage());
ERDiscovery erDiscovery = new ERDiscovery();
erDiscovery.discoverERTypes();
//EntityRegistrationAction erEntityRegistrationAction = new EntityRegistrationAction();
//erDiscovery.manageDiscoveredERTypes(erEntityRegistrationAction);
}
}

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.resources.impl; package org.gcube.informationsystem.resourceregistry.er;
import java.net.URI; import java.net.URI;
import java.net.URL; import java.net.URL;
@ -43,9 +43,9 @@ import org.gcube.informationsystem.model.relation.Relation;
import org.gcube.informationsystem.model.relation.isrelatedto.Hosts; import org.gcube.informationsystem.model.relation.isrelatedto.Hosts;
import org.gcube.informationsystem.resourceregistry.ScopedTest; import org.gcube.informationsystem.resourceregistry.ScopedTest;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.FacetManagement; import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.ResourceManagement; import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
import org.gcube.informationsystem.resourceregistry.ermanagement.relation.ConsistsOfManagement; import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.resources.impl; package org.gcube.informationsystem.resourceregistry.er;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
@ -56,7 +56,7 @@ import org.gcube.informationsystem.model.relation.consistsof.HasPersistentMemory
import org.gcube.informationsystem.model.relation.consistsof.HasVolatileMemory; import org.gcube.informationsystem.model.relation.consistsof.HasVolatileMemory;
import org.gcube.informationsystem.resourceregistry.ScopedTest; import org.gcube.informationsystem.resourceregistry.ScopedTest;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.ermanagement.entity.ResourceManagement; import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package org.gcube.informationsystem.resourceregistry.resources.impl; package org.gcube.informationsystem.resourceregistry.schema;
import java.util.List; import java.util.List;