You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.4 KiB
Java
80 lines
2.4 KiB
Java
package org.gcube.informationsystem.exporter;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
|
import org.gcube.informationsystem.exporter.mapper.GenericResourceExporterTest;
|
|
import org.gcube.informationsystem.exporter.mapper.ServiceEndpointExporterTest;
|
|
import org.junit.Test;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
public class ISExporterPluginTest {
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(ISExporterPluginTest.class);
|
|
|
|
// @Test
|
|
public void testLaunch() throws ObjectNotFound, Exception {
|
|
String[] tokens = {
|
|
ContextTest.GCUBE,
|
|
ContextTest.GCUBE_DEVSEC,
|
|
ContextTest.GCUBE_DEVSEC_DEVVRE,
|
|
// ContextTest.GCUBE_DEVNEXT,
|
|
// ContextTest.GCUBE_DEVNEXT_NEXTNEXT
|
|
};
|
|
|
|
for(String token : tokens) {
|
|
logger.info("\n\n\n-------------------------------------------------------------------------");
|
|
ContextTest.setContext(token);
|
|
ISExporterPlugin isExporterPlugin = new ISExporterPlugin(new ISExporterPluginDeclaration());
|
|
Map<String,Object> inputs = new HashMap<String,Object>();
|
|
inputs.put(ISExporterPlugin.FILTERED_REPORT, true);
|
|
isExporterPlugin.launch(inputs);
|
|
logger.info("\n\n\n");
|
|
}
|
|
}
|
|
|
|
// @Test
|
|
public void export() throws ObjectNotFound, Exception {
|
|
String[] tokens = {
|
|
ContextTest.GCUBE,
|
|
ContextTest.GCUBE_DEVSEC,
|
|
ContextTest.GCUBE_DEVSEC_DEVVRE,
|
|
// ContextTest.GCUBE_DEVNEXT,
|
|
// ContextTest.GCUBE_DEVNEXT_NEXTNEXT
|
|
};
|
|
|
|
for(String token : tokens) {
|
|
ContextTest.setContext(token);
|
|
|
|
GenericResourceExporterTest genericResourceExporterTest = new GenericResourceExporterTest();
|
|
genericResourceExporterTest.export();
|
|
|
|
ServiceEndpointExporterTest serviceEndpointExporterTest = new ServiceEndpointExporterTest();
|
|
serviceEndpointExporterTest.export();
|
|
}
|
|
}
|
|
|
|
//@Test
|
|
public void removeExported() throws ObjectNotFound, Exception {
|
|
String[] tokens = {
|
|
ContextTest.GCUBE,
|
|
ContextTest.GCUBE_DEVSEC,
|
|
ContextTest.GCUBE_DEVSEC_DEVVRE,
|
|
ContextTest.GCUBE_DEVNEXT,
|
|
ContextTest.GCUBE_DEVNEXT_NEXTNEXT
|
|
};
|
|
|
|
for(String token : tokens) {
|
|
ContextTest.setContext(token);
|
|
|
|
GenericResourceExporterTest genericResourceExporterTest = new GenericResourceExporterTest();
|
|
genericResourceExporterTest.removeExported();
|
|
|
|
ServiceEndpointExporterTest serviceEndpointExporterTest = new ServiceEndpointExporterTest();
|
|
serviceEndpointExporterTest.removeExported();
|
|
}
|
|
}
|
|
}
|