From 06eaafe6c566d7751ae58a6a40a31247016faf24 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 4 Dec 2019 09:57:49 +0100 Subject: [PATCH] Version 2.0.0 --- .classpath | 2 +- .settings/org.eclipse.core.resources.prefs | 6 ++++++ .settings/org.eclipse.jdt.core.prefs | 5 +++++ pom.xml | 7 +++---- .../executor/client/SmartExecutorClientImpl.java | 11 +++-------- .../executor/client/SmartExecutorClientTest.java | 6 ++++-- 6 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs diff --git a/.classpath b/.classpath index 8e795b1..fae1a2b 100644 --- a/.classpath +++ b/.classpath @@ -22,7 +22,7 @@ - + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..29abf99 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..714351a --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/pom.xml b/pom.xml index 53c2603..55833fc 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.vremanagement smart-executor-client - 2.0.0-SNAPSHOT + 2.0.0 Smart Executor Service Client Library jar @@ -31,7 +31,7 @@ org.gcube.distribution gcube-bom - LATEST + 1.4.0 pom import @@ -82,13 +82,12 @@ ch.qos.logback logback-classic - 1.0.13 test org.gcube.vremanagement hello-world-se-plugin - [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + [1.0.0, 2.0.0-SNAPSHOT) test diff --git a/src/main/java/org/gcube/vremanagement/executor/client/SmartExecutorClientImpl.java b/src/main/java/org/gcube/vremanagement/executor/client/SmartExecutorClientImpl.java index d1a4786..7a875e1 100644 --- a/src/main/java/org/gcube/vremanagement/executor/client/SmartExecutorClientImpl.java +++ b/src/main/java/org/gcube/vremanagement/executor/client/SmartExecutorClientImpl.java @@ -18,7 +18,6 @@ import org.gcube.common.gxhttp.reference.GXConnection; import org.gcube.common.gxhttp.reference.GXConnection.HTTPMETHOD; import org.gcube.common.gxhttp.request.GXHTTPStringRequest; import org.gcube.vremanagement.executor.api.rest.RestConstants; -import org.gcube.vremanagement.executor.api.rest.SmartExecutor; import org.gcube.vremanagement.executor.api.types.LaunchParameter; import org.gcube.vremanagement.executor.exception.ExecutorException; import org.gcube.vremanagement.executor.json.SEMapper; @@ -179,7 +178,7 @@ public class SmartExecutorClientImpl implements SmartExecutorClient { @Override public String getOrphanLaunches() { - return getScheduledTask(SmartExecutor.ORPHAN_PATH_PARAM); + return getScheduledTask(RestConstants.ORPHAN_PATH_PARAM); } @Override @@ -310,12 +309,8 @@ public class SmartExecutorClientImpl implements SmartExecutorClient { gxHTTPStringRequest.queryParams(parameters); HttpURLConnection httpURLConnection = gxHTTPStringRequest.delete(); - String stoppedString = parseHttpURLConnection(httpURLConnection); - Boolean stopped = Boolean.valueOf(stoppedString); - - logger.debug("Plugin {} with UUID {} {} stopped on host {}", pluginName, executionIdentifier, - stopped ? "successfully" : "was not", host); - return stopped; + parseHttpURLConnection(httpURLConnection); + return true; } catch(WebApplicationException e) { throw e; } catch(Exception e) { diff --git a/src/test/java/org/gcube/vremanagement/executor/client/SmartExecutorClientTest.java b/src/test/java/org/gcube/vremanagement/executor/client/SmartExecutorClientTest.java index 4ec5c63..c58a87e 100644 --- a/src/test/java/org/gcube/vremanagement/executor/client/SmartExecutorClientTest.java +++ b/src/test/java/org/gcube/vremanagement/executor/client/SmartExecutorClientTest.java @@ -57,8 +57,10 @@ public class SmartExecutorClientTest extends ContextTest { return launchParameter; } - // @Test - public void testServiceInteraction() throws IOException { + @Test + public void testServiceInteraction() throws Exception { + SmartExecutorClientFactory.forceURL("http://pc-frosini.isti.cnr.it:8080/smart-executor"); + HelloWorldPluginDeclaration helloWorldPluginDeclaration = new HelloWorldPluginDeclaration(); logger.debug("Going to test smart executor using {} plugin", helloWorldPluginDeclaration.getName()); SmartExecutorClient smartExecutorClient = SmartExecutorClientFactory