1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\r
3 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
4 # you may not use this file except in compliance with the License. #
\r
5 # You may obtain a copy of the License at #
\r
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
9 # Unless required by applicable law or agreed to in writing, software #
\r
10 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
12 # See the License for the specific language governing permissions and #
\r
13 # limitations under the License. #
\r
14 ##############################################################################*/
\r
17 package org.oran.otf.common.model;
\r
19 import org.oran.otf.common.model.historic.TestDefinitionHistoric;
\r
20 import org.oran.otf.common.model.historic.TestInstanceHistoric;
\r
21 import org.oran.otf.common.model.local.TestHeadResult;
\r
22 import org.oran.otf.common.utility.gson.Convert;
\r
23 import java.io.Serializable;
\r
24 import java.util.Date;
\r
25 import java.util.List;
\r
26 import java.util.Map;
\r
27 import org.bson.types.ObjectId;
\r
28 import org.springframework.data.annotation.Id;
\r
29 import org.springframework.data.mongodb.core.mapping.Document;
\r
31 @Document(collection = "testExecutions")
\r
32 public class TestExecution implements Serializable {
\r
34 private static final long serialVersionUID = 1L;
\r
37 private ObjectId _id;
\r
38 private ObjectId groupId;
\r
39 private ObjectId executorId;
\r
41 private boolean async;
\r
42 private Date startTime;
\r
43 private Date endTime;
\r
44 private String asyncTopic;
\r
45 private String businessKey;
\r
46 private String processInstanceId;
\r
47 private String testResult;
\r
48 private String testResultMessage;
\r
49 private Map<String, Object> testDetails;
\r
50 private List<TestHeadResult> testHeadResults;
\r
51 private List<TestExecution> testInstanceResults;
\r
52 // Stores historic information of associated
\r
53 private String historicEmail;
\r
54 private TestInstanceHistoric historicTestInstance;
\r
55 private TestDefinitionHistoric historicTestDefinition;
\r
57 public TestExecution() {
\r
60 public TestExecution(
\r
63 ObjectId executorId,
\r
69 String processInstanceId,
\r
71 String testResultMessage,
\r
72 Map<String, Object> testDetails,
\r
73 List<TestHeadResult> testHeadResults,
\r
74 List<TestExecution> testInstanceResults,
\r
75 String historicEmail,
\r
76 TestInstanceHistoric historicTestInstance,
\r
77 TestDefinitionHistoric historicTestDefinition) {
\r
79 this.groupId = groupId;
\r
80 this.executorId = executorId;
\r
82 this.startTime = startTime;
\r
83 this.endTime = endTime;
\r
84 this.asyncTopic = asyncTopic;
\r
85 this.businessKey = businessKey;
\r
86 this.processInstanceId = processInstanceId;
\r
87 this.testResult = testResult;
\r
88 this.testDetails = testDetails;
\r
89 this.testHeadResults = testHeadResults;
\r
90 this.testInstanceResults = testInstanceResults;
\r
91 this.historicEmail = historicEmail;
\r
92 this.historicTestInstance = historicTestInstance;
\r
93 this.historicTestDefinition = historicTestDefinition;
\r
96 public ObjectId get_id() {
\r
100 public void set_id(ObjectId _id) {
\r
104 public ObjectId getGroupId() {
\r
108 public void setGroupId(ObjectId groupId) {
\r
109 this.groupId = groupId;
\r
112 public ObjectId getExecutorId() {
\r
116 public void setExecutorId(ObjectId executorId) {
\r
117 this.executorId = executorId;
\r
120 public boolean isAsync() {
\r
124 public void setAsync(boolean async) {
\r
125 this.async = async;
\r
128 public Date getStartTime() {
\r
132 public void setStartTime(Date startTime) {
\r
133 this.startTime = startTime;
\r
136 public Date getEndTime() {
\r
140 public void setEndTime(Date endTime) {
\r
141 this.endTime = endTime;
\r
144 public String getAsyncTopic() {
\r
148 public void setAsyncTopic(String asyncTopic) {
\r
149 this.asyncTopic = asyncTopic;
\r
152 public String getBusinessKey() {
\r
153 return businessKey;
\r
156 public void setBusinessKey(String businessKey) {
\r
157 this.businessKey = businessKey;
\r
160 public String getProcessInstanceId() {
\r
161 return processInstanceId;
\r
164 public void setProcessInstanceId(String processInstanceId) {
\r
165 this.processInstanceId = processInstanceId;
\r
168 public String getTestResult() {
\r
172 public void setTestResult(String testResult) {
\r
173 this.testResult = testResult;
\r
176 public String getTestResultMessage() {
\r
177 return testResultMessage;
\r
180 public void setTestResultMessage(String testResultMessage) {
\r
181 this.testResultMessage = testResultMessage;
\r
184 public Map<String, Object> getTestDetails() {
\r
185 return testDetails;
\r
188 public void setTestDetails(Map<String, Object> testDetails) {
\r
189 this.testDetails = testDetails;
\r
192 public List<TestHeadResult> getTestHeadResults() {
\r
193 synchronized (testHeadResults) {
\r
194 return testHeadResults;
\r
198 public void setTestHeadResults(List<TestHeadResult> testHeadResults) {
\r
199 synchronized (testHeadResults) {
\r
200 this.testHeadResults = testHeadResults;
\r
204 public List<TestExecution> getTestInstanceResults() {
\r
205 synchronized (testInstanceResults) {
\r
206 return testInstanceResults;
\r
210 public void setTestInstanceResults(List<TestExecution> testInstanceResults) {
\r
211 synchronized (testInstanceResults) {
\r
212 this.testInstanceResults = testInstanceResults;
\r
216 public String getHistoricEmail() {
\r
217 return historicEmail;
\r
220 public void setHistoricEmail(String historicEmail) {
\r
221 this.historicEmail = historicEmail;
\r
224 public TestInstanceHistoric getHistoricTestInstance() {
\r
225 return historicTestInstance;
\r
228 public void setHistoricTestInstance(TestInstanceHistoric historicTestInstance) {
\r
229 this.historicTestInstance = historicTestInstance;
\r
232 public TestDefinitionHistoric getHistoricTestDefinition() {
\r
233 return historicTestDefinition;
\r
236 public void setHistoricTestDefinition(
\r
237 TestDefinitionHistoric historicTestDefinition) {
\r
238 this.historicTestDefinition = historicTestDefinition;
\r
242 public String toString() {
\r
243 return Convert.objectToJson(this);
\r