]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/PartSubList.java
Improve demo
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / test / tree / PartSubList.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.core.test.tree;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import java.util.Vector;
22
23 import org.argeo.slc.test.TestResultPart;
24 import org.argeo.slc.test.TestStatus;
25
26 /**
27 * List of <code>TestResultPart</code>. It can be used to build complex
28 * <code>TestResult</code> affording the possibility to a
29 * <code>TestDefinition</code> to add a list of result part under the same
30 * <code>StructurePath</code>.
31 *
32 * @see TreeTestResult
33 */
34 public class PartSubList implements Serializable {
35 private static final long serialVersionUID = -5308754827565759844L;
36
37 /** For ORM */
38 private Long tid;
39
40 private List<TestResultPart> parts = new Vector<TestResultPart>();
41
42 /** Gets the result parts. */
43 public List<TestResultPart> getParts() {
44 return parts;
45 }
46
47 /** Sets the result parts. */
48 public void setParts(List<TestResultPart> parts) {
49 this.parts = parts;
50 }
51
52 Long getTid() {
53 return tid;
54 }
55
56 void setTid(Long tid) {
57 this.tid = tid;
58 }
59
60 public Boolean getIsPassed() {
61 for (TestResultPart part : parts) {
62 if (part.getStatus() != TestStatus.PASSED) {
63 return false;
64 }
65 }
66 return true;
67 }
68 }