You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2015/11/27 13:37:43 UTC

[02/38] portals-pluto git commit: Replaced code that reads the deployment descriptor with an implementation that can be better extended to add v3.0 support. Added test cases. Uses jaxb binding classes that are generated at compile time.

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java
new file mode 100644
index 0000000..de06e67
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletApplicationDefinition362ImplTest.java
@@ -0,0 +1,652 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.Filter;
+import org.apache.pluto.container.om.portlet.FilterMapping;
+import org.apache.pluto.container.om.portlet.Listener;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.apache.pluto.container.om.portlet.impl.CustomPortletModeImpl;
+import org.apache.pluto.container.om.portlet.impl.CustomWindowStateImpl;
+import org.apache.pluto.container.om.portlet.impl.EventDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.FilterImpl;
+import org.apache.pluto.container.om.portlet.impl.FilterMappingImpl;
+import org.apache.pluto.container.om.portlet.impl.ListenerImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PublicRenderParameterImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityConstraintImpl;
+import org.apache.pluto.container.om.portlet.impl.UserAttributeImpl;
+import org.apache.pluto.container.om.portlet.impl.UserDataConstraintImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Junit test cases for JSR 362 portlet application definition.
+ * @author Scott Nicklous
+ *
+ */
+public class PortletApplicationDefinition362ImplTest {
+
+   private static final String  WEBDDPKG         = "org/apache/pluto/container/om/portlet/";
+   private static final String  WEBDD31          = "webApp31simple.xml";
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private static ConfigurationHolder cfp;
+   
+   // class under test; cloned new for each test
+   private  PortletApplicationDefinition cut;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletApplicationDefinition362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      cut = new PortletApplicationDefinitionImpl(pad);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getId()}.
+    */
+   @Test
+   public void testGetSetId() {
+      String val = pad.getId();
+      assertNotNull(val);
+      assertEquals("id1", val);
+      pad.setId("42");
+      val = pad.getId();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getName()}.
+    */
+   @Test
+   public void testGetSetName() {
+      pad.setName("Bob");
+      String val = pad.getName();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getContextPath()}.
+    */
+   @Test
+   public void testSetGetContextPath() {
+      pad.setContextPath("Bob");
+      String val = pad.getContextPath();
+      assertNotNull(val);
+      assertEquals("Bob", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.PortletApplicationDefinitionImpl#getVersion()}.
+    */
+   @Test
+   public void testGetSetVersion() {
+      String val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("3.0", val);
+      pad.setVersion("42");
+      val = pad.getVersion();
+      assertNotNull(val);
+      assertEquals("42", val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getResourceBundle()}.
+    */
+   @Test
+   public void testGetSetResourceBundle() {
+      String val = pad.getResourceBundle();
+      String txt = "com.ibm.portal.ResourceBundle";
+      assertNotNull(val);
+      assertEquals("org.apache.portal.ResourceBundle", val);
+      pad.setResourceBundle(txt);
+      val = pad.getResourceBundle();
+      assertNotNull(val);
+      assertEquals(txt, val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getDefaultNamespace()}.
+    */
+   @Test
+   public void testGetSetDefaultNamespace() {
+      String val = pad.getDefaultNamespace();
+      String txt = "https://www.ibm.com/";
+      assertNotNull(val);
+      assertEquals("https://www.apache.org/", val);
+      pad.setDefaultNamespace(txt);
+      val = pad.getDefaultNamespace();
+      assertNotNull(val);
+      assertEquals(txt, val);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPortlet(java.lang.String)}.
+    */
+   @Test
+   public void testGetPortlet() {
+      PortletDefinition pd = pad.getPortlet("portlet362");
+      assertNotNull(pd);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPortlets()}.
+    */
+   @Test
+   public void testGetPortlets() {
+      List<PortletDefinition> list = cut.getPortlets();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("portlet362", list.get(0).getPortletName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addPortlet(org.apache.pluto.container.om.portlet.PortletDefinition)}.
+    */
+   @Test
+   public void testAddPortlet() {
+      String newPN = "newPortlet";
+      PortletDefinition pd = new PortletDefinitionImpl(newPN, cut);
+      cut.addPortlet(pd);
+      
+      List<PortletDefinition> list = cut.getPortlets();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (PortletDefinition item : list) {
+         if (item.getPortletName().equals(newPN)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+  }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getEventDefinitions()}.
+    */
+   @Test
+   public void testGetEventDefinitions() {
+      List<EventDefinition> list = cut.getEventDefinitions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      for (EventDefinition item : list) {
+         if (item.getQName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getEventDefinition(javax.xml.namespace.QName)}.
+    */
+   @Test
+   public void testGetEventDefinition() {
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      EventDefinition item = cut.getEventDefinition(qn);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addEventDefinition(org.apache.pluto.container.om.portlet.EventDefinition)}.
+    */
+   @Test
+   public void testAddEventDefinition() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinition ed = new EventDefinitionImpl(qn);
+      cut.addEventDefinition(ed);
+
+      List<EventDefinition> list = cut.getEventDefinitions();
+      assertNotNull(list);
+      assertEquals(3, list.size());
+      boolean ok = false;
+      for (EventDefinition item : list) {
+         if (item.getQName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPublicRenderParameter(java.lang.String)}.
+    */
+   @Test
+   public void testGetPublicRenderParameter() {
+      String prpid = "supported-public-render-parameter";
+      PublicRenderParameter prp = cut.getPublicRenderParameter(prpid);
+      assertNotNull(prp);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getPublicRenderParameters()}.
+    */
+   @Test
+   public void testGetPublicRenderParameters() {
+      String prpid = "supported-public-render-parameter";
+      List<PublicRenderParameter> prps = cut.getPublicRenderParameters();
+      assertNotNull(prps);
+      assertEquals(2, prps.size());
+      assertEquals(prpid, prps.get(0).getIdentifier());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addPublicRenderParameter(org.apache.pluto.container.om.portlet.PublicRenderParameter)}.
+    */
+   @Test
+   public void testAddPublicRenderParameter() {
+      String prpid = "newprp";
+      QName qn = new QName("https://www.ibm.com/", "some-other-prp");
+      PublicRenderParameter prp = new PublicRenderParameterImpl(qn, prpid);
+      cut.addPublicRenderParameter(prp);
+      
+      List<PublicRenderParameter> prps = cut.getPublicRenderParameters();
+      assertNotNull(prps);
+      assertEquals(3, prps.size());
+      assertEquals(prpid, prps.get(2).getIdentifier());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomPortletMode(java.lang.String)}.
+    */
+   @Test
+   public void testGetCustomPortletMode() {
+      String newItem = "portlet-mode";
+      CustomPortletMode item = cut.getCustomPortletMode(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomPortletModes()}.
+    */
+   @Test
+   public void testGetCustomPortletModes() {
+      String newItem = "portlet-mode";
+      List<CustomPortletMode> list = cut.getCustomPortletModes();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addCustomPortletMode(org.apache.pluto.container.om.portlet.CustomPortletMode)}.
+    */
+   @Test
+   public void testAddCustomPortletMode() {
+      String newItem = "newMode";
+      CustomPortletMode prp = new CustomPortletModeImpl(newItem);
+      cut.addCustomPortletMode(prp);
+      
+      List<CustomPortletMode> list = cut.getCustomPortletModes();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getPortletMode());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomWindowState(java.lang.String)}.
+    */
+   @Test
+   public void testGetCustomWindowState() {
+      String newItem = "window-state";
+      CustomWindowState item = cut.getCustomWindowState(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getCustomWindowStates()}.
+    */
+   @Test
+   public void testGetCustomWindowStates() {
+      String newItem = "window-state";
+      List<CustomWindowState> list = cut.getCustomWindowStates();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addCustomWindowState(org.apache.pluto.container.om.portlet.CustomWindowState)}.
+    */
+   @Test
+   public void testAddCustomWindowState() {
+      String newItem = "newMode";
+      CustomWindowState prp = new CustomWindowStateImpl(newItem);
+      cut.addCustomWindowState(prp);
+      
+      List<CustomWindowState> list = cut.getCustomWindowStates();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getWindowState());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getUserAttribute(java.lang.String)}.
+    */
+   @Test
+   public void testGetUserAttribute() {
+      String newItem = "name";
+      UserAttribute item = cut.getUserAttribute(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getUserAttributes()}.
+    */
+   @Test
+   public void testGetUserAttributes() {
+      String newItem = "name";
+      List<UserAttribute> list = cut.getUserAttributes();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addUserAttribute(org.apache.pluto.container.om.portlet.UserAttribute)}.
+    */
+   @Test
+   public void testAddUserAttribute() {
+      String newItem = "newAttr";
+      UserAttribute prp = new UserAttributeImpl(newItem);
+      cut.addUserAttribute(prp);
+      
+      List<UserAttribute> list = cut.getUserAttributes();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilter(java.lang.String)}.
+    */
+   @Test
+   public void testGetFilter() {
+      String newItem = "filter-name";
+      Filter item = cut.getFilter(newItem);
+      assertNotNull(item);
+      Filter filter = cut.getFilters().get(0);
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestFilter", 
+            filter.getFilterClass());
+      assertEquals("description", filter.getDescription(new Locale("de")).getDescription());
+      assertEquals("display-name", filter.getDisplayName(new Locale("de")).getDisplayName());
+      assertEquals("lifecycle", filter.getLifecycles().get(0));
+      assertEquals("value", filter.getInitParam("name").getParamValue());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilters()}.
+    */
+   @Test
+   public void testGetFilters() {
+      String newItem = "filter-name";
+      List<Filter> list = cut.getFilters();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addFilter(org.apache.pluto.container.om.portlet.Filter)}.
+    */
+   @Test
+   public void testAddFilter() {
+      String newItem = "newFilter";
+      Filter prp = new FilterImpl(newItem);
+      cut.addFilter(prp);
+      
+      List<Filter> list = cut.getFilters();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilterMapping(java.lang.String)}.
+    */
+   @Test
+   public void testGetFilterMapping() {
+      String newItem = "filter-name";
+      FilterMapping item = cut.getFilterMapping(newItem);
+      assertNotNull(item);
+      assertEquals(1, item.getPortletNames().size());
+      assertEquals("portlet362", item.getPortletNames().get(0));
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getFilterMappings()}.
+    */
+   @Test
+   public void testGetFilterMappings() {
+      String newItem = "filter-name";
+      List<FilterMapping> list = cut.getFilterMappings();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addFilterMapping(org.apache.pluto.container.om.portlet.FilterMapping)}.
+    */
+   @Test
+   public void testAddFilterMapping() {
+      String newItem = "newFilter";
+      FilterMapping prp = new FilterMappingImpl(newItem);
+      cut.addFilterMapping(prp);
+      
+      List<FilterMapping> list = cut.getFilterMappings();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getFilterName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getContainerRuntimeOption(java.lang.String)}.
+    */
+   @Test
+   public void testGetContainerRuntimeOption() {
+      String newItem = "Runtime-Option-Portlet-App";
+      ContainerRuntimeOption item = cut.getContainerRuntimeOption(newItem);
+      assertNotNull(item);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getContainerRuntimeOptions()}.
+    */
+   @Test
+   public void testGetContainerRuntimeOptions() {
+      String newItem = "Runtime-Option-Portlet-App";
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals(newItem, list.get(0).getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addContainerRuntimeOption(org.apache.pluto.container.om.portlet.ContainerRuntimeOption)}.
+    */
+   @Test
+   public void testAddContainerRuntimeOption() {
+      String newItem = "newRTO";
+      String[] newvals = {"v1", "v2"}; 
+      ContainerRuntimeOption item = new ContainerRuntimeOptionImpl(newItem, Arrays.asList(newvals));
+      cut.addContainerRuntimeOption(item);
+      
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(newItem, list.get(1).getName());
+      assertArrayEquals(newvals, list.get(1).getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getListeners()}.
+    */
+   @Test
+   public void testGetListeners() {
+      List<Listener> list = cut.getListeners();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("org.apache.pluto.container.om.portlet.impl.fixtures.TestListener", list.get(0).getListenerClass());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addListener(org.apache.pluto.container.om.portlet.Listener)}.
+    */
+   @Test
+   public void testAddListener() {
+      String clsName = "org.apache.pluto.container.om.portlet.impl.fixtures.DifferentListener";
+      Listener newitem = new ListenerImpl(clsName);
+      cut.addListener(newitem);
+      
+      List<Listener> list = cut.getListeners();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals(clsName, list.get(1).getListenerClass());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getSecurityConstraints()}.
+    */
+   @Test
+   public void testGetSecurityConstraints() {
+      List<SecurityConstraint> list = cut.getSecurityConstraints();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("NONE", list.get(0).getUserDataConstraint().getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addSecurityConstraint(org.apache.pluto.container.om.portlet.SecurityConstraint)}.
+    */
+   @Test
+   public void testAddSecurityConstraint() {
+      SecurityConstraint seco = new SecurityConstraintImpl(new UserDataConstraintImpl("CONFIDENTIAL"));
+      cut.addSecurityConstraint(seco);
+      
+      List<SecurityConstraint> list = cut.getSecurityConstraints();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertEquals("CONFIDENTIAL", list.get(1).getUserDataConstraint().getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#getLocaleEncodingMappings()}.
+    * @throws Exception 
+    */
+   @Test
+   public void testGetLocaleEncodingMappings() throws Exception {
+      String file = WEBDDPKG + WEBDD31;
+      InputStream in = this.getClass().getClassLoader().getResourceAsStream(file);
+      
+      try {
+         cfp.processWebDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+
+      Map<Locale, String> localemap = pad.getLocaleEncodingMappings();
+      assertEquals(2, localemap.size());
+      ArrayList<Locale> testlocs = new ArrayList<Locale>(Arrays.asList(new Locale[]{
+            Locale.forLanguageTag("de"), Locale.forLanguageTag("ja") }));
+      String[] testencs = {"UTF-8", "Shift_JIS"};
+      for (Locale loc : localemap.keySet()) {
+         assertTrue(testlocs.contains(loc));
+         int ind = testlocs.indexOf(loc);
+         assertEquals(testencs[ind], localemap.get(loc));
+      }
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.PortletApplicationDefinitionImpl#addLocaleEncodingMapping(java.util.Locale, java.lang.String)}.
+    */
+   @Test
+   public void testAddLocaleEncodingMapping() {
+      ArrayList<Locale> testlocs = new ArrayList<Locale>(Arrays.asList(new Locale[]{
+            Locale.forLanguageTag("de"), Locale.forLanguageTag("ja") }));
+      String[] testencs = {"UTF-8", "Shift_JIS"};
+      for (Locale loc : testlocs) {
+         int ind = testlocs.indexOf(loc);
+         cut.addLocaleEncodingMapping(loc, testencs[ind]);
+      }
+      
+      Map<Locale, String> localemap = cut.getLocaleEncodingMappings();
+      assertEquals(2, localemap.size());
+      for (Locale loc : localemap.keySet()) {
+         assertTrue(testlocs.contains(loc));
+         int ind = testlocs.indexOf(loc);
+         assertEquals(testencs[ind], localemap.get(loc));
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java
new file mode 100644
index 0000000..e757ecd
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/PortletDefinition362ImplTest.java
@@ -0,0 +1,538 @@
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.InitParam;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PortletInfo;
+import org.apache.pluto.container.om.portlet.Preference;
+import org.apache.pluto.container.om.portlet.Preferences;
+import org.apache.pluto.container.om.portlet.SecurityRoleRef;
+import org.apache.pluto.container.om.portlet.Supports;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.EventDefinitionReferenceImpl;
+import org.apache.pluto.container.om.portlet.impl.InitParamImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.pluto.container.om.portlet.impl.PortletInfoImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferenceImpl;
+import org.apache.pluto.container.om.portlet.impl.PreferencesImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityRoleRefImpl;
+import org.apache.pluto.container.om.portlet.impl.SupportsImpl;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet;
+import org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PortletDefinition362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   // Class under test
+   private PortletDefinition cut;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = PortletDefinition362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getPortlets().size());
+      cut = new PortletDefinitionImpl(pad.getPortlets().get(0));
+   }
+
+   @Test
+   public void testGetPortletName() {
+      assertNotNull(cut.getPortletName());
+      assertEquals("portlet362", cut.getPortletName());
+   }
+
+   @Test
+   public void testGetApplication() {
+      assertNotNull(cut.getApplication());
+      assertTrue(cut.getApplication() instanceof PortletApplicationDefinition);
+   }
+
+   @Test
+   public void testGetInitParam() {
+      InitParam ip = cut.getInitParam("name");
+      assertNotNull(ip);
+      assertEquals("name", ip.getParamName());
+      assertEquals("value", ip.getParamValue());
+      assertEquals(1, ip.getDescriptions().size());
+      Locale loc = new Locale("de");
+      Description d = ip.getDescription(loc);
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+   }
+
+   @Test
+   public void testGetInitParamNullValue() {
+      InitParam ip = cut.getInitParam("nullValueParam");
+      assertNotNull(ip);
+      assertEquals("nullValueParam", ip.getParamName());
+      assertEquals("", ip.getParamValue());
+   }
+
+   @Test
+   public void testGetInitParams() {
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(2, ips.size());
+      boolean ok = false;
+      for (InitParam ip : ips) {
+         if (ip.getParamName().equals("name") && ip.getParamValue().equals("value")) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test
+   public void testAddInitParam() {
+      String name = "Fred", value = "bowling";
+      InitParam newip = new InitParamImpl(name, value);
+      cut.addInitParam(newip);
+      
+      List<InitParam> ips = cut.getInitParams();
+      assertEquals(3, ips.size());
+      InitParam ip = cut.getInitParam(name);
+      assertNotNull(ip);
+      assertEquals(name, ip.getParamName());
+      assertEquals(value, ip.getParamValue());
+   }
+
+   @Test
+   public void testGetPortletClass() {
+      assertNotNull(cut.getPortletClass());
+      assertEquals(TestPortlet.class.getCanonicalName(), cut.getPortletClass());
+   }
+
+   @Test
+   public void testSetPortletClass() {
+      String text = "someClass";
+      cut.setPortletClass(text);
+      assertEquals(text, cut.getPortletClass());
+   }
+
+   @Test
+   public void testGetPortletInfo() {
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals("title", info.getTitle());
+      assertEquals("short-title", info.getShortTitle());
+      assertEquals("keywords", info.getKeywords());
+   }
+
+   @Test
+   public void testSetPortletInfo() {
+      String ti = "t2", st = "st", kw = "kw";
+      PortletInfo i2 = new PortletInfoImpl(ti, kw, st);
+      cut.setPortletInfo(i2);
+
+      PortletInfo info = cut.getPortletInfo();
+      assertNotNull(info);
+      assertEquals(ti, info.getTitle());
+      assertEquals(st, info.getShortTitle());
+      assertEquals(kw, info.getKeywords());
+   }
+
+   @Test
+   public void testGetPortletPreferences() {
+      Preferences prefs = cut.getPortletPreferences();
+      assertNotNull(prefs);
+      assertEquals(TestPreferencesValidator.class.getCanonicalName(), prefs.getPreferencesValidator());
+      List<Preference> list = prefs.getPortletPreferences();
+      assertEquals(1, list.size());
+      Preference item = list.get(0);
+      assertEquals("name", item.getName());
+      List<String> vals = item.getValues();
+      assertEquals(1, vals.size());
+      assertEquals("value", vals.get(0));
+   }
+
+   @Test
+   public void testSetPortletPreferences() {
+      String validator = "validator";
+      String name = "prefName";
+      String[] vals = {"v1", "v2"};
+      Preferences prefs = new PreferencesImpl(cut.getPortletPreferences());
+      prefs.setPreferencesValidator(validator);
+      prefs.addPreference(new PreferenceImpl(name, true, Arrays.asList(vals)));
+      cut.setPortletPreferences(prefs);
+      
+      Preferences prefs2 = cut.getPortletPreferences();
+      assertNotNull(prefs2);
+      assertEquals(validator, prefs2.getPreferencesValidator());
+      List<Preference> list = prefs2.getPortletPreferences();
+      assertEquals(2, list.size());
+      Preference item = prefs2.getPortletPreference(name);
+      assertEquals(name, item.getName());
+      List<String> newvals = item.getValues();
+      assertEquals(2, newvals.size());
+      assertArrayEquals(vals, newvals.toArray());
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedProcessingEvents() {
+      List<EventDefinitionReference> list = cut.getSupportedProcessingEvents();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      boolean ok = false;
+      QName qn = new QName("https://www.apache.org/", "supported-processing-event");
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedProcessingEvent() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinitionReference edr = new EventDefinitionReferenceImpl(qn);
+      cut.addSupportedProcessingEvent(edr);
+      
+      List<EventDefinitionReference> list = cut.getSupportedProcessingEvents();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedPublishingEvents() {
+      List<EventDefinitionReference> list = cut.getSupportedPublishingEvents();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      boolean ok = false;
+      QName qn = new QName("http://test.com", "supported-publishing-event");
+      for (EventDefinitionReference item : list) {
+         QName aqn = item.getQualifiedName();
+         if (aqn.equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedPublishingEvent() {
+      QName qn = new QName("https://www.ibm.com/", "some-other-event");
+      EventDefinitionReference edr = new EventDefinitionReferenceImpl(qn);
+      cut.addSupportedPublishingEvent(edr);
+      
+      List<EventDefinitionReference> list = cut.getSupportedPublishingEvents();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (EventDefinitionReference item : list) {
+         if (item.getQualifiedName().equals(qn)) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testGetSupportedPublicRenderParameters() {
+      List<String> list = cut.getSupportedPublicRenderParameters();
+      String prp = "supported-public-render-parameter";
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertTrue(list.contains(prp));
+   }
+
+   @Test  // JSR 286
+   public void testAddSupportedPublicRenderParameter() {
+      String newprp = "some-prp";
+      cut.addSupportedPublicRenderParameter(newprp);
+      List<String> list = cut.getSupportedPublicRenderParameters();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertTrue(list.contains(newprp));
+   }
+
+   @Test
+   public void testGetResourceBundle() {
+      assertNotNull(cut.getResourceBundle());
+      assertEquals("resource-bundle", cut.getResourceBundle());
+   }
+
+   @Test
+   public void testSetResourceBundle() {
+      String text = "newBundle";
+      cut.setResourceBundle(text);
+      assertNotNull(cut.getResourceBundle());
+      assertEquals(text, cut.getResourceBundle());
+   }
+
+   @Test
+   public void testGetSecurityRoleRef() {
+      SecurityRoleRef srr = cut.getSecurityRoleRef("NMTOKEN");
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSecurityRoleRefs() {
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(1, list.size());
+      SecurityRoleRef srr = list.get(0);
+      assertNotNull(srr);
+      assertEquals("NMTOKEN", srr.getRoleName());
+      assertEquals("role-link", srr.getRoleLink());
+      Description d = srr.getDescription(new Locale("de"));
+      assertNotNull(d);
+      assertEquals("description", d.getDescription());
+      
+   }
+
+   @Test
+   public void testAddSecurityRoleRef() {
+      String name = "RoleName";
+      String link = "RoleLink";
+      SecurityRoleRef srr = new SecurityRoleRefImpl(name);
+      srr.setRoleLink(link);
+      cut.addSecurityRoleRef(srr);
+
+      List<SecurityRoleRef> list = cut.getSecurityRoleRefs();
+      assertEquals(2, list.size());
+      srr = cut.getSecurityRoleRef(name);
+      assertNotNull(srr);
+      assertEquals(name, srr.getRoleName());
+      assertEquals(link, srr.getRoleLink());
+   }
+
+   @Test
+   public void testGetSupportsString() {
+      Supports s = cut.getSupports("mime-type2");
+      assertNotNull(s);
+      assertTrue(s.getPortletModes().contains("portlet-mode2"));
+   }
+
+   @Test
+   public void testGetSupportsMode() {
+      Supports s = cut.getSupports("mime-type2");
+      assertNotNull(s);
+      assertTrue(s.getPortletModes().contains("portlet-mode2"));
+   }
+
+   @Test
+   public void testGetSupportsState() {
+      Supports s = cut.getSupports("mime-type3");
+      assertNotNull(s);
+      assertTrue(s.getWindowStates().contains("window-state3"));
+   }
+
+   @Test
+   public void testGetSupports() {
+      List<Supports> list = cut.getSupports();
+      assertEquals(3, list.size());
+   }
+
+   @Test
+   public void testAddSupports() {
+      Supports s = new SupportsImpl("text/html");
+      cut.addSupports(s);
+      List<Supports> list = cut.getSupports();
+      assertEquals(4, list.size());
+      boolean ok = false;
+      for (Supports item : list) {
+         if (item.getMimeType().equals("text/html")) {
+            ok = true;
+            break;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = cut.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("multi line description", desc.getDescription());
+   }
+
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("multi line description", list.get(0).getDescription());
+   }
+
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      cut.addDescription(d);
+
+      List<Description> list = cut.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("multi line description", desc.getDescription());
+         }
+      }
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = cut.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      cut.addDisplayName(d);
+
+      List<DisplayName> list = cut.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetSupportedLocales() {
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(1, list.size());
+      assertTrue(list.contains("supported-locale"));
+   }
+
+   @Test
+   public void testAddSupportedLocale() {
+      String locname = "zh-cmn-Hans-CN";
+      cut.addSupportedLocale(locname);
+      
+      List<String> list = cut.getSupportedLocales();
+      assertEquals(2, list.size());
+      assertTrue(list.contains(locname));
+   }
+
+   @Test
+   public void testGetExpirationCache() {
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(50, cut.getExpirationCache());
+   }
+
+   @Test
+   public void testSetExpirationCache() {
+      cut.setExpirationCache(100);
+      assertNotNull(cut.getExpirationCache());
+      assertEquals(100, cut.getExpirationCache());
+   }
+
+   @Test  // JSR 286
+   public void testGetCacheScope() {
+      assertNotNull(cut.getCacheScope());
+      assertEquals("private", cut.getCacheScope());
+   }
+
+   @Test  // JSR 286
+   public void testSetCacheScope() {
+      String cs = "whatever";
+      cut.setCacheScope(cs);
+      assertNotNull(cut.getCacheScope());
+      assertEquals(cs, cut.getCacheScope());
+   }
+
+   @Test  // JSR 286
+   public void testGetContainerRuntimeOption() {
+      ContainerRuntimeOption rto = cut.getContainerRuntimeOption("Runtime-Option1");
+      assertNotNull(rto);
+      assertEquals(1, rto.getValues().size());
+      assertTrue(rto.getValues().get(0).equalsIgnoreCase("true"));
+   }
+
+   @Test  // JSR 286
+   public void testGetContainerRuntimeOptions() {
+      List<ContainerRuntimeOption> list = cut.getContainerRuntimeOptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      boolean ok = false;
+      for (ContainerRuntimeOption item : list) {
+         if (item.getName().equalsIgnoreCase("Runtime-Option2") && 
+               item.getValues().size() == 1 && item.getValues().get(0).equalsIgnoreCase("value2")) {
+            ok = true;
+         }
+      }
+      assertTrue(ok);
+   }
+
+   @Test  // JSR 286
+   public void testAddContainerRuntimeOption() {
+      String name = "NewRTO";
+      String[] vals = {"v1", "v2", "v3"};
+      ContainerRuntimeOption cro = new ContainerRuntimeOptionImpl(name, Arrays.asList(vals));
+      cut.addContainerRuntimeOption(cro);
+      
+      ContainerRuntimeOption newcro = cut.getContainerRuntimeOption(name);
+      assertNotNull(newcro);
+      assertArrayEquals(vals, newcro.getValues().toArray());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java
new file mode 100644
index 0000000..33eca76
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/SecurityConstraint362ImplTest.java
@@ -0,0 +1,122 @@
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.DisplayName;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DisplayNameImpl;
+import org.apache.pluto.container.om.portlet.impl.SecurityConstraintImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SecurityConstraint362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   
+   private ArrayList<SecurityConstraint> constraints;
+   private SecurityConstraint constraint;
+
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = SecurityConstraint362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      constraints = new ArrayList<SecurityConstraint>();
+      for (SecurityConstraint sc : pad.getSecurityConstraints()) {
+         // test the copy constructor
+         constraints.add(new SecurityConstraintImpl(sc));
+      }
+      assertEquals(1, constraints.size());
+      constraint = constraints.get(0);
+   }
+
+   @Test
+   // tests the UserDataConstraint as well
+   public void testGetUserDataConstraint() {
+      UserDataConstraint udc = constraint.getUserDataConstraint();
+      assertNotNull(udc);
+      
+   }
+
+   @Test
+   public void testGetDisplayName() {
+      Locale loc = new Locale("DE");
+      DisplayName name = constraint.getDisplayName(loc);
+      assertNotNull(name);
+      assertEquals("display-name", name.getDisplayName());
+   }
+
+   @Test
+   public void testGetDisplayNames() {
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("display-name", list.get(0).getDisplayName());
+   }
+
+   @Test
+   public void testAddDisplayName() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some display name";
+      DisplayName d = new DisplayNameImpl(loc, text);
+      constraint.addDisplayName(d);
+
+      List<DisplayName> list = constraint.getDisplayNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (DisplayName desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDisplayName());
+         } else {
+            assertEquals("display-name", desc.getDisplayName());
+         }
+      }
+   }
+
+   @Test
+   public void testGetPortletNames() {
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+   }
+
+   @Test
+   public void testAddPortletName() {
+      String text = "SomeName";
+      constraint.addPortletName(text);;
+
+      List<String> list = constraint.getPortletNames();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      assertTrue(list.contains(text));
+      assertTrue(list.contains("portlet362"));
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java
new file mode 100644
index 0000000..8840093
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/StandAloneContainerRuntimeOptionImplTest.java
@@ -0,0 +1,98 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+
+import org.apache.pluto.container.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.container.om.portlet.impl.ContainerRuntimeOptionImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class StandAloneContainerRuntimeOptionImplTest {
+   
+   private static final String NAME = "name";
+   private static final String VAL3 = "v3";
+   private static final String[] VALS = {"v1", "v2"}; 
+   private static final String[] VALS3 = {"v1", "v2", "v3"}; 
+   
+   private ContainerRuntimeOption cro;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @Before
+   public void setUp() throws Exception {
+      cro = new ContainerRuntimeOptionImpl(NAME, Arrays.asList(VALS));
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#ContainerRuntimeOptionImpl(java.lang.String, java.util.List)}.
+    */
+   @Test
+   public void testContainerRuntimeOptionImplStringListOfString() {
+      assertEquals(NAME, cro.getName());
+      assertArrayEquals(VALS, cro.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#ContainerRuntimeOptionImpl(org.apache.pluto.container.om.portlet.ContainerRuntimeOption)}.
+    */
+   @Test
+   public void testContainerRuntimeOptionImplContainerRuntimeOption() {
+      ContainerRuntimeOption cro2 = new ContainerRuntimeOptionImpl(cro);
+      assertEquals(NAME, cro2.getName());
+      assertArrayEquals(VALS, cro2.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#getName()}.
+    */
+   @Test
+   public void testGetName() {
+      assertEquals(NAME, cro.getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#getValues()}.
+    */
+   @Test
+   public void testGetValues() {
+      assertArrayEquals(VALS, cro.getValues().toArray());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.ContainerRuntimeOptionImpl#addValue(java.lang.String)}.
+    */
+   @Test
+   public void testAddValue() {
+      ContainerRuntimeOption cro2 = new ContainerRuntimeOptionImpl(cro);
+      cro.addValue(VAL3);
+      assertArrayEquals(VALS3, cro.getValues().toArray());
+      assertArrayEquals(VALS, cro2.getValues().toArray());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java
new file mode 100644
index 0000000..33fc80f
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserAttribute362ImplTest.java
@@ -0,0 +1,133 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.UserAttribute;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.apache.pluto.container.om.portlet.impl.UserAttributeImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class UserAttribute362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        List<UserAttribute> attrs;
+   private        UserAttribute ua;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = UserAttribute362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      attrs = new ArrayList<UserAttribute>();
+      for (UserAttribute ua : pad.getUserAttributes()) {
+         attrs.add(new UserAttributeImpl(ua));
+      }
+      assertEquals(1, attrs.size());
+      ua = attrs.get(0);
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#getName()}.
+    */
+   @Test
+   public void testGetName() {
+      assertEquals("name", ua.getName());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = ua.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserAttributeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      ua.addDescription(d);
+
+      List<Description> list = ua.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java
new file mode 100644
index 0000000..8b46d1f
--- /dev/null
+++ b/pluto-container/src/test/java/org/apache/pluto/container/om/portlet/impl/jsr362/UserDataConstraint362ImplTest.java
@@ -0,0 +1,105 @@
+package org.apache.pluto.container.om.portlet.impl.jsr362;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.pluto.container.om.portlet.Description;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.SecurityConstraint;
+import org.apache.pluto.container.om.portlet.UserDataConstraint;
+import org.apache.pluto.container.om.portlet.impl.ConfigurationHolder;
+import org.apache.pluto.container.om.portlet.impl.DescriptionImpl;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class UserDataConstraint362ImplTest {
+
+   private static final String XML_FILE = 
+         "org/apache/pluto/container/om/portlet/portlet362Generated.xml";
+   
+   private static PortletApplicationDefinition pad;
+   private        UserDataConstraint udc;
+
+   /**
+    * @throws java.lang.Exception
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Exception {
+      
+      InputStream in = UserDataConstraint362ImplTest.class
+            .getClassLoader().getResourceAsStream(XML_FILE);
+      
+      ConfigurationHolder cfp = new ConfigurationHolder(pad);
+      try {
+         cfp.processPortletDD(in);
+         pad = cfp.getPad();
+      } catch (Exception e) {
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   
+   @Before
+   public void setUpBefore() throws Exception {
+      assertEquals(1, pad.getSecurityConstraints().size());
+      SecurityConstraint sc = pad.getSecurityConstraints().get(0);
+      assertNotNull(sc);
+      assertNotNull(sc.getUserDataConstraint());
+      udc = sc.getUserDataConstraint();
+   }
+
+   @Test
+   public void testGetTransportGuarantee() {
+      assertEquals("NONE", udc.getTransportGuarantee());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserDataConstraintImpl#getDescription(java.util.Locale)}.
+    */
+   @Test
+   public void testGetDescription() {
+      Locale loc = new Locale("DE");
+      Description desc = udc.getDescription(loc);
+      assertNotNull(desc);
+      assertEquals("description", desc.getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserDataConstraintImpl#getDescriptions()}.
+    */
+   @Test
+   public void testGetDescriptions() {
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(1, list.size());
+      assertEquals("description", list.get(0).getDescription());
+   }
+
+   /**
+    * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr362.UserDataConstraintImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
+    */
+   @Test
+   public void testAddDescription() {
+      Locale loc = Locale.FRENCH;
+      String text = "Some description";
+      Description d = new DescriptionImpl(loc, text);
+      udc.addDescription(d);
+
+      List<Description> list = udc.getDescriptions();
+      assertNotNull(list);
+      assertEquals(2, list.size());
+      for (Description desc : list) {
+         if (desc.getLocale().equals(loc)) {
+            assertEquals(text, desc.getDescription());
+         } else {
+            assertEquals("description", desc.getDescription());
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/META-INF/beans.xml b/pluto-container/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..8a73cf1
--- /dev/null
+++ b/pluto-container/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,10 @@
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="
+http://java.sun.com/xml/ns/javaee
+http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+   <alternatives>
+      <class>com.ibm.portal.samples.GermanPrefixFactory</class>
+   </alternatives>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml
new file mode 100644
index 0000000..af4ea06
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet-app_2_0.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet:portlet-app id="" version=""
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd portlet-app_2_0.xsd "
+>
+
+   <!-- generated 2.0 deployment descriptor created by eclipse -->
+
+   <portlet:portlet id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:portlet-name>portlet-name</portlet:portlet-name>
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:portlet-class>portlet-class</portlet:portlet-class>
+      <portlet:init-param id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:name>name</portlet:name>
+         <portlet:value>value</portlet:value>
+      </portlet:init-param>
+      <portlet:expiration-cache>0</portlet:expiration-cache>
+      <portlet:cache-scope>cache-scope</portlet:cache-scope>
+      <portlet:supports id="">
+         <portlet:mime-type>mime-type</portlet:mime-type>
+         <portlet:portlet-mode>portlet-mode</portlet:portlet-mode>
+         <portlet:window-state>window-state</portlet:window-state>
+      </portlet:supports>
+      <portlet:supported-locale>supported-locale</portlet:supported-locale>
+      <portlet:resource-bundle>resource-bundle</portlet:resource-bundle>
+      <portlet:portlet-info id="">
+         <portlet:title>title</portlet:title>
+         <portlet:short-title>short-title</portlet:short-title>
+         <portlet:keywords>keywords</portlet:keywords>
+      </portlet:portlet-info>
+      <portlet:portlet-preferences id="">
+         <portlet:preference id="">
+            <portlet:name>name</portlet:name>
+            <portlet:value>value</portlet:value>
+            <portlet:read-only>false</portlet:read-only>
+         </portlet:preference>
+         <portlet:preferences-validator>preferences-validator</portlet:preferences-validator>
+      </portlet:portlet-preferences>
+      <portlet:security-role-ref id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:role-name>NMTOKEN</portlet:role-name>
+         <portlet:role-link>role-link</portlet:role-link>
+      </portlet:security-role-ref>
+      <portlet:supported-processing-event id="">
+         <portlet:qname>QName</portlet:qname>
+      </portlet:supported-processing-event>
+      <portlet:supported-publishing-event id="">
+         <portlet:qname>QName</portlet:qname>
+      </portlet:supported-publishing-event>
+      <portlet:supported-public-render-parameter>supported-public-render-parameter</portlet:supported-public-render-parameter>
+      <portlet:container-runtime-option>
+         <portlet:name>name</portlet:name>
+         <portlet:value>value</portlet:value>
+      </portlet:container-runtime-option>
+   </portlet:portlet>
+   <portlet:custom-portlet-mode id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:portlet-mode>portlet-mode</portlet:portlet-mode>
+      <portlet:portal-managed>false</portlet:portal-managed>
+   </portlet:custom-portlet-mode>
+   <portlet:custom-window-state id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:window-state>window-state</portlet:window-state>
+   </portlet:custom-window-state>
+   <portlet:user-attribute id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:name>name</portlet:name>
+   </portlet:user-attribute>
+   <portlet:security-constraint id="">
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:portlet-collection>
+         <portlet:portlet-name>portlet-name</portlet:portlet-name>
+      </portlet:portlet-collection>
+      <portlet:user-data-constraint id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:transport-guarantee>CONFIDENTIAL</portlet:transport-guarantee>
+      </portlet:user-data-constraint>
+   </portlet:security-constraint>
+   <portlet:resource-bundle>resource-bundle</portlet:resource-bundle>
+   <portlet:filter>
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:filter-name>filter-name</portlet:filter-name>
+      <portlet:filter-class>filter-class</portlet:filter-class>
+      <portlet:lifecycle>lifecycle</portlet:lifecycle>
+      <portlet:init-param id="">
+         <portlet:description xml:lang="">description</portlet:description>
+         <portlet:name>name</portlet:name>
+         <portlet:value>value</portlet:value>
+      </portlet:init-param>
+   </portlet:filter>
+   <portlet:filter-mapping>
+      <portlet:filter-name>filter-name</portlet:filter-name>
+      <portlet:portlet-name>portlet-name</portlet:portlet-name>
+   </portlet:filter-mapping>
+   <portlet:default-namespace>http://tempuri.org</portlet:default-namespace>
+   <portlet:event-definition id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:qname>QName</portlet:qname>
+      <portlet:alias>QName</portlet:alias>
+      <portlet:value-type>value-type</portlet:value-type>
+   </portlet:event-definition>
+   <portlet:public-render-parameter id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:identifier>identifier</portlet:identifier>
+      <portlet:qname>QName</portlet:qname>
+      <portlet:alias>QName</portlet:alias>
+   </portlet:public-render-parameter>
+   <portlet:listener id="">
+      <portlet:description xml:lang="">description</portlet:description>
+      <portlet:display-name xml:lang="">display-name</portlet:display-name>
+      <portlet:listener-class>listener-class</portlet:listener-class>
+   </portlet:listener>
+   <portlet:container-runtime-option>
+      <portlet:name>name</portlet:name>
+      <portlet:value>value</portlet:value>
+   </portlet:container-runtime-option>
+</portlet:portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml
new file mode 100644
index 0000000..36e421b
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168Generated.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1"
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
+http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+>
+
+   <portlet id="id2">
+      <description xml:lang="de">multi
+         line 
+         description</description>
+      <portlet-name>portlet168</portlet-name>
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet</portlet-class>
+      <init-param id="init1">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+      <expiration-cache>50</expiration-cache>
+      <supports id="sup1">
+         <mime-type>mime-type</mime-type>
+         <portlet-mode>portlet-mode</portlet-mode>
+      </supports>
+      <supports id="sup2">
+         <mime-type>mime-type2</mime-type>
+         <portlet-mode>portlet-mode2</portlet-mode>
+      </supports>
+      <supports id="sup3">
+         <mime-type>mime-type3</mime-type>
+         <portlet-mode>portlet-mode3</portlet-mode>
+      </supports>
+      <supported-locale>supported-locale</supported-locale>
+      <resource-bundle>resource-bundle</resource-bundle>
+      <portlet-info id="info1">
+         <title>title</title>
+         <short-title>short-title</short-title>
+         <keywords>keywords</keywords>
+      </portlet-info>
+      <portlet-preferences id="prefs">
+         <preference id="pref1">
+            <name>name</name>
+            <value>value</value>
+            <read-only>true</read-only>
+         </preference>
+         <preferences-validator>
+            org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator
+         </preferences-validator>
+      </portlet-preferences>
+      <security-role-ref id="sec1">
+         <description xml:lang="de">description</description>
+         <role-name>NMTOKEN</role-name>
+         <role-link>role-link</role-link>
+      </security-role-ref>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet.name</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+</portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml
new file mode 100644
index 0000000..504c750
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet168NoCache.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1"
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
+http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+
+   <portlet>
+      <description>AboutPortletDescription</description>
+      <portlet-name>AboutPortlet</portlet-name>
+      <display-name>About Portlet</display-name>
+      <display-name xml:lang="fr">About Portlet</display-name>
+      <portlet-class>org.apache.pluto.driver.portlets.AboutPortlet</portlet-class>
+      <init-param>
+         <description xml:lang="de">a</description>
+         <name>b</name>
+         <value>v</value>
+      </init-param>
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+         <portlet-mode>EDIT</portlet-mode>
+         <portlet-mode>HELP</portlet-mode>
+      </supports>
+      <supported-locale>en</supported-locale>
+      <portlet-info>
+         <title>About Apache Pluto</title>
+      </portlet-info>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet-name</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+</portlet-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/bf15b331/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml
----------------------------------------------------------------------
diff --git a/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml
new file mode 100644
index 0000000..0a82e9b
--- /dev/null
+++ b/pluto-container/src/test/resources/org/apache/pluto/container/om/portlet/portlet286Generated.xml
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app id="id1"
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+
+   <portlet id="id2">
+      <description xml:lang="de">multi 
+      line 
+      description</description>
+      <portlet-name>portlet286</portlet-name>
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestPortlet</portlet-class>
+      <init-param id="init1">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+      <init-param id="init2">
+         <description xml:lang="de">description</description>
+         <name>nullValueParam</name>
+         <value></value>
+      </init-param>
+      <expiration-cache>50</expiration-cache>
+      <cache-scope>private</cache-scope>
+      <supports id="sup1">
+         <mime-type>mime-type</mime-type>
+         <portlet-mode>portlet-mode</portlet-mode>
+         <portlet:window-state>window-state</portlet:window-state>
+      </supports>
+      <supports id="sup2">
+         <mime-type>mime-type2</mime-type>
+         <portlet-mode>portlet-mode2</portlet-mode>
+         <portlet:window-state>window-state2</portlet:window-state>
+      </supports>
+      <supports id="sup3">
+         <mime-type>mime-type3</mime-type>
+         <portlet-mode>portlet-mode3</portlet-mode>
+         <portlet:window-state>window-state3</portlet:window-state>
+      </supports>
+      <supported-locale>supported-locale</supported-locale>
+      <resource-bundle>resource-bundle</resource-bundle>
+      <portlet-info id="info1">
+         <title>title</title>
+         <short-title>short-title</short-title>
+         <keywords>keywords</keywords>
+      </portlet-info>
+      <portlet-preferences id="prefs">
+         <preference id="pref1">
+            <name>name</name>
+            <value>value</value>
+            <read-only>true</read-only>
+         </preference>
+         <preferences-validator>
+            org.apache.pluto.container.om.portlet.impl.fixtures.TestPreferencesValidator
+         </preferences-validator>
+      </portlet-preferences>
+      <security-role-ref id="sec1">
+         <description xml:lang="de">description</description>
+         <role-name>NMTOKEN</role-name>
+         <role-link>role-link</role-link>
+      </security-role-ref>
+      <supported-processing-event>
+         <name>supported-processing-event</name>
+      </supported-processing-event>
+      <supported-publishing-event>
+         <qname xmlns:x="http://test.com">x:supported-publishing-event</qname>
+      </supported-publishing-event>
+      <supported-public-render-parameter>supported-public-render-parameter
+      </supported-public-render-parameter>
+      <container-runtime-option>
+         <name>Runtime-Option1</name>
+         <value>true</value>
+      </container-runtime-option>
+      <container-runtime-option>
+         <name>Runtime-Option2</name>
+         <value>value2</value>
+      </container-runtime-option>
+   </portlet>
+   <custom-portlet-mode id="mode1">
+      <description xml:lang="de">description</description>
+      <portlet-mode>portlet-mode</portlet-mode>
+      <portal-managed>false</portal-managed>
+   </custom-portlet-mode>
+   <custom-window-state id="state1">
+      <description xml:lang="de">description</description>
+      <window-state>window-state</window-state>
+   </custom-window-state>
+   <user-attribute id="att1">
+      <description xml:lang="de">description</description>
+      <name>name</name>
+   </user-attribute>
+   <security-constraint id="cons1">
+      <display-name xml:lang="de">display-name</display-name>
+      <portlet-collection>
+         <portlet-name>portlet.name</portlet-name>
+      </portlet-collection>
+      <user-data-constraint id="data1">
+         <description xml:lang="de">description</description>
+         <transport-guarantee>NONE</transport-guarantee>
+      </user-data-constraint>
+   </security-constraint>
+   <resource-bundle>org.apache.portal.ResourceBundle</resource-bundle>
+   <filter>
+      <description xml:lang="de">description</description>
+      <display-name xml:lang="de">display-name</display-name>
+      <filter-name>filter-name</filter-name>
+      <filter-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestFilter</filter-class>
+      <lifecycle>lifecycle</lifecycle>
+      <init-param id="init2">
+         <description xml:lang="de">description</description>
+         <name>name</name>
+         <value>value</value>
+      </init-param>
+   </filter>
+   <filter-mapping>
+      <filter-name>filter-name</filter-name>
+      <portlet-name>portlet286</portlet-name>
+   </filter-mapping>
+   <portlet:default-namespace>https://www.apache.org/</portlet:default-namespace>
+   <event-definition id="event1">
+      <description xml:lang="de">description</description>
+      <name>supported-processing-event</name>
+      <alias>QName</alias>
+      <value-type>org.apache.pluto.container.om.portlet.impl.fixtures.TestEventType</value-type>
+   </event-definition>
+   <event-definition id="event2">
+      <description xml:lang="de">description</description>
+      <qname xmlns:x="http://test.com">x:supported-publishing-event</qname>
+      <alias>QName</alias>
+      <value-type>java.lang.String</value-type>
+   </event-definition>
+   <public-render-parameter id="public1">
+      <description xml:lang="de">description</description>
+      <identifier>supported-public-render-parameter</identifier>
+      <qname>QName</qname>
+   </public-render-parameter>
+   <public-render-parameter id="public2">
+      <description xml:lang="de">description2</description>
+      <identifier>identifier2</identifier>
+      <name>Name</name>
+   </public-render-parameter>
+   <listener>
+      <description xml:lang="de">description</description>
+      <display-name xml:lang="de">display-name</display-name>
+      <listener-class>org.apache.pluto.container.om.portlet.impl.fixtures.TestListener</listener-class>
+   </listener>
+   <container-runtime-option>
+      <name>Runtime-Option-Portlet-App</name>
+      <value>false</value>
+   </container-runtime-option>
+</portlet-app>