1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.refactoring.internal; |
21 |
|
|
22 |
|
import org.jmock.Expectations; |
23 |
|
import org.jmock.Mockery; |
24 |
|
import org.xwiki.bridge.DocumentAccessBridge; |
25 |
|
import org.xwiki.component.descriptor.DefaultComponentDescriptor; |
26 |
|
import org.xwiki.rendering.parser.Parser; |
27 |
|
import org.xwiki.test.jmock.AbstractComponentTestCase; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
35 |
|
public class AbstractRefactoringTestCase extends AbstractComponentTestCase |
36 |
|
{ |
37 |
|
protected Mockery mockery = new Mockery(); |
38 |
|
|
39 |
|
|
40 |
|
@link |
41 |
|
|
42 |
|
protected DocumentAccessBridge docBridge; |
43 |
|
|
44 |
|
|
45 |
|
@link |
46 |
|
|
47 |
|
protected Parser xwikiParser; |
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
49 |
4 |
@Override... |
50 |
|
protected void registerComponents() throws Exception |
51 |
|
{ |
52 |
|
|
53 |
4 |
final DocumentAccessBridge mockDocumentAccessBridge = this.mockery.mock(DocumentAccessBridge.class); |
54 |
4 |
DefaultComponentDescriptor<DocumentAccessBridge> descriptorDAB = |
55 |
|
new DefaultComponentDescriptor<DocumentAccessBridge>(); |
56 |
4 |
descriptorDAB.setRole(DocumentAccessBridge.class); |
57 |
4 |
getComponentManager().registerComponent(descriptorDAB, mockDocumentAccessBridge); |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
59 |
4 |
mockery.checking(new Expectations() {{... |
60 |
4 |
allowing(mockDocumentAccessBridge).exists(with(any(String.class))); will(returnValue(false)); |
61 |
|
}}); |
62 |
|
|
63 |
4 |
this.docBridge = getComponentManager().getInstance(DocumentAccessBridge.class, "default"); |
64 |
4 |
this.xwikiParser = getComponentManager().getInstance(Parser.class, "xwiki/2.0"); |
65 |
|
} |
66 |
|
} |