1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.escaping.framework; |
21 |
|
|
22 |
|
import org.apache.commons.configuration.PropertiesConfiguration; |
23 |
|
import org.xwiki.test.integration.XWikiExecutor; |
24 |
|
|
25 |
|
|
26 |
|
@link@link |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 93.1% |
Uncovered Elements: 2 (29) |
Complexity: 10 |
Complexity Density: 0.67 |
|
33 |
|
public final class SingleXWikiExecutor extends XWikiExecutor |
34 |
|
{ |
35 |
|
|
36 |
|
private static SingleXWikiExecutor executor = null; |
37 |
|
|
38 |
|
|
39 |
|
private static int counter = 0; |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
44 |
1 |
private SingleXWikiExecutor()... |
45 |
|
{ |
46 |
1 |
super(0); |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
@return |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
54 |
1912 |
public static synchronized SingleXWikiExecutor getExecutor()... |
55 |
|
{ |
56 |
1912 |
if (SingleXWikiExecutor.executor == null) { |
57 |
1 |
SingleXWikiExecutor.executor = new SingleXWikiExecutor(); |
58 |
|
} |
59 |
1912 |
return SingleXWikiExecutor.executor; |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
@inheritDoc |
64 |
|
|
65 |
|
|
66 |
|
|
|
|
| 85.7% |
Uncovered Elements: 2 (14) |
Complexity: 5 |
Complexity Density: 0.62 |
|
67 |
956 |
@Override... |
68 |
|
public synchronized void start() throws Exception |
69 |
|
{ |
70 |
956 |
if (counter == 0) { |
71 |
1 |
if (!VERIFY_RUNNING_XWIKI_AT_START.equals("true") || isXWikiStarted(getURL(), 15).timedOut) { |
72 |
|
|
73 |
1 |
PropertiesConfiguration properties = loadXWikiPropertiesConfiguration(); |
74 |
1 |
if (!properties.containsKey("extension.repositories")) { |
75 |
1 |
properties.setProperty("extension.repositories", ""); |
76 |
|
} |
77 |
1 |
saveXWikiProperties(properties); |
78 |
|
} |
79 |
|
|
80 |
1 |
super.start(); |
81 |
|
} |
82 |
956 |
counter++; |
83 |
|
} |
84 |
|
|
85 |
|
|
86 |
|
@inheritDoc |
87 |
|
|
88 |
|
|
89 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
90 |
956 |
@Override... |
91 |
|
public synchronized void stop() throws Exception |
92 |
|
{ |
93 |
956 |
if (counter == 1) { |
94 |
1 |
super.stop(); |
95 |
|
} |
96 |
956 |
counter--; |
97 |
|
} |
98 |
|
} |