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.module.blossom.suite; |
35 |
|
|
36 |
|
import static org.junit.Assert.*; |
37 |
|
|
38 |
|
import info.magnolia.content2bean.Content2BeanException; |
39 |
|
import info.magnolia.objectfactory.Components; |
40 |
|
import info.magnolia.registry.RegistrationException; |
41 |
|
import info.magnolia.rendering.template.TemplateDefinition; |
42 |
|
import info.magnolia.rendering.template.registry.TemplateDefinitionRegistry; |
43 |
|
|
44 |
|
import javax.jcr.RepositoryException; |
45 |
|
|
46 |
|
import org.junit.Test; |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@since |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 3 |
Complexity Density: 0.19 |
|
53 |
|
public class DetectProxiedObjectsTest extends AbstractBlossomTestCase { |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
55 |
1 |
@Override... |
56 |
|
protected String getRootWebApplicationConfigLocation() { |
57 |
1 |
return null; |
58 |
|
} |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
60 |
1 |
@Override... |
61 |
|
protected String getDispatcherServletConfigLocation() { |
62 |
1 |
return "classpath:info/magnolia/module/blossom/suite/DetectProxiedObjects-test.xml"; |
63 |
|
} |
64 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
65 |
1 |
@Test... |
66 |
|
public void testDetectsProxiedObjects() throws RepositoryException, Content2BeanException, RegistrationException { |
67 |
|
|
68 |
1 |
TemplateDefinitionRegistry templateDefinitionRegistry = Components.getComponent(TemplateDefinitionRegistry.class); |
69 |
|
|
70 |
1 |
TemplateDefinition testTemplate = templateDefinitionRegistry.getTemplateDefinition("testTemplate"); |
71 |
1 |
assertNotNull(testTemplate); |
72 |
1 |
assertEquals("Test Template", testTemplate.getTitle()); |
73 |
1 |
assertEquals("Test Template Description", testTemplate.getDescription()); |
74 |
1 |
assertTrue(testTemplate.getTemplateAvailability().getClass().getName().startsWith("info.magnolia.module.blossom")); |
75 |
|
|
76 |
|
|
77 |
1 |
assertDialogIsNotRegistered("blossom-template-dialog:" + MassiveTest.TestTemplate.class.getName()); |
78 |
|
|
79 |
1 |
assertDialogIsRegistered("test-template-dialog"); |
80 |
|
|
81 |
1 |
TemplateDefinition testComponent = templateDefinitionRegistry.getTemplateDefinition("testComponent"); |
82 |
1 |
assertNotNull(testComponent); |
83 |
1 |
assertEquals("Test Component", testComponent.getTitle()); |
84 |
1 |
assertEquals("Test Component Description", testComponent.getDescription()); |
85 |
|
|
86 |
1 |
assertDialogIsRegistered("blossom-template-dialog:" + MassiveTest.TestComponent.class.getName()); |
87 |
|
|
88 |
1 |
assertDialogIsRegistered("test-dialog"); |
89 |
|
} |
90 |
|
} |