Switched to new APIs which removed the PluginDeclaration class
This commit is contained in:
parent
6206a091f4
commit
8bf985b124
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
||||||
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
|
import org.gcube.vremanagement.executor.plugin.PluginDefinition;
|
||||||
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
|
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
|
||||||
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
|
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ public interface SmartExecutorClient {
|
||||||
|
|
||||||
public String getAvailablePlugins();
|
public String getAvailablePlugins();
|
||||||
|
|
||||||
public List<PluginDeclaration> getPlugins() throws IOException;
|
public List<PluginDefinition> getPlugins() throws IOException;
|
||||||
|
|
||||||
public String getLaunches();
|
public String getLaunches();
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.gcube.vremanagement.executor.api.rest.RestConstants;
|
||||||
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
||||||
import org.gcube.vremanagement.executor.exception.ExecutorException;
|
import org.gcube.vremanagement.executor.exception.ExecutorException;
|
||||||
import org.gcube.vremanagement.executor.json.SEMapper;
|
import org.gcube.vremanagement.executor.json.SEMapper;
|
||||||
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
|
import org.gcube.vremanagement.executor.plugin.PluginDefinition;
|
||||||
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
|
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
|
||||||
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
|
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -147,9 +147,9 @@ public class SmartExecutorClientImpl implements SmartExecutorClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PluginDeclaration> getPlugins() throws IOException {
|
public List<PluginDefinition> getPlugins() throws IOException {
|
||||||
String pluginList = getAvailablePlugins();
|
String pluginList = getAvailablePlugins();
|
||||||
return SEMapper.getInstance().unmarshalList(PluginDeclaration.class,pluginList);
|
return SEMapper.getInstance().unmarshalList(PluginDefinition.class,pluginList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getScheduledTask(String name) {
|
private String getScheduledTask(String name) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
||||||
import org.gcube.vremanagement.executor.api.types.Scheduling;
|
import org.gcube.vremanagement.executor.api.types.Scheduling;
|
||||||
import org.gcube.vremanagement.executor.client.query.Discover;
|
import org.gcube.vremanagement.executor.client.query.Discover;
|
||||||
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
|
import org.gcube.vremanagement.executor.plugin.PluginDefinition;
|
||||||
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
|
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
|
||||||
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
|
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
|
||||||
import org.gcube.vremanagement.helloworld.HelloWorldPlugin;
|
import org.gcube.vremanagement.helloworld.HelloWorldPlugin;
|
||||||
|
@ -68,9 +68,9 @@ public class SmartExecutorClientTest extends ContextTest {
|
||||||
String host = smartExecutorClient.getHost();
|
String host = smartExecutorClient.getHost();
|
||||||
Assert.assertTrue(host.contains("pc-frosini.isti.cnr.it"));
|
Assert.assertTrue(host.contains("pc-frosini.isti.cnr.it"));
|
||||||
|
|
||||||
List<PluginDeclaration> plugins = smartExecutorClient.getPlugins();
|
List<PluginDefinition> plugins = smartExecutorClient.getPlugins();
|
||||||
Assert.assertTrue(plugins.size() == 1);
|
Assert.assertTrue(plugins.size() == 1);
|
||||||
PluginDeclaration pluginDeclaration = plugins.get(0);
|
PluginDefinition pluginDeclaration = plugins.get(0);
|
||||||
|
|
||||||
Assert.assertTrue(pluginDeclaration.getName().compareTo(helloWorldPluginDeclaration.getName()) == 0);
|
Assert.assertTrue(pluginDeclaration.getName().compareTo(helloWorldPluginDeclaration.getName()) == 0);
|
||||||
Assert.assertTrue(
|
Assert.assertTrue(
|
||||||
|
@ -118,8 +118,8 @@ public class SmartExecutorClientTest extends ContextTest {
|
||||||
logger.debug("Host {}", SmartExecutorClientImpl.getHostFromCompleteURL(host));
|
logger.debug("Host {}", SmartExecutorClientImpl.getHostFromCompleteURL(host));
|
||||||
SmartExecutorClientImpl client = new SmartExecutorClientImpl();
|
SmartExecutorClientImpl client = new SmartExecutorClientImpl();
|
||||||
client.setAddress(host);
|
client.setAddress(host);
|
||||||
List<PluginDeclaration> plugins = client.getPlugins();
|
List<PluginDefinition> plugins = client.getPlugins();
|
||||||
for(PluginDeclaration p : plugins) {
|
for(PluginDefinition p : plugins) {
|
||||||
logger.debug("\tPlugin {}", p);
|
logger.debug("\tPlugin {}", p);
|
||||||
client.setPluginName(p.getName());
|
client.setPluginName(p.getName());
|
||||||
List<ScheduledTask> tasks = client.getScheduledLaunches();
|
List<ScheduledTask> tasks = client.getScheduledLaunches();
|
||||||
|
|
Loading…
Reference in New Issue