This commit is contained in:
Fabio Sinibaldi 2019-04-02 15:46:32 +00:00
parent a078f1026c
commit e3bf07b1aa
29 changed files with 253 additions and 16 deletions

View File

@ -4,4 +4,18 @@ public class Constants {
public static final String GCAT_TYPE="GCAT";
public static final String PLUGIN_ID="DATAMINER_ALGORITHMS_COLLECTOR";
public static final String ENVIRONMENT_PROPERTIES_BASE=PLUGIN_ID+".";
// ENVIRONMENT EXPECTED PARAMETERS
public static final String GUI_BASE_URL=ENVIRONMENT_PROPERTIES_BASE+"GUI_BASE_URL";
public static final String DEFAULT_AUTHOR=ENVIRONMENT_PROPERTIES_BASE+"DEFAULT_AUTHOR";
public static final String DEFAULT_MAINTAINER=ENVIRONMENT_PROPERTIES_BASE+"DEFAULT_MAINTAINER";
public static final String VISIBILITY=ENVIRONMENT_PROPERTIES_BASE+"VISIBILITY";
}

View File

@ -2,6 +2,7 @@ package org.gcube.data.publishing.gCatFeeder.collectors.dm;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.gcube.data.analysis.dataminermanagercl.server.DataMinerService;
@ -11,6 +12,7 @@ import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorCategor
import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorsClassification;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.InternalAlgorithmDescriptor;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.InternalAlgorithmDescriptor.Parameter;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatfeeder.collectors.DataCollector;
import org.gcube.data.publishing.gCatfeeder.collectors.model.faults.CollectorFault;
@ -19,6 +21,13 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorithmDescriptor> {
private Map<String,String> env=null;
public void setEnvironmentConfiguration(EnvironmentConfiguration envConfig) {
this.env=envConfig.getCurrentConfiguration();
}
@Override
public Set<InternalAlgorithmDescriptor> collect() throws CollectorFault {
@ -70,8 +79,8 @@ public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorith
desc.setId(opID);
desc.setName(operatorName);
desc.setAuthor(DataMinerCollectorProperties.getProperty(DataMinerCollectorProperties.DEFAULT_AUTHOR));
desc.setMaintainer(DataMinerCollectorProperties.getProperty(DataMinerCollectorProperties.DEFAULT_AUTHOR));
desc.setAuthor(getAuthor(opDescription));
desc.setMaintainer(desc.getAuthor());
// Parameters info
for(org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter param:op.getOperatorParameters()) {
String paramDescription=param.getDescription();
@ -87,6 +96,12 @@ public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorith
desc.getTags().add(categoryName);
desc.setGuiLink(getGUIBasePath()+"?"+
DataMinerCollectorProperties.getProperty(DataMinerCollectorProperties.GUI_PARAM_NAME)+"="+opID);
desc.setVisibility(env.get(Constants.VISIBILITY));
toReturn.add(desc);
}
@ -106,4 +121,27 @@ public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorith
}
}
private String getGUIBasePath() {
return env.get(Constants.GUI_BASE_URL);
}
private String getAuthor(String algorithmDescription) {
String toReturn=parseDescription(algorithmDescription);
if(toReturn==null)
toReturn=env.get(Constants.DEFAULT_AUTHOR);
if(toReturn==null)
toReturn=DataMinerCollectorProperties.getProperty(DataMinerCollectorProperties.DEFAULT_AUTHOR);
return toReturn;
}
private static final String parseDescription(String description) {
return null;
}
private final String getWPSBasePath() {
return null;
}
}

View File

@ -6,6 +6,10 @@ import java.util.Properties;
public class DataMinerCollectorProperties {
public static final String DEFAULT_AUTHOR="default_author";
public static final String GUI_PARAM_NAME="gui_param_name";
public static final String CKAN_RESOURCE_TYPE="DataMiner Process";
private static Properties props;

View File

@ -4,13 +4,13 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.Properties;
import java.util.Set;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.InternalAlgorithmDescriptor;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.ckan.GCatModel;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
import org.gcube.data.publishing.gCatFeeder.model.ControllerConfiguration;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatfeeder.collectors.CatalogueRetriever;
import org.gcube.data.publishing.gCatfeeder.collectors.CollectorPlugin;
import org.gcube.data.publishing.gCatfeeder.collectors.DataCollector;
@ -29,7 +29,7 @@ public class DataMinerPlugin implements CollectorPlugin<InternalAlgorithmDescrip
@Override
public PluginDescriptor getDescriptor() {
return new PluginDescriptor("DATA_MINER_ALGORITHMS");
return new PluginDescriptor(Constants.PLUGIN_ID);
}
@Override
@ -83,4 +83,10 @@ public class DataMinerPlugin implements CollectorPlugin<InternalAlgorithmDescrip
return new ControllerConfiguration();
}
@Override
public void setEnvironmentConfiguration(EnvironmentConfiguration env) {
// TODO Auto-generated method stub
}
}

View File

@ -16,9 +16,9 @@ public class GCATRetriever implements CatalogueRetriever {
@Override
public CatalogueInstanceDescriptor getInstance() {
throw new RuntimeException("Implement this");
// throw new RuntimeException("Implement this");
// GCoreEndpoint ep=ISUtils.queryForGCoreEndpoint("NO", "NO");
// return null;
return new CatalogueInstanceDescriptor();
}
}

View File

@ -72,6 +72,10 @@ public class InternalAlgorithmDescriptor implements CustomData {
private Set<Parameter> parameters=new HashSet<>();
private String guiLink;
private String wpsLink;
private String visibility;
private List<String> tags=new ArrayList<>();

View File

@ -2,6 +2,9 @@ package org.gcube.data.publishing.gCatFeeder.collectors.dm.model.ckan;
public class CkanResource {
private String name;
private String url;
private String description;
}

View File

@ -3,6 +3,7 @@ package org.gcube.data.publishing.gCatFeeder.collectors.dm.model.ckan;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.DataMinerCollectorProperties;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.InternalAlgorithmDescriptor;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.InternalAlgorithmDescriptor.Parameter;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
@ -40,7 +41,9 @@ public class GCatModel implements CatalogueFormatData {
for(String tag:desc.getTags()) {
item.getTags().add(fixTag(tag));
}
item.getExtras().add(new CKanExtraField("system", "Algorithm"));
item.getExtras().add(new CKanExtraField("system", DataMinerCollectorProperties.getProperty(DataMinerCollectorProperties.CKAN_RESOURCE_TYPE)));
item.setVisibility(desc.getVisibility());
// TODO ADD PARAMETERS
for(Parameter param: desc.getParameters())
@ -50,7 +53,6 @@ public class GCatModel implements CatalogueFormatData {
((param.getValue()!=null&&!param.getValue().isEmpty())?"default : "+param.getValue():""),
param.getDescription())));
// TODO ADD RESOURCES
}

View File

@ -1 +1,2 @@
default_author=gianpaolo.coro
default_author=gianpaolo.coro
gui_param_name=OperatorId

View File

@ -1,8 +1,14 @@
<metadataformat type="Algorithm">
<metadataformat type="DataMiner Process">
<metadatafield>
<fieldName>Input Parameter</fieldName>
<dataType>String</dataType>
<mandatory>false</mandatory>
<note>Input parameter expected for the execution of the algorithm</note>
</metadatafield>
<note>Input parameter expected for the execution of the process</note>
</metadatafield>
<metadatafield>
<fieldName>Output Parameter</fieldName>
<dataType>String</dataType>
<mandatory>false</mandatory>
<note>Output parameter expected from the execution of the process</note>
</metadatafield>
</metadataformat>

View File

@ -3,6 +3,7 @@ package org.gcube.data.publishing.gCatFeeder.catalogues;
import org.gcube.data.publishing.gCatFeeder.catalogues.model.CataloguePluginDescriptor;
import org.gcube.data.publishing.gCatFeeder.catalogues.model.faults.ControllerInstantiationFault;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueInstanceDescriptor;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
public interface CataloguePlugin {
@ -14,4 +15,7 @@ public interface CataloguePlugin {
public void init() throws Exception;
public void initInScope() throws Exception;
public void setEnvironmentConfiguration(EnvironmentConfiguration env);
}

View File

@ -4,6 +4,7 @@ import java.util.Set;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
import org.gcube.data.publishing.gCatFeeder.model.ControllerConfiguration;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatfeeder.collectors.model.CustomData;
import org.gcube.data.publishing.gCatfeeder.collectors.model.PluginDescriptor;
import org.gcube.data.publishing.gCatfeeder.collectors.model.faults.CatalogueNotSupportedException;
@ -26,4 +27,7 @@ public interface CollectorPlugin<E extends CustomData>{
public void init() throws Exception;
public void initInScope() throws Exception;
public void setEnvironmentConfiguration(EnvironmentConfiguration env);
}

View File

@ -0,0 +1,9 @@
package org.gcube.data.publishing.gCatFeeder.model;
import java.util.Map;
public interface EnvironmentConfiguration {
public Map<String,String> getCurrentConfiguration();
}

View File

@ -6,6 +6,7 @@ import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
import java.util.List;
import org.gcube.common.resources.gcore.GCoreEndpoint;
import org.gcube.common.resources.gcore.GenericResource;
import org.gcube.common.resources.gcore.ServiceEndpoint;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
@ -45,4 +46,18 @@ public class ISUtils {
return client.submit(query);
}
public static List<GenericResource> queryForGenericResources(String name,String secondaryType) {
log.debug("Querying for Generic Resource [Name : {} , SecondaryType : {}, currentScope : {} ]",secondaryType,name,ContextUtils.getCurrentScope());
SimpleQuery query =queryFor(GenericResource.class);
query.addCondition("$resource/Profile/SecondaryType/text() eq '"+secondaryType+"'")
.addCondition("$resource/Profile/Name/text() eq '"+name+"'");
// .setResult("$resource/Profile/AccessPoint");
DiscoveryClient<GenericResource> client = clientFor(GenericResource.class);
return client.submit(query);
}
}

View File

@ -5,6 +5,7 @@ import org.gcube.data.publishing.gCatFeeder.catalogues.CataloguePlugin;
import org.gcube.data.publishing.gCatFeeder.catalogues.model.CataloguePluginDescriptor;
import org.gcube.data.publishing.gCatFeeder.catalogues.model.faults.ControllerInstantiationFault;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueInstanceDescriptor;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
public class GCatPlugin implements CataloguePlugin {
@ -31,4 +32,10 @@ public class GCatPlugin implements CataloguePlugin {
}
@Override
public void setEnvironmentConfiguration(EnvironmentConfiguration env) {
// TODO Auto-generated method stub
}
}

View File

@ -71,6 +71,12 @@ public class Interactions extends BaseCataloguePluginTest{
}
@Test
public void testDM() throws CatalogueInteractionException, WrongObjectFormatException, PublicationException, InternalConversionException, ControllerInstantiationFault {
Assume.assumeTrue(isTestInfrastructureEnabled());
publish(getController(),"full-algorithm.json");
}
@Test(expected=WrongObjectFormatException.class)
public void empties() throws CatalogueInteractionException, WrongObjectFormatException, PublicationException, ControllerInstantiationFault, InternalConversionException {
Assume.assumeTrue(isTestInfrastructureEnabled());

View File

@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Mon Apr 01 15:14:16 CEST 2019
#Tue Apr 02 17:12:53 CEST 2019
version=1.0.0-SNAPSHOT
groupId=org.gcube.data-publishing.gCat-Feeder
m2e.projectName=gCat-Controller

View File

@ -3,6 +3,7 @@ package org.gcube.data.publishing.gCatFeeder.service;
import javax.inject.Singleton;
import javax.ws.rs.ApplicationPath;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatFeeder.service.engine.CatalogueControllersManager;
import org.gcube.data.publishing.gCatFeeder.service.engine.CollectorsManager;
import org.gcube.data.publishing.gCatFeeder.service.engine.ConnectionManager;
@ -17,6 +18,7 @@ import org.gcube.data.publishing.gCatFeeder.service.engine.impl.CollectorsManage
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.ExecutionManagerImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.FeederEngineImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.InfrastructureUtilsImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.LiveEnvironmentConfiguration;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.LocalConfigurationImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.persistence.ConnectionManagerImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.persistence.PersistenceManagerImpl;
@ -44,6 +46,8 @@ public class GCatFeeder extends ResourceConfig{
bind(PersistenceManagerImpl.class).to(PersistenceManager.class);
bind(ConnectionManagerImpl.class).to(ConnectionManager.class).in(Singleton.class);
bind(LocalConfigurationImpl.class).to(LocalConfiguration.class).in(Singleton.class);
bind(LiveEnvironmentConfiguration.class).to(EnvironmentConfiguration.class);
}
};
register(binder);

View File

@ -1,5 +1,7 @@
package org.gcube.data.publishing.gCatFeeder.service.engine;
import java.util.Map;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.persistence.DatabaseConnectionDescriptor;
public interface Infrastructure {
@ -19,4 +21,7 @@ public interface Infrastructure {
//
public DatabaseConnectionDescriptor queryForDatabase(String category,String name) throws InternalError;
public Map<String,String> getEnvironmentConfigurationParameters();
}

View File

@ -13,6 +13,7 @@ import org.gcube.data.publishing.gCatFeeder.catalogues.model.faults.PublicationE
import org.gcube.data.publishing.gCatFeeder.catalogues.model.faults.WrongObjectFormatException;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueInstanceDescriptor;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatFeeder.model.InternalConversionException;
import org.gcube.data.publishing.gCatFeeder.service.engine.CatalogueControllersManager;
import org.gcube.data.publishing.gCatFeeder.service.engine.CollectorsManager;
@ -51,6 +52,9 @@ public class ExecutionTask implements Runnable {
private Storage storage;
private EnvironmentConfiguration environmentConfiguration;
public ExecutionTask(ExecutionDescriptor desc) {
super();
this.request=desc;
@ -110,6 +114,10 @@ public class ExecutionTask implements Runnable {
}
public void setEnvironmentConfiguration(EnvironmentConfiguration environmentConfiguration) {
this.environmentConfiguration = environmentConfiguration;
}
@Override
public void run() {
try {
@ -186,6 +194,7 @@ public class ExecutionTask implements Runnable {
log.debug("Looking for catalogue instance ..");
CatalogueRetriever retriever=collectorPlugin.getRetrieverByCatalogueType(cataloguePluginId);
CatalogueInstanceDescriptor instanceDescriptor=retriever.getInstance();
cataloguePlugin.setEnvironmentConfiguration(environmentConfiguration);
CatalogueController controller=cataloguePlugin.instantiateController(instanceDescriptor);
controller.configure(collectorPlugin.getPublisherControllerConfiguration(cataloguePluginId));
@ -252,6 +261,7 @@ public class ExecutionTask implements Runnable {
// * COLLECT DATA
log.info("Starting collector {} ",collectorId);
CollectorPlugin collectorPlugin=collectors.getPluginById(collectorId);
collectorPlugin.setEnvironmentConfiguration(environmentConfiguration);
DataCollector collector=collectorPlugin.getCollector();
log.info("Collecting data..");
Set collectedData=collector.collect();

View File

@ -3,8 +3,17 @@ package org.gcube.data.publishing.gCatFeeder.service.engine.impl;
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.gcube.common.resources.gcore.ServiceEndpoint;
import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
@ -12,16 +21,47 @@ import org.gcube.data.publishing.gCatFeeder.service.engine.Infrastructure;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.persistence.DatabaseConnectionDescriptor;
import org.gcube.data.publishing.gCatFeeder.utils.CommonUtils;
import org.gcube.data.publishing.gCatFeeder.utils.ContextUtils;
import org.gcube.data.publishing.gCatFeeder.utils.ISUtils;
import org.gcube.data.publishing.gCatFeeder.utils.TokenUtils;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
public class InfrastructureUtilsImpl implements Infrastructure {
private static final Logger log= LoggerFactory.getLogger(InfrastructureUtilsImpl.class);
private static DocumentBuilder builder;
private static DocumentBuilderFactory factory;
private static XPathFactory xPathfactory;
private static XPath xpath;
private static XPathExpression expr;
static {
factory= DocumentBuilderFactory.newInstance();
xPathfactory = XPathFactory.newInstance();
xpath = xPathfactory.newXPath();
try {
builder= factory.newDocumentBuilder();
expr= xpath.compile("string(/bookstore/book/title/@lang)");
} catch (ParserConfigurationException | XPathExpressionException e) {
throw new RuntimeException("Unable to initialize Controller");
}
}
@Override
public String getCurrentToken() {
return TokenUtils.getCurrentToken();
@ -91,4 +131,17 @@ public class InfrastructureUtilsImpl implements Infrastructure {
return toReturn;
}
@Override
public Map<String, String> getEnvironmentConfigurationParameters() {
HashMap<String,String> toReturn=new HashMap<>();
Element root=(Element) ISUtils.queryForGenericResources("gcat-feeder", "configuration").get(0).profile().body().getChildNodes().item(0);
NodeList parameters=root.getChildNodes();
for(int i=0;i<parameters.getLength();i++) {
String value=parameters.item(i).getTextContent();
String key=parameters.item(i).getNodeName();
toReturn.put(key, value);
}
return toReturn;
}
}

View File

@ -0,0 +1,21 @@
package org.gcube.data.publishing.gCatFeeder.service.engine.impl;
import java.util.Map;
import javax.inject.Inject;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatFeeder.service.engine.Infrastructure;
public class LiveEnvironmentConfiguration implements EnvironmentConfiguration {
@Inject
private Infrastructure infra;
@Override
public Map<String, String> getCurrentConfiguration() {
return infra.getEnvironmentConfigurationParameters();
}
}

View File

@ -22,13 +22,11 @@ import org.gcube.data.publishing.gCatFeeder.service.engine.impl.CatalogueControl
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.CollectorsManagerImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.ExecutionManagerImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.FeederEngineImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.InfrastructureUtilsImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.LocalConfigurationImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.persistence.ConnectionManagerImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.persistence.PersistenceManagerImpl;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.persistence.StorageImpl;
import org.gcube.data.publishing.gCatFeeder.service.mockups.InfrastructureMockup;
import org.gcube.data.publishing.gCatFeeder.service.mockups.PersistenceManagerMock;
import org.gcube.data.publishing.gCatFeeder.service.mockups.StorageMockup;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.test.JerseyTest;

View File

@ -11,6 +11,7 @@ import org.gcube.data.publishing.gCatFeeder.catalogues.model.faults.WrongObjectF
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueInstanceDescriptor;
import org.gcube.data.publishing.gCatFeeder.model.ControllerConfiguration;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatFeeder.service.TestCommon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -68,4 +69,10 @@ public class FakeCataloguePlugin implements CataloguePlugin {
}catch(InterruptedException e) {}
}
@Override
public void setEnvironmentConfiguration(EnvironmentConfiguration env) {
// TODO Auto-generated method stub
}
}

View File

@ -8,6 +8,7 @@ import java.util.Set;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueInstanceDescriptor;
import org.gcube.data.publishing.gCatFeeder.model.ControllerConfiguration;
import org.gcube.data.publishing.gCatFeeder.model.EnvironmentConfiguration;
import org.gcube.data.publishing.gCatFeeder.service.TestCommon;
import org.gcube.data.publishing.gCatfeeder.collectors.CatalogueRetriever;
import org.gcube.data.publishing.gCatfeeder.collectors.CollectorPlugin;
@ -109,4 +110,10 @@ public class FakeCollectorPlugin implements CollectorPlugin<FakeCustomData> {
}catch(InterruptedException e) {}
}
@Override
public void setEnvironmentConfiguration(EnvironmentConfiguration env) {
// TODO Auto-generated method stub
}
}

View File

@ -1,6 +1,8 @@
package org.gcube.data.publishing.gCatFeeder.service.mockups;
import java.sql.SQLException;
import java.util.Collections;
import java.util.Map;
import org.gcube.data.publishing.gCatFeeder.service.BaseTest;
import org.gcube.data.publishing.gCatFeeder.service.engine.impl.InfrastructureUtilsImpl;
@ -81,6 +83,13 @@ public class InfrastructureMockup extends InfrastructureUtilsImpl {
return toEncrypt;
}
@Override
public Map<String, String> getEnvironmentConfigurationParameters() {
if(BaseTest.isTestInfrastructureEnabled())
return super.getEnvironmentConfigurationParameters();
else return Collections.emptyMap();
}
@Override
public DatabaseConnectionDescriptor queryForDatabase(String category, String name) throws InternalError {

View File

@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Mon Apr 01 15:14:17 CEST 2019
#Tue Apr 02 17:12:52 CEST 2019
version=1.0.0-SNAPSHOT
groupId=org.gcube.data-publishing.gCat-Feeder
m2e.projectName=test-commons