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.googlesitemap.setup; |
35 |
|
|
36 |
|
import static info.magnolia.test.hamcrest.ExecutionMatcher.throwsNothing; |
37 |
|
import static info.magnolia.test.hamcrest.NodeMatchers.hasNode; |
38 |
|
import static info.magnolia.test.hamcrest.NodeMatchers.hasProperty; |
39 |
|
import static org.hamcrest.CoreMatchers.not; |
40 |
|
import static org.hamcrest.MatcherAssert.assertThat; |
41 |
|
import static org.junit.Assert.assertEquals; |
42 |
|
import static org.junit.Assert.assertTrue; |
43 |
|
|
44 |
|
import info.magnolia.cms.core.version.VersionManager; |
45 |
|
import info.magnolia.cms.util.ClasspathResourcesUtil; |
46 |
|
import info.magnolia.context.MgnlContext; |
47 |
|
import info.magnolia.jcr.util.NodeTypes; |
48 |
|
import info.magnolia.jcr.util.NodeUtil; |
49 |
|
import info.magnolia.module.InstallContext; |
50 |
|
import info.magnolia.module.ModuleManagementException; |
51 |
|
import info.magnolia.module.ModuleVersionHandler; |
52 |
|
import info.magnolia.module.ModuleVersionHandlerTestCase; |
53 |
|
import info.magnolia.module.googlesitemap.GoogleSiteMapConfiguration; |
54 |
|
import info.magnolia.module.googlesitemap.SiteMapNodeTypes; |
55 |
|
import info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.contentviews.formatter.FolderNameColumnFormatter; |
56 |
|
import info.magnolia.module.model.Version; |
57 |
|
import info.magnolia.objectfactory.Components; |
58 |
|
import info.magnolia.repository.RepositoryConstants; |
59 |
|
import info.magnolia.repository.RepositoryManager; |
60 |
|
import info.magnolia.test.hamcrest.Execution; |
61 |
|
|
62 |
|
import java.util.Arrays; |
63 |
|
import java.util.List; |
64 |
|
|
65 |
|
import javax.jcr.Node; |
66 |
|
import javax.jcr.NodeIterator; |
67 |
|
import javax.jcr.RepositoryException; |
68 |
|
import javax.jcr.Session; |
69 |
|
|
70 |
|
import org.junit.Test; |
71 |
|
|
72 |
|
|
73 |
|
@link |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (145) |
Complexity: 22 |
Complexity Density: 0.18 |
|
75 |
|
public class GoogleSiteMapVersionHandlerTest extends ModuleVersionHandlerTestCase { |
76 |
|
|
77 |
|
private Session session; |
78 |
|
private final String siteMapNodeTypeConfigFile = "/test-google-sitemap-nodetypes.xml"; |
79 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
14 |
@Override... |
81 |
|
protected String getModuleDescriptorPath() { |
82 |
14 |
return "/META-INF/magnolia/google-sitemap.xml"; |
83 |
|
} |
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
14 |
@Override... |
86 |
|
protected ModuleVersionHandler newModuleVersionHandlerForTests() { |
87 |
14 |
return new GoogleSiteMapVersionHandler(); |
88 |
|
} |
89 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
14 |
@Override... |
91 |
|
protected String[] getExtraWorkspaces() { |
92 |
14 |
return new String[]{"templates", GoogleSiteMapConfiguration.WORKSPACE}; |
93 |
|
} |
94 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
14 |
@Override... |
96 |
|
protected List<String> getModuleDescriptorPathsForTests() { |
97 |
14 |
return Arrays.asList("/META-INF/magnolia/core.xml"); |
98 |
|
} |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
14 |
@Override... |
101 |
|
protected String getExtraNodeTypes() { |
102 |
14 |
return siteMapNodeTypeConfigFile; |
103 |
|
} |
104 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
105 |
|
@Override... |
106 |
|
public String getRepositoryConfigFileName() { |
107 |
|
return "/test-siteMap-repositories.xml"; |
108 |
|
} |
109 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 2 |
Complexity Density: 0.14 |
|
110 |
14 |
@Override... |
111 |
|
public void setUp() throws Exception { |
112 |
14 |
super.setUp(); |
113 |
|
|
114 |
14 |
session = MgnlContext.getJCRSession(RepositoryConstants.CONFIG); |
115 |
|
|
116 |
14 |
addSupportForSetupModuleRepositoriesTask(null); |
117 |
|
|
118 |
|
|
119 |
14 |
try { |
120 |
14 |
Components.getComponent(RepositoryManager.class).getRepositoryProvider("magnolia").registerNodeTypes(ClasspathResourcesUtil.getResource(siteMapNodeTypeConfigFile).openStream()); |
121 |
|
} catch (RepositoryException e) { |
122 |
|
} |
123 |
|
|
124 |
14 |
this.setupConfigProperty("/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites/fields/sites/field", "workspace", "website"); |
125 |
14 |
this.setupConfigNode("/modules/google-sitemap/dialogs/generic/controls/googleSiteMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapPriority"); |
126 |
14 |
this.setupConfigNode("/modules/google-sitemap/dialogs/generic/controls/googleSiteMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapChangefreq"); |
127 |
14 |
this.setupConfigNode("/modules/google-sitemap/dialogs/generic/controls/googleVirtualUriMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapPriority"); |
128 |
14 |
this.setupConfigNode("/modules/google-sitemap/dialogs/generic/controls/googleVirtualUriMapTab/form/tabs/tabGoogleSitemapProps/fields/googleSitemapChangefreq"); |
129 |
14 |
this.setupConfigNode("/modules/google-sitemap/templates/pages/siteMapsConfiguration"); |
130 |
14 |
this.setupConfigNode("/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/deactivate"); |
131 |
14 |
this.setupConfigNode("/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/export"); |
132 |
14 |
this.setupConfigNode("/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/editSiteMap"); |
133 |
|
} |
134 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
135 |
1 |
@Test... |
136 |
|
public void updateFrom123ReordersSitemapBeforeConfigApp() throws Exception { |
137 |
|
|
138 |
1 |
Node manageApps = NodeUtil.createPath(session.getRootNode(), "modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps", NodeTypes.ContentNode.NAME); |
139 |
1 |
NodeUtil.createPath(manageApps, "rssAggregator", NodeTypes.ContentNode.NAME); |
140 |
1 |
NodeUtil.createPath(manageApps, "configuration", NodeTypes.ContentNode.NAME); |
141 |
|
|
142 |
|
|
143 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("1.2.3")); |
144 |
|
|
145 |
|
|
146 |
1 |
NodeIterator it = manageApps.getNodes(); |
147 |
1 |
assertTrue(manageApps.hasNode("siteMaps")); |
148 |
1 |
assertEquals("rssAggregator", it.nextNode().getName()); |
149 |
1 |
assertEquals("siteMaps", it.nextNode().getName()); |
150 |
1 |
assertEquals("configuration", it.nextNode().getName()); |
151 |
|
} |
152 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
1PASS
|
|
153 |
1 |
@Test... |
154 |
|
public void freshInstallReordersSitemapBeforeConfigApp() throws Exception { |
155 |
|
|
156 |
1 |
Node manageApps = NodeUtil.createPath(session.getRootNode(), "modules/ui-admincentral/config/appLauncherLayout/groups/manage/apps", NodeTypes.ContentNode.NAME); |
157 |
1 |
NodeUtil.createPath(manageApps, "rssAggregator", NodeTypes.ContentNode.NAME); |
158 |
1 |
NodeUtil.createPath(manageApps, "configuration", NodeTypes.ContentNode.NAME); |
159 |
|
|
160 |
1 |
NodeUtil.createPath(manageApps, "siteMaps", NodeTypes.ContentNode.NAME); |
161 |
|
|
162 |
|
|
163 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(null); |
164 |
|
|
165 |
|
|
166 |
1 |
NodeIterator it = manageApps.getNodes(); |
167 |
1 |
assertTrue(manageApps.hasNode("siteMaps")); |
168 |
1 |
assertEquals("rssAggregator", it.nextNode().getName()); |
169 |
1 |
assertEquals("siteMaps", it.nextNode().getName()); |
170 |
1 |
assertEquals("configuration", it.nextNode().getName()); |
171 |
|
} |
172 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
173 |
1 |
@Test... |
174 |
|
public void update22() throws RepositoryException, ModuleManagementException { |
175 |
|
|
176 |
1 |
this.setupConfigProperty("/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/siteMap", "property", "value"); |
177 |
1 |
this.setupConfigNode("/modules/google-sitemap/apps/siteMaps/subApps/browser"); |
178 |
1 |
this.setupConfigProperty("/modules/google-sitemap/apps/siteMaps/subApps/pages", "property", "value"); |
179 |
1 |
this.setupConfigProperty("/modules/google-sitemap/apps/siteMaps/subApps/browser/workbench/contentViews/list/columns/name", "formatterClass", "info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.formatter.FolderNameColumnFormatter"); |
180 |
|
|
181 |
|
|
182 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.0")); |
183 |
|
|
184 |
|
|
185 |
1 |
NodeIterator it = session.getNode("/modules/google-sitemap/apps/siteMaps/subApps").getNodes(); |
186 |
1 |
assertEquals("browser", it.nextNode().getName()); |
187 |
1 |
assertEquals("pages", it.nextNode().getName()); |
188 |
1 |
assertConfig(FolderNameColumnFormatter.class.getName(), "/modules/google-sitemap/apps/siteMaps/subApps/browser/workbench/contentViews/list/columns/name/formatterClass"); |
189 |
1 |
assertConfig("0.5", "/modules/google-sitemap/config/priority"); |
190 |
1 |
assertConfig("weekly", "/modules/google-sitemap/config/changeFrequency"); |
191 |
1 |
assertTrue(session.nodeExists("/modules/google-sitemap/fieldTypes/siteMapSelect")); |
192 |
|
} |
193 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (21) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
194 |
1 |
@Test... |
195 |
|
public void updateFrom21ConfigureActions() throws Exception { |
196 |
|
|
197 |
1 |
Session session = MgnlContext.getJCRSession(RepositoryConstants.CONFIG); |
198 |
1 |
this.setupConfigProperty("/modules/google-sitemap/apps/siteMaps/subApps/browser/workbench/contentViews/list/columns/name", "formatterClass", "info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.formatter.FolderNameColumnFormatter"); |
199 |
1 |
Node addSiteMapAction = NodeUtil.createPath(session.getRootNode(), GoogleSiteMapVersionHandler.GOOGLESITEMAP_APP_BROWSER_ACTIONS + "addSiteMap", NodeTypes.ContentNode.NAME); |
200 |
1 |
Node deleteAction = NodeUtil.createPath(session.getRootNode(), GoogleSiteMapVersionHandler.GOOGLESITEMAP_APP_BROWSER_ACTIONS + "delete", NodeTypes.ContentNode.NAME); |
201 |
1 |
Node editSiteMapAction = NodeUtil.createPath(session.getRootNode(), GoogleSiteMapVersionHandler.GOOGLESITEMAP_APP_BROWSER_ACTIONS + "editSiteMap", NodeTypes.ContentNode.NAME); |
202 |
1 |
Node activateAction = NodeUtil.createPath(session.getRootNode(), GoogleSiteMapVersionHandler.GOOGLESITEMAP_APP_BROWSER_ACTIONS + "activate", NodeTypes.ContentNode.NAME); |
203 |
1 |
Node deactivateAction = NodeUtil.createPath(session.getRootNode(), GoogleSiteMapVersionHandler.GOOGLESITEMAP_APP_BROWSER_ACTIONS + "deactivate", NodeTypes.ContentNode.NAME); |
204 |
1 |
Node activateDeletedAction = NodeUtil.createPath(session.getRootNode(), GoogleSiteMapVersionHandler.GOOGLESITEMAP_APP_BROWSER_ACTIONS + "activateDeleted", NodeTypes.ContentNode.NAME); |
205 |
|
|
206 |
|
|
207 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.1")); |
208 |
|
|
209 |
|
|
210 |
1 |
assertThat(addSiteMapAction, hasNode("availability")); |
211 |
1 |
assertThat(addSiteMapAction.getNode("availability"), hasProperty("writePermissionRequired", true)); |
212 |
1 |
assertThat(deleteAction, hasNode("availability")); |
213 |
1 |
assertThat(deleteAction.getNode("availability"), hasProperty("writePermissionRequired", true)); |
214 |
1 |
assertThat(editSiteMapAction, hasNode("availability")); |
215 |
1 |
assertThat(editSiteMapAction.getNode("availability"), hasProperty("writePermissionRequired", true)); |
216 |
1 |
assertThat(activateAction, hasNode("availability")); |
217 |
1 |
assertThat(activateAction.getNode("availability"), hasProperty("writePermissionRequired", true)); |
218 |
1 |
assertThat(deactivateAction, hasNode("availability")); |
219 |
1 |
assertThat(deactivateAction.getNode("availability"), hasProperty("writePermissionRequired", true)); |
220 |
1 |
assertThat(activateDeletedAction, hasNode("availability")); |
221 |
1 |
assertThat(activateDeletedAction.getNode("availability"), hasProperty("writePermissionRequired", true)); |
222 |
|
} |
223 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
224 |
1 |
@Test... |
225 |
|
public void updateFrom222NewCatalogProperty() throws RepositoryException, ModuleManagementException { |
226 |
|
|
227 |
|
|
228 |
|
|
229 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.2.2")); |
230 |
|
|
231 |
|
|
232 |
1 |
assertTrue(session.propertyExists("/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/deactivate/catalog")); |
233 |
1 |
assertEquals("website", session.getProperty("/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/deactivate/catalog").getString()); |
234 |
|
} |
235 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
236 |
1 |
@Test... |
237 |
|
public void updateFrom232RemovesHiddenProperty() throws Exception { |
238 |
|
|
239 |
1 |
setupConfigProperty("/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/siteMap/fields/template", "hidden", "true"); |
240 |
|
|
241 |
|
|
242 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.3.2")); |
243 |
|
|
244 |
|
|
245 |
1 |
assertThat(session.getNode("/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/siteMap/fields/template"), not(hasProperty("hidden"))); |
246 |
|
} |
247 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
248 |
1 |
@Test... |
249 |
|
public void updateFrom232ChangesBrokenTemplateOnExistingSites() throws Exception { |
250 |
|
|
251 |
1 |
final Session siteMapSession = MgnlContext.getJCRSession(GoogleSiteMapConfiguration.WORKSPACE); |
252 |
1 |
final Node siteMap = NodeUtil.createPath(siteMapSession.getRootNode(), "testSiteMap", SiteMapNodeTypes.SiteMap.NAME); |
253 |
1 |
siteMap.setProperty(NodeTypes.Renderable.TEMPLATE, "GoogleSiteMap"); |
254 |
|
|
255 |
1 |
Components.getComponent(VersionManager.class).addVersion(siteMap); |
256 |
|
|
257 |
|
|
258 |
1 |
assertThat("We want to make sure that the update task is not executed on jcr:system nodes (modifying a property would result in exception)", new Execution() { |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
259 |
1 |
@Override... |
260 |
|
public void evaluate() throws Exception { |
261 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.3.2")); |
262 |
|
} |
263 |
|
}, throwsNothing()); |
264 |
|
|
265 |
|
|
266 |
1 |
assertThat(siteMapSession.getNode("/testSiteMap"), hasProperty(NodeTypes.Renderable.TEMPLATE, "google-sitemap:pages/siteMapsConfiguration")); |
267 |
|
} |
268 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
269 |
1 |
@Test... |
270 |
|
public void updateFrom233SetsDefaultType() throws Exception { |
271 |
|
|
272 |
|
|
273 |
|
|
274 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.3.3")); |
275 |
|
|
276 |
|
|
277 |
1 |
assertThat(session.getNode("/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/siteMap/fields/mgnl-googleSiteMapType/options/standard"), hasProperty("selected", "true")); |
278 |
|
} |
279 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
280 |
1 |
@Test... |
281 |
|
public void updateFrom233AddsRendererAndUsage() throws Exception { |
282 |
|
|
283 |
1 |
setupConfigProperty("/modules/google-sitemap/templates/pages/siteMapsConfiguration", "renderType", "freemarker"); |
284 |
|
|
285 |
|
|
286 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.3.3")); |
287 |
|
|
288 |
|
|
289 |
1 |
assertThat(session.getNode("/modules/google-sitemap/renderers/sitemap"), hasProperty("contentType", "application/xml")); |
290 |
1 |
assertThat(session.getNode("/modules/google-sitemap/templates/pages/siteMapsConfiguration"), hasProperty("renderType", "sitemap")); |
291 |
|
} |
292 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
293 |
1 |
@Test... |
294 |
|
public void updateFrom24RemovesInvalidProperties() throws Exception { |
295 |
|
|
296 |
1 |
Node exportAction = session.getNode("/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/export"); |
297 |
1 |
Node editSiteMapAction = session.getNode("/modules/google-sitemap/apps/siteMaps/subApps/browser/actions/editSiteMap"); |
298 |
1 |
Node siteMapPagesField = NodeUtil.createPath(session.getRootNode(), "modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites/fields/mgnl:googleSiteMapPages", NodeTypes.ContentNode.NAME); |
299 |
1 |
exportAction.setProperty("extends", ""); |
300 |
1 |
editSiteMapAction.setProperty("nodeType", ""); |
301 |
1 |
siteMapPagesField.setProperty("chooseOnClick", ""); |
302 |
|
|
303 |
|
|
304 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.4")); |
305 |
1 |
siteMapPagesField = session.getNode("/modules/google-sitemap/dialogs/components/content/siteComponentTab/form/tabs/tabSites/fields/mgnl-googleSiteMapPages"); |
306 |
|
|
307 |
|
|
308 |
1 |
assertThat(exportAction, not(hasProperty("export"))); |
309 |
1 |
assertThat(exportAction, hasProperty("icon")); |
310 |
1 |
assertThat(editSiteMapAction, not(hasProperty("nodeType"))); |
311 |
1 |
assertThat(siteMapPagesField, not(hasProperty("chooseOnClick"))); |
312 |
1 |
assertThat(siteMapPagesField, hasProperty("name", "mgnl:googleSiteMapPages")); |
313 |
|
} |
314 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
315 |
1 |
@Test... |
316 |
|
public void updateFrom24UpdatesURI2RepoMapping() throws Exception { |
317 |
|
|
318 |
1 |
setupConfigProperty("/server/URI2RepositoryMapping/mappings/sitemaps", "URIPrefix", "/sitemaps"); |
319 |
|
|
320 |
1 |
InstallContext ctx = executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.4")); |
321 |
|
|
322 |
1 |
Node uriNode = ctx.getJCRSession(RepositoryConstants.CONFIG).getNode("/server/URI2RepositoryMapping/mappings/sitemaps"); |
323 |
1 |
assertThat(uriNode, hasProperty("URIPrefix", "/sitemaps/")); |
324 |
|
|
325 |
|
} |
326 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
327 |
1 |
@Test... |
328 |
|
public void updateFrom242AddEditIcon() throws Exception { |
329 |
|
|
330 |
1 |
setupConfigNode("/modules/google-sitemap/apps/siteMaps/subApps/pages"); |
331 |
1 |
setupConfigNode("/modules/google-sitemap/apps/siteMaps/subApps/virtualURI"); |
332 |
|
|
333 |
|
|
334 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.4.2")); |
335 |
|
|
336 |
|
|
337 |
1 |
assertThat(session.getNode("/modules/google-sitemap/apps/siteMaps/subApps/pages"), hasProperty("icon", "icon-edit")); |
338 |
1 |
assertThat(session.getNode("/modules/google-sitemap/apps/siteMaps/subApps/virtualURI"), hasProperty("icon", "icon-edit")); |
339 |
|
} |
340 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
341 |
1 |
@Test... |
342 |
|
public void updateFrom242ChangeVirtualUriMappings() throws Exception { |
343 |
|
|
344 |
1 |
String path = "/modules/google-sitemap/virtualURIMapping/siteMaps"; |
345 |
1 |
setupConfigNode(path); |
346 |
1 |
setupConfigProperty(path, "class", "info.magnolia.module.googlesitemap.config.SiteMapVirtualUriMapping"); |
347 |
1 |
setupConfigProperty(path, "prefix", "redirect:/sitemaps"); |
348 |
|
|
349 |
|
|
350 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(Version.parseVersion("2.4.2")); |
351 |
|
|
352 |
|
|
353 |
1 |
String newPath = "/modules/google-sitemap/virtualUriMappings/siteMaps"; |
354 |
1 |
assertThat(session.getNode(newPath), hasProperty("class", "info.magnolia.module.googlesitemap.config.mapping.SiteMapVirtualUriMapping")); |
355 |
1 |
assertThat(session.getNode(newPath), hasProperty("prefix", "redirect:/sitemaps")); |
356 |
|
} |
357 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
358 |
1 |
@Test... |
359 |
|
public void freshInstallToWithNewVirtualUriMappings() throws Exception { |
360 |
|
|
361 |
1 |
executeUpdatesAsIfTheCurrentlyInstalledVersionWas(null); |
362 |
|
|
363 |
|
|
364 |
1 |
String newPath = "/modules/google-sitemap/virtualUriMappings/siteMaps"; |
365 |
1 |
assertThat(session.getNode(newPath), hasProperty("class", "info.magnolia.module.googlesitemap.config.mapping.SiteMapVirtualUriMapping")); |
366 |
1 |
assertThat(session.getNode(newPath), hasProperty("prefix", "redirect:/sitemaps")); |
367 |
|
} |
368 |
|
|
369 |
|
} |