Fixing tests

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/resource-registry-database-creator@177102 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2019-02-13 11:25:56 +00:00
parent 94b3abaade
commit 2734389b42
4 changed files with 7 additions and 7 deletions

View File

@ -32,7 +32,7 @@ public class ContextCreator extends ContextElaborator {
protected Context create(Context context) throws ResourceRegistryException, IOException { protected Context create(Context context) throws ResourceRegistryException, IOException {
ContextManagement contextManagement = new ContextManagement(); ContextManagement contextManagement = new ContextManagement();
contextManagement.setJSON(ISMapper.marshal(context)); contextManagement.setJson(ISMapper.marshal(context));
String contextString = contextManagement.create(); String contextString = contextManagement.create();
logger.info("Created {}", contextString); logger.info("Created {}", contextString);
Context c = ISMapper.unmarshal(Context.class, contextString); Context c = ISMapper.unmarshal(Context.class, contextString);

View File

@ -24,9 +24,9 @@ import org.slf4j.LoggerFactory;
* @author Luca Frosini (ISTI - CNR) * @author Luca Frosini (ISTI - CNR)
* *
*/ */
public class ScopedTest { public class ContextTest {
private static final Logger logger = LoggerFactory.getLogger(ScopedTest.class); private static final Logger logger = LoggerFactory.getLogger(ContextTest.class);
protected static final String PROPERTIES_FILENAME = "token.properties"; protected static final String PROPERTIES_FILENAME = "token.properties";
@ -38,7 +38,7 @@ public class ScopedTest {
static { static {
Properties properties = new Properties(); Properties properties = new Properties();
InputStream input = ScopedTest.class.getClassLoader().getResourceAsStream(PROPERTIES_FILENAME); InputStream input = ContextTest.class.getClassLoader().getResourceAsStream(PROPERTIES_FILENAME);
try { try {
// load the properties file // load the properties file

View File

@ -33,7 +33,7 @@ public class DataBaseCreator {
protected Context create(Context context) throws ResourceRegistryException, IOException { protected Context create(Context context) throws ResourceRegistryException, IOException {
ContextManagement contextManagement = new ContextManagement(); ContextManagement contextManagement = new ContextManagement();
contextManagement.setJSON(ISMapper.marshal(context)); contextManagement.setJson(ISMapper.marshal(context));
String contextString = contextManagement.create(); String contextString = contextManagement.create();
logger.info("Created {}", contextString); logger.info("Created {}", contextString);
Context c = ISMapper.unmarshal(Context.class, contextString); Context c = ISMapper.unmarshal(Context.class, contextString);

View File

@ -1,13 +1,13 @@
package org.gcube.informationsystem.resourceregistry.context; package org.gcube.informationsystem.resourceregistry.context;
import org.gcube.informationsystem.resourceregistry.ScopedTest; import org.gcube.informationsystem.resourceregistry.ContextTest;
import org.junit.Test; import org.junit.Test;
/* /*
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
*/ */
public class ContextManagementTest extends ScopedTest { public class ContextManagementTest extends ContextTest {
// private static Logger logger = LoggerFactory.getLogger(ContextManagementTest.class); // private static Logger logger = LoggerFactory.getLogger(ContextManagementTest.class);