Fixed context creation
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/resource-registry-database-creator@171337 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d94a7a4436
commit
837e7d9abd
|
@ -12,6 +12,7 @@ import org.gcube.informationsystem.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.entity.Context;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
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.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -59,7 +60,12 @@ public class ContextCreator extends ContextElaborator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void elaborateContext(ScopeBean scopeBean) throws Exception {
|
protected void elaborateContext(ScopeBean scopeBean) throws Exception {
|
||||||
UUID uuid = getContextUUID(scopeBean);
|
UUID uuid = null;
|
||||||
|
try {
|
||||||
|
uuid = getContextUUID(scopeBean);
|
||||||
|
}catch (ContextNotFoundException e) {
|
||||||
|
// The context has to be created
|
||||||
|
}
|
||||||
if(uuid==null) {
|
if(uuid==null) {
|
||||||
logger.info("Parent Context of {} is {}", scopeBean, scopeBean.enclosingScope());
|
logger.info("Parent Context of {} is {}", scopeBean, scopeBean.enclosingScope());
|
||||||
UUID parentUUID = getContextUUID(scopeBean.enclosingScope());
|
UUID parentUUID = getContextUUID(scopeBean.enclosingScope());
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class ContextManagementTest {
|
public class ContextManagementTest extends ScopedTest {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(ContextManagementTest.class);
|
private static Logger logger = LoggerFactory.getLogger(ContextManagementTest.class);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue