1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.integration; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.List; |
24 |
|
|
25 |
|
import junit.extensions.TestSetup; |
26 |
|
import junit.framework.Test; |
27 |
|
|
28 |
|
import org.apache.commons.configuration.PropertiesConfiguration; |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
@version |
49 |
|
@deprecated@link |
50 |
|
|
51 |
|
@Deprecated |
|
|
| 81.8% |
Uncovered Elements: 4 (22) |
Complexity: 7 |
Complexity Density: 0.5 |
|
52 |
|
public class XWikiTestSetup extends TestSetup |
53 |
|
{ |
54 |
|
private List<XWikiExecutor> executors = new ArrayList<XWikiExecutor>(); |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
2 |
public XWikiTestSetup(Test test) throws Exception... |
57 |
|
{ |
58 |
2 |
this(test, 1); |
59 |
|
} |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
61 |
2 |
public XWikiTestSetup(Test test, int nb) throws Exception... |
62 |
|
{ |
63 |
2 |
super(test); |
64 |
|
|
65 |
4 |
for (int i = 0; i < nb; ++i) { |
66 |
2 |
XWikiExecutor executor = new XWikiExecutor(i); |
67 |
|
|
68 |
2 |
PropertiesConfiguration properties = executor.loadXWikiPropertiesConfiguration(); |
69 |
|
|
70 |
|
|
71 |
2 |
properties.setProperty("extension.repositories", ""); |
72 |
2 |
executor.saveXWikiProperties(properties); |
73 |
|
|
74 |
2 |
this.executors.add(executor); |
75 |
|
} |
76 |
|
} |
77 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
78 |
2 |
@Override... |
79 |
|
protected void setUp() throws Exception |
80 |
|
{ |
81 |
2 |
for (XWikiExecutor executor : this.executors) { |
82 |
2 |
executor.start(); |
83 |
|
} |
84 |
|
} |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
86 |
2 |
@Override... |
87 |
|
protected void tearDown() throws Exception |
88 |
|
{ |
89 |
2 |
for (XWikiExecutor executor : this.executors) { |
90 |
2 |
executor.stop(); |
91 |
|
} |
92 |
|
} |
93 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
94 |
0 |
protected XWikiExecutor getXWikiExecutor()... |
95 |
|
{ |
96 |
0 |
return getXWikiExecutor(0); |
97 |
|
} |
98 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
0 |
protected XWikiExecutor getXWikiExecutor(int index)... |
100 |
|
{ |
101 |
0 |
return this.executors.get(index); |
102 |
|
} |
103 |
|
} |