Skip to content

Commit

Permalink
Adjusting test cases to improved detail page configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
tHerrmann committed Aug 15, 2018
1 parent 8b09e21 commit 5fa17e1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 28 deletions.
9 changes: 9 additions & 0 deletions test/data/imports/ade-config/sites/default/.content/.config
Expand Up @@ -28,6 +28,15 @@
</Folder>
<NamePattern><![CDATA[asdf]]></NamePattern>
</ResourceType>

<ResourceType>
<TypeName><![CDATA[foo]]></TypeName>
<Disabled>false</Disabled>
<Folder>
<Name><![CDATA[foo1]]></Name>
</Folder>
<NamePattern><![CDATA[asdf]]></NamePattern>
</ResourceType>

<DetailPage>
<Type><![CDATA[foo]]></Type>
Expand Down
13 changes: 9 additions & 4 deletions test/org/opencms/ade/configuration/TestConfig.java
Expand Up @@ -292,9 +292,11 @@ public void testCreateContentsLocally2() throws Exception {
set(typeConfigs.get(0).getFolderPath(rootCms(), null), typeConfigs.get(1).getFolderPath(rootCms(), null)));

assertEquals(2, config2.getResourceTypes().size());
assertEquals(set("/sites/default/foo/.content/foo", "/sites/default/.content/plain"), set(
config2.getResourceTypes().get(0).getFolderPath(rootCms(), null),
config2.getResourceTypes().get(1).getFolderPath(rootCms(), null)));
assertEquals(
set("/sites/default/foo/.content/foo", "/sites/default/.content/plain"),
set(
config2.getResourceTypes().get(0).getFolderPath(rootCms(), null),
config2.getResourceTypes().get(1).getFolderPath(rootCms(), null)));
}

/**
Expand Down Expand Up @@ -493,9 +495,12 @@ public void testDetailPages2() throws Exception {
List<CmsDetailPageInfo> parentDetailPages = list(a1, a2, b1, b2);
List<CmsDetailPageInfo> childDetailPages = list(a3, a4);

List<CmsResourceTypeConfig> types = new ArrayList<CmsResourceTypeConfig>();
types.add(new CmsResourceTypeConfig("a", false, null, null, false, false, null, null, true, false, 1, null));

CmsTestConfigData config1 = new CmsTestConfigData(
"/sites/default",
NO_TYPES,
types,
NO_PROPERTIES,
parentDetailPages,
NO_MODEL_PAGES);
Expand Down
48 changes: 24 additions & 24 deletions test/org/opencms/ade/configuration/TestLiveConfig.java
Expand Up @@ -242,10 +242,10 @@ public void testLevel1Configuration() throws Exception {
CmsObject offlineCms = getCmsObject();
CmsObject onlineCms = onlineCms();
OpenCms.getADEManager().refresh();
checkResourceTypes(offlineCms, "/sites/default", "foldername", "a1", "b1", "c1");
checkResourceTypes(onlineCms, "/sites/default", "foldername", "a1", "b1", "c1");
checkResourceTypes(offlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1");
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1");
checkResourceTypes(offlineCms, "/sites/default", "foldername", "a1", "b1", "c1", "foo1");
checkResourceTypes(onlineCms, "/sites/default", "foldername", "a1", "b1", "c1", "foo1");
checkResourceTypes(offlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1", "foo1");
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1", "foo1");
}

/**
Expand All @@ -257,15 +257,15 @@ public void testLevel2Configuration() throws Exception {
CmsObject offlineCms = getCmsObject();
CmsObject onlineCms = onlineCms();
OpenCms.getADEManager().refresh();
checkResourceTypes(offlineCms, "/sites/default/today/events", "foldername", "d2", "a1", "c1");
checkResourceTypes(offlineCms, "/sites/default/today/events/foo", "foldername", "d2", "a1", "c1");
checkResourceTypes(onlineCms, "/sites/default/today/events/", "foldername", "d2", "a1", "c1");
checkResourceTypes(onlineCms, "/sites/default/today/events/foo", "foldername", "d2", "a1", "c1");

checkResourceTypes(onlineCms, "/sites/default/today/news", "foldername", "c3", "e3", "a1", "b1");
checkResourceTypes(onlineCms, "/sites/default/today/news/foo/", "foldername", "c3", "e3", "a1", "b1");
checkResourceTypes(offlineCms, "/sites/default/today/news", "foldername", "c3", "e3", "a1", "b1");
checkResourceTypes(offlineCms, "/sites/default/today/news/foo", "foldername", "c3", "e3", "a1", "b1");
checkResourceTypes(offlineCms, "/sites/default/today/events", "foldername", "d2", "a1", "c1", "foo1");
checkResourceTypes(offlineCms, "/sites/default/today/events/foo", "foldername", "d2", "a1", "c1", "foo1");
checkResourceTypes(onlineCms, "/sites/default/today/events/", "foldername", "d2", "a1", "c1", "foo1");
checkResourceTypes(onlineCms, "/sites/default/today/events/foo", "foldername", "d2", "a1", "c1", "foo1");

checkResourceTypes(onlineCms, "/sites/default/today/news", "foldername", "c3", "e3", "a1", "b1", "foo1");
checkResourceTypes(onlineCms, "/sites/default/today/news/foo/", "foldername", "c3", "e3", "a1", "b1", "foo1");
checkResourceTypes(offlineCms, "/sites/default/today/news", "foldername", "c3", "e3", "a1", "b1", "foo1");
checkResourceTypes(offlineCms, "/sites/default/today/news/foo", "foldername", "c3", "e3", "a1", "b1", "foo1");
}

/**
Expand Down Expand Up @@ -357,7 +357,7 @@ public void testModuleConfig1() throws Exception {
data.getBytes(),
Collections.<CmsProperty> emptyList());
waitForUpdate(false);
checkResourceTypes(cms, "/sites/default", "foldername", "a1", "b1", "c1", "m0");
checkResourceTypes(cms, "/sites/default", "foldername", "a1", "b1", "c1", "foo1", "m0");
} finally {
cms.lockResource(filename);
cms.deleteResource(filename, CmsResource.DELETE_PRESERVE_SIBLINGS);
Expand All @@ -376,8 +376,8 @@ public void testMove1() throws Exception {
cms.lockResource("/sites/default/today/events");
cms.moveResource("/sites/default/today/events", "/sites/default/today/news/events");
OpenCms.getADEManager().getOfflineCache().getWaitHandleForUpdateTask().enter(0);
checkResourceTypes(cms, "/sites/default/today/news", "foldername", "c3", "e3", "a1", "b1");
checkResourceTypes(cms, "/sites/default/today/news/events/", "foldername", "d2", "c3", "e3", "a1");
checkResourceTypes(cms, "/sites/default/today/news", "foldername", "c3", "e3", "a1", "b1", "foo1");
checkResourceTypes(cms, "/sites/default/today/news/events/", "foldername", "d2", "c3", "e3", "a1", "foo1");
} finally {
restoreFiles();
}
Expand Down Expand Up @@ -429,17 +429,17 @@ public void testPublish() throws Exception {
CmsObject onlineCms = onlineCms();
try {
waitForUpdate(false);
checkResourceTypes(cms, "/sites/default/today", "foldername", "a1", "b1", "c1");
checkResourceTypes(cms, "/sites/default/today", "foldername", "a1", "b1", "c1", "foo1");
cms.copyResource("/sites/default/today/news/.content", "sites/default/today/.content");
waitForUpdate(true);
waitForUpdate(false);
checkResourceTypes(cms, "/sites/default/today", "foldername", "c3", "e3", "a1", "b1");
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1");
checkResourceTypes(cms, "/sites/default/today", "foldername", "c3", "e3", "a1", "b1", "foo1");
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1", "foo1");
publish();
waitForUpdate(true);
waitForUpdate(false);
checkResourceTypes(onlineCms, "/sites/default/today/", "foldername", "c3", "e3", "a1", "b1");
checkResourceTypes(onlineCms, "/sites/default/today/events", "foldername", "d2", "c3", "e3", "a1");
checkResourceTypes(onlineCms, "/sites/default/today/", "foldername", "c3", "e3", "a1", "b1", "foo1");
checkResourceTypes(onlineCms, "/sites/default/today/events", "foldername", "d2", "c3", "e3", "a1", "foo1");
} finally {
restoreFiles();
}
Expand All @@ -457,12 +457,12 @@ public void testPublishDeleted() throws Exception {
try {
waitForUpdate(false);
waitForUpdate(true);
checkResourceTypes(cms, "/sites/default/today", "foldername", "a1", "b1", "c1");
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1");
checkResourceTypes(cms, "/sites/default/today", "foldername", "a1", "b1", "c1", "foo1");
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1", "foo1");
cms.lockResource("/sites/default/.content");
cms.deleteResource("/sites/default/.content", CmsResource.DELETE_PRESERVE_SIBLINGS);
waitForUpdate(true);
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1");
checkResourceTypes(onlineCms, "/sites/default/today", "foldername", "a1", "b1", "c1", "foo1");
publish();
waitForUpdate(true);
checkResourceTypes(onlineCms, "/sites/default/today/", "foldername");
Expand Down

0 comments on commit 5fa17e1

Please sign in to comment.