This project has retired. For details please refer to its Attic page.
CmisTestResultImpl xref

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.chemistry.opencmis.tck.impl;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  import org.apache.chemistry.opencmis.tck.CmisTestResult;
25  import org.apache.chemistry.opencmis.tck.CmisTestResultStatus;
26  
27  /**
28   * CmisTestResult implementation.
29   */
30  public class CmisTestResultImpl implements CmisTestResult {
31      private final String groupName;
32      private final String testName;
33      private final String message;
34      private final CmisTestResultStatus status;
35      private final Throwable exception;
36      private StackTraceElement[] stackTrace;
37      private String url;
38      private String request;
39      private String response;
40      private final List<CmisTestResult> children = new ArrayList<CmisTestResult>();
41      private final boolean isFatal;
42  
43      public CmisTestResultImpl(String groupName, String testName, String message, CmisTestResultStatus status,
44              Throwable exception, boolean isFatal) {
45          this.groupName = groupName;
46          this.testName = testName;
47          this.message = message;
48          this.status = status;
49          this.exception = exception;
50          this.isFatal = isFatal;
51      }
52  
53      public String getGroupName() {
54          return groupName;
55      }
56  
57      public String getTestName() {
58          return testName;
59      }
60  
61      public String getMessage() {
62          return message;
63      }
64  
65      public CmisTestResultStatus getStatus() {
66          return status;
67      }
68  
69      public Throwable getException() {
70          return exception;
71      }
72  
73      public StackTraceElement[] getStackTrace() {
74          return stackTrace;
75      }
76  
77      public void setStackTrace(StackTraceElement[] stackTrace) {
78          this.stackTrace = stackTrace;
79      }
80  
81      public String getRequest() {
82          return request;
83      }
84  
85      public void setRequest(String request) {
86          this.request = request;
87      }
88  
89      public String getResponse() {
90          return response;
91      }
92  
93      public void setResponse(String response) {
94          this.response = response;
95      }
96  
97      public String getUrl() {
98          return url;
99      }
100 
101     public void setUrl(String url) {
102         this.url = url;
103     }
104 
105     public List<CmisTestResult> getChildren() {
106         return children;
107     }
108 
109     public boolean isFatal() {
110         return isFatal;
111     }
112 
113     @Override
114     public String toString() {
115         return status + ": " + groupName + "/" + testName + ": " + message;
116     }
117 }