Fixed imports and class names due to IS Model refactoring
This commit is contained in:
parent
191b91d6c9
commit
4998a3768e
|
@ -14,7 +14,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.context.Conte
|
|||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
||||
import org.gcube.informationsystem.resourceregistry.contexts.entities.ContextManagement;
|
||||
import org.gcube.informationsystem.utils.ISMapper;
|
||||
import org.gcube.informationsystem.utils.ElementMapper;
|
||||
import org.gcube.resourcemanagement.support.shared.types.datamodel.D4SEnvironment;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -34,10 +34,10 @@ public class ContextCreator extends ContextElaborator {
|
|||
|
||||
protected Context create(Context context) throws ResourceRegistryException, IOException {
|
||||
ContextManagement contextManagement = new ContextManagement();
|
||||
contextManagement.setJson(ISMapper.marshal(context));
|
||||
contextManagement.setJson(ElementMapper.marshal(context));
|
||||
String contextString = contextManagement.create();
|
||||
logger.info("Created {}", contextString);
|
||||
Context c = ISMapper.unmarshal(Context.class, contextString);
|
||||
Context c = ElementMapper.unmarshal(Context.class, contextString);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ import org.gcube.informationsystem.base.reference.entities.EntityElement;
|
|||
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
|
||||
import org.gcube.informationsystem.base.reference.relations.RelationElement;
|
||||
import org.gcube.informationsystem.types.TypeBinder;
|
||||
import org.gcube.informationsystem.types.reference.TypeDefinition;
|
||||
import org.gcube.informationsystem.types.reference.Type;
|
||||
import org.gcube.informationsystem.types.reference.entities.EntityType;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyType;
|
||||
import org.gcube.informationsystem.types.reference.relations.RelationType;
|
||||
import org.gcube.informationsystem.utils.ISMapper;
|
||||
import org.gcube.informationsystem.utils.discovery.ISMDiscovery;
|
||||
import org.gcube.informationsystem.utils.ElementMapper;
|
||||
import org.gcube.informationsystem.utils.discovery.ElementSpecilizationDiscovery;
|
||||
import org.gcube.informationsystem.utils.discovery.RegistrationProvider;
|
||||
import org.gcube.informationsystem.utils.discovery.SchemaAction;
|
||||
import org.junit.Test;
|
||||
|
@ -25,9 +25,9 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public class EntityDiscoveryTest {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ISMDiscovery.class);
|
||||
private static Logger logger = LoggerFactory.getLogger(ElementSpecilizationDiscovery.class);
|
||||
|
||||
private void addDiscoveredModel(ISMDiscovery<? extends Element> ismDiscovery) {
|
||||
private void addDiscoveredModel(ElementSpecilizationDiscovery<? extends Element> ismDiscovery) {
|
||||
ServiceLoader<? extends RegistrationProvider> regsitrationProviders = ServiceLoader
|
||||
.load(RegistrationProvider.class);
|
||||
for(RegistrationProvider registrationProvider : regsitrationProviders) {
|
||||
|
@ -63,7 +63,7 @@ public class EntityDiscoveryTest {
|
|||
};
|
||||
List<Package> packages = new ArrayList<Package>();
|
||||
|
||||
Class<TypeDefinition> tdClz = TypeDefinition.class;
|
||||
Class<Type> tdClz = Type.class;
|
||||
packages.add(tdClz.getPackage());
|
||||
|
||||
AccessType[] accessTypes = AccessType.values();
|
||||
|
@ -77,20 +77,20 @@ public class EntityDiscoveryTest {
|
|||
for(RegistrationProvider registrationProvider : regsitrationProviders) {
|
||||
packages.addAll(registrationProvider.getPackagesToRegister());
|
||||
}
|
||||
ISMDiscovery.manageISM(schemaAction, packages);
|
||||
ElementSpecilizationDiscovery.manageISM(schemaAction, packages);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPropertyDiscovery() throws Exception {
|
||||
ISMDiscovery<PropertyElement> propertyDiscovery = new ISMDiscovery<PropertyElement>(PropertyElement.class);
|
||||
ElementSpecilizationDiscovery<PropertyElement> propertyDiscovery = new ElementSpecilizationDiscovery<PropertyElement>(PropertyElement.class);
|
||||
addDiscoveredModel(propertyDiscovery);
|
||||
propertyDiscovery.discover();
|
||||
|
||||
for(Class<? extends PropertyElement> propertyClass : propertyDiscovery.getDiscovered()) {
|
||||
String json = TypeBinder.serializeType(propertyClass);
|
||||
logger.info("{}", json);
|
||||
TypeDefinition typeDefinition = TypeBinder.deserializeTypeDefinition(json);
|
||||
logger.info("{}", ISMapper.marshal(typeDefinition));
|
||||
Type typeDefinition = TypeBinder.deserializeTypeDefinition(json);
|
||||
logger.info("{}", ElementMapper.marshal(typeDefinition));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class EntityDiscoveryTest {
|
|||
|
||||
@Test
|
||||
public void testDefinitionSerialization() throws Exception {
|
||||
logger.info("{}", TypeBinder.serializeType(TypeDefinition.class));
|
||||
logger.info("{}", TypeBinder.serializeType(Type.class));
|
||||
logger.info("{}", TypeBinder.serializeType(EntityType.class));
|
||||
logger.info("{}", TypeBinder.serializeType(RelationType.class));
|
||||
logger.info("{}", TypeBinder.serializeType(PropertyType.class));
|
||||
|
@ -110,7 +110,7 @@ public class EntityDiscoveryTest {
|
|||
|
||||
@Test
|
||||
public void testEntityDiscovery() throws Exception {
|
||||
ISMDiscovery<EntityElement> entityDiscovery = new ISMDiscovery<>(EntityElement.class);
|
||||
ElementSpecilizationDiscovery<EntityElement> entityDiscovery = new ElementSpecilizationDiscovery<>(EntityElement.class);
|
||||
addDiscoveredModel(entityDiscovery);
|
||||
entityDiscovery.discover();
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class EntityDiscoveryTest {
|
|||
@Test
|
||||
public void testRelationDiscovery() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ISMDiscovery<RelationElement> relationDiscovery = new ISMDiscovery<>(RelationElement.class);
|
||||
ElementSpecilizationDiscovery<RelationElement> relationDiscovery = new ElementSpecilizationDiscovery<>(RelationElement.class);
|
||||
addDiscoveredModel(relationDiscovery);
|
||||
relationDiscovery.discover();
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@ import org.gcube.informationsystem.context.reference.entities.Context;
|
|||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.contexts.entities.ContextManagement;
|
||||
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
||||
import org.gcube.informationsystem.utils.ISMapper;
|
||||
import org.gcube.informationsystem.utils.discovery.ISMDiscovery;
|
||||
import org.gcube.informationsystem.utils.ElementMapper;
|
||||
import org.gcube.informationsystem.utils.discovery.ElementSpecilizationDiscovery;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class DataBaseCreator extends ContextTest {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ISMDiscovery.class);
|
||||
private static Logger logger = LoggerFactory.getLogger(ElementSpecilizationDiscovery.class);
|
||||
|
||||
@Test
|
||||
public void createDatabase() throws Exception {
|
||||
|
@ -26,10 +26,10 @@ public class DataBaseCreator extends ContextTest {
|
|||
|
||||
protected Context create(Context context) throws ResourceRegistryException, IOException {
|
||||
ContextManagement contextManagement = new ContextManagement();
|
||||
contextManagement.setJson(ISMapper.marshal(context));
|
||||
contextManagement.setJson(ElementMapper.marshal(context));
|
||||
String contextString = contextManagement.create();
|
||||
logger.info("Created {}", contextString);
|
||||
Context c = ISMapper.unmarshal(Context.class, contextString);
|
||||
Context c = ElementMapper.unmarshal(Context.class, contextString);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue