|
1 |
| package com.agical.rdoc.core.model.test.impl; |
|
2 |
| |
|
3 |
| import com.agical.rdoc.core.model.test.AbstractCompositeTestNode; |
|
4 |
| import com.agical.rdoc.core.model.test.Test; |
|
5 |
| import com.agical.rdoc.core.model.test.TestCase; |
|
6 |
| import com.agical.rdoc.core.model.test.TestNodeVisitor; |
|
7 |
| import com.agical.rdoc.core.model.test.TestStructure; |
|
8 |
| import com.agical.rdoc.core.model.test.builder.TestSuite; |
|
9 |
| |
|
10 |
| public class TestStructureImpl extends AbstractCompositeTestNode implements TestStructure { |
|
11 |
| private static final long serialVersionUID = -8648286687822895675L; |
|
12 |
| private final String name; |
|
13 |
| |
|
14 |
29
| public TestStructureImpl(String name) {
|
|
15 |
29
| this.name = name;
|
|
16 |
| } |
|
17 |
| |
|
18 |
10
| protected void visitThis(TestNodeVisitor visitor) {
|
|
19 |
10
| visitor.visit(this);
|
|
20 |
| } |
|
21 |
| |
|
22 |
29
| public void addRoot(TestSuite testSuite) {
|
|
23 |
29
| addChild(testSuite);
|
|
24 |
| } |
|
25 |
| |
|
26 |
0
| public String toString() {
|
|
27 |
0
| final StringBuffer buffer = new StringBuffer( "TestStructure" ).append("\n");
|
|
28 |
0
| accept( new TestNodeVisitor() {
|
|
29 |
0
| public void visit(Test test) {
|
|
30 |
0
| buffer.append( test ).append("\n");
|
|
31 |
| } |
|
32 |
| |
|
33 |
0
| public void visit(TestCase testCase) {
|
|
34 |
0
| buffer.append( testCase ).append("\n");
|
|
35 |
| } |
|
36 |
| |
|
37 |
0
| public void visit(TestSuite testSuite) {
|
|
38 |
0
| buffer.append( testSuite ).append("\n");
|
|
39 |
| } |
|
40 |
| |
|
41 |
0
| public void visit(TestStructure testStructure) {
|
|
42 |
| } |
|
43 |
| }); |
|
44 |
0
| return buffer.toString();
|
|
45 |
| } |
|
46 |
| |
|
47 |
0
| public String getName() {
|
|
48 |
0
| return name;
|
|
49 |
| } |
|
50 |
| |
|
51 |
| |
|
52 |
| } |