diff --git a/DataMinerAlgorithmsCrawler/src/main/java/org/gcube/data/publishing/gCatFeeder/collectors/dm/DMAlgorithmsInfoCollector.java b/DataMinerAlgorithmsCrawler/src/main/java/org/gcube/data/publishing/gCatFeeder/collectors/dm/DMAlgorithmsInfoCollector.java index db7922f..754aa1c 100644 --- a/DataMinerAlgorithmsCrawler/src/main/java/org/gcube/data/publishing/gCatFeeder/collectors/dm/DMAlgorithmsInfoCollector.java +++ b/DataMinerAlgorithmsCrawler/src/main/java/org/gcube/data/publishing/gCatFeeder/collectors/dm/DMAlgorithmsInfoCollector.java @@ -6,11 +6,11 @@ import java.util.Set; import org.gcube.data.analysis.dataminermanagercl.server.DataMinerService; import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClient; -import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter; import org.gcube.data.analysis.dataminermanagercl.shared.process.Operator; import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorCategory; 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.collectors.DataCollector; import org.gcube.data.publishing.gCatfeeder.collectors.model.faults.CollectorFault; @@ -70,18 +70,22 @@ public class DMAlgorithmsInfoCollector implements DataCollector { + + + + @Override public PluginDescriptor getDescriptor() { return new PluginDescriptor("DATA_MINER_ALGORITHMS"); @@ -60,7 +65,10 @@ public class DataMinerPlugin implements CollectorPlugin plugin:collectorPluginsLoader) { @@ -112,8 +101,6 @@ public class BaseCollectorTest { -protected static boolean isTestInfrastructureEnabled() { - return testContext!=null; -} + } diff --git a/test-commons/src/main/java/org/gcube/data/publishing/gCatFeeder/tests/InfrastructureTests.java b/test-commons/src/main/java/org/gcube/data/publishing/gCatFeeder/tests/InfrastructureTests.java new file mode 100644 index 0000000..0928f75 --- /dev/null +++ b/test-commons/src/main/java/org/gcube/data/publishing/gCatFeeder/tests/InfrastructureTests.java @@ -0,0 +1,37 @@ +package org.gcube.data.publishing.gCatFeeder.tests; + +import java.io.IOException; +import java.util.Properties; + +import org.gcube.common.authorization.library.provider.SecurityTokenProvider; +import org.gcube.common.scope.api.ScopeProvider; +import org.junit.BeforeClass; + +public class InfrastructureTests { + + private static String testContext=null; + + static { + testContext=System.getProperty("testContext"); + System.out.println("TEST CONTEXT = "+testContext); + } + + protected static boolean isTestInfrastructureEnabled() { + return testContext!=null; + } + + @BeforeClass + public static void setTestContext() { + + if(isTestInfrastructureEnabled()) { + Properties props=new Properties(); + try{ + props.load(BaseCollectorTest.class.getResourceAsStream("/tokens.properties")); + }catch(IOException e) {throw new RuntimeException(e);} + if(!props.containsKey(testContext)) throw new RuntimeException("No token found for scope : "+testContext); + SecurityTokenProvider.instance.set(props.getProperty(testContext)); + ScopeProvider.instance.set(testContext); + } + } + +} diff --git a/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCataloguePluginTest.class b/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCataloguePluginTest.class index 47f5b5b..d3c0385 100644 Binary files a/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCataloguePluginTest.class and b/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCataloguePluginTest.class differ diff --git a/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCollectorTest.class b/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCollectorTest.class index 95ea02f..fa7e038 100644 Binary files a/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCollectorTest.class and b/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/BaseCollectorTest.class differ diff --git a/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/InfrastructureTests.class b/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/InfrastructureTests.class new file mode 100644 index 0000000..e702857 Binary files /dev/null and b/test-commons/target/classes/org/gcube/data/publishing/gCatFeeder/tests/InfrastructureTests.class differ