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 businessKey;
\r
45 private String processInstanceId;
\r
46 private String testResult;
\r
47 private String testResultMessage;
\r
48 private Map<String, Object> testDetails;
\r
49 private List<TestHeadResult> testHeadResults;
\r
50 private List<TestExecution> testInstanceResults;
\r
51 // Stores historic information of associated
\r
52 private String historicEmail;
\r
53 private TestInstanceHistoric historicTestInstance;
\r
54 private TestDefinitionHistoric historicTestDefinition;
\r
56 public TestExecution() {
\r
59 public TestExecution(
\r
62 ObjectId executorId,
\r
67 String processInstanceId,
\r
69 String testResultMessage,
\r
70 Map<String, Object> testDetails,
\r
71 List<TestHeadResult> testHeadResults,
\r
72 List<TestExecution> testInstanceResults,
\r
73 String historicEmail,
\r
74 TestInstanceHistoric historicTestInstance,
\r
75 TestDefinitionHistoric historicTestDefinition) {
\r
77 this.groupId = groupId;
\r
78 this.executorId = executorId;
\r
80 this.startTime = startTime;
\r
81 this.endTime = endTime;
\r
82 this.businessKey = businessKey;
\r
83 this.processInstanceId = processInstanceId;
\r
84 this.testResult = testResult;
\r
85 this.testResultMessage = testResultMessage;
\r
86 this.testDetails = testDetails;
\r
87 this.testHeadResults = testHeadResults;
\r
88 this.testInstanceResults = testInstanceResults;
\r
89 this.historicEmail = historicEmail;
\r
90 this.historicTestInstance = historicTestInstance;
\r
91 this.historicTestDefinition = historicTestDefinition;
\r
94 public ObjectId get_id() {
\r
98 public void set_id(ObjectId _id) {
\r
102 public ObjectId getGroupId() {
\r
106 public void setGroupId(ObjectId groupId) {
\r
107 this.groupId = groupId;
\r
110 public ObjectId getExecutorId() {
\r
114 public void setExecutorId(ObjectId executorId) {
\r
115 this.executorId = executorId;
\r
118 public boolean isAsync() {
\r
122 public void setAsync(boolean async) {
\r
123 this.async = async;
\r
126 public Date getStartTime() {
\r
130 public void setStartTime(Date startTime) {
\r
131 this.startTime = startTime;
\r
134 public Date getEndTime() {
\r
138 public void setEndTime(Date endTime) {
\r
139 this.endTime = endTime;
\r
142 public String getBusinessKey() {
\r
143 return businessKey;
\r
146 public void setBusinessKey(String businessKey) {
\r
147 this.businessKey = businessKey;
\r
150 public String getProcessInstanceId() {
\r
151 return processInstanceId;
\r
154 public void setProcessInstanceId(String processInstanceId) {
\r
155 this.processInstanceId = processInstanceId;
\r
158 public String getTestResult() {
\r
162 public void setTestResult(String testResult) {
\r
163 this.testResult = testResult;
\r
166 public String getTestResultMessage() {
\r
167 return testResultMessage;
\r
170 public void setTestResultMessage(String testResultMessage) {
\r
171 this.testResultMessage = testResultMessage;
\r
174 public Map<String, Object> getTestDetails() {
\r
175 return testDetails;
\r
178 public void setTestDetails(Map<String, Object> testDetails) {
\r
179 this.testDetails = testDetails;
\r
182 public List<TestHeadResult> getTestHeadResults() {
\r
183 synchronized (testHeadResults) {
\r
184 return testHeadResults;
\r
188 public void setTestHeadResults(List<TestHeadResult> testHeadResults) {
\r
189 synchronized (testHeadResults) {
\r
190 this.testHeadResults = testHeadResults;
\r
194 public List<TestExecution> getTestInstanceResults() {
\r
195 synchronized (testInstanceResults) {
\r
196 return testInstanceResults;
\r
200 public void setTestInstanceResults(List<TestExecution> testInstanceResults) {
\r
201 synchronized (testInstanceResults) {
\r
202 this.testInstanceResults = testInstanceResults;
\r
206 public String getHistoricEmail() {
\r
207 return historicEmail;
\r
210 public void setHistoricEmail(String historicEmail) {
\r
211 this.historicEmail = historicEmail;
\r
214 public TestInstanceHistoric getHistoricTestInstance() {
\r
215 return historicTestInstance;
\r
218 public void setHistoricTestInstance(TestInstanceHistoric historicTestInstance) {
\r
219 this.historicTestInstance = historicTestInstance;
\r
222 public TestDefinitionHistoric getHistoricTestDefinition() {
\r
223 return historicTestDefinition;
\r
226 public void setHistoricTestDefinition(
\r
227 TestDefinitionHistoric historicTestDefinition) {
\r
228 this.historicTestDefinition = historicTestDefinition;
\r
232 public String toString() {
\r
233 return Convert.objectToJson(this);
\r