1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.imaging; |
35 |
|
|
36 |
|
import static org.hamcrest.MatcherAssert.assertThat; |
37 |
|
import static org.hamcrest.core.Is.is; |
38 |
|
import static org.mockito.Mockito.mock; |
39 |
|
|
40 |
|
import info.magnolia.module.ModuleLifecycleContext; |
41 |
|
|
42 |
|
import junit.framework.TestCase; |
43 |
|
|
44 |
|
|
45 |
|
@link |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 3 |
Complexity Density: 0.27 |
|
47 |
|
public class ImagingModuleTest extends TestCase { |
48 |
|
|
49 |
|
private ImagingModule module; |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
51 |
2 |
@Override... |
52 |
|
public void setUp() throws Exception { |
53 |
2 |
super.setUp(); |
54 |
2 |
this.module = new ImagingModule(); |
55 |
|
} |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
57 |
1 |
public void testModuleStartRegistersSpiProviders() throws Exception {... |
58 |
|
|
59 |
|
|
60 |
|
|
61 |
1 |
module.start(mock(ModuleLifecycleContext.class)); |
62 |
|
|
63 |
|
|
64 |
1 |
int registered = TestImageWriterSpiRegistryCounter.getInstance().registered; |
65 |
1 |
int unregistered = TestImageWriterSpiRegistryCounter.getInstance().deregistered; |
66 |
|
|
67 |
|
|
68 |
1 |
assertThat("Spi service has been registered.", registered - unregistered, is(1)); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
71 |
1 |
public void testModuleStopUnRegistersSpiProviders() throws Exception {... |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
1 |
module.start(mock(ModuleLifecycleContext.class)); |
76 |
1 |
module.stop(mock(ModuleLifecycleContext.class)); |
77 |
|
|
78 |
|
|
79 |
1 |
int registered = TestImageWriterSpiRegistryCounter.getInstance().registered; |
80 |
1 |
int unregistered = TestImageWriterSpiRegistryCounter.getInstance().deregistered; |
81 |
|
|
82 |
1 |
assertThat("Spi service has been un-registered.", registered - unregistered, is(0)); |
83 |
|
} |
84 |
|
} |