Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ote.rest.client/src/org/eclipse/osee/ote/rest/client/internal/RunTests.java')
-rw-r--r--plugins/org.eclipse.osee.ote.rest.client/src/org/eclipse/osee/ote/rest/client/internal/RunTests.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.ote.rest.client/src/org/eclipse/osee/ote/rest/client/internal/RunTests.java b/plugins/org.eclipse.osee.ote.rest.client/src/org/eclipse/osee/ote/rest/client/internal/RunTests.java
index 775c76c31d7..f28be597355 100644
--- a/plugins/org.eclipse.osee.ote.rest.client/src/org/eclipse/osee/ote/rest/client/internal/RunTests.java
+++ b/plugins/org.eclipse.osee.ote.rest.client/src/org/eclipse/osee/ote/rest/client/internal/RunTests.java
@@ -4,14 +4,15 @@ import java.net.URI;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriBuilder;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.jaxrs.client.JaxRsClient;
import org.eclipse.osee.ote.rest.client.Progress;
import org.eclipse.osee.ote.rest.client.ProgressWithCancel;
import org.eclipse.osee.ote.rest.model.OTEJobStatus;
import org.eclipse.osee.ote.rest.model.OTETestRun;
+
public class RunTests implements ProgressWithCancel, Callable<ProgressWithCancel> {
private final URI uri;
@@ -38,12 +39,10 @@ public class RunTests implements ProgressWithCancel, Callable<ProgressWithCancel
@Override
public boolean cancelSingle() {
- WebTarget baseService;
+ URI targetUri = UriBuilder.fromUri(uri).path("ote").path("run").path("{run-id}").build(id);
try {
- baseService = factory.target(uri);
OTEJobStatus cancelStatus =
- baseService.path("ote").path("run").path(id).request(MediaType.APPLICATION_JSON).put(Entity.json(""),
- OTEJobStatus.class);
+ factory.target(targetUri).request(MediaType.APPLICATION_JSON).put(Entity.json(""), OTEJobStatus.class);
return cancelStatus.isSuccess();
} catch (Exception e) {
OseeLog.log(getClass(), Level.SEVERE, e);
@@ -52,18 +51,17 @@ public class RunTests implements ProgressWithCancel, Callable<ProgressWithCancel
}
private OTEJobStatus sendCommand() throws Exception {
- WebTarget baseService = factory.target(uri);
- return baseService.path("ote").path("run").request(MediaType.APPLICATION_JSON).post(Entity.json(tests),
- OTEJobStatus.class);
+ URI targetUri = UriBuilder.fromUri(uri).path("ote").path("run").build();
+ return factory.target(targetUri).request(MediaType.APPLICATION_JSON).post(Entity.json(tests), OTEJobStatus.class);
}
@Override
public boolean cancelAll() {
- WebTarget baseService;
+ URI targetUri = UriBuilder.fromUri(uri).path("ote").path("run").path("{run-id}").build(id);
+
try {
- baseService = factory.target(uri);
OTEJobStatus cancelStatus =
- baseService.path("ote").path("run").path(id).request(MediaType.APPLICATION_JSON).delete(OTEJobStatus.class);
+ factory.target(targetUri).request(MediaType.APPLICATION_JSON).delete(OTEJobStatus.class);
return cancelStatus.isSuccess();
} catch (Exception e) {
OseeLog.log(getClass(), Level.SEVERE, e);

Back to the top