This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 5bc9e9e999 remove deprecated hop server classes, fixes #4560 (#7559)
5bc9e9e999 is described below
commit 5bc9e9e999be497e92c405ef97fa8f4ba8a167bd
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Fri Jul 17 16:37:16 2026 +0200
remove deprecated hop server classes, fixes #4560 (#7559)
---
engine/pom.xml | 13 --
.../main/java/org/apache/hop/www/WebServer.java | 10 -
.../apache/hop/www/jaxrs/HopServerResource.java | 146 ------------
.../main/java/org/apache/hop/www/jaxrs/NVPair.java | 50 -----
.../org/apache/hop/www/jaxrs/PipelineResource.java | 244 --------------------
.../org/apache/hop/www/jaxrs/PipelineStatus.java | 72 ------
.../org/apache/hop/www/jaxrs/ServerStatus.java | 247 ---------------------
.../org/apache/hop/www/jaxrs/WorkflowResource.java | 245 --------------------
.../org/apache/hop/www/jaxrs/WorkflowStatus.java | 56 -----
.../java/org/apache/hop/www/jaxrs/NVPairTest.java | 44 ----
.../apache/hop/www/jaxrs/PipelineStatusTest.java | 48 ----
.../org/apache/hop/www/jaxrs/ServerStatusTest.java | 41 ----
.../apache/hop/www/jaxrs/WorkflowStatusTest.java | 36 ---
13 files changed, 1252 deletions(-)
diff --git a/engine/pom.xml b/engine/pom.xml
index 6737dba305..adc2e0318f 100644
--- a/engine/pom.xml
+++ b/engine/pom.xml
@@ -163,15 +163,6 @@
<groupId>org.eclipse.jetty.ee11</groupId>
<artifactId>jetty-ee11-webapp</artifactId>
</dependency>
- <dependency>
- <groupId>org.glassfish.jersey.connectors</groupId>
- <artifactId>jersey-jetty-connector</artifactId>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.containers</groupId>
- <artifactId>jersey-container-servlet</artifactId>
- <!-- jersey-container-servlet-core was merged into
jersey-container-servlet in Jersey 4.0 -->
- </dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
@@ -180,10 +171,6 @@
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
</dependency>
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-server</artifactId>
- </dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
diff --git a/engine/src/main/java/org/apache/hop/www/WebServer.java
b/engine/src/main/java/org/apache/hop/www/WebServer.java
index 0141df5c81..f0b7960831 100644
--- a/engine/src/main/java/org/apache/hop/www/WebServer.java
+++ b/engine/src/main/java/org/apache/hop/www/WebServer.java
@@ -63,7 +63,6 @@ import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.resource.ResourceFactory;
import org.eclipse.jetty.util.security.Password;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.glassfish.jersey.servlet.ServletContainer;
public class WebServer {
@@ -254,15 +253,6 @@ public class WebServer {
shutdownServlet.setJettyMode(true);
shutdownContext.addServlet(new ServletHolder(shutdownServlet), "/*");
- // setup jersey (REST)
- ServletHolder jerseyServletHolder = new
ServletHolder(ServletContainer.class);
- jerseyServletHolder.setInitParameter(
- "com.sun.jersey.config.property.resourceConfigClass",
- "com.sun.jersey.api.core.PackagesResourceConfig");
- jerseyServletHolder.setInitParameter(
- "com.sun.jersey.config.property.packages", "org.apache.hop.www.jaxrs");
- root.addServlet(jerseyServletHolder, "/api/*");
-
// Static resources
ServletHolder staticHolder = new ServletHolder("static",
DefaultServlet.class);
// baseResource maps to the path relative to where hop-server is started
diff --git
a/engine/src/main/java/org/apache/hop/www/jaxrs/HopServerResource.java
b/engine/src/main/java/org/apache/hop/www/jaxrs/HopServerResource.java
deleted file mode 100644
index 903dbf10a0..0000000000
--- a/engine/src/main/java/org/apache/hop/www/jaxrs/HopServerResource.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.hop.core.logging.HopLogStore;
-import org.apache.hop.pipeline.PipelineMeta;
-import org.apache.hop.pipeline.engine.IPipelineEngine;
-import org.apache.hop.workflow.WorkflowMeta;
-import org.apache.hop.workflow.engine.IWorkflowEngine;
-import org.apache.hop.www.HopServerConfig;
-import org.apache.hop.www.HopServerObjectEntry;
-import org.apache.hop.www.HopServerSingleton;
-
-/**
- * @deprecated Since 2.18.0
- */
-@Deprecated(since = "2.18.0")
-@Path("/carte")
-public class HopServerResource {
-
- public HopServerResource() {
- // Do nothing
- }
-
- public static IPipelineEngine<PipelineMeta> getPipeline(String id) {
- return HopServerSingleton.getInstance()
- .getPipelineMap()
- .getPipeline(getHopServerObjectEntry(id));
- }
-
- public static IWorkflowEngine<WorkflowMeta> getWorkflow(String id) {
- return HopServerSingleton.getInstance()
- .getWorkflowMap()
- .getWorkflow(getHopServerObjectEntry(id));
- }
-
- public static HopServerObjectEntry getHopServerObjectEntry(String id) {
- List<HopServerObjectEntry> pipelineList =
- HopServerSingleton.getInstance().getPipelineMap().getPipelineObjects();
- for (HopServerObjectEntry entry : pipelineList) {
- if (entry.getId().equals(id)) {
- return entry;
- }
- }
- List<HopServerObjectEntry> workflowList =
- HopServerSingleton.getInstance().getWorkflowMap().getWorkflowObjects();
- for (HopServerObjectEntry entry : workflowList) {
- if (entry.getId().equals(id)) {
- return entry;
- }
- }
- return null;
- }
-
- @GET
- @Path("/systemInfo")
- @Produces({MediaType.APPLICATION_JSON})
- public ServerStatus getSystemInfo() {
- ServerStatus serverStatus = new ServerStatus();
- serverStatus.setStatusDescription("Online");
- return serverStatus;
- }
-
- @GET
- @Path("/configDetails")
- @Produces({MediaType.APPLICATION_JSON})
- public List<NVPair> getConfigDetails() {
- HopServerConfig serverConfig =
- HopServerSingleton.getInstance().getPipelineMap().getHopServerConfig();
- List<NVPair> list = new ArrayList<>();
- list.add(new NVPair("maxLogLines", "" +
HopLogStore.getAppender().getMaxNrLines()));
- list.add(new NVPair("maxLogLinesAge", "" +
HopLogStore.getMaxLogTimeoutMinutes()));
- list.add(
- new NVPair(
- "maxObjectsAge", "" +
HopServerSingleton.determineObjectTimeoutMinutes(serverConfig)));
- list.add(new NVPair("configFile", "" + serverConfig.getFilename()));
- return list;
- }
-
- @GET
- @Path("/pipelines")
- @Produces({MediaType.APPLICATION_JSON})
- public List<HopServerObjectEntry> getPipelines() {
- return
HopServerSingleton.getInstance().getPipelineMap().getPipelineObjects();
- }
-
- @GET
- @Path("/pipelines/detailed")
- @Produces({MediaType.APPLICATION_JSON})
- public List<PipelineStatus> getPipelineDetails() {
- List<HopServerObjectEntry> pipelineEntries =
- HopServerSingleton.getInstance().getPipelineMap().getPipelineObjects();
-
- List<PipelineStatus> details = new ArrayList<>();
-
- PipelineResource pipelineRes = new PipelineResource();
- for (HopServerObjectEntry entry : pipelineEntries) {
- details.add(pipelineRes.getPipelineStatus(entry.getId()));
- }
- return details;
- }
-
- @GET
- @Path("/workflows")
- @Produces({MediaType.APPLICATION_JSON})
- public List<HopServerObjectEntry> getWorkflows() {
- return
HopServerSingleton.getInstance().getWorkflowMap().getWorkflowObjects();
- }
-
- @GET
- @Path("/workflows/detailed")
- @Produces({MediaType.APPLICATION_JSON})
- public List<WorkflowStatus> getWorkflowsDetails() {
- List<HopServerObjectEntry> actions =
- HopServerSingleton.getInstance().getWorkflowMap().getWorkflowObjects();
-
- List<WorkflowStatus> details = new ArrayList<>();
-
- WorkflowResource jobRes = new WorkflowResource();
- for (HopServerObjectEntry entry : actions) {
- details.add(jobRes.getWorkflowStatus(entry.getId()));
- }
- return details;
- }
-}
diff --git a/engine/src/main/java/org/apache/hop/www/jaxrs/NVPair.java
b/engine/src/main/java/org/apache/hop/www/jaxrs/NVPair.java
deleted file mode 100644
index 3b48c970ce..0000000000
--- a/engine/src/main/java/org/apache/hop/www/jaxrs/NVPair.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import jakarta.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class NVPair {
-
- private String name;
- private String value;
-
- public NVPair() {}
-
- public NVPair(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-}
diff --git
a/engine/src/main/java/org/apache/hop/www/jaxrs/PipelineResource.java
b/engine/src/main/java/org/apache/hop/www/jaxrs/PipelineResource.java
deleted file mode 100644
index dc378da9d8..0000000000
--- a/engine/src/main/java/org/apache/hop/www/jaxrs/PipelineResource.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.PUT;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.Response;
-import java.util.UUID;
-import org.apache.hop.core.exception.HopException;
-import org.apache.hop.core.logging.HopLogStore;
-import org.apache.hop.core.logging.ILogChannel;
-import org.apache.hop.core.logging.LoggingObjectType;
-import org.apache.hop.core.logging.SimpleLoggingObject;
-import org.apache.hop.core.variables.IVariables;
-import org.apache.hop.core.variables.Variables;
-import org.apache.hop.metadata.api.IHopMetadataProvider;
-import org.apache.hop.metadata.serializer.multi.MultiMetadataProvider;
-import org.apache.hop.pipeline.PipelineConfiguration;
-import org.apache.hop.pipeline.PipelineExecutionConfiguration;
-import org.apache.hop.pipeline.PipelineMeta;
-import org.apache.hop.pipeline.engine.EngineComponent.ComponentExecutionStatus;
-import org.apache.hop.pipeline.engine.IEngineComponent;
-import org.apache.hop.pipeline.engine.IPipelineEngine;
-import org.apache.hop.pipeline.engine.PipelineEngineFactory;
-import org.apache.hop.pipeline.transform.TransformStatus;
-import org.apache.hop.www.HopServerObjectEntry;
-import org.apache.hop.www.HopServerSingleton;
-
-/**
- * @deprecated Since 2.18.0
- */
-@Deprecated(since = "2.18.0")
-@Path("/carte/pipeline")
-public class PipelineResource {
-
- public PipelineResource() {
- // Do nothing
- }
-
- @GET
- @Path("/log/{id : .+}")
- @Produces({MediaType.TEXT_PLAIN})
- public String getPipelineLog(@PathParam("id") String id) {
- return getPipelineLog(id, 0);
- }
-
- @GET
- @Path("/log/{id : .+}/{logStart : .+}")
- @Produces({MediaType.TEXT_PLAIN})
- public String getPipelineLog(@PathParam("id") String id,
@PathParam("logStart") int startLineNr) {
- int lastLineNr = HopLogStore.getLastBufferLineNr();
- IPipelineEngine<PipelineMeta> pipeline = HopServerResource.getPipeline(id);
-
- return HopLogStore.getAppender()
- .getBuffer(pipeline.getLogChannel().getLogChannelId(), false,
startLineNr, lastLineNr)
- .toString();
- }
-
- @GET
- @Path("/status/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus getPipelineStatus(@PathParam("id") String id) {
- PipelineStatus status = new PipelineStatus();
- // find pipeline
- IPipelineEngine<PipelineMeta> pipeline = HopServerResource.getPipeline(id);
- HopServerObjectEntry entry = HopServerResource.getHopServerObjectEntry(id);
-
- status.setId(entry.getId());
- status.setName(entry.getName());
- status.setStatus(pipeline.getStatusDescription());
-
- for (IEngineComponent component : pipeline.getComponents()) {
- if ((component.isRunning())
- || (component.getStatus() != ComponentExecutionStatus.STATUS_EMPTY))
{
- TransformStatus transformStatus = new TransformStatus(component);
- status.addTransformStatus(transformStatus);
- }
- }
- return status;
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/start/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus startPipeline(@PathParam("id") String id) {
- IPipelineEngine<PipelineMeta> pipeline = HopServerResource.getPipeline(id);
- try {
- // Discard old log lines from old pipeline runs
- //
- HopLogStore.discardLines(pipeline.getLogChannelId(), true);
-
- String serverObjectId = UUID.randomUUID().toString();
- SimpleLoggingObject servletLoggingObject =
- new SimpleLoggingObject(getClass().getName(),
LoggingObjectType.HOP_SERVER, null);
- servletLoggingObject.setContainerObjectId(serverObjectId);
- servletLoggingObject.setLogLevel(pipeline.getLogLevel());
- pipeline.setParent(servletLoggingObject);
- pipeline.execute();
- } catch (HopException e) {
- e.printStackTrace();
- }
- return getPipelineStatus(id);
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/prepare/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus preparePipeline(@PathParam("id") String id) {
- IPipelineEngine<PipelineMeta> pipeline = HopServerResource.getPipeline(id);
- try {
-
- HopServerObjectEntry entry =
HopServerResource.getHopServerObjectEntry(id);
- PipelineConfiguration pipelineConfiguration =
-
HopServerSingleton.getInstance().getPipelineMap().getConfiguration(entry);
- PipelineExecutionConfiguration executionConfiguration =
- pipelineConfiguration.getPipelineExecutionConfiguration();
- // Set the appropriate logging, variables, arguments, replay date, ...
- // etc.
- pipeline.setVariables(executionConfiguration.getVariablesMap());
- pipeline.setPreviousResult(executionConfiguration.getPreviousResult());
-
- pipeline.prepareExecution();
- } catch (HopException e) {
- e.printStackTrace();
- }
- return getPipelineStatus(id);
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/pause/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus pausePipeline(@PathParam("id") String id) {
- HopServerResource.getPipeline(id).pauseExecution();
- return getPipelineStatus(id);
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/resume/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus resumePipeline(@PathParam("id") String id) {
- HopServerResource.getPipeline(id).resumeExecution();
- return getPipelineStatus(id);
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/stop/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus stopPipeline(@PathParam("id") String id) {
- HopServerResource.getPipeline(id).stopAll();
- return getPipelineStatus(id);
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/remove/{id : .+}")
- public Response removePipeline(@PathParam("id") String id) {
- IPipelineEngine<PipelineMeta> pipeline = HopServerResource.getPipeline(id);
- HopServerObjectEntry entry = HopServerResource.getHopServerObjectEntry(id);
- HopLogStore.discardLines(pipeline.getLogChannelId(), true);
- HopServerSingleton.getInstance().getPipelineMap().removePipeline(entry);
- return Response.ok().build();
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/cleanup/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus cleanupPipeline(@PathParam("id") String id) {
- HopServerResource.getPipeline(id).cleanup();
- return getPipelineStatus(id);
- }
-
- @PUT
- @Path("/add")
- @Produces({MediaType.APPLICATION_JSON})
- public PipelineStatus addPipeline(String xml) {
- PipelineConfiguration pipelineConfiguration;
- try {
- pipelineConfiguration = PipelineConfiguration.fromXml(xml);
- IHopMetadataProvider metadataProvider =
- new MultiMetadataProvider(
- HopServerSingleton.getHopServer().getVariables(),
-
HopServerSingleton.getHopServer().getConfig().getMetadataProvider(),
- pipelineConfiguration.getMetadataProvider());
- PipelineMeta pipelineMeta = pipelineConfiguration.getPipelineMeta();
- ILogChannel log = HopServerSingleton.getInstance().getLog();
- if (log.isDetailed()) {
- log.logDetailed("Logging level set to " +
log.getLogLevel().getDescription());
- }
-
- PipelineExecutionConfiguration executionConfiguration =
- pipelineConfiguration.getPipelineExecutionConfiguration();
-
- String serverObjectId = UUID.randomUUID().toString();
- SimpleLoggingObject servletLoggingObject =
- new SimpleLoggingObject(getClass().getName(),
LoggingObjectType.HOP_SERVER, null);
- servletLoggingObject.setContainerObjectId(serverObjectId);
- servletLoggingObject.setLogLevel(executionConfiguration.getLogLevel());
-
- // Create the pipeline and store in the list...
- //
- String runConfigurationName =
executionConfiguration.getRunConfiguration();
- IVariables variables = Variables.getADefaultVariableSpace(); // TODO:
configure
- final IPipelineEngine pipeline =
- PipelineEngineFactory.createPipelineEngine(
- variables, variables.resolve(runConfigurationName),
metadataProvider, pipelineMeta);
- pipeline.setParent(servletLoggingObject);
-
- HopServerSingleton.getInstance()
- .getPipelineMap()
- .addPipeline(pipelineMeta.getName(), serverObjectId, pipeline,
pipelineConfiguration);
- pipeline.setContainerId(serverObjectId);
-
- return getPipelineStatus(serverObjectId);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/engine/src/main/java/org/apache/hop/www/jaxrs/PipelineStatus.java
b/engine/src/main/java/org/apache/hop/www/jaxrs/PipelineStatus.java
deleted file mode 100644
index 058b4d82f4..0000000000
--- a/engine/src/main/java/org/apache/hop/www/jaxrs/PipelineStatus.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import jakarta.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.hop.pipeline.transform.TransformStatus;
-
-@XmlRootElement
-public class PipelineStatus {
-
- private String id;
- private String name;
- private String status;
- private List<TransformStatus> transformStatuses = new ArrayList<>();
-
- public PipelineStatus() {
- // Do nothing
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public List<TransformStatus> getTransformStatuses() {
- return transformStatuses;
- }
-
- public void setTransformStatuses(List<TransformStatus> transformStatuses) {
- this.transformStatuses = transformStatuses;
- }
-
- public void addTransformStatus(TransformStatus status) {
- transformStatuses.add(status);
- }
-}
diff --git a/engine/src/main/java/org/apache/hop/www/jaxrs/ServerStatus.java
b/engine/src/main/java/org/apache/hop/www/jaxrs/ServerStatus.java
deleted file mode 100644
index bdaf4cac87..0000000000
--- a/engine/src/main/java/org/apache/hop/www/jaxrs/ServerStatus.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import jakarta.xml.bind.annotation.XmlRootElement;
-import java.lang.management.OperatingSystemMXBean;
-import java.lang.management.RuntimeMXBean;
-import java.lang.management.ThreadMXBean;
-import org.apache.hop.core.Const;
-import org.apache.hop.core.util.Utils;
-import org.apache.hop.core.xml.XmlHandler;
-import org.w3c.dom.Node;
-
-@XmlRootElement
-public class ServerStatus {
-
- private String statusDescription;
- private String errorDescription;
-
- private long memoryFree;
- private long memoryTotal;
-
- private int cpuCores;
- private long cpuProcessTime;
-
- private long uptime;
-
- private int threadCount;
-
- private double loadAvg;
-
- private String osName;
-
- private String osVersion;
-
- private String osArchitecture;
-
- public ServerStatus() {
- OperatingSystemMXBean operatingSystemMXBean =
- java.lang.management.ManagementFactory.getOperatingSystemMXBean();
- ThreadMXBean threadMXBean =
java.lang.management.ManagementFactory.getThreadMXBean();
- RuntimeMXBean runtimeMXBean =
java.lang.management.ManagementFactory.getRuntimeMXBean();
-
- int cores = Runtime.getRuntime().availableProcessors();
-
- long freeMemory = Runtime.getRuntime().freeMemory();
- long totalMemory = Runtime.getRuntime().totalMemory();
- String osArch = operatingSystemMXBean.getArch();
- String osName = operatingSystemMXBean.getName();
- String osVersion = operatingSystemMXBean.getVersion();
- double loadAvg = operatingSystemMXBean.getSystemLoadAverage();
-
- int threadCount = threadMXBean.getThreadCount();
- long allThreadsCpuTime = 0L;
-
- long[] threadIds = threadMXBean.getAllThreadIds();
- for (long threadId : threadIds) {
- allThreadsCpuTime += threadMXBean.getThreadCpuTime(threadId);
- }
-
- long uptime = runtimeMXBean.getUptime();
-
- setCpuCores(cores);
- setCpuProcessTime(allThreadsCpuTime);
- setUptime(uptime);
- setThreadCount(threadCount);
- setLoadAvg(loadAvg);
- setOsName(osName);
- setOsVersion(osVersion);
- setOsArchitecture(osArch);
- setMemoryFree(freeMemory);
- setMemoryTotal(totalMemory);
- }
-
- public ServerStatus(String statusDescription) {
- this();
- this.statusDescription = statusDescription;
- }
-
- public ServerStatus(Node statusNode) {
- this();
- statusDescription = XmlHandler.getTagValue(statusNode, "statusdesc");
-
- memoryFree = Const.toLong(XmlHandler.getTagValue(statusNode,
"memory_free"), -1L);
- memoryTotal = Const.toLong(XmlHandler.getTagValue(statusNode,
"memory_total"), -1L);
-
- String cpuCoresStr = XmlHandler.getTagValue(statusNode, "cpu_cores");
- cpuCores = Const.toInt(cpuCoresStr, -1);
- String cpuProcessTimeStr = XmlHandler.getTagValue(statusNode,
"cpu_process_time");
- cpuProcessTime = Utils.isEmpty(cpuProcessTimeStr) ? 0L :
Long.parseLong(cpuProcessTimeStr);
-
- uptime = Const.toLong(XmlHandler.getTagValue(statusNode, "uptime"), -1);
- threadCount = Const.toInt(XmlHandler.getTagValue(statusNode,
"thread_count"), -1);
- loadAvg = Const.toDouble(XmlHandler.getTagValue(statusNode, "load_avg"),
-1.0);
-
- osName = XmlHandler.getTagValue(statusNode, "os_name");
- osVersion = XmlHandler.getTagValue(statusNode, "os_version");
- osArchitecture = XmlHandler.getTagValue(statusNode, "os_arch");
- }
-
- /**
- * @return the statusDescription
- */
- public String getStatusDescription() {
- return statusDescription;
- }
-
- /**
- * @param statusDescription the statusDescription to set
- */
- public void setStatusDescription(String statusDescription) {
- this.statusDescription = statusDescription;
- }
-
- /**
- * @return the errorDescription
- */
- public String getErrorDescription() {
- return errorDescription;
- }
-
- /**
- * @param errorDescription the errorDescription to set
- */
- public void setErrorDescription(String errorDescription) {
- this.errorDescription = errorDescription;
- }
-
- /**
- * @return the memoryFree
- */
- public double getMemoryFree() {
- return memoryFree;
- }
-
- /**
- * @param memoryFree the memoryFree to set
- */
- public void setMemoryFree(long memoryFree) {
- this.memoryFree = memoryFree;
- }
-
- /**
- * @return the memoryTotal
- */
- public double getMemoryTotal() {
- return memoryTotal;
- }
-
- /**
- * @param memoryTotal the memoryTotal to set
- */
- public void setMemoryTotal(long memoryTotal) {
- this.memoryTotal = memoryTotal;
- }
-
- /**
- * @return the cpuCores
- */
- public int getCpuCores() {
- return cpuCores;
- }
-
- /**
- * @param cpuCores the cpuCores to set
- */
- public void setCpuCores(int cpuCores) {
- this.cpuCores = cpuCores;
- }
-
- /**
- * @return the cpuProcessTime
- */
- public long getCpuProcessTime() {
- return cpuProcessTime;
- }
-
- /**
- * @param cpuProcessTime the cpuProcessTime to set
- */
- public void setCpuProcessTime(long cpuProcessTime) {
- this.cpuProcessTime = cpuProcessTime;
- }
-
- public void setUptime(long uptime) {
- this.uptime = uptime;
- }
-
- public long getUptime() {
- return uptime;
- }
-
- public void setThreadCount(int threadCount) {
- this.threadCount = threadCount;
- }
-
- public int getThreadCount() {
- return threadCount;
- }
-
- public void setLoadAvg(double loadAvg) {
- this.loadAvg = loadAvg;
- }
-
- public double getLoadAvg() {
- return loadAvg;
- }
-
- public void setOsName(String osName) {
- this.osName = osName;
- }
-
- public String getOsName() {
- return osName;
- }
-
- public void setOsVersion(String osVersion) {
- this.osVersion = osVersion;
- }
-
- public String getOsVersion() {
- return osVersion;
- }
-
- public void setOsArchitecture(String osArch) {
- this.osArchitecture = osArch;
- }
-
- public String getOsArchitecture() {
- return osArchitecture;
- }
-}
diff --git
a/engine/src/main/java/org/apache/hop/www/jaxrs/WorkflowResource.java
b/engine/src/main/java/org/apache/hop/www/jaxrs/WorkflowResource.java
deleted file mode 100644
index 7b4f9c21fd..0000000000
--- a/engine/src/main/java/org/apache/hop/www/jaxrs/WorkflowResource.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.PUT;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.Response;
-import java.util.UUID;
-import org.apache.hop.core.exception.HopRuntimeException;
-import org.apache.hop.core.logging.HopLogStore;
-import org.apache.hop.core.logging.LoggingObjectType;
-import org.apache.hop.core.logging.SimpleLoggingObject;
-import org.apache.hop.core.util.Utils;
-import org.apache.hop.core.variables.IVariables;
-import org.apache.hop.core.variables.Variables;
-import org.apache.hop.metadata.api.IHopMetadataProvider;
-import org.apache.hop.metadata.serializer.multi.MultiMetadataProvider;
-import org.apache.hop.workflow.WorkflowConfiguration;
-import org.apache.hop.workflow.WorkflowExecutionConfiguration;
-import org.apache.hop.workflow.WorkflowMeta;
-import org.apache.hop.workflow.engine.IWorkflowEngine;
-import org.apache.hop.workflow.engine.WorkflowEngineFactory;
-import org.apache.hop.www.HopServerObjectEntry;
-import org.apache.hop.www.HopServerSingleton;
-
-/**
- * @deprecated Since 2.18.0
- */
-@Deprecated(since = "2.18.0")
-@Path("/carte/workflow")
-public class WorkflowResource {
-
- public WorkflowResource() {
- // Do nothing
- }
-
- @GET
- @Path("/log/{id : .+}")
- @Produces({MediaType.TEXT_PLAIN})
- public String getWorkflowLog(@PathParam("id") String id) {
- return getWorkflowLog(id, 0);
- }
-
- @GET
- @Path("/log/{id : .+}/{logStart : .+}")
- @Produces({MediaType.TEXT_PLAIN})
- public String getWorkflowLog(@PathParam("id") String id,
@PathParam("logStart") int startLineNr) {
- int lastLineNr = HopLogStore.getLastBufferLineNr();
- IWorkflowEngine<WorkflowMeta> workflow = HopServerResource.getWorkflow(id);
-
- return HopLogStore.getAppender()
- .getBuffer(workflow.getLogChannel().getLogChannelId(), false,
startLineNr, lastLineNr)
- .toString();
- }
-
- @GET
- @Path("/status/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public WorkflowStatus getWorkflowStatus(@PathParam("id") String id) {
- WorkflowStatus status = new WorkflowStatus();
- // find workflow
- IWorkflowEngine<WorkflowMeta> workflow = HopServerResource.getWorkflow(id);
- HopServerObjectEntry entry = HopServerResource.getHopServerObjectEntry(id);
-
- status.setId(entry.getId());
- status.setName(entry.getName());
- status.setStatus(workflow.getStatusDescription());
-
- return status;
- }
-
- // change from GET to UPDATE/POST for proper REST method
- @GET
- @Path("/start/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public WorkflowStatus startJob(@PathParam("id") String id) {
- IWorkflowEngine<WorkflowMeta> workflow = HopServerResource.getWorkflow(id);
- HopServerObjectEntry entry = HopServerResource.getHopServerObjectEntry(id);
- if (workflow.isInitialized() && !workflow.isActive()) {
- // Re-create the workflow from the workflowMeta
- //
-
- // Create a new workflow object to start from a sane state. Then replace
- // the new workflow in the workflow map
- //
- synchronized (this) {
- WorkflowConfiguration workflowConfiguration =
-
HopServerSingleton.getInstance().getWorkflowMap().getConfiguration(entry);
- IHopMetadataProvider metadataProvider =
- new MultiMetadataProvider(
- HopServerSingleton.getHopServerConfig().getVariables(),
- HopServerSingleton.getHopServer().getMetadataProvider(),
- workflowConfiguration.getMetadataProvider());
- String serverObjectId = UUID.randomUUID().toString();
- SimpleLoggingObject servletLoggingObject =
- new SimpleLoggingObject(getClass().getName(),
LoggingObjectType.HOP_SERVER, null);
- servletLoggingObject.setContainerObjectId(serverObjectId);
- String runConfigurationName =
-
workflowConfiguration.getWorkflowExecutionConfiguration().getRunConfiguration();
- try {
- IVariables variables = Variables.getADefaultVariableSpace();
- IWorkflowEngine<WorkflowMeta> newWorkflow =
- WorkflowEngineFactory.createWorkflowEngine(
- variables,
- variables.resolve(runConfigurationName),
- metadataProvider,
- workflow.getWorkflowMeta(),
- servletLoggingObject);
- newWorkflow.setLogLevel(workflow.getLogLevel());
-
- // Discard old log lines from the old workflow
- //
- HopLogStore.discardLines(workflow.getLogChannelId(), true);
-
- HopServerSingleton.getInstance()
- .getWorkflowMap()
- .replaceWorkflow(workflow, newWorkflow, workflowConfiguration);
- workflow = newWorkflow;
- } catch (Exception e) {
- throw new HopRuntimeException("Unable to instantiate new workflow",
e);
- }
- }
- }
- final IWorkflowEngine<WorkflowMeta> finalWorkflow = workflow;
-
- // Simply start the workflow in the background in a new thread.
- // This will allow us to work asynchronously
- //
- new Thread(finalWorkflow::startExecution).start();
-
- return getWorkflowStatus(id);
- }
-
- @GET
- @Path("/stop/{id : .+}")
- @Produces({MediaType.APPLICATION_JSON})
- public WorkflowStatus stopJob(@PathParam("id") String id) {
- IWorkflowEngine<WorkflowMeta> workflow = HopServerResource.getWorkflow(id);
- workflow.stopExecution();
- return getWorkflowStatus(id);
- }
-
- @GET
- @Path("/remove/{id : .+}")
- public Response removeJob(@PathParam("id") String id) {
- IWorkflowEngine<WorkflowMeta> workflow = HopServerResource.getWorkflow(id);
- HopServerObjectEntry entry = HopServerResource.getHopServerObjectEntry(id);
- HopLogStore.discardLines(workflow.getLogChannelId(), true);
- HopServerSingleton.getInstance().getWorkflowMap().removeWorkflow(entry);
- return Response.ok().build();
- }
-
- @PUT
- @Path("/add")
- @Produces({MediaType.APPLICATION_JSON})
- public WorkflowStatus addJob(String xml) {
-
- // Parse the XML, create a workflow configuration
- //
- WorkflowConfiguration workflowConfiguration;
- try {
- IVariables variables = Variables.getADefaultVariableSpace(); // TODO
- workflowConfiguration = WorkflowConfiguration.fromXml(xml, variables);
- IHopMetadataProvider metadataProvider =
- new MultiMetadataProvider(
- variables,
- HopServerSingleton.getHopServer().getMetadataProvider(),
- workflowConfiguration.getMetadataProvider());
-
- WorkflowMeta workflowMeta = workflowConfiguration.getWorkflowMeta();
- WorkflowExecutionConfiguration workflowExecutionConfiguration =
- workflowConfiguration.getWorkflowExecutionConfiguration();
-
- String serverObjectId = UUID.randomUUID().toString();
- SimpleLoggingObject servletLoggingObject =
- new SimpleLoggingObject(getClass().getName(),
LoggingObjectType.HOP_SERVER, null);
- servletLoggingObject.setContainerObjectId(serverObjectId);
-
servletLoggingObject.setLogLevel(workflowExecutionConfiguration.getLogLevel());
-
- // Create the workflow and store in the list...
- //
- String runConfigurationName =
-
workflowConfiguration.getWorkflowExecutionConfiguration().getRunConfiguration();
- final IWorkflowEngine<WorkflowMeta> workflow =
- WorkflowEngineFactory.createWorkflowEngine(
- variables,
- variables.resolve(runConfigurationName),
- metadataProvider,
- workflowMeta,
- servletLoggingObject);
-
- // Setting variables
- //
- workflow.initializeFrom(null);
- workflow.getWorkflowMeta().setInternalHopVariables(workflow);
- workflow.setVariables(
-
workflowConfiguration.getWorkflowExecutionConfiguration().getVariablesMap());
-
- // Also copy the parameters over...
- //
- workflow.copyParametersFromDefinitions(workflowMeta);
- workflow.clearParameterValues();
- String[] parameterNames = workflow.listParameters();
- for (String parameterName : parameterNames) {
- // Grab the parameter value set in the action
- //
- String thisValue =
workflowExecutionConfiguration.getParametersMap().get(parameterName);
- if (!Utils.isEmpty(thisValue)) {
- // Set the value as specified by the user in the action
- //
- workflow.setParameterValue(parameterName, thisValue);
- }
- }
- workflow.activateParameters(workflow);
-
- HopServerSingleton.getInstance()
- .getWorkflowMap()
- .addWorkflow(workflow.getWorkflowName(), serverObjectId, workflow,
workflowConfiguration);
-
- return getWorkflowStatus(serverObjectId);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/engine/src/main/java/org/apache/hop/www/jaxrs/WorkflowStatus.java
b/engine/src/main/java/org/apache/hop/www/jaxrs/WorkflowStatus.java
deleted file mode 100644
index ac5b6f4c6e..0000000000
--- a/engine/src/main/java/org/apache/hop/www/jaxrs/WorkflowStatus.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import jakarta.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class WorkflowStatus {
-
- private String id;
- private String name;
- private String status;
-
- public WorkflowStatus() {
- // Do nothing
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-}
diff --git a/engine/src/test/java/org/apache/hop/www/jaxrs/NVPairTest.java
b/engine/src/test/java/org/apache/hop/www/jaxrs/NVPairTest.java
deleted file mode 100644
index 64e575263c..0000000000
--- a/engine/src/test/java/org/apache/hop/www/jaxrs/NVPairTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-
-import org.junit.jupiter.api.Test;
-
-class NVPairTest {
-
- @Test
- void defaultConstructor() {
- NVPair p = new NVPair();
- assertNull(p.getName());
- assertNull(p.getValue());
- }
-
- @Test
- void valueConstructorAndSetters() {
- NVPair p = new NVPair("k", "v");
- assertEquals("k", p.getName());
- assertEquals("v", p.getValue());
- p.setName("k2");
- p.setValue("v2");
- assertEquals("k2", p.getName());
- assertEquals("v2", p.getValue());
- }
-}
diff --git
a/engine/src/test/java/org/apache/hop/www/jaxrs/PipelineStatusTest.java
b/engine/src/test/java/org/apache/hop/www/jaxrs/PipelineStatusTest.java
deleted file mode 100644
index 96bfb6dac3..0000000000
--- a/engine/src/test/java/org/apache/hop/www/jaxrs/PipelineStatusTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertSame;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.util.Collections;
-import org.apache.hop.pipeline.transform.TransformStatus;
-import org.junit.jupiter.api.Test;
-
-class PipelineStatusTest {
-
- @Test
- void accessorsAndAddTransformStatus() {
- PipelineStatus ps = new PipelineStatus();
- ps.setId("id1");
- ps.setName("pipe");
- ps.setStatus("Running");
- assertEquals("id1", ps.getId());
- assertEquals("pipe", ps.getName());
- assertEquals("Running", ps.getStatus());
-
- TransformStatus ts = new TransformStatus();
- ps.addTransformStatus(ts);
- assertEquals(1, ps.getTransformStatuses().size());
- assertSame(ts, ps.getTransformStatuses().get(0));
-
- ps.setTransformStatuses(Collections.emptyList());
- assertTrue(ps.getTransformStatuses().isEmpty());
- }
-}
diff --git
a/engine/src/test/java/org/apache/hop/www/jaxrs/ServerStatusTest.java
b/engine/src/test/java/org/apache/hop/www/jaxrs/ServerStatusTest.java
deleted file mode 100644
index c45d1bdd1d..0000000000
--- a/engine/src/test/java/org/apache/hop/www/jaxrs/ServerStatusTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import org.junit.jupiter.api.Test;
-
-class ServerStatusTest {
-
- @Test
- void defaultConstructorPopulatesRuntimeMetrics() {
- ServerStatus status = new ServerStatus();
- assertTrue(status.getMemoryTotal() > 0);
- assertNotNull(status.getOsName());
- assertTrue(status.getCpuCores() > 0);
- }
-
- @Test
- void statusDescriptionConstructor() {
- ServerStatus status = new ServerStatus("Online");
- assertEquals("Online", status.getStatusDescription());
- }
-}
diff --git
a/engine/src/test/java/org/apache/hop/www/jaxrs/WorkflowStatusTest.java
b/engine/src/test/java/org/apache/hop/www/jaxrs/WorkflowStatusTest.java
deleted file mode 100644
index e0b4690c38..0000000000
--- a/engine/src/test/java/org/apache/hop/www/jaxrs/WorkflowStatusTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hop.www.jaxrs;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-import org.junit.jupiter.api.Test;
-
-class WorkflowStatusTest {
-
- @Test
- void accessors() {
- WorkflowStatus ws = new WorkflowStatus();
- ws.setId("w1");
- ws.setName("wf");
- ws.setStatus("Finished");
- assertEquals("w1", ws.getId());
- assertEquals("wf", ws.getName());
- assertEquals("Finished", ws.getStatus());
- }
-}