Author: nfilotto
Date: 2010-09-23 05:45:53 -0400 (Thu, 23 Sep 2010)
New Revision: 3182
Modified:
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/container-configuration.xml
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml
Log:
KER-162: Adapt EXOJCR-974 for kernel 2.2.x
Modified:
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/container-configuration.xml
===================================================================
---
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/container-configuration.xml 2010-09-23
09:28:45 UTC (rev 3181)
+++
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/container-configuration.xml 2010-09-23
09:45:53 UTC (rev 3182)
@@ -385,6 +385,11 @@
<name>default.realm.name</name>
<value>my-exo-domain</value>
</value-param>
+ <!-- Indicates whether the unregistered webapps have to be ignored
-->
+ <value-param>
+ <name>ignore.unregistered.webapp</name>
+ <value>true</value>
+ </value-param>
<!-- The default portal container definition -->
<!-- It cans be used to avoid duplicating configuration -->
<object-param>
@@ -470,6 +475,28 @@
</row>
<row>
+ <entry>ignore.unregistered.webapp</entry>
+
+ <entry>Indicates whether the unregistered webapps have to be
+ ignored. If a webapp has not been registered as a dependency
+ of any portal container, the application will use the value of
+ this parameter to know what to do:<itemizedlist>
+ <listitem>
+ <para>If it is set to <emphasis>false</emphasis>,
this
+ webapp will be considered by default as a dependency of
+ all the portal containers.</para>
+ </listitem>
+
+ <listitem>
+ <para>If it is set to <emphasis>true</emphasis>,
this
+ webapp won't be considered by default as a dependency of
+ any portal container, it will be simply ignored.</para>
+ </listitem>
+ </itemizedlist>This field is optional and by default this
+ parameter is set to
<emphasis>false</emphasis>.</entry>
+ </row>
+
+ <row>
<entry>default.portal.definition</entry>
<entry>The definition of the default portal container. This
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-09-23
09:28:45 UTC (rev 3181)
+++
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-09-23
09:45:53 UTC (rev 3182)
@@ -41,7 +41,6 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -109,9 +108,9 @@
private volatile boolean initialized;
/**
- * The set of all the portal containers
+ * The list of all the portal containers
*/
- private Set<String> portalContainerNames = Collections.unmodifiableSet(new
HashSet<String>());
+ private List<String> portalContainerNames = Collections.unmodifiableList(new
ArrayList<String>());
/**
* The set of all the portal containers that have been disabled
@@ -148,6 +147,15 @@
* Indicates if new system properties have been added
*/
private final PropertyConfigurator pc;
+
+ /**
+ * Indicates whether the unregistered webapps have to be ignored. If a webapp has not
been registered as a dependency
+ * of any portal containers, we will use the value of this parameter to know what to
do.
+ * If it is set to false, this webapp will be considered by default as a dependency of
all the portal containers.
+ * If it is set to true, this webapp won't be considered by default as a
dependency of any portal container, it will
+ * be simply ignored.
+ */
+ private final boolean ignoreUnregisteredWebapp;
public PortalContainerConfig(ConfigurationManager cm)
{
@@ -196,6 +204,9 @@
this.cm = cm;
this.serverInfo = serverInfo;
this.defaultDefinition = create(params);
+ this.ignoreUnregisteredWebapp =
+ params != null &&
params.getValueParam("ignore.unregistered.webapp") != null
+ &&
Boolean.valueOf(params.getValueParam("ignore.unregistered.webapp").getValue());
}
/**
@@ -423,12 +434,12 @@
*/
public synchronized void registerPortalContainerName(String name)
{
- if (!portalContainerNames.contains(name))
+ if (!portalContainerNames.contains(name) &&
!portalContainerNamesDisabled.contains(name))
{
- final Set<String> lPortalContainerNames = new
LinkedHashSet<String>(portalContainerNames.size() + 1);
+ final List<String> lPortalContainerNames = new
ArrayList<String>(portalContainerNames.size() + 1);
lPortalContainerNames.add(name);
lPortalContainerNames.addAll(portalContainerNames);
- this.portalContainerNames = Collections.unmodifiableSet(lPortalContainerNames);
+ this.portalContainerNames =
Collections.unmodifiableList(lPortalContainerNames);
}
}
@@ -440,9 +451,9 @@
{
if (portalContainerNames.contains(name))
{
- final Set<String> lPortalContainerNames = new
LinkedHashSet<String>(portalContainerNames);
+ final List<String> lPortalContainerNames = new
ArrayList<String>(portalContainerNames);
lPortalContainerNames.remove(name);
- this.portalContainerNames = Collections.unmodifiableSet(lPortalContainerNames);
+ this.portalContainerNames =
Collections.unmodifiableList(lPortalContainerNames);
if (hasDefinition())
{
// The new behavior is expected
@@ -490,7 +501,14 @@
// The given context is a portal container
return Collections.singletonList(contextName);
}
- return Collections.emptyList();
+ else if (portalContainerNamesDisabled.contains(contextName) ||
ignoreUnregisteredWebapp)
+ {
+ // The given context name is a context name of a disabled portal container
or
+ // the webapp is ignored since it has not been registered in any portal
container dependency list
+ return Collections.emptyList();
+ }
+ // By default we scope it to all the portal containers
+ return portalContainerNames;
}
return result;
}
@@ -521,12 +539,24 @@
if (result == null || result.isEmpty())
{
// This context has not been added as dependency of any portal containers
+ if (portalContainerNamesDisabled.contains(contextName) ||
ignoreUnregisteredWebapp)
+ {
+ // The given context name is a context name of a disabled portal container
or
+ // the webapp is ignored since it has not been registered in any portal
container dependency list
+ if (PropertyManager.isDevelopping())
+ {
+ log.warn("The context '" + contextName + "' has not
been added as " +
+ "dependency of any portal containers");
+ }
+ return null;
+ }
if (PropertyManager.isDevelopping())
{
- log.info("The context '" + contextName + "' has not
been added as " +
+ log.debug("The context '" + contextName + "' has not
been added as " +
"dependency of any portal containers");
}
- return null;
+ // by default we will return the default portal container
+ return defaultDefinition.getName();
}
return result.get(0);
}
@@ -1086,7 +1116,13 @@
*/
private void initialize(Map<String, PortalContainerDefinition> mDefinitions)
{
- final Set<String> lPortalContainerNames = new
LinkedHashSet<String>(mDefinitions.size() + 1);
+ final List<String> lPortalContainerNames = new
ArrayList<String>(mDefinitions.size() + 1);
+ boolean isDefaultPortalDisabled =
isPortalContainerNameDisabled(defaultDefinition.getName());
+ if (mDefinitions.isEmpty() || !isDefaultPortalDisabled)
+ {
+ // Add the default portal container name if not disabled
+ lPortalContainerNames.add(defaultDefinition.getName());
+ }
final Map<String, List<String>> mScopes = new HashMap<String,
List<String>>();
boolean first = true;
for (Map.Entry<String, PortalContainerDefinition> entry :
mDefinitions.entrySet())
@@ -1100,24 +1136,27 @@
continue;
}
boolean hasChanged = false;
- lPortalContainerNames.add(name);
+ if (!lPortalContainerNames.contains(name))
+ {
+ lPortalContainerNames.add(name);
+ }
if (first)
{
first = false;
// Initialize the main fields thanks to the data found in the first portal
container
- if (defaultDefinition.getName() == DEFAULT_PORTAL_CONTAINER_NAME)
+ if (defaultDefinition.getName() == DEFAULT_PORTAL_CONTAINER_NAME ||
isDefaultPortalDisabled)
{
defaultDefinition.setName(name);
hasChanged = true;
}
- if (defaultDefinition.getRestContextName() == DEFAULT_REST_CONTEXT_NAME
+ if ((defaultDefinition.getRestContextName() == DEFAULT_REST_CONTEXT_NAME ||
isDefaultPortalDisabled)
&& definition.getRestContextName() != null &&
definition.getRestContextName().trim().length() > 0)
{
defaultDefinition.setRestContextName(definition.getRestContextName().trim());
hasChanged = true;
}
- if (defaultDefinition.getRealmName() == DEFAULT_REALM_NAME &&
definition.getRealmName() != null
- && definition.getRealmName().trim().length() > 0)
+ if ((defaultDefinition.getRealmName() == DEFAULT_REALM_NAME ||
isDefaultPortalDisabled)
+ && definition.getRealmName() != null &&
definition.getRealmName().trim().length() > 0)
{
defaultDefinition.setRealmName(definition.getRealmName().trim());
hasChanged = true;
@@ -1132,10 +1171,8 @@
}
initializeSettings(definition, true);
}
- if (mDefinitions.isEmpty())
+ if (!mDefinitions.containsKey(defaultDefinition.getName()))
{
- // Add the default portal container name
- lPortalContainerNames.add(defaultDefinition.getName());
// Apply the changes corresponding to the default definition
applyChanges(defaultDefinition);
initializeSettings(defaultDefinition, false);
@@ -1145,7 +1182,7 @@
// dependencies have been defined
registerDependencies(defaultDefinition, mScopes);
}
- if (!portalContainerNamesDisabled.isEmpty())
+ if (mDefinitions.isEmpty() && !portalContainerNamesDisabled.isEmpty())
{
if (PropertyManager.isDevelopping())
{
@@ -1156,7 +1193,7 @@
portalContainerNamesDisabled = Collections.unmodifiableSet(new
HashSet<String>());
}
}
- this.portalContainerNames = Collections.unmodifiableSet(lPortalContainerNames);
+ this.portalContainerNames = Collections.unmodifiableList(lPortalContainerNames);
this.scopes = Collections.unmodifiableMap(mScopes);
// clear the changes
changes.clear();
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java 2010-09-23
09:28:45 UTC (rev 3181)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java 2010-09-23
09:45:53 UTC (rev 3182)
@@ -27,7 +27,7 @@
* Created by The eXo Platform SAS
* Author : Nicolas Filotto
* nicolas.filotto(a)exoplatform.com
- * 18 f�vr. 2010
+ * 18 fホvr. 2010
*/
public class TestPortalContainer extends AbstractTestContainer
{
@@ -43,7 +43,7 @@
assertEquals("myRest", portal.getRestContextName());
assertEquals("my-exo-domain", portal.getRealmName());
- assertFalse(PortalContainer.isPortalContainerName("myPortal"));
+ assertTrue(PortalContainer.isPortalContainerName("myPortal"));
assertTrue(PortalContainer.isPortalContainerName("portal"));
assertFalse(PortalContainer.isPortalContainerName("foo"));
@@ -73,7 +73,7 @@
assertEquals("myRest",
PortalContainer.getRestContextName("foo"));
assertEquals("my-exo-domain",
PortalContainer.getRealmName("foo"));
- assertFalse(PortalContainer.isPortalContainerName("myPortal"));
+ assertTrue(PortalContainer.isPortalContainerName("myPortal"));
assertTrue(PortalContainer.isPortalContainerName("portal"));
assertFalse(PortalContainer.isPortalContainerName("foo"));
@@ -84,7 +84,7 @@
assertEquals("myRest", PortalContainer.getCurrentRestContextName());
assertEquals("my-exo-domain", PortalContainer.getCurrentRealmName());
- assertFalse(PortalContainer.isPortalContainerName("myPortal"));
+ assertTrue(PortalContainer.isPortalContainerName("myPortal"));
assertTrue(PortalContainer.isPortalContainerName("portal"));
assertFalse(PortalContainer.isPortalContainerName("foo"));
}
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-09-23
09:28:45 UTC (rev 3181)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-09-23
09:45:53 UTC (rev 3182)
@@ -30,7 +30,7 @@
* Created by The eXo Platform SAS
* Author : Nicolas Filotto
* nicolas.filotto(a)exoplatform.com
- * 18 f�vr. 2010
+ * 18 fホvr. 2010
*/
public class TestPortalContainerConfig extends AbstractTestContainer
{
@@ -214,7 +214,6 @@
assertFalse(config.isPortalContainerName("myPortal"));
assertFalse(config.isPortalContainerName("myPortal-pcdef"));
assertTrue(config.isPortalContainerName(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME));
-
// Needed for backward compatibility
assertTrue(config.isScopeValid(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
"foo"));
assertFalse(config.isScopeValid("foo", "foo"));
@@ -290,45 +289,126 @@
assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
names.get(0));
}
// Without dependencies
- rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml");
+ String[] ignoreWebappProfiles = {"ignore.unregistered.webapp-default",
"ignore.unregistered.webapp-false",
"ignore.unregistered.webapp-true"};
+ for (int i = 0; i < ignoreWebappProfiles.length; i++)
+ {
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml",
ignoreWebappProfiles[i]);
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getDependencies("foo"));
+ assertNull(config.getDependencies("myPortal"));
+ assertNull(config.getDependencies("myPortal-pcdef"));
+ names = config.getPortalContainerNames("foo");
+ if (i < ignoreWebappProfiles.length - 1)
+ {
+ // Default behavior
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal"));
+ assertTrue(names.contains("myPortal-pcdef"));
+ assertEquals("myPortal",
config.getPortalContainerName("foo"));
+ }
+ else
+ {
+ // Ignore webapp needed for EXOJCR-795
+ assertTrue(names != null && names.isEmpty());
+ assertNull(config.getPortalContainerName("foo"));
+ }
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myRest", config.getRestContextName("foo"));
+ assertEquals("myRest",
config.getRestContextName("myPortal"));
+ assertEquals("myRest-pcdef",
config.getRestContextName("myPortal-pcdef"));
+ assertEquals("my-exo-domain", config.getRealmName("foo"));
+ assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
+ assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertTrue(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ // Needed for backward compatibility
+ assertFalse(config.isScopeValid("foo", "foo"));
+ if (i < ignoreWebappProfiles.length - 1)
+ {
+ // Default behavior
+ assertTrue(config.isScopeValid("myPortal", "foo"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ }
+ else
+ {
+ // Ignore webapp needed for EXOJCR-795
+ assertFalse(config.isScopeValid("myPortal", "foo"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"foo"));
+ }
+ assertTrue(config.isScopeValid("myPortal", "myPortal"));
+ assertTrue(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ assertTrue(config.hasDefinition());
+ }
+
+ // Unregister the portal container
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml",
"disable-pc");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
- assertNull(config.getDependencies("foo"));
- assertNull(config.getDependencies("myPortal"));
- assertNull(config.getDependencies("myPortal-pcdef"));
- names = config.getPortalContainerNames("foo");
+ assertNull(config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
+ assertFalse(config.isPortalContainerName("myPortal-pcdef"));
+ assertTrue(config.isPortalContainerName("myPortal"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal"));
+ assertFalse(config.isScopeValid("myPortal",
"myPortal-pcdef"));
+ assertTrue(config.isScopeValid("myPortal", "myPortal"));
+ names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && names.isEmpty());
names = config.getPortalContainerNames("myPortal");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal"));
+ // Unregister the default portal container
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml",
"disable-pc2");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertNull(config.getPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal"));
+ assertFalse(config.isScopeValid("myPortal",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal", "myPortal"));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && !names.isEmpty());
- assertEquals("myPortal-pcdef", names.get(0));
- assertNull(config.getPortalContainerName("foo"));
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && names.isEmpty());
+ config.disablePortalContainer("myPortal-pcdef");
+ assertNull(config.getPortalContainerName("myPortal-pcdef"));
assertNull(config.getPortalContainerName("myPortal"));
- assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
- assertEquals("myRest", config.getRestContextName("foo"));
- assertEquals("myRest", config.getRestContextName("myPortal"));
- assertEquals("myRest-pcdef",
config.getRestContextName("myPortal-pcdef"));
- assertEquals("my-exo-domain", config.getRealmName("foo"));
- assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
- assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
- assertFalse(config.isPortalContainerName("foo"));
+ assertFalse(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("myPortal"));
- assertTrue(config.isPortalContainerName("myPortal-pcdef"));
- // Needed for backward compatibility
- assertFalse(config.isScopeValid("foo", "foo"));
- assertFalse(config.isScopeValid("myPortal", "foo"));
- assertFalse(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal"));
+ assertFalse(config.isScopeValid("myPortal",
"myPortal-pcdef"));
assertFalse(config.isScopeValid("myPortal", "myPortal"));
- assertTrue(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
- assertTrue(config.hasDefinition());
- // Unregister the portal container
- rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml",
"disable-pc");
- config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && names.isEmpty());
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && names.isEmpty());
+ config.registerPortalContainerName("myPortal-pcdef");
assertNull(config.getPortalContainerName("myPortal-pcdef"));
+ assertNull(config.getPortalContainerName("myPortal"));
assertFalse(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("myPortal"));
assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal"));
+ assertFalse(config.isScopeValid("myPortal",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal", "myPortal"));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && names.isEmpty());
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && names.isEmpty());
// Without dependencies and with no portal container name
rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-empty-portal-def.xml");
@@ -374,14 +454,18 @@
assertNull(config.getDependencies("myPortal"));
assertNull(config.getDependencies("myPortal-pcdef"));
names = config.getPortalContainerNames("foo");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal"));
+ assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("myPortal");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
- assertNull(config.getPortalContainerName("foo"));
- assertNull(config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
assertEquals("myRest", config.getRestContextName("foo"));
assertEquals("myRest", config.getRestContextName("myPortal"));
@@ -390,13 +474,13 @@
assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
assertEquals("my-exo-domain",
config.getRealmName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("foo"));
- assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal"));
assertTrue(config.isPortalContainerName("myPortal-pcdef"));
// Needed for backward compatibility
assertFalse(config.isScopeValid("foo", "foo"));
- assertFalse(config.isScopeValid("myPortal", "foo"));
- assertFalse(config.isScopeValid("myPortal-pcdef", "foo"));
- assertFalse(config.isScopeValid("myPortal", "myPortal"));
+ assertTrue(config.isScopeValid("myPortal", "foo"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertTrue(config.isScopeValid("myPortal", "myPortal"));
assertTrue(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
assertTrue(config.hasDefinition());
// Unregister the portal container
@@ -420,17 +504,24 @@
assertTrue(deps != null && deps.size() == 1 &&
deps.contains("fooX"));
names = config.getPortalContainerNames("fooX");
assertTrue(names != null && !names.isEmpty());
- assertEquals(1, names.size());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("foo");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("myPortal");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
- assertNull(config.getPortalContainerName("foo"));
- assertNull(config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("myPortal"));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
assertEquals("myRest-dpcdef",
config.getRestContextName("foo"));
assertEquals("myRest-dpcdef",
config.getRestContextName("myPortal"));
@@ -440,23 +531,68 @@
assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("foo"));
assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-dpcdef"));
assertTrue(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isScopeValid("foo", "fooX"));
assertFalse(config.isScopeValid("myPortal", "fooX"));
+ assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX"));
assertTrue(config.isScopeValid("myPortal-pcdef", "fooX"));
assertTrue(config.hasDefinition());
// Unregister the portal container
rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml",
"disable-pc");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("myPortal-dpcdef"));
assertNull(config.getPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-dpcdef"));
assertFalse(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isScopeValid("foo", "fooX"));
+ assertFalse(config.isScopeValid("myPortal", "fooX"));
+ assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX"));
+ assertFalse(config.isScopeValid("myPortal-pcdef", "fooX"));
+ assertTrue(config.isScopeValid("myPortal-dpcdef",
"myPortal-dpcdef"));
assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && names.isEmpty());
- assertFalse(config.isScopeValid("myPortal-pcdef", "fooX"));
+ names = config.getPortalContainerNames("myPortal-dpcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
names = config.getPortalContainerNames("fooX");
- assertTrue(names != null && names.isEmpty());
-
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ // Unregister the default portal container
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml",
"disable-pc2");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal"));
+ assertNull(config.getPortalContainerName("myPortal-dpcdef"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertFalse(config.isPortalContainerName("myPortal-dpcdef"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isScopeValid("foo", "fooX"));
+ assertFalse(config.isScopeValid("myPortal", "fooX"));
+ assertFalse(config.isScopeValid("myPortal-dpcdef", "fooX"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "fooX"));
+ assertFalse(config.isScopeValid("myPortal-dpcdef",
"myPortal-dpcdef"));
+ assertTrue(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+ names = config.getPortalContainerNames("myPortal-dpcdef");
+ assertTrue(names != null && names.isEmpty());
+ names = config.getPortalContainerNames("fooX");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+
profiles =
new String[]{"AddDependencies",
"AddDependenciesBefore-No-Target",
"AddDependenciesBefore-With-Fake-Target",
"AddDependenciesBefore-With-Target",
"AddDependenciesAfter-No-Target",
@@ -488,19 +624,24 @@
}
names = config.getPortalContainerNames("fooX");
assertTrue(names != null && !names.isEmpty());
- assertEquals(1, names.size());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("foo");
assertTrue(names != null && !names.isEmpty());
- assertEquals(1, names.size());
- assertEquals("myPortal-pcdef", names.get(0));
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("myPortal");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
- assertNull(config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("myPortal"));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
assertEquals("myRest-dpcdef",
config.getRestContextName("foo"));
assertEquals("myRest-dpcdef",
config.getRestContextName("myPortal"));
@@ -519,18 +660,68 @@
rootContainer = createRootContainer(
"portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml",
"with-profiles", profile, "disable-pc");
- config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
- assertNull(config.getPortalContainerName("foo"));
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("myPortal-dpcdef"));
assertNull(config.getPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-dpcdef"));
assertFalse(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isScopeValid("foo", "fooX"));
+ assertFalse(config.isScopeValid("myPortal", "fooX"));
+ assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX"));
+ assertFalse(config.isScopeValid("myPortal-pcdef", "fooX"));
+ assertTrue(config.isScopeValid("myPortal-dpcdef",
"myPortal-dpcdef"));
assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && names.isEmpty());
- assertFalse(config.isScopeValid("myPortal-pcdef", "fooX"));
+ names = config.getPortalContainerNames("myPortal-dpcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
names = config.getPortalContainerNames("foo");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
names = config.getPortalContainerNames("fooX");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ // Unregister the default portal container
+ rootContainer = createRootContainer(
+
"portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml",
+ "with-profiles", profile, "disable-pc2");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal"));
+ assertNull(config.getPortalContainerName("myPortal-dpcdef"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertFalse(config.isPortalContainerName("myPortal-dpcdef"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isScopeValid("foo", "fooX"));
+ assertFalse(config.isScopeValid("myPortal", "fooX"));
+ assertFalse(config.isScopeValid("myPortal-dpcdef",
"fooX"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "fooX"));
+ assertFalse(config.isScopeValid("myPortal-dpcdef",
"myPortal-dpcdef"));
+ assertTrue(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+ names = config.getPortalContainerNames("myPortal-dpcdef");
+ assertTrue(names != null && names.isEmpty());
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+ names = config.getPortalContainerNames("fooX");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
}
// With dependencies
@@ -544,12 +735,13 @@
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
names = config.getPortalContainerNames("myPortal");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
- assertNull(config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
assertEquals("myRest", config.getRestContextName("foo"));
assertEquals("myRest", config.getRestContextName("myPortal"));
@@ -558,27 +750,65 @@
assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("foo"));
- assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal"));
assertTrue(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isScopeValid("foo", "foo"));
assertFalse(config.isScopeValid("myPortal", "foo"));
assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal"));
- assertFalse(config.isScopeValid("myPortal-pcdef", "fooY"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "fooY"));
assertTrue(config.hasDefinition());
// Unregister the portal container
rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def2.xml",
"disable-pc");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
- assertNull(config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
assertNull(config.getPortalContainerName("myPortal-pcdef"));
+ assertTrue(config.isPortalContainerName("myPortal"));
assertFalse(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal"));
+ assertFalse(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertFalse(config.isScopeValid("myPortal",
"myPortal-pcdef"));
+ assertTrue(config.isScopeValid("myPortal", "myPortal"));
+ assertTrue(config.isScopeValid("myPortal", "foo"));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && names.isEmpty());
- assertFalse(config.isScopeValid("myPortal-pcdef", "foo"));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal"));
names = config.getPortalContainerNames("foo");
- assertTrue(names != null && names.isEmpty());
-
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal"));
+ // Unregister the default portal container
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def2.xml",
"disable-pc2");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ assertTrue(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertFalse(config.isScopeValid("myPortal",
"myPortal-pcdef"));
+ assertFalse(config.isScopeValid("myPortal", "myPortal"));
+ assertFalse(config.isScopeValid("myPortal", "foo"));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal-pcdef"));
+
for (String profile : profiles)
{
rootContainer =
@@ -612,12 +842,13 @@
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
names = config.getPortalContainerNames("myPortal");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
- assertNull(config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
assertEquals("myRest", config.getRestContextName("foo"));
assertEquals("myRest",
config.getRestContextName("myPortal"));
@@ -626,7 +857,7 @@
assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("foo"));
- assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal"));
assertTrue(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isScopeValid("foo", "foo"));
assertFalse(config.isScopeValid("myPortal", "foo"));
@@ -636,7 +867,7 @@
rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def2.xml",
"with-profiles", profile, "disable-pc");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
- assertNull(config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("foo"));
assertNull(config.getPortalContainerName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
@@ -644,7 +875,9 @@
assertTrue(names != null && names.isEmpty());
assertFalse(config.isScopeValid("myPortal-pcdef", "foo"));
names = config.getPortalContainerNames("foo");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal"));
}
// With dependencies and with default portal container definition
@@ -658,18 +891,21 @@
deps = config.getDependencies("myPortal-pcdef");
assertTrue(deps != null && deps.size() == 3);
names = config.getPortalContainerNames("fooX");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertEquals("myPortal", names.get(0));
names = config.getPortalContainerNames("foo");
assertTrue(names != null && !names.isEmpty());
assertEquals(1, names.size());
assertEquals("myPortal-pcdef", names.get(0));
names = config.getPortalContainerNames("myPortal");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
names = config.getPortalContainerNames("myPortal-pcdef");
assertTrue(names != null && !names.isEmpty());
assertEquals("myPortal-pcdef", names.get(0));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
- assertNull(config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
assertEquals("myRest", config.getRestContextName("foo"));
assertEquals("myRest", config.getRestContextName("myPortal"));
@@ -678,7 +914,7 @@
assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("foo"));
- assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal"));
assertTrue(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isScopeValid("foo", "foo"));
assertFalse(config.isScopeValid("myPortal", "foo"));
@@ -687,7 +923,7 @@
// Unregister the portal container
rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def2.xml",
"disable-pc");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
- assertNull(config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("foo"));
assertNull(config.getPortalContainerName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("myPortal-pcdef"));
assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal-pcdef"));
@@ -695,7 +931,9 @@
assertTrue(names != null && names.isEmpty());
assertFalse(config.isScopeValid("myPortal-pcdef", "foo"));
names = config.getPortalContainerNames("foo");
- assertTrue(names != null && names.isEmpty());
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertTrue(names.contains("myPortal"));
}
public void testSettings()
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml 2010-09-23
09:28:45 UTC (rev 3181)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml 2010-09-23
09:45:53 UTC (rev 3182)
@@ -237,5 +237,24 @@
</values-param>
</init-params>
</component-plugin>
- </external-component-plugins>
+ </external-component-plugins>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin profiles="disable-pc2">
+ <!-- The name of the plugin -->
+ <name>Disable a PortalContainer</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerDisablePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionDisablePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionDisablePlugin</type>
+ <init-params>
+ <!-- The list of the name of the portal containers to disable -->
+ <values-param>
+ <name>names</name>
+ <value>myPortal-dpcdef</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml 2010-09-23
09:28:45 UTC (rev 3181)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def.xml 2010-09-23
09:45:53 UTC (rev 3182)
@@ -28,6 +28,15 @@
<name>default.realm.name</name>
<value>my-exo-domain</value>
</value-param>
+ <!-- Indicates whether the unregistered webapps have to be ignored -->
+ <value-param profiles="ignore.unregistered.webapp-false">
+ <name>ignore.unregistered.webapp</name>
+ <value>false</value>
+ </value-param>
+ <value-param profiles="ignore.unregistered.webapp-true">
+ <name>ignore.unregistered.webapp</name>
+ <value>true</value>
+ </value-param>
</init-params>
</component>
<external-component-plugins>
@@ -79,5 +88,24 @@
</values-param>
</init-params>
</component-plugin>
- </external-component-plugins>
+ </external-component-plugins>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin profiles="disable-pc2">
+ <!-- The name of the plugin -->
+ <name>Disable a PortalContainer</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerDisablePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionDisablePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionDisablePlugin</type>
+ <init-params>
+ <!-- The list of the name of the portal containers to disable -->
+ <values-param>
+ <name>names</name>
+ <value>myPortal</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml 2010-09-23
09:28:45 UTC (rev 3181)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml 2010-09-23
09:45:53 UTC (rev 3182)
@@ -68,6 +68,9 @@
<value>
<string>foo3</string>
</value>
+ <value profiles="disable-pc2">
+ <string>myPortal</string>
+ </value>
</collection>
</field>
</object>
@@ -214,5 +217,24 @@
</values-param>
</init-params>
</component-plugin>
- </external-component-plugins>
+ </external-component-plugins>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin profiles="disable-pc2">
+ <!-- The name of the plugin -->
+ <name>Disable a PortalContainer</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerDisablePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionDisablePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionDisablePlugin</type>
+ <init-params>
+ <!-- The list of the name of the portal containers to disable -->
+ <values-param>
+ <name>names</name>
+ <value>myPortal</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file