added svcapi ui and camunda code
[it/otf.git] / otf-service-api / src / main / java / org / oran / otf / common / model / TestExecution.java
diff --git a/otf-service-api/src/main/java/org/oran/otf/common/model/TestExecution.java b/otf-service-api/src/main/java/org/oran/otf/common/model/TestExecution.java
new file mode 100644 (file)
index 0000000..8f02e0b
--- /dev/null
@@ -0,0 +1,245 @@
+/*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
+#                                                                              #\r
+#   Licensed under the Apache License, Version 2.0 (the "License");            #\r
+#   you may not use this file except in compliance with the License.           #\r
+#   You may obtain a copy of the License at                                    #\r
+#                                                                              #\r
+#       http://www.apache.org/licenses/LICENSE-2.0                             #\r
+#                                                                              #\r
+#   Unless required by applicable law or agreed to in writing, software        #\r
+#   distributed under the License is distributed on an "AS IS" BASIS,          #\r
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
+#   See the License for the specific language governing permissions and        #\r
+#   limitations under the License.                                             #\r
+##############################################################################*/\r
+\r
+\r
+package org.oran.otf.common.model;\r
+\r
+import org.oran.otf.common.model.historic.TestDefinitionHistoric;\r
+import org.oran.otf.common.model.historic.TestInstanceHistoric;\r
+import org.oran.otf.common.model.local.TestHeadResult;\r
+import org.oran.otf.common.utility.gson.Convert;\r
+import java.io.Serializable;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.Map;\r
+import org.bson.types.ObjectId;\r
+import org.springframework.data.annotation.Id;\r
+import org.springframework.data.mongodb.core.mapping.Document;\r
+\r
+@Document(collection = "testExecutions")\r
+public class TestExecution implements Serializable {\r
+\r
+  private static final long serialVersionUID = 1L;\r
+\r
+  @Id\r
+  private ObjectId _id;\r
+  private ObjectId groupId;\r
+  private ObjectId executorId;\r
+\r
+  private boolean async;\r
+  private Date startTime;\r
+  private Date endTime;\r
+  private String asyncTopic;\r
+  private String businessKey;\r
+  private String processInstanceId;\r
+  private String testResult;\r
+  private String testResultMessage;\r
+  private Map<String, Object> testDetails;\r
+  private List<TestHeadResult> testHeadResults;\r
+  private List<TestExecution> testInstanceResults;\r
+  // Stores historic information of associated\r
+  private String historicEmail;\r
+  private TestInstanceHistoric historicTestInstance;\r
+  private TestDefinitionHistoric historicTestDefinition;\r
+\r
+  public TestExecution() {\r
+  }\r
+\r
+  public TestExecution(\r
+          ObjectId _id,\r
+          ObjectId groupId,\r
+          ObjectId executorId,\r
+          boolean async,\r
+          Date startTime,\r
+          Date endTime,\r
+          String asyncTopic,\r
+          String businessKey,\r
+          String processInstanceId,\r
+          String testResult,\r
+          String testResultMessage,\r
+          Map<String, Object> testDetails,\r
+          List<TestHeadResult> testHeadResults,\r
+          List<TestExecution> testInstanceResults,\r
+          String historicEmail,\r
+          TestInstanceHistoric historicTestInstance,\r
+          TestDefinitionHistoric historicTestDefinition) {\r
+    this._id = _id;\r
+    this.groupId = groupId;\r
+    this.executorId = executorId;\r
+    this.async = async;\r
+    this.startTime = startTime;\r
+    this.endTime = endTime;\r
+    this.asyncTopic = asyncTopic;\r
+    this.businessKey = businessKey;\r
+    this.processInstanceId = processInstanceId;\r
+    this.testResult = testResult;\r
+    this.testDetails = testDetails;\r
+    this.testHeadResults = testHeadResults;\r
+    this.testInstanceResults = testInstanceResults;\r
+    this.historicEmail = historicEmail;\r
+    this.historicTestInstance = historicTestInstance;\r
+    this.historicTestDefinition = historicTestDefinition;\r
+  }\r
+\r
+  public ObjectId get_id() {\r
+    return _id;\r
+  }\r
+\r
+  public void set_id(ObjectId _id) {\r
+    this._id = _id;\r
+  }\r
+\r
+  public ObjectId getGroupId() {\r
+    return groupId;\r
+  }\r
+\r
+  public void setGroupId(ObjectId groupId) {\r
+    this.groupId = groupId;\r
+  }\r
+\r
+  public ObjectId getExecutorId() {\r
+    return executorId;\r
+  }\r
+\r
+  public void setExecutorId(ObjectId executorId) {\r
+    this.executorId = executorId;\r
+  }\r
+\r
+  public boolean isAsync() {\r
+    return async;\r
+  }\r
+\r
+  public void setAsync(boolean async) {\r
+    this.async = async;\r
+  }\r
+\r
+  public Date getStartTime() {\r
+    return startTime;\r
+  }\r
+\r
+  public void setStartTime(Date startTime) {\r
+    this.startTime = startTime;\r
+  }\r
+\r
+  public Date getEndTime() {\r
+    return endTime;\r
+  }\r
+\r
+  public void setEndTime(Date endTime) {\r
+    this.endTime = endTime;\r
+  }\r
+\r
+  public String getAsyncTopic() {\r
+    return asyncTopic;\r
+  }\r
+\r
+  public void setAsyncTopic(String asyncTopic) {\r
+    this.asyncTopic = asyncTopic;\r
+  }\r
+\r
+  public String getBusinessKey() {\r
+    return businessKey;\r
+  }\r
+\r
+  public void setBusinessKey(String businessKey) {\r
+    this.businessKey = businessKey;\r
+  }\r
+\r
+  public String getProcessInstanceId() {\r
+    return processInstanceId;\r
+  }\r
+\r
+  public void setProcessInstanceId(String processInstanceId) {\r
+    this.processInstanceId = processInstanceId;\r
+  }\r
+\r
+  public String getTestResult() {\r
+    return testResult;\r
+  }\r
+\r
+  public void setTestResult(String testResult) {\r
+    this.testResult = testResult;\r
+  }\r
+\r
+  public String getTestResultMessage() {\r
+    return testResultMessage;\r
+  }\r
+\r
+  public void setTestResultMessage(String testResultMessage) {\r
+    this.testResultMessage = testResultMessage;\r
+  }\r
+\r
+  public Map<String, Object> getTestDetails() {\r
+    return testDetails;\r
+  }\r
+\r
+  public void setTestDetails(Map<String, Object> testDetails) {\r
+    this.testDetails = testDetails;\r
+  }\r
+\r
+  public List<TestHeadResult> getTestHeadResults() {\r
+    synchronized (testHeadResults) {\r
+      return testHeadResults;\r
+    }\r
+  }\r
+\r
+  public void setTestHeadResults(List<TestHeadResult> testHeadResults) {\r
+    synchronized (testHeadResults) {\r
+      this.testHeadResults = testHeadResults;\r
+    }\r
+  }\r
+\r
+  public List<TestExecution> getTestInstanceResults() {\r
+    synchronized (testInstanceResults) {\r
+      return testInstanceResults;\r
+    }\r
+  }\r
+\r
+  public void setTestInstanceResults(List<TestExecution> testInstanceResults) {\r
+    synchronized (testInstanceResults) {\r
+      this.testInstanceResults = testInstanceResults;\r
+    }\r
+  }\r
+\r
+  public String getHistoricEmail() {\r
+    return historicEmail;\r
+  }\r
+\r
+  public void setHistoricEmail(String historicEmail) {\r
+    this.historicEmail = historicEmail;\r
+  }\r
+\r
+  public TestInstanceHistoric getHistoricTestInstance() {\r
+    return historicTestInstance;\r
+  }\r
+\r
+  public void setHistoricTestInstance(TestInstanceHistoric historicTestInstance) {\r
+    this.historicTestInstance = historicTestInstance;\r
+  }\r
+\r
+  public TestDefinitionHistoric getHistoricTestDefinition() {\r
+    return historicTestDefinition;\r
+  }\r
+\r
+  public void setHistoricTestDefinition(\r
+          TestDefinitionHistoric historicTestDefinition) {\r
+    this.historicTestDefinition = historicTestDefinition;\r
+  }\r
+\r
+  @Override\r
+  public String toString() {\r
+    return Convert.objectToJson(this);\r
+  }\r
+}\r