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

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      @SuppressWarnings("PMD.ArrayIsStoredDirectly")
78      public void setStackTrace(StackTraceElement[] stackTrace) {
79          this.stackTrace = stackTrace;
80      }
81  
82      public String getRequest() {
83          return request;
84      }
85  
86      public void setRequest(String request) {
87          this.request = request;
88      }
89  
90      public String getResponse() {
91          return response;
92      }
93  
94      public void setResponse(String response) {
95          this.response = response;
96      }
97  
98      public String getUrl() {
99          return url;
100     }
101 
102     public void setUrl(String url) {
103         this.url = url;
104     }
105 
106     public List<CmisTestResult> getChildren() {
107         return children;
108     }
109 
110     public boolean isFatal() {
111         return isFatal;
112     }
113 
114     @Override
115     public String toString() {
116         return status + ": " + groupName + "/" + testName + ": " + message;
117     }
118 }