[portal-commits] JBoss Portal SVN: r9107 - in modules/portlet/trunk/test: src/main/org/jboss/portal/portlet/test and 20 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Mon Nov 26 09:17:59 EST 2007


Author: emuckenhuber
Date: 2007-11-26 09:17:59 -0500 (Mon, 26 Nov 2007)
New Revision: 9107

Added:
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SimplePortletTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaDataException.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/ContainerRuntimeAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/EventListAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterMappingAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/LocalizedStringAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletListAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletPreferencesListAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/UserAttributeAdapter.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/ContainerRuntimeMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/DescribeableMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/InitParamMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/LocalizedDescriptionMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionReferenceMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMappingMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletCacheScopeEnum.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletInfoMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletModeMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferenceMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferencesMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SecurityRoleRefMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportedLocaleMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportsMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/WindowStateMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/PortletCollectionMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/SecurityConstraintMetaData.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/TransportGuaranteeEnum.java
   modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/UserDataConstraintMetaData.java
   modules/portlet/trunk/test/src/resources/metadata/
   modules/portlet/trunk/test/src/resources/metadata/customPortletMode/
   modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1-fail.xml
   modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1.xml
   modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet2.xml
   modules/portlet/trunk/test/src/resources/metadata/customWindowState/
   modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet1.xml
   modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet2.xml
   modules/portlet/trunk/test/src/resources/metadata/event/
   modules/portlet/trunk/test/src/resources/metadata/event/portlet-event1.xml
   modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2-fail.xml
   modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2.xml
   modules/portlet/trunk/test/src/resources/metadata/filter/
   modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter1.xml
   modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter2.xml
   modules/portlet/trunk/test/src/resources/metadata/general/
   modules/portlet/trunk/test/src/resources/metadata/general/portlet1.xml
   modules/portlet/trunk/test/src/resources/metadata/general/portlet2-jsr286.xml
   modules/portlet/trunk/test/src/resources/metadata/general/portlet2.xml
   modules/portlet/trunk/test/src/resources/metadata/portlet-app_1_0.xsd
   modules/portlet/trunk/test/src/resources/metadata/portlet-app_2_0.xsd
   modules/portlet/trunk/test/src/resources/metadata/portlet/
   modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1-simple.xml
   modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1.xml
   modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2-jsr286.xml
   modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2.xml
   modules/portlet/trunk/test/src/resources/metadata/renderParameter/
   modules/portlet/trunk/test/src/resources/metadata/renderParameter/portlet2.xml
   modules/portlet/trunk/test/src/resources/metadata/security/
   modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail1.xml
   modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail2.xml
   modules/portlet/trunk/test/src/resources/metadata/security/portlet1.xml
   modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail1.xml
   modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail2.xml
   modules/portlet/trunk/test/src/resources/metadata/security/portlet2.xml
   modules/portlet/trunk/test/src/resources/metadata/userAttribute/
   modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet1.xml
   modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet2.xml
Modified:
   modules/portlet/trunk/test/
   modules/portlet/trunk/test/build.xml
   modules/portlet/trunk/test/src/resources/test/local-jboss-unit.xml
Log:
initial import of jsr-286 metadata parsing


Property changes on: modules/portlet/trunk/test
___________________________________________________________________
Name: svn:ignore
   - output

   + output
gen-src


Modified: modules/portlet/trunk/test/build.xml
===================================================================
--- modules/portlet/trunk/test/build.xml	2007-11-26 14:16:33 UTC (rev 9106)
+++ modules/portlet/trunk/test/build.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -98,6 +98,7 @@
          <path refid="jboss.jbossxb.classpath"/>
          <path refid="apache.log4j.classpath"/>
          <path refid="sun.servlet.classpath"/>
+      	 <path refid="sun.jaxb.classpath" />
       </path>
 
       <!-- Configure modules -->
@@ -574,6 +575,8 @@
          <classpath>
 
             <pathelement location="${build.resources}/test"/>
+            <!-- metadata stuff -->
+            <pathelement location="${build.resources}/metadata"/>
 
             <path refid="jboss.portal/modules/test.classpath"/>
             <path location="../tools/lib/ant.jar"/>
@@ -603,4 +606,5 @@
 
    </target>
 
+
 </project>


Property changes on: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata
___________________________________________________________________
Name: svn:ignore
   + MytestCase.java


Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,152 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import static org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants.*;
+
+import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class AbstractMetaDataTestCase
+{
+
+   /** The schema resolver factory */
+   protected static SingletonSchemaResolverFactory factory;
+
+   /** The schema resolver */
+   protected static DefaultSchemaResolver resolver;
+
+   /** The unmarshaller */
+   protected static Unmarshaller unmarshaller;
+
+   /** some Suff */
+//   private static Map<String, Validator> cachedXSDs = new HashMap<String, Validator>();
+   
+   static
+   {
+      try
+      {
+//         cachedXSDs.put(PORTLET_JSR_286_NS, getValidator(PORTLET_JSR_286_NS));
+//         cachedXSDs.put(PORTLET_JSR_168_NS, getValidator(PORTLET_JSR_168_NS));
+         
+         factory = SingletonSchemaResolverFactory.getInstance();
+         resolver = (DefaultSchemaResolver) factory.getSchemaBindingResolver();
+         unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+         unmarshaller.setNamespaceAware(true);
+         unmarshaller.setSchemaValidation(true);
+         unmarshaller.setValidation(true);
+         // SchemaResolver
+         resolver.addSchemaLocation(PORTLET_JSR_168_NS, "portlet-app_1_0.xsd");
+         resolver.addSchemaLocation(PORTLET_JSR_286_NS, "portlet-app_2_0.xsd");
+         resolver.addClassBinding(PORTLET_JSR_286_NS, PortletApplication20MetaData.class);
+         resolver.addClassBinding(PORTLET_JSR_168_NS, PortletApplication10MetaData.class);
+
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   protected <T> T unmarshall(String file, String nameSpace, Class<T> clazz) throws JBossXBException, SAXException,
+         ParserConfigurationException, IOException
+   {
+      /** validate */
+//      this.validateFile(file, nameSpace);
+      unmarshaller.setValidation(true);
+
+      /** unmarshal */
+      return (T) unmarshaller.unmarshal(getPath(file), resolver);
+   }
+
+   protected PortletApplicationMetaData unmarshall(String file) throws JBossXBException, SAXException,
+         ParserConfigurationException, IOException
+   {
+      unmarshaller.setValidation(true);
+      unmarshaller.setNamespaceAware(true);
+      //      unmarshaller.setSchemaValidation(true);
+      return (PortletApplicationMetaData) unmarshaller.unmarshal(getPath(file), resolver);
+   }
+/*
+   public void validateFile(String file, String namespace) throws SAXException, ParserConfigurationException,
+         IOException
+   {
+      Validator validator = cachedXSDs.get(namespace);
+      URL xmlFile = Thread.currentThread().getContextClassLoader().getResource(file);
+
+      DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+      Document d = db.parse(xmlFile.openStream());
+      validator.validate(new DOMSource(d));
+   }
+
+   private static Validator getValidator(String namespace) throws SAXException
+   {
+      String xsdFile = PORTLET_JSR_168_NS.equals(namespace) ? "portlet-app_1_0.xsd" : "portlet-app_2_0.xsd";
+      URL schemaFile = Thread.currentThread().getContextClassLoader().getResource(xsdFile);
+
+      SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+      Schema schema = sf.newSchema(schemaFile);
+      Validator validator = schema.newValidator();
+      validator.setErrorHandler(new ValidationErrorHandler());
+      return validator;
+   }
+*/
+   public String getPath(String file)
+   {
+      URL url = Thread.currentThread().getContextClassLoader().getResource(file);
+      if (url == null)
+      {
+         fail(file + " not found.");
+      }
+      return url.toString();
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,132 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.test.metadata.impl.CustomPortletModeMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomPortletModeTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+         String xmlFile = "customPortletMode/portlet1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+         PortletApplication10MetaData md = unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+         assertEquals("1.0", md.getVersion());
+
+         CustomPortletModeMetaData cmd1 = md.getCustomPortletMode().get(0);
+         assertNotNull(cmd1);
+         assertEquals("Custom", cmd1.getPortletMode());
+         assertEquals("portletMode1", cmd1.getDescription().getDefaultString());
+         assertEquals("eigener portlet modus", cmd1.getDescription().getString(new Locale("de"), false));
+         assertEquals("mode1", cmd1.getId());
+
+         assertNotNull(md.getCustomPortletMode().get(1));
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+
+         String xmlFile = "customPortletMode/portlet2.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplication20MetaData md = unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+         assertNotNull(md);
+         assertEquals("2.0", md.getVersion());
+
+         CustomPortletModeMetaData cmd1 = md.getCustomPortletMode().get(0);
+         assertNotNull(cmd1);
+         assertEquals("Custom", cmd1.getPortletMode());
+         assertEquals("cmode1", cmd1.getId());
+         assertEquals(true, cmd1.isPortalManaged());
+         assertEquals("portletMode1", cmd1.getDescription().getDefaultString());
+         assertEquals("eigener portlet modus", cmd1.getDescription().getString(new Locale("de"), false));
+         assertEquals("Portlet Mode One", cmd1.getDecorationName().getDefaultString());
+         assertEquals("Eigener Portlet Modus Eins", cmd1.getDecorationName().getString(new Locale("de"), false));
+
+         CustomPortletModeMetaData cmd2 = md.getCustomPortletMode().get(1);
+         assertNotNull(cmd2);
+         assertEquals("Custom2", cmd2.getPortletMode());
+         assertEquals("Portlet Mode One", cmd2.getDecorationName().getDefaultString());
+         assertEquals(false, cmd2.isPortalManaged());
+
+         CustomPortletModeMetaData cmd3 = md.getCustomPortletMode().get(2);
+         assertNotNull(cmd3);
+         assertEquals("Custom3", cmd3.getPortletMode());
+         assertEquals("Portlet Mode Three", cmd3.getDescription().getDefaultString());
+         // default value
+         assertEquals(true, cmd3.isPortalManaged());
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test03()
+   {
+      try
+      {
+
+         String xmlFile = "customPortletMode/portlet1-fail.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+         PortletApplication10MetaData md = unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+         fail("portlet 2.0 properties are not allowed");
+      }
+      catch (Exception e)
+      {
+         // OK
+      }
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,106 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.test.metadata.impl.CustomWindowStateMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomWindowStateTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+
+         String xmlFile = "customWindowState/portlet1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+         PortletApplication10MetaData md = unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+         assertEquals("1.0", md.getVersion());
+
+         CustomWindowStateMetaData cws1 = md.getCustomWindowState().get(0);
+         assertEquals("foo", cws1.getId());
+         assertEquals("WindowState", cws1.getDescription().getDefaultString());
+         assertEquals("windowState1", cws1.getWindowState());
+         assertEquals("Offenes Fenster", cws1.getDescription().getString(new Locale("de"), false));
+
+         CustomWindowStateMetaData cws2 = md.getCustomWindowState().get(1);
+         assertNotNull(cws2);
+
+         CustomWindowStateMetaData cws3 = md.getCustomWindowState().get(2);
+         assertEquals("drei", cws3.getId());
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+
+         String xmlFile = "customWindowState/portlet2.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplication20MetaData md = unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+         assertEquals("2.0", md.getVersion());
+
+         CustomWindowStateMetaData cws1 = md.getCustomWindowState().get(0);
+         assertEquals("foo", cws1.getId());
+         assertEquals("windowState1", cws1.getWindowState());
+         assertEquals("WindowState", cws1.getDescription().getDefaultString());
+         assertEquals("Offenes Fenster", cws1.getDescription().getString(new Locale("de"), false));
+
+         CustomWindowStateMetaData cws2 = md.getCustomWindowState().get(1);
+         assertNotNull(cws2);
+
+         CustomWindowStateMetaData cws3 = md.getCustomWindowState().get(2);
+         assertEquals("drei", cws3.getId());
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,154 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionReferenceMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class EventTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+
+         String xmlFile = "event/portlet-event1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+         PortletApplication10MetaData md = unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+         fail();
+      }
+      catch (Exception e)
+      {
+         // ok
+      }
+   }
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+
+         String xmlFile = "event/portlet-event2.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplication20MetaData md = unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+         assertNotNull(md);
+         assertEquals("2.0", md.getVersion());
+
+         EventDefinitionMetaData emd = md.getEvents().get(0);
+         QName qname = emd.getQname();
+
+         assertEquals("eventID", emd.getId());
+         assertEquals("http://example.com/testEvents", qname.getNamespaceURI());
+         assertEquals("portletEvent", qname.getLocalPart());
+         assertEquals("x", qname.getPrefix());
+         assertEquals("org.jboss.portal.event.invoke.refill.beer", emd.getValueType());
+         assertEquals("descriptionDefaultLanguage", emd.getDescription().getDefaultString());
+         assertEquals("descriptionDefaultLanguage", emd.getDescription().getString(new Locale("en"), false));
+         assertEquals("Beschreibung in Deutsch", emd.getDescription().getString(new Locale("de"), false));
+
+         EventDefinitionMetaData emd2 = md.getEvents().get(1);
+         
+         // TODO - choice is not checked correctly
+         assertNull(emd2.getQname());
+         assertEquals("hellouh", emd2.getName());
+         assertEquals("hello", emd2.getAlias().get(0).getLocalPart());
+
+         // portlet event reference testing
+         PortletMetaData p1 = md.getPortlet("Portlet2");
+         QName referenceQName = new QName("http://example.com/testEvents", "portletEvent");
+         assertNotNull(p1);
+         assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet", p1.getPortletClass());
+
+         EventDefinitionReferenceMetaData ermd1 = p1.getSupportedProcessingEvent().get(0);
+         assertNotNull(ermd1);
+         assertEquals(referenceQName, ermd1.getQname());
+
+         EventDefinitionReferenceMetaData ermd2 = p1.getSupportedProcessingEvent().get(1);
+         assertNotNull(ermd2);
+         assertEquals("hellouh", ermd2.getName());
+
+         EventDefinitionReferenceMetaData ermd3 = p1.getSupportedPublishingEvent().get(0);
+         assertNotNull(ermd3);
+         assertEquals(referenceQName, ermd3.getQname());
+
+         EventDefinitionReferenceMetaData ermd4 = p1.getSupportedPublishingEvent().get(1);
+         assertNotNull(ermd4);
+         assertEquals("hellouh", ermd4.getName());
+         
+         
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test021()
+   {
+      try
+      {
+
+         String xmlFile = "event/portlet-event2-fail.xml";
+
+         PortletApplicationMetaData md = unmarshall(xmlFile);
+         assertNotNull(md);
+         assertEquals("2.0", md.getVersion());
+
+         EventDefinitionMetaData edm = md.getEvents().get(0);
+
+         System.out.println(edm.getName());
+         System.out.println(edm.getQname());         
+
+         fail("Should fail: choice and qname defined!");
+      }
+      catch (Exception e)
+      {
+         // ok
+      }
+   }
+
+   
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FilterTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+         PortletApplication10MetaData md = unmarshall("filter/portlet-filter1.xml",
+               PortletMetaDataConstants.PORTLET_JSR_168_NS, PortletApplication10MetaData.class);
+         // no filters in jsr 168
+         fail();
+      }
+      catch (Exception e)
+      {
+         // ok
+      }
+   }
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+         String xmlFile = "filter/portlet-filter2.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplication20MetaData md = unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+
+         FilterMetaData filter = md.getFilter("testFilter");
+         assertEquals("org.jboss.portal.meta.NoExistingClass", filter.getFilterClass());
+         assertEquals("testFilter", filter.getFilterName());
+         assertEquals("ACTION_PHASE", filter.getLifecycle().get(0));
+         assertEquals("RENDER_PHASE", filter.getLifecycle().get(1));
+         assertEquals("test", filter.getDescription().getDefaultString());
+         assertEquals("bla", filter.getDescription().getString(new Locale("de"), false));
+         assertEquals("foo", filter.getDisplayName().getString(new Locale("fr"), false));
+         assertEquals("foobar", filter.getDisplayName().getDefaultString());
+
+         InitParamMetaData ip = filter.getInitParams().get(0);
+         assertEquals("eins", ip.getId());
+         assertEquals("foo", ip.getName());
+         assertEquals("bar", ip.getValue());
+         assertNotNull(ip.getDescription());
+
+         InitParamMetaData ip2 = filter.getInitParams().get(1);
+         assertNull(ip2.getId());
+         assertEquals("test", ip2.getName());
+         assertEquals("testing", ip2.getValue());
+
+         // 
+         FilterMetaData filter2 = md.getFilter("testFilterZwei");
+         assertEquals("testFilterZwei", filter2.getFilterName());
+         assertEquals("ACTION_PHASE", filter2.getLifecycle().get(0));
+
+         // Filter mapping
+
+         assertTrue(md.getFilterMapping().containsKey("testFilter"));
+         assertEquals("Portlet1", md.getFilterMapping().get("testFilter").get(0));
+         assertEquals("Portlet2", md.getFilterMapping().get("testFilter").get(1));
+
+         assertTrue(md.getFilterMapping().containsKey("testFilterZwei"));
+         assertEquals("Portlet2", md.getFilterMapping().get("testFilterZwei").get(0));
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.net.URI;
+import java.util.List;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class GeneralMetaDataTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+         PortletApplicationMetaData md = this.unmarshall("general/portlet1.xml");
+         assertEquals("1.0", md.getVersion());
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+         PortletApplicationMetaData md = this.unmarshall("general/portlet2.xml");
+         assertEquals("2.0", md.getVersion());
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test021()
+   {
+      try
+      {
+         PortletApplicationMetaData md = (PortletApplicationMetaData) this.unmarshall("general/portlet2-jsr286.xml");
+         assertEquals("2.0", md.getVersion());
+
+         assertEquals("MyResourceBundle", md.getResourceBundle());
+         assertEquals(new URI("foobar"), md.getDefaultNamespace());
+         
+         PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
+         assertEquals("param1", prp1.getId());
+         assertEquals("Public render parameter one", prp1.getDescription().getDefaultString());
+         assertEquals("param1", prp1.getName());
+         assertEquals("Parameter1", prp1.getAlias().get(0).getLocalPart());
+         assertEquals("Parameter2", prp1.getAlias().get(1).getLocalPart());
+         assertEquals("blub", prp1.getIdentifier());
+         
+         assertEquals("foobar", md.getContainerRuntimeOption("foo").get(0));
+         assertEquals("foobar2", md.getContainerRuntimeOption("foo").get(1));
+         
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,484 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.util.List;
+import java.util.Locale;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletCacheScopeEnum;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletInfoMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletPreferencesMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.SupportedLocaleMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.SupportsMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+         String xmlFile = "portlet/portlet1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+         PortletApplication10MetaData md = unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+         assertNotNull(md);
+
+         Locale fr = new Locale("fr");
+         Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
+
+         PortletMetaData p1 = md.getPortlet("Portlet1");
+         assertNotNull(p1);
+         assertEquals("fragmichnicht", p1.getId());
+         assertEquals("Portlet1", p1.getPortletName());
+         assertEquals(default_locale, p1.getDescription().getDefaultLocale());
+         assertEquals("default", p1.getDescription().getDefaultString());
+         assertEquals("defaut", p1.getDescription().getString(fr, false));
+         assertEquals(default_locale, p1.getDisplayName().getDefaultLocale());
+         assertEquals("display", p1.getDisplayName().getDefaultString());
+         assertEquals("affichage", p1.getDisplayName().getString(fr, false));
+         assertEquals("org.jboss.portal.test.portlet.TestPortlet", p1.getPortletClass());
+
+         InitParamMetaData ip1 = p1.getInitParams().get(0);
+         assertEquals(default_locale, ip1.getDescription().getDefaultLocale());
+         assertEquals("first parameter", ip1.getDescription().getDefaultString());
+         assertEquals("premier parametre", ip1.getDescription().getString(fr, false));
+         assertEquals("one", ip1.getName());
+         assertEquals("1", ip1.getValue());
+
+         InitParamMetaData ip2 = p1.getInitParams().get(1);
+         assertNotNull(ip2);
+         assertEquals("second parameter", ip2.getDescription().getDefaultString());
+         assertEquals("deuxieme parametre", ip2.getDescription().getString(fr, false));
+         assertEquals("two", ip2.getName());
+         assertEquals("2", ip2.getValue());
+
+         // Expiration cache
+         assertEquals(0, p1.getExpirationCache());
+
+         SupportsMetaData smd1 = p1.getSupports().get(0);
+         assertEquals("text/html", smd1.getMimeType());
+         assertEquals("VIEW", smd1.getPortletModes().get(0).getPortletMode());
+         assertEquals("EDIT", smd1.getPortletModes().get(1).getPortletMode());
+         assertEquals("HELP", smd1.getPortletModes().get(2).getPortletMode());
+
+         SupportsMetaData smd2 = p1.getSupports().get(1);
+         assertEquals("text/wml", smd2.getMimeType());
+         assertEquals("VIEW", smd2.getPortletModes().get(0).getPortletMode());
+         assertEquals("HELP", smd2.getPortletModes().get(1).getPortletMode());
+
+         List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+         assertEquals("en", localeList.get(0).getLocale());
+         assertEquals("fr", localeList.get(1).getLocale());
+
+         assertEquals("MyResourceBundle", p1.getResourceBundle());
+
+         PortletInfoMetaData pimd = p1.getPortletInfo();
+         assertNotNull(pimd);
+         assertEquals("very long portlet title", pimd.getTitle());
+         assertEquals("short portlet title", pimd.getShortTitle());
+         assertEquals("a,b,c,d,e,f", pimd.getKeywords());
+
+         PortletPreferencesMetaData ppmd = p1.getPortletPreferences();
+         assertNotNull(ppmd);
+         assertEquals("MyValidator", ppmd.getPreferenceValidator());
+         assertEquals("1", ppmd.getPortletPreferences().get("one").getValue().get(0));
+         assertEquals("2", ppmd.getPortletPreferences().get("two").getValue().get(0));
+         assertEquals(false, ppmd.getPortletPreferences().get("two").isReadOnly());
+         assertEquals("3", ppmd.getPortletPreferences().get("three").getValue().get(0));
+         assertEquals(true, ppmd.getPortletPreferences().get("three").isReadOnly());
+         assertEquals("1", ppmd.getPortletPreferences().get("all").getValue().get(0));
+         assertEquals("2", ppmd.getPortletPreferences().get("all").getValue().get(1));
+         assertEquals("3", ppmd.getPortletPreferences().get("all").getValue().get(2));
+
+         SecurityRoleRefMetaData srrmd1 = p1.getSecurityRoleRef().get(0);
+         assertNotNull(srrmd1);
+         assertEquals("role with no link", srrmd1.getDescription().getDefaultString());
+         assertEquals("role sans link", srrmd1.getDescription().getString(fr, false));
+         assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName());
+
+         SecurityRoleRefMetaData srrmd2 = p1.getSecurityRoleRef().get(1);
+         assertNotNull(srrmd2);
+         assertEquals("role with link", srrmd2.getDescription().getDefaultString());
+         assertEquals("role avec link", srrmd2.getDescription().getString(fr, false));
+         assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName());
+         assertEquals("ROLE_LINK", srrmd2.getRoleLink());
+
+         // Portlet 2
+
+         PortletMetaData p2 = md.getPortlet("Portlet2");
+         assertNotNull(p2);
+         assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet", p2.getPortletClass());
+         assertEquals("text/html", p2.getSupports().get(0).getMimeType());
+         assertEquals("test the portlet session", p2.getPortletInfo().getTitle());
+
+         PortletMetaData p3 = md.getPortlet("Portlet3");
+         assertNotNull(p3);
+
+         PortletMetaData p4 = md.getPortlet("Portlet4");
+         assertNotNull(p4);
+
+         PortletMetaData p5 = md.getPortlet("Portlet5");
+         assertNotNull(p5);
+         PortletPreferencesMetaData ppmd5 = p5.getPortletPreferences();
+         assertEquals("1", ppmd5.getPortletPreferences().get("one").getValue().get(0));
+         assertEquals("2", ppmd5.getPortletPreferences().get("two").getValue().get(0));
+         assertEquals(false, ppmd5.getPortletPreferences().get("two").isReadOnly());
+         assertEquals("3", ppmd5.getPortletPreferences().get("three").getValue().get(0));
+         assertEquals(true, ppmd5.getPortletPreferences().get("three").isReadOnly());
+         assertEquals("1", ppmd5.getPortletPreferences().get("all").getValue().get(0));
+         assertEquals("2", ppmd5.getPortletPreferences().get("all").getValue().get(1));
+         assertEquals("3", ppmd5.getPortletPreferences().get("all").getValue().get(2));
+
+         PortletMetaData p6 = md.getPortlet("Portlet6");
+         assertNotNull(p6);
+         assertEquals("Portlet6", p6.getResourceBundle());
+         assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
+         assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+
+         PortletMetaData p7 = md.getPortlet("Portlet7");
+         assertNotNull(p7);
+
+         PortletMetaData p8 = md.getPortlet("Portlet8");
+         assertNotNull(p8);
+
+         PortletMetaData p9 = md.getPortlet("Portlet9");
+         assertNotNull(p9);
+
+         PortletMetaData p10 = md.getPortlet("Portlet10");
+         assertNotNull(p10);
+
+         PortletMetaData p11 = md.getPortlet("Portlet11");
+         assertNotNull(p11);
+
+         PortletMetaData p12 = md.getPortlet("Portlet12");
+         assertNotNull(p12);
+         assertEquals(60, p12.getExpirationCache());
+
+         PortletMetaData p13 = md.getPortlet("Portlet13");
+         assertNotNull(p13);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+         String xmlFile = "portlet/portlet2.xml";
+//         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplicationMetaData md = unmarshall(xmlFile); 
+            //unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+         assertNotNull(md);
+
+         Locale fr = new Locale("fr");
+         Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
+
+         PortletMetaData p1 = md.getPortlet("Portlet1");
+         assertNotNull(p1);
+         assertEquals("fragmichnicht2", p1.getId());
+         assertEquals("Portlet1", p1.getPortletName());
+         assertEquals(default_locale, p1.getDescription().getDefaultLocale());
+         assertEquals("default", p1.getDescription().getDefaultString());
+         assertEquals("defaut", p1.getDescription().getString(fr, false));
+         assertEquals(default_locale, p1.getDisplayName().getDefaultLocale());
+         assertEquals("display", p1.getDisplayName().getDefaultString());
+         assertEquals("affichage", p1.getDisplayName().getString(fr, false));
+         assertEquals("org.jboss.portal.test.portlet.TestPortlet", p1.getPortletClass());
+
+         InitParamMetaData ip1 = p1.getInitParams().get(0);
+         assertEquals(default_locale, ip1.getDescription().getDefaultLocale());
+         assertEquals("first parameter", ip1.getDescription().getDefaultString());
+         assertEquals("premier parametre", ip1.getDescription().getString(fr, false));
+         assertEquals("one", ip1.getName());
+         assertEquals("1", ip1.getValue());
+
+         InitParamMetaData ip2 = p1.getInitParams().get(1);
+         assertNotNull(ip2);
+         assertEquals("second parameter", ip2.getDescription().getDefaultString());
+         assertEquals("deuxieme parametre", ip2.getDescription().getString(fr, false));
+         assertEquals("two", ip2.getName());
+         assertEquals("2", ip2.getValue());
+
+         // Expiration cache
+         assertEquals(0, p1.getExpirationCache());
+
+         // cache Scope - JSR 286
+         assertEquals(PortletCacheScopeEnum.PUBLIC, p1.getCacheScope());
+
+         SupportsMetaData smd1 = p1.getSupports().get(0);
+         assertEquals("text/html", smd1.getMimeType());
+         assertEquals("VIEW", smd1.getPortletModes().get(0).getPortletMode());
+         assertEquals("EDIT", smd1.getPortletModes().get(1).getPortletMode());
+         assertEquals("HELP", smd1.getPortletModes().get(2).getPortletMode());
+
+         SupportsMetaData smd2 = p1.getSupports().get(1);
+         assertEquals("text/wml", smd2.getMimeType());
+         assertEquals("VIEW", smd2.getPortletModes().get(0).getPortletMode());
+         assertEquals("HELP", smd2.getPortletModes().get(1).getPortletMode());
+
+         List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+         assertEquals("en", localeList.get(0).getLocale());
+         assertEquals("fr", localeList.get(1).getLocale());
+
+         assertEquals("MyResourceBundle", p1.getResourceBundle());
+
+         PortletInfoMetaData pimd = p1.getPortletInfo();
+         assertNotNull(pimd);
+         assertEquals("very long portlet title", pimd.getTitle());
+         assertEquals("short portlet title", pimd.getShortTitle());
+         assertEquals("a,b,c,d,e,f", pimd.getKeywords());
+
+         PortletPreferencesMetaData ppmd = p1.getPortletPreferences();
+         assertNotNull(ppmd);
+         assertEquals("MyValidator", ppmd.getPreferenceValidator());
+         assertEquals("1", ppmd.getPortletPreferences().get("one").getValue().get(0));
+         assertEquals("2", ppmd.getPortletPreferences().get("two").getValue().get(0));
+         assertEquals(false, ppmd.getPortletPreferences().get("two").isReadOnly());
+         assertEquals("3", ppmd.getPortletPreferences().get("three").getValue().get(0));
+         assertEquals(true, ppmd.getPortletPreferences().get("three").isReadOnly());
+         assertEquals("1", ppmd.getPortletPreferences().get("all").getValue().get(0));
+         assertEquals("2", ppmd.getPortletPreferences().get("all").getValue().get(1));
+         assertEquals("3", ppmd.getPortletPreferences().get("all").getValue().get(2));
+
+         SecurityRoleRefMetaData srrmd1 = p1.getSecurityRoleRef().get(0);
+         assertNotNull(srrmd1);
+         assertEquals("role with no link", srrmd1.getDescription().getDefaultString());
+         assertEquals("role sans link", srrmd1.getDescription().getString(fr, false));
+         assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName());
+
+         SecurityRoleRefMetaData srrmd2 = p1.getSecurityRoleRef().get(1);
+         assertNotNull(srrmd2);
+         assertEquals("role with link", srrmd2.getDescription().getDefaultString());
+         assertEquals("role avec link", srrmd2.getDescription().getString(fr, false));
+         assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName());
+         assertEquals("ROLE_LINK", srrmd2.getRoleLink());
+
+         // Portlet2
+
+         PortletMetaData p2 = md.getPortlet("Portlet2");
+         assertNotNull(p2);
+         assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet", p2.getPortletClass());
+         assertEquals("text/html", p2.getSupports().get(0).getMimeType());
+         assertEquals("test the portlet session", p2.getPortletInfo().getTitle());
+
+         PortletMetaData p3 = md.getPortlet("Portlet3");
+         assertNotNull(p3);
+
+         PortletMetaData p4 = md.getPortlet("Portlet4");
+         assertNotNull(p4);
+
+         PortletMetaData p5 = md.getPortlet("Portlet5");
+         assertNotNull(p5);
+         PortletPreferencesMetaData ppmd5 = p5.getPortletPreferences();
+         assertEquals("1", ppmd5.getPortletPreferences().get("one").getValue().get(0));
+         assertEquals("2", ppmd5.getPortletPreferences().get("two").getValue().get(0));
+         assertEquals(false, ppmd5.getPortletPreferences().get("two").isReadOnly());
+         assertEquals("3", ppmd5.getPortletPreferences().get("three").getValue().get(0));
+         assertEquals(true, ppmd5.getPortletPreferences().get("three").isReadOnly());
+         assertEquals("1", ppmd5.getPortletPreferences().get("all").getValue().get(0));
+         assertEquals("2", ppmd5.getPortletPreferences().get("all").getValue().get(1));
+         assertEquals("3", ppmd5.getPortletPreferences().get("all").getValue().get(2));
+
+         PortletMetaData p6 = md.getPortlet("Portlet6");
+         assertNotNull(p6);
+         assertEquals("Portlet6", p6.getResourceBundle());
+         assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
+         assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+
+         PortletMetaData p7 = md.getPortlet("Portlet7");
+         assertNotNull(p7);
+
+         PortletMetaData p8 = md.getPortlet("Portlet8");
+         assertNotNull(p8);
+
+         PortletMetaData p9 = md.getPortlet("Portlet9");
+         assertNotNull(p9);
+
+         PortletMetaData p10 = md.getPortlet("Portlet10");
+         assertNotNull(p10);
+
+         PortletMetaData p11 = md.getPortlet("Portlet11");
+         assertNotNull(p11);
+
+         PortletMetaData p12 = md.getPortlet("Portlet12");
+         assertNotNull(p12);
+         assertEquals(60, p12.getExpirationCache());
+
+         PortletMetaData p13 = md.getPortlet("Portlet13");
+         assertNotNull(p13);
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test021()
+   {
+      try
+      {
+         String xmlFile = "portlet/portlet2-jsr286.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplication20MetaData md = unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+         assertNotNull(md);
+
+         Locale fr = new Locale("fr");
+         Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
+
+         PortletMetaData p1 = md.getPortlet("Portlet1");
+         assertNotNull(p1);
+         assertEquals("fragmichnicht2", p1.getId());
+         assertEquals("Portlet1", p1.getPortletName());
+         assertEquals(default_locale, p1.getDescription().getDefaultLocale());
+         assertEquals("default", p1.getDescription().getDefaultString());
+         assertEquals("defaut", p1.getDescription().getString(fr, false));
+         assertEquals(default_locale, p1.getDisplayName().getDefaultLocale());
+         assertEquals("display", p1.getDisplayName().getDefaultString());
+         assertEquals("affichage", p1.getDisplayName().getString(fr, false));
+         assertEquals("org.jboss.portal.test.portlet.TestPortlet", p1.getPortletClass());
+
+         InitParamMetaData ip1 = p1.getInitParams().get(0);
+         assertEquals(default_locale, ip1.getDescription().getDefaultLocale());
+         assertEquals("first parameter", ip1.getDescription().getDefaultString());
+         assertEquals("premier parametre", ip1.getDescription().getString(fr, false));
+         assertEquals("one", ip1.getName());
+         assertEquals("1", ip1.getValue());
+
+         InitParamMetaData ip2 = p1.getInitParams().get(1);
+         assertNotNull(ip2);
+         assertEquals("second parameter", ip2.getDescription().getDefaultString());
+         assertEquals("deuxieme parametre", ip2.getDescription().getString(fr, false));
+         assertEquals("two", ip2.getName());
+         assertEquals("2", ip2.getValue());
+
+         // Expiration cache
+         assertEquals(0, p1.getExpirationCache());
+
+         SupportsMetaData smd1 = p1.getSupports().get(0);
+         assertEquals("text/html", smd1.getMimeType());
+         assertEquals("VIEW", smd1.getPortletModes().get(0).getPortletMode());
+         assertEquals("EDIT", smd1.getPortletModes().get(1).getPortletMode());
+         assertEquals("HELP", smd1.getPortletModes().get(2).getPortletMode());
+         // window state jsr 286
+         assertEquals("MAXIMIZED", smd1.getWindowStates().get(0).getWindowState());
+         assertEquals("NORMAL", smd1.getWindowStates().get(1).getWindowState());
+
+         SupportsMetaData smd2 = p1.getSupports().get(1);
+         assertEquals("foo", smd2.getId());
+         assertEquals("text/wml", smd2.getMimeType());
+         assertEquals("VIEW", smd2.getPortletModes().get(0).getPortletMode());
+         assertEquals("HELP", smd2.getPortletModes().get(1).getPortletMode());
+         // window state jsr 286
+         assertEquals("NORMAL", smd2.getWindowStates().get(0).getWindowState());
+         assertEquals("CUSTOM", smd2.getWindowStates().get(1).getWindowState());
+
+         List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+         assertEquals("en", localeList.get(0).getLocale());
+         assertEquals("fr", localeList.get(1).getLocale());
+
+         assertEquals("MyResourceBundle", p1.getResourceBundle());
+
+         PortletInfoMetaData pimd = p1.getPortletInfo();
+         assertNotNull(pimd);
+         assertEquals("very long portlet title", pimd.getTitle());
+         assertEquals("short portlet title", pimd.getShortTitle());
+         assertEquals("a,b,c,d,e,f", pimd.getKeywords());
+
+         PortletPreferencesMetaData ppmd = p1.getPortletPreferences();
+         assertNotNull(ppmd);
+         assertEquals("MyValidator", ppmd.getPreferenceValidator());
+         assertEquals("1", ppmd.getPortletPreferences().get("one").getValue().get(0));
+         assertEquals("2", ppmd.getPortletPreferences().get("two").getValue().get(0));
+         assertEquals(false, ppmd.getPortletPreferences().get("two").isReadOnly());
+         assertEquals("3", ppmd.getPortletPreferences().get("three").getValue().get(0));
+         assertEquals(true, ppmd.getPortletPreferences().get("three").isReadOnly());
+         assertEquals("1", ppmd.getPortletPreferences().get("all").getValue().get(0));
+         assertEquals("2", ppmd.getPortletPreferences().get("all").getValue().get(1));
+         assertEquals("3", ppmd.getPortletPreferences().get("all").getValue().get(2));
+
+         SecurityRoleRefMetaData srrmd1 = p1.getSecurityRoleRef().get(0);
+         assertNotNull(srrmd1);
+         assertEquals("role with no link", srrmd1.getDescription().getDefaultString());
+         assertEquals("role sans link", srrmd1.getDescription().getString(fr, false));
+         assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName());
+
+         SecurityRoleRefMetaData srrmd2 = p1.getSecurityRoleRef().get(1);
+         assertNotNull(srrmd2);
+         assertEquals("role with link", srrmd2.getDescription().getDefaultString());
+         assertEquals("role avec link", srrmd2.getDescription().getString(fr, false));
+         assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName());
+         assertEquals("ROLE_LINK", srrmd2.getRoleLink());
+
+         // JSR 286 properties
+         assertEquals(PortletCacheScopeEnum.PUBLIC, p1.getCacheScope());
+         assertEquals("http://example.com/testEvents", p1.getSupportedProcessingEvent().get(0).getQname()
+               .getNamespaceURI());
+         assertEquals("portletEvent", p1.getSupportedProcessingEvent().get(0).getQname().getLocalPart());
+         assertEquals("x", p1.getSupportedProcessingEvent().get(0).getQname().getPrefix());
+         assertEquals("foo", p1.getSupportedPublicRenderParameters().get(0));
+         assertEquals("bar", p1.getSupportedPublicRenderParameters().get(1));
+         assertEquals("foo2", p1.getSupportedPublicRenderParameters().get(2));
+         assertEquals("foo2bar", p1.getSupportedPublicRenderParameters().get(3));
+
+         assertEquals("org.jboss.portal.test.url.generation.listener", p1.getUrlGenerationListener().get(0));
+         assertEquals("org.jboss.portal.test.url.generation.listener.foo", p1.getUrlGenerationListener().get(1));
+
+         assertTrue(p1.getContainerRuntimeOptions().containsKey("option1"));
+         assertTrue(p1.getContainerRuntimeOptions().containsKey("option2"));
+         assertEquals("value1", p1.getContainerRuntimeOptions().get("option1").get(0));
+         assertEquals("value2", p1.getContainerRuntimeOptions().get("option1").get(1));
+         assertEquals("value3", p1.getContainerRuntimeOptions().get("option2").get(0));
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class RenderParameterTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+
+         String xmlFile = "renderParameter/portlet2.xml";
+//         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplicationMetaData md = unmarshall(xmlFile); //, namespace, PortletApplication20MetaData.class);
+         assertNotNull(md);
+         assertEquals("2.0", md.getVersion());
+
+         PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
+         assertEquals("blah", prp1.getIdentifier());
+         assertEquals("renderParameter1", prp1.getName());
+         assertEquals("fooo", prp1.getAlias().get(0).getLocalPart());
+         assertEquals("rP1", prp1.getAlias().get(1).getLocalPart());
+         assertEquals("render parameter foo", prp1.getDescription().getDefaultString());
+
+         PublicRenderParameterMetaData prp2 = md.getPublicRenderParameters().get(1);
+         assertEquals("foo", prp2.getQname().getLocalPart());
+         assertEquals("x", prp2.getQname().getPrefix());
+         assertEquals("http://someurl.com", prp2.getQname().getNamespaceURI());
+         assertEquals("foo", prp2.getAlias().get(0).getLocalPart());
+         assertEquals("http://someurl.alias.com", prp2.getAlias().get(0).getNamespaceURI());
+         assertEquals("s", prp2.getAlias().get(0).getPrefix());
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,221 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.security.TransportGuaranteeEnum;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class SecurityConstraintTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+
+         String xmlFile = "security/portlet1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+         PortletApplicationMetaData md = unmarshall(xmlFile);
+         assertEquals("1.0", md.getVersion());
+
+         SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
+         assertNotNull(scd1);
+
+         assertEquals("foo", scd1.getId());
+         assertEquals("test", scd1.getDisplayName().getDefaultString());
+         assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
+         assertEquals(TransportGuaranteeEnum.NONE, scd1.getUserDataConstraint().getTransportQuarantee());
+         assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
+         assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
+         assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
+         assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
+
+         SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
+         assertNotNull(scd2);
+         assertEquals(TransportGuaranteeEnum.INTEGRAL, scd2.getUserDataConstraint().getTransportQuarantee());
+         assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
+         try
+         {
+            scd2.getPortletList().getPortletNames().get(1);
+            fail("2nd security constraint should only contain one element,");
+         }
+         catch (IndexOutOfBoundsException e)
+         {
+            // expected java.lang.IndexOutOfBoundsException
+         }
+
+         PortletMetaData pmd1 = md.getPortlet("foo");
+         assertNotNull(pmd1);
+
+         PortletMetaData pmd2 = md.getPortlet("foobar");
+         assertNotNull(pmd2);
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   /*
+   public void test011()
+   {
+      try
+      {
+
+         String xmlFile = "security/portlet1-fail1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+         
+         unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+   
+         fail();         
+      }
+      catch(Exception e)
+      {
+         // OK
+      }
+   }
+
+   public void test012()
+   {
+      try
+      {
+
+         String xmlFile = "security/portlet1-fail1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+         
+         unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+         fail();         
+      }
+      catch(Exception e)
+      {
+         // OK
+      }
+   }
+   */
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+
+         String xmlFile = "security/portlet2.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplication20MetaData md = unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+         assertEquals("2.0", md.getVersion());
+
+         SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
+         assertNotNull(scd1);
+         assertEquals("foo", scd1.getId());
+         assertEquals("test", scd1.getDisplayName().getDefaultString());
+         assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
+         assertEquals(TransportGuaranteeEnum.NONE, scd1.getUserDataConstraint().getTransportQuarantee());
+         assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
+         assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
+         assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
+         assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
+
+         SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
+         assertNotNull(scd2);
+         assertEquals(TransportGuaranteeEnum.INTEGRAL, scd2.getUserDataConstraint().getTransportQuarantee());
+         assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
+         try
+         {
+            scd2.getPortletList().getPortletNames().get(1);
+            fail("2nd security constraint should only contain one element,");
+         }
+         catch (IndexOutOfBoundsException e)
+         {
+            // expected java.lang.IndexOutOfBoundsException
+         }
+         /*
+              PortletMetaData pmd1 = md.getPortlet("foo");
+              assertNotNull(pmd1);
+              assertTrue(pmd1.getTransportGuarantee().containsGuarantee(TransportGuaranteeEnum.NONE));
+              assertTrue(pmd1.getTransportGuarantee().containsGuarantee(TransportGuaranteeEnum.INTEGRAL));
+              
+              PortletMetaData pmd2 = md.getPortlet("foobar");
+              assertNotNull(pmd2);
+              assertTrue(pmd2.getTransportGuarantee().containsGuarantee(TransportGuaranteeEnum.NONE));  
+           */
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+   /*  
+     public void test021()
+     {
+        try
+        {
+
+           String xmlFile = "security/portlet2-fail1.xml";
+           String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+           
+           unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+           fail();  
+        }
+        catch(Exception e)
+        {
+           // OK
+        }
+     }
+     
+     public void test022()
+     {
+        try
+        {
+
+           String xmlFile = "security/portlet2-fail2.xml";
+           String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+           
+           unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+           fail();  
+        }
+        catch(Exception e)
+        {
+           // OK
+        }
+     }
+     */
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SimplePortletTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SimplePortletTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/SimplePortletTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class SimplePortletTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+         PortletApplicationMetaData md = unmarshall("portlet/portlet1-simple.xml");
+         fail();
+      }
+      catch (Exception e)
+      {
+         // OK
+      }
+   }
+   
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.UserAttributeMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UserAttributeTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+   @Test
+   public void test01()
+   {
+      try
+      {
+         String xmlFile = "userAttribute/portlet1.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+         PortletApplication10MetaData md = unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+         assertNotNull(md);
+
+         UserAttributeMetaData umb = md.getUserAttributes().get("blub");
+         assertNotNull(umb);
+         assertEquals("notFoo", umb.getId());
+         assertNull(umb.getDescription());
+
+         UserAttributeMetaData umd = md.getUserAttributes().get("foo");
+         assertNotNull(umd);
+         assertEquals("realFoo", umd.getId());
+         assertEquals("foobar", umd.getDescription().getDefaultString());
+         assertEquals("fuhbar", umd.getDescription().getString(new Locale("de"), true));
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+   @Test
+   public void test02()
+   {
+      try
+      {
+         String xmlFile = "userAttribute/portlet2.xml";
+         String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+         PortletApplication20MetaData md = unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+         assertNotNull(md);
+         UserAttributeMetaData umb = md.getUserAttributes().get("blub");
+         assertNotNull(umb);
+         assertEquals("notFoo", umb.getId());
+         assertNull(umb.getDescription());
+
+         UserAttributeMetaData umd = md.getUserAttributes().get("foo");
+         assertNotNull(umd);
+         assertEquals("realFoo", umd.getId());
+         assertEquals("foobar", umd.getDescription().getDefaultString());
+         assertEquals("fuhbar", umd.getDescription().getString(new Locale("de"), true));
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         fail();
+      }
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ValidationErrorHandler implements ErrorHandler
+{
+
+   public void error(SAXParseException e) throws SAXException
+   {
+      throw new SAXException("Syntax error on line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + "\n"
+            + e.getMessage());
+   }
+
+   public void fatalError(SAXParseException e) throws SAXException
+   {
+      throw new SAXException("Fatal syntax error on line: " + e.getLineNumber() + ", column: " + e.getColumnNumber()
+            + "\n" + e.getMessage());
+   }
+
+   public void warning(SAXParseException e) throws SAXException
+   {
+      // TODO
+   }
+
+}
\ No newline at end of file

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "custom-portlet-modeType")
+public class CustomPortletModeMetaData extends DescribeableMetaData
+{
+
+   /** The custom portlet mode id*/
+   private String id;
+
+   /** The portlet mode */
+   private String portletMode;
+
+   /** Is portal managed */
+   private boolean portalManaged = true;
+
+   /** The decoration name */
+   private LocalizedString decorationName;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "portlet-mode")
+   public String getPortletMode()
+   {
+      return portletMode;
+   }
+
+   public void setPortletMode(String portletMode)
+   {
+      this.portletMode = portletMode;
+   }
+
+   @XmlElement(name = "portal-managed", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public boolean isPortalManaged()
+   {
+      return portalManaged;
+   }
+
+   public void setPortalManaged(boolean portalManaged)
+   {
+      this.portalManaged = portalManaged;
+   }
+
+   @XmlElement(name = "decoration-name", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+   public LocalizedString getDecorationName()
+   {
+      return decorationName;
+   }
+
+   public void setDecorationName(LocalizedString decorationName)
+   {
+      this.decorationName = decorationName;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "custom-window-stateType")
+public class CustomWindowStateMetaData extends DescribeableMetaData
+{
+
+   /** The window state id */
+   private String id;
+
+   /** The window state */
+   private String windowState;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "window-state")
+   public String getWindowState()
+   {
+      return windowState;
+   }
+
+   public void setWindowState(String windowState)
+   {
+      this.windowState = windowState;
+   }
+
+}
\ No newline at end of file

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,293 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.adapter.ContainerRuntimeAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterMappingAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.PortletListAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.UserAttributeAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+ at XmlRootElement(name = "portlet-app")
+ at JBossXmlSchema(xmlns = {@XmlNs(namespaceURI = PortletMetaDataConstants.PORTLET_JSR_168_NS, prefix = "portlet")},
+         ignoreUnresolvedFieldOrClass = false,
+         namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS,
+         elementFormDefault = XmlNsForm.QUALIFIED)
+ at XmlType(name = "portlet-appType")
+public class PortletApplication10MetaData implements PortletApplicationMetaData
+{
+   /** The portlet application id */
+   private String id;
+
+   /** The portlet application version */
+   private String version;
+
+   /** A bunch of portlets */
+   private Map<String, PortletMetaData> portlets;
+
+   /** The user attributes */
+   private Map<String, UserAttributeMetaData> userAttributes;
+
+   /** The custom portlet mode */
+   private List<CustomPortletModeMetaData> customPortletMode;
+
+   /** The custom window states */
+   private List<CustomWindowStateMetaData> customWindowState;
+
+   /** The security constraints */
+   private List<SecurityConstraintMetaData> securityConstraints;
+
+   /** The resource bundle (JSR 286) */
+   private String resourceBundle;
+
+   /** The default namespace URI (JSR 286) */
+   private URI defaultNamespace;
+
+   /** The filters (JSR 286) */
+   private Map<String, FilterMetaData> filters;
+
+   /** The filter mapping (JSR 286) */
+   private Map<String, List<String>> filterMapping;
+
+   /** The events (JSR 286) */
+   private List<EventDefinitionMetaData> events;
+
+   /** The public render parameters */
+   private List<PublicRenderParameterMetaData> publicRenderParameters;
+
+   /** The container runtime options */
+   private Map<String, List<String>> containerRuntimeOptions;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlAttribute(name = "version")
+   public String getVersion()
+   {
+      return version;
+   }
+
+   public void setVersion(String version)
+   {
+      this.version = version;
+   }
+
+   @XmlElement(name = "portlet")
+   @XmlJavaTypeAdapter(PortletListAdapter.class)
+   public Map<String, PortletMetaData> getPortlets()
+   {
+      return portlets;
+   }
+
+   public void setPortlets(Map<String, PortletMetaData> portlets)
+   {
+      this.portlets = portlets;
+   }
+
+   public Collection<PortletMetaData> getPortletCollection()
+   {
+      return portlets != null ? portlets.values() : null;
+   }
+
+   public PortletMetaData getPortlet(String portletName)
+   {
+      return portlets.get(portletName);
+   }
+
+   @XmlElement(name = "user-attribute")
+   @XmlJavaTypeAdapter(UserAttributeAdapter.class)
+   public Map<String, UserAttributeMetaData> getUserAttributes()
+   {
+      return userAttributes;
+   }
+
+   public void setUserAttributes(Map<String, UserAttributeMetaData> userAttributes)
+   {
+      this.userAttributes = userAttributes;
+   }
+
+   @XmlElement(name = "custom-portlet-mode")
+   public List<CustomPortletModeMetaData> getCustomPortletMode()
+   {
+      return customPortletMode;
+   }
+
+   public void setCustomPortletMode(List<CustomPortletModeMetaData> customPortletMode)
+   {
+      this.customPortletMode = customPortletMode;
+   }
+
+   @XmlElement(name = "custom-window-state")
+   public List<CustomWindowStateMetaData> getCustomWindowState()
+   {
+      return customWindowState;
+   }
+
+   public void setCustomWindowState(List<CustomWindowStateMetaData> customWindowState)
+   {
+      this.customWindowState = customWindowState;
+   }
+
+   @XmlElement(name = "security-constraint")
+   public List<SecurityConstraintMetaData> getSecurityConstraints()
+   {
+      return securityConstraints;
+   }
+
+   public void setSecurityConstraints(List<SecurityConstraintMetaData> securityConstraints)
+   {
+      this.securityConstraints = securityConstraints;
+   }
+
+   @XmlElement(name = "resource-bundle", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public String getResourceBundle()
+   {
+      return resourceBundle;
+   }
+
+   public void setResourceBundle(String resourceBundle)
+   {
+      this.resourceBundle = resourceBundle;
+   }
+
+   @XmlElement(name = "default-namespace")
+   public URI getDefaultNamespace()
+   {
+      return defaultNamespace;
+   }
+
+   public void setDefaultNamespace(URI defaultNamespace)
+   {
+      this.defaultNamespace = defaultNamespace;
+   }
+
+   @XmlElement(name = "filter", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   @XmlJavaTypeAdapter(FilterAdapter.class)
+   public Map<String, FilterMetaData> getFilters()
+   {
+      return this.filters;
+   }
+
+   public void setFilters(Map<String, FilterMetaData> filters)
+   {
+      this.filters = filters;
+   }
+
+   public Collection<FilterMetaData> getFilterCollection()
+   {
+      return this.filters != null ? this.filters.values() : null;
+   }
+
+   public FilterMetaData getFilter(String filterName)
+   {
+      return this.filters.get(filterName);
+   }
+
+   @XmlElement(name = "filter-mapping")
+   @XmlJavaTypeAdapter(FilterMappingAdapter.class)
+   public Map<String, List<String>> getFilterMapping()
+   {
+      return filterMapping;
+   }
+
+   public void setFilterMapping(Map<String, List<String>> filterMapping)
+   {
+      this.filterMapping = filterMapping;
+   }
+
+   @XmlElement(name = "event-definition", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public List<EventDefinitionMetaData> getEvents()
+   {
+      return events;
+   }
+
+   public void setEvents(List<EventDefinitionMetaData> events)
+   {
+      this.events = events;
+   }
+
+   @XmlElement(name = "public-render-parameter")
+   public List<PublicRenderParameterMetaData> getPublicRenderParameters()
+   {
+      return publicRenderParameters;
+   }
+
+   public void setPublicRenderParameters(List<PublicRenderParameterMetaData> publicRenderParameters)
+   {
+      this.publicRenderParameters = publicRenderParameters;
+   }
+
+   @XmlElement(name = "container-runtime-option")
+   @XmlJavaTypeAdapter(ContainerRuntimeAdapter.class)
+   public Map<String, List<String>> getContainerRuntimeOptions()
+   {
+      return containerRuntimeOptions;
+   }
+
+   public void setContainerRuntimeOptions(Map<String, List<String>> containerRuntimeOptions)
+   {
+      this.containerRuntimeOptions = containerRuntimeOptions;
+   }
+
+   public List<String> getContainerRuntimeOption(String option)
+   {
+      return this.containerRuntimeOptions.get(option);
+   }
+
+   public Set<String> getContainerRuntimeOptionSet()
+   {
+      return this.containerRuntimeOptions != null ? this.containerRuntimeOptions.keySet() : null;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,294 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.adapter.ContainerRuntimeAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterMappingAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.PortletListAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.UserAttributeAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+ at XmlRootElement(name = "portlet-app")
+ at JBossXmlSchema(xmlns = {@XmlNs(namespaceURI = PortletMetaDataConstants.PORTLET_JSR_286_NS, prefix = "portlet")},
+         ignoreUnresolvedFieldOrClass = false,
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS,
+         elementFormDefault = XmlNsForm.QUALIFIED)
+ at XmlType(name = "portlet-appType")
+public class PortletApplication20MetaData implements PortletApplicationMetaData
+{
+   /** The portlet application id */
+   private String id;
+
+   /** The portlet application version */
+   private String version;
+
+   /** A bunch of portlets */
+   private Map<String, PortletMetaData> portlets;
+
+   /** The user attributes */
+   private Map<String, UserAttributeMetaData> userAttributes;
+
+   /** The custom portlet mode */
+   private List<CustomPortletModeMetaData> customPortletMode;
+
+   /** The custom window states */
+   private List<CustomWindowStateMetaData> customWindowState;
+
+   /** The security constraints */
+   private List<SecurityConstraintMetaData> securityConstraints;
+
+   /** The resource bundle (JSR 286) */
+   private String resourceBundle;
+
+   /** The default namespace URI (JSR 286) */
+   private URI defaultNamespace;
+
+   /** The filters (JSR 286) */
+   private Map<String, FilterMetaData> filters;
+
+   /** The filter mapping (JSR 286) */
+   private Map<String, List<String>> filterMapping;
+
+   /** The events (JSR 286) */
+   private List<EventDefinitionMetaData> events;
+
+   /** The public render parameters */
+   private List<PublicRenderParameterMetaData> publicRenderParameters;
+
+   /** The container runtime options */
+   private Map<String, List<String>> containerRuntimeOptions;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlAttribute(name = "version")
+   public String getVersion()
+   {
+      return version;
+   }
+
+   public void setVersion(String version)
+   {
+      this.version = version;
+   }
+
+   @XmlElement(name = "portlet")
+   @XmlJavaTypeAdapter(PortletListAdapter.class)
+   public Map<String, PortletMetaData> getPortlets()
+   {
+      return portlets;
+   }
+
+   public void setPortlets(Map<String, PortletMetaData> portlets)
+   {
+      this.portlets = portlets;
+   }
+
+   public Collection<PortletMetaData> getPortletCollection()
+   {
+
+      return portlets != null ? portlets.values() : null;
+   }
+
+   public PortletMetaData getPortlet(String portletName)
+   {
+      return portlets.get(portletName);
+   }
+
+   @XmlElement(name = "user-attribute")
+   @XmlJavaTypeAdapter(UserAttributeAdapter.class)
+   public Map<String, UserAttributeMetaData> getUserAttributes()
+   {
+      return userAttributes;
+   }
+
+   public void setUserAttributes(Map<String, UserAttributeMetaData> userAttributes)
+   {
+      this.userAttributes = userAttributes;
+   }
+
+   @XmlElement(name = "custom-portlet-mode")
+   public List<CustomPortletModeMetaData> getCustomPortletMode()
+   {
+      return customPortletMode;
+   }
+
+   public void setCustomPortletMode(List<CustomPortletModeMetaData> customPortletMode)
+   {
+      this.customPortletMode = customPortletMode;
+   }
+
+   @XmlElement(name = "custom-window-state")
+   public List<CustomWindowStateMetaData> getCustomWindowState()
+   {
+      return customWindowState;
+   }
+
+   public void setCustomWindowState(List<CustomWindowStateMetaData> customWindowState)
+   {
+      this.customWindowState = customWindowState;
+   }
+
+   @XmlElement(name = "security-constraint")
+   public List<SecurityConstraintMetaData> getSecurityConstraints()
+   {
+      return securityConstraints;
+   }
+
+   public void setSecurityConstraints(List<SecurityConstraintMetaData> securityConstraints)
+   {
+      this.securityConstraints = securityConstraints;
+   }
+
+   @XmlElement(name = "resource-bundle", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public String getResourceBundle()
+   {
+      return resourceBundle;
+   }
+
+   public void setResourceBundle(String resourceBundle)
+   {
+      this.resourceBundle = resourceBundle;
+   }
+
+   @XmlElement(name = "default-namespace")
+   public URI getDefaultNamespace()
+   {
+      return defaultNamespace;
+   }
+
+   public void setDefaultNamespace(URI defaultNamespace)
+   {
+      this.defaultNamespace = defaultNamespace;
+   }
+
+   @XmlElement(name = "filter", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   @XmlJavaTypeAdapter(FilterAdapter.class)
+   public Map<String, FilterMetaData> getFilters()
+   {
+      return this.filters;
+   }
+
+   public void setFilters(Map<String, FilterMetaData> filters)
+   {
+      this.filters = filters;
+   }
+
+   public Collection<FilterMetaData> getFilterCollection()
+   {
+      return this.filters != null ? this.filters.values() : null;
+   }
+
+   public FilterMetaData getFilter(String filterName)
+   {
+      return this.filters.get(filterName);
+   }
+
+   @XmlElement(name = "filter-mapping")
+   @XmlJavaTypeAdapter(FilterMappingAdapter.class)
+   public Map<String, List<String>> getFilterMapping()
+   {
+      return filterMapping;
+   }
+
+   public void setFilterMapping(Map<String, List<String>> filterMapping)
+   {
+      this.filterMapping = filterMapping;
+   }
+
+   @XmlElement(name = "event-definition", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public List<EventDefinitionMetaData> getEvents()
+   {
+      return events;
+   }
+
+   public void setEvents(List<EventDefinitionMetaData> events)
+   {
+      this.events = events;
+   }
+
+   @XmlElement(name = "public-render-parameter")
+   public List<PublicRenderParameterMetaData> getPublicRenderParameters()
+   {
+      return publicRenderParameters;
+   }
+
+   public void setPublicRenderParameters(List<PublicRenderParameterMetaData> publicRenderParameters)
+   {
+      this.publicRenderParameters = publicRenderParameters;
+   }
+
+   @XmlElement(name = "container-runtime-option")
+   @XmlJavaTypeAdapter(ContainerRuntimeAdapter.class)
+   public Map<String, List<String>> getContainerRuntimeOptions()
+   {
+      return containerRuntimeOptions;
+   }
+
+   public void setContainerRuntimeOptions(Map<String, List<String>> containerRuntimeOptions)
+   {
+      this.containerRuntimeOptions = containerRuntimeOptions;
+   }
+
+   public List<String> getContainerRuntimeOption(String option)
+   {
+      return this.containerRuntimeOptions.get(option);
+   }
+
+   public Set<String> getContainerRuntimeOptionSet()
+   {
+      return this.containerRuntimeOptions != null ? this.containerRuntimeOptions.keySet() : null;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface PortletApplicationMetaData
+{
+   public String getId();
+
+   public String getVersion();
+
+   public Collection<PortletMetaData> getPortletCollection();
+
+   public PortletMetaData getPortlet(String portletName);
+
+   public Map<String, UserAttributeMetaData> getUserAttributes();
+
+   public List<CustomPortletModeMetaData> getCustomPortletMode();
+
+   public List<CustomWindowStateMetaData> getCustomWindowState();
+
+   public List<SecurityConstraintMetaData> getSecurityConstraints();
+
+   public String getResourceBundle();
+
+   public URI getDefaultNamespace();
+
+   public Collection<FilterMetaData> getFilterCollection();
+
+   public FilterMetaData getFilter(String filterName);
+   
+   public Map<String, List<String>> getFilterMapping();
+
+   public List<EventDefinitionMetaData> getEvents();
+
+   public void setEvents(List<EventDefinitionMetaData> events);
+
+   public List<PublicRenderParameterMetaData> getPublicRenderParameters();
+
+   public Set<String> getContainerRuntimeOptionSet();
+   
+   public List<String> getContainerRuntimeOption(String option);
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaDataException.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaDataException.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaDataException.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletApplicationMetaDataException extends Exception
+{
+   public PortletApplicationMetaDataException()
+   {
+      super();
+   }
+
+   public PortletApplicationMetaDataException(Throwable cause)
+   {
+      super(cause);
+   }
+
+   public PortletApplicationMetaDataException(String message)
+   {
+      super(message);
+   }
+
+   public PortletApplicationMetaDataException(String message, Throwable cause)
+   {
+      super(message, cause);
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletMetaDataConstants
+{
+
+   /** The portlet version 1.0 namespace */
+   public final static String PORTLET_JSR_168_NS = "http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
+
+   /** The portlet version 2.0 namespace */
+   public final static String PORTLET_JSR_286_NS = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";
+
+   /** The xml namespace */
+   public final static String NS_XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+
+   /** The default locale */
+   public final static String DEFAULT_LOCALE = "en";
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "public-render-parameterType")
+public class PublicRenderParameterMetaData extends DescribeableMetaData
+{
+
+   /** The public render parameter id */
+   private String id;
+
+   /** The public render parameter identifier */
+   private String identifier;
+
+   /** The QName */
+   private QName qname;
+   
+   /** The name */
+   private String name;
+
+   /** The public render parameter alias */
+   private List<QName> alias;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "identifier")
+   public String getIdentifier()
+   {
+      return identifier;
+   }
+
+   public void setIdentifier(String identifier)
+   {
+      this.identifier = identifier;
+   }
+
+   @XmlElement(name = "qname")
+   public QName getQname()
+   {
+      return qname;
+   }
+
+   public void setQname(QName qname)
+   {
+      this.qname = qname;
+   }
+   
+   @XmlElement(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlElement(name = "alias")
+   public List<QName> getAlias()
+   {
+      return alias;
+   }
+
+   public void setAlias(List<QName> alias)
+   {
+      this.alias = alias;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "user-attributeType")
+public class UserAttributeMetaData extends DescribeableMetaData
+{
+
+   /** The id */
+   private String id;
+   
+   /** The name */
+   private String name;
+   
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+   
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+   
+   @XmlElement(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}
+

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/ContainerRuntimeAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/ContainerRuntimeAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/ContainerRuntimeAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ContainerRuntimeAdapter
+      extends XmlAdapter<List<ContainerRuntimeMetaData>, java.util.Map<String, List<String>>>
+{
+
+   @Override
+   public List<ContainerRuntimeMetaData> marshal(Map<String, List<String>> map) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public Map<String, List<String>> unmarshal(List<ContainerRuntimeMetaData> list) throws Exception
+   {
+      Map<String, List<String>> map = new HashMap<String, List<String>>();
+      for (ContainerRuntimeMetaData c : list)
+      {
+         map.put(c.getName(), c.getValues());
+      }
+      return map;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/EventListAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/EventListAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/EventListAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public final class EventListAdapter
+   extends XmlAdapter<EventDefinitionMetaData[], Map<String, EventDefinitionMetaData>>
+{
+
+   @Override
+   public EventDefinitionMetaData[] marshal(Map<String, EventDefinitionMetaData> eventMap) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public Map<String, EventDefinitionMetaData> unmarshal(EventDefinitionMetaData[] eventList) throws Exception
+   {
+      Map<String, EventDefinitionMetaData> eventMap = new HashMap<String, EventDefinitionMetaData>();
+      for (EventDefinitionMetaData eventDef : eventList)
+      {
+         eventMap.put(eventDef.getQname().getLocalPart(), eventDef);
+      }
+      return eventMap;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FilterAdapter
+   extends XmlAdapter<List<FilterMetaData>, Map<String, FilterMetaData>>
+{
+
+   @Override
+   public List<FilterMetaData> marshal(Map<String, FilterMetaData> map) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public Map<String, FilterMetaData> unmarshal(List<FilterMetaData> list) throws Exception
+   {
+      Map<String, FilterMetaData> map = new LinkedHashMap<String, FilterMetaData>();
+      for (FilterMetaData f : list)
+      {
+         String filterName = f.getFilterName();
+         if (!map.containsKey(filterName))
+         {
+            map.put(filterName, f);
+         }
+         else
+         {
+            throw new IllegalArgumentException("Duplicate filter: " + filterName);
+         }
+      }
+      return map;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterMappingAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterMappingAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/FilterMappingAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMappingMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FilterMappingAdapter
+   extends XmlAdapter<List<FilterMappingMetaData>, Map<String, List<String>>>
+{
+
+   @Override
+   public List<FilterMappingMetaData> marshal(Map<String, List<String>> arg0) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public Map<String, List<String>> unmarshal(List<FilterMappingMetaData> list) throws Exception
+   {
+      Map<String, List<String>> map = new HashMap<String, List<String>>();
+      for (FilterMappingMetaData f : list)
+      {
+         map.put(f.getName(), f.getPortletNames());
+      }
+      return map;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/LocalizedStringAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/LocalizedStringAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/LocalizedStringAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.common.LocalizedDescriptionMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class LocalizedStringAdapter
+   extends XmlAdapter<List<LocalizedDescriptionMetaData>, LocalizedString>
+{
+
+   @Override
+   public List<LocalizedDescriptionMetaData> marshal(LocalizedString arg0) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public LocalizedString unmarshal(List<LocalizedDescriptionMetaData> descriptionList) throws Exception
+   {
+      Map<Locale, String> map = new LinkedHashMap<Locale, String>();
+      for (LocalizedDescriptionMetaData d : descriptionList)
+      {
+         map.put(new Locale(d.getLang()), d.getDescription());
+      }
+      return new LocalizedString(map, new Locale(PortletMetaDataConstants.DEFAULT_LOCALE));
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletListAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletListAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletListAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public final class PortletListAdapter
+   extends XmlAdapter<List<PortletMetaData>, Map<String, PortletMetaData>>
+{
+
+   @Override
+   public List<PortletMetaData> marshal(Map<String, PortletMetaData> portletMap) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public Map<String, PortletMetaData> unmarshal(List<PortletMetaData> portletList) throws Exception
+   {
+      Map<String, PortletMetaData> portletMap = new LinkedHashMap<String, PortletMetaData>();
+      for (PortletMetaData portlet : portletList)
+      {
+         if (!portletMap.containsKey(portlet.getPortletName()))
+         {
+            portletMap.put(portlet.getPortletName(), portlet);
+         }
+         else
+         {
+            throw new IllegalArgumentException("Portlet name '" + portlet.getPortletName() + "' already defined.");
+         }
+      }
+      return portletMap;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletPreferencesListAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletPreferencesListAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/PortletPreferencesListAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletPreferenceMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletPreferencesListAdapter
+      extends XmlAdapter<List<PortletPreferenceMetaData>, Map<String, PortletPreferenceMetaData>>
+{
+
+   @Override
+   public List<PortletPreferenceMetaData> marshal(Map<String, PortletPreferenceMetaData> arg0) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public Map<String, PortletPreferenceMetaData> unmarshal(List<PortletPreferenceMetaData> list) throws Exception
+   {
+      Map<String, PortletPreferenceMetaData> map = new LinkedHashMap<String, PortletPreferenceMetaData>();
+      for (PortletPreferenceMetaData p : list)
+      {
+         map.put(p.getName(), p);
+      }
+      return map;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/UserAttributeAdapter.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/UserAttributeAdapter.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/adapter/UserAttributeAdapter.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.adapter;
+
+import java.util.HashMap;
+import java.util.List;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.UserAttributeMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+public class UserAttributeAdapter
+      extends XmlAdapter<List<UserAttributeMetaData>, HashMap<String, UserAttributeMetaData>>
+{
+
+   @Override
+   public List<UserAttributeMetaData> marshal(HashMap<String, UserAttributeMetaData> arg0) throws Exception
+   {
+      throw new RuntimeException("Not yet implemented.");
+   }
+
+   @Override
+   public HashMap<String, UserAttributeMetaData> unmarshal(List<UserAttributeMetaData> list) throws Exception
+   {
+      HashMap<String, UserAttributeMetaData> m = new HashMap<String, UserAttributeMetaData>();
+      for (UserAttributeMetaData a : list)
+      {
+         String userAttributeName = a.getName();
+         if (!m.containsKey(userAttributeName))
+         {
+            m.put(a.getName(), a);
+         }
+         else
+         {
+            throw new IllegalArgumentException("Duplicate user-attribute: " + userAttributeName);
+         }
+      }
+      return m;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/ContainerRuntimeMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/ContainerRuntimeMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/ContainerRuntimeMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.common;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "container-runtime-optionType")
+public class ContainerRuntimeMetaData
+{
+
+   /** The name */
+   private String name;
+
+   /** The value list */
+   private List<String> values;
+
+   @XmlElement(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlElement(name = "value")
+   public List<String> getValues()
+   {
+      return values;
+   }
+
+   public void setValues(List<String> values)
+   {
+      this.values = values;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/DescribeableMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/DescribeableMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/DescribeableMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.common;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.LocalizedStringAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class DescribeableMetaData
+{
+
+   /** The description */
+   private LocalizedString description;
+
+   @XmlElement(name = "description")
+   @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+   public LocalizedString getDescription()
+   {
+      return description;
+   }
+
+   public void setDescription(LocalizedString description)
+   {
+      this.description = description;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/InitParamMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/InitParamMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/InitParamMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.common;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "init-paramType")
+public class InitParamMetaData extends DescribeableMetaData
+{
+
+   /** The init param id */
+   private String id;
+
+   /** The init param name */
+   private String name;
+
+   /** The init param value */
+   private String value;
+
+   @XmlAttribute
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "name")
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlElement(name = "value")
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getValue()
+   {
+      return value;
+   }
+
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/LocalizedDescriptionMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/LocalizedDescriptionMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/common/LocalizedDescriptionMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.common;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+
+/**
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "descriptionType")
+public class LocalizedDescriptionMetaData
+{
+
+   /** The lang */
+   private String lang = "en";
+
+   /** The description */
+   private String description;
+
+   @XmlAttribute(name = "lang", 
+         namespace = PortletMetaDataConstants.NS_XML_NAMESPACE)
+   public String getLang()
+   {
+      return this.lang;
+   }
+
+   public void setLang(String lang)
+   {
+      this.lang = lang;
+   }
+
+   @XmlValue
+   public String getDescription()
+   {
+      return description;
+   }
+
+   public void setDescription(String description)
+   {
+      this.description = description;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.event;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "event-definitionType")
+public class EventDefinitionMetaData extends DescribeableMetaData
+{
+   /** The event definition id */
+   private String id;
+
+   /** The QName */
+   private QName qname;
+   
+   /** The name */
+   private String name;
+
+   /** The value-type */
+   private String valueType;
+
+   /** The alias */
+   private List<QName> alias;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "qname")
+   public QName getQname()
+   {
+      return qname;
+   }
+
+   public void setQname(QName qname)
+   {
+      this.qname = qname;
+   }
+   
+   @XmlElement(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   @XmlElement(name = "value-type")
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getValueType()
+   {
+      return valueType;
+   }
+
+   public void setValueType(String valueType)
+   {
+      this.valueType = valueType;
+   }
+
+   @XmlElement(name = "alias")
+   public List<QName> getAlias()
+   {
+      return alias;
+   }
+
+   public void setAlias(List<QName> alias)
+   {
+      this.alias = alias;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionReferenceMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionReferenceMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/event/EventDefinitionReferenceMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.event;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "event-definition-referenceType")
+public class EventDefinitionReferenceMetaData
+{
+
+   /** The reference id */
+   private String id;
+
+   /** The qname */
+   private QName qname;
+   
+   /** The name */
+   private String name;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "qname")
+   public QName getQname()
+   {
+      return qname;
+   }
+
+   public void setQname(QName qname)
+   {
+      this.qname = qname;
+   }
+   
+   @XmlElement(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMappingMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMappingMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMappingMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.filter;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+ at XmlType(name = "filter-mappingType")
+public class FilterMappingMetaData
+{
+
+   /** The filter name */
+   private String name;
+
+   /** The mapped portlet names */
+   private List<String> portletNames;
+
+   @XmlElement(name = "filter-name")
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlElement(name = "portlet-name")
+   public List<String> getPortletNames()
+   {
+      return portletNames;
+   }
+
+   public void setPortletNames(List<String> portletNames)
+   {
+      this.portletNames = portletNames;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/filter/FilterMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.filter;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+ at XmlType(name = "filterType", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS,
+      propOrder = {"description", "displayName", "filterName", "filterClass", "lifecycle", "initParams"})
+public class FilterMetaData extends DescribeableMetaData
+{
+   /** The filter name */
+   private String filterName;
+
+   /** The filter class */
+   private String filterClass;
+
+   /** The filter lifecycle */
+   private List<String> lifecycle;
+
+   /** The filter display name */
+   private LocalizedString displayName;
+
+   /** The filter init parameters */
+   private List<InitParamMetaData> initParams;
+
+   @XmlElement(name = "filter-name", required = true)
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getFilterName()
+   {
+      return filterName;
+   }
+
+   public void setFilterName(String filterName)
+   {
+      this.filterName = filterName;
+   }
+
+   @XmlElement(name = "filter-class", required = true)
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getFilterClass()
+   {
+      return filterClass;
+   }
+
+   public void setFilterClass(String filterClass)
+   {
+      this.filterClass = filterClass;
+   }
+
+   @XmlElement(name = "lifecycle", required = true)
+//   @XmlJavaTypeAdapter(FilterLifeCycleAdapter.class)
+//   public List<LifeCycleEnumMetaData> getLifecycle()
+   public List<String> getLifecycle()
+   {
+      return lifecycle;
+   }
+
+   public void setLifecycle(List<String> lifecycle)
+   {
+      this.lifecycle = lifecycle;
+   }
+
+   @XmlElement(name = "display-name")
+   @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+   public LocalizedString getDisplayName()
+   {
+      return displayName;
+   }
+
+   public void setDisplayName(LocalizedString displayNames)
+   {
+      this.displayName = displayNames;
+   }
+
+   @XmlElement(name = "init-param")
+   public List<InitParamMetaData> getInitParams()
+   {
+      return initParams;
+   }
+
+   public void setInitParams(List<InitParamMetaData> initParams)
+   {
+      this.initParams = initParams;
+   }
+
+}
\ No newline at end of file

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletCacheScopeEnum.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletCacheScopeEnum.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletCacheScopeEnum.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlEnum
+public enum PortletCacheScopeEnum {
+
+   /** The private cache scope */
+   PRIVATE,
+
+   /** The public cache scope */
+   PUBLIC
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletInfoMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletInfoMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletInfoMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "portlet-infoType")
+public class PortletInfoMetaData
+{
+
+   /** The portlet info id */
+   private String id;
+
+   /** The portlet title */
+   private String title;
+
+   /** The portlet short-title */
+   private String shortTitle;
+
+   /* The portlet keywords*/
+   private String keywords;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "title")
+   public String getTitle()
+   {
+      return title;
+   }
+
+   public void setTitle(String title)
+   {
+      this.title = title;
+   }
+
+   @XmlElement(name = "short-title")
+   public String getShortTitle()
+   {
+      return shortTitle;
+   }
+
+   public void setShortTitle(String shortTitle)
+   {
+      this.shortTitle = shortTitle;
+   }
+
+   @XmlElement(name = "keywords")
+//   @XmlJavaTypeAdapter(KeywordsAdapter.class)
+   public String getKeywords()
+   {
+      return keywords;
+   }
+
+   public void setKeywords(String keywords)
+   {
+      this.keywords = keywords;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,322 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.ContainerRuntimeAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionReferenceMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "portletType",
+      propOrder = {"id", "description", "portletName", "displayName", "portletClass", "initParams", "expirationCache", "cacheScope",
+      "supports", "supportedLocale", "resourceBundle", "portletInfo", "portletPreferences", "securityRoleRef",
+      "supportedProcessingEvent", "supportedPublishingEvent", "supportedPublicRenderParameters",
+      "urlGenerationListener", "containerRuntimeOptions"})
+public class PortletMetaData extends DescribeableMetaData
+{
+
+   /** The portlet id */
+   private String id;
+
+   /** The portlet name */
+   private String portletName;
+
+   /** The portlet class */
+   private String portletClass;
+
+   /** The portlet display name */
+   private LocalizedString displayName;
+
+   /** The portlet init parameters */
+   private List<InitParamMetaData> initParams;
+
+   /** The portlet expiration cache */
+   private int expirationCache;
+
+   /** The cache scope */
+   private PortletCacheScopeEnum cacheScope = PortletCacheScopeEnum.PRIVATE;
+
+   /** The supports */
+   private List<SupportsMetaData> supports;
+
+   /** The supported locale */
+   private List<SupportedLocaleMetaData> supportedLocale;
+
+   /** The resource bundle */
+   private String resourceBundle;
+
+   /** The portlet info */
+   private PortletInfoMetaData portletInfo;
+
+   /** The portlet preferences */
+   private PortletPreferencesMetaData portletPreferences;
+
+   /** The portlet security role references */
+   private List<SecurityRoleRefMetaData> securityRoleRef;
+
+   /** The portlet event supported processing event */
+   private List<EventDefinitionReferenceMetaData> supportedProcessingEvent;
+
+   /** The portlet event supported publishing event */
+   private List<EventDefinitionReferenceMetaData> supportedPublishingEvent;
+
+   /** The portlet supported public render parameters */
+   private List<String> supportedPublicRenderParameters;
+
+   /** The url generation listener */
+   private List<String> urlGenerationListener;
+
+   /** The portlet container runtime options */
+   private Map<String, List<String>> containerRuntimeOptions;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "portlet-name",
+         required = true)
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getPortletName()
+   {
+      return portletName;
+   }
+
+   public void setPortletName(String portletName)
+   {
+      this.portletName = portletName;
+   }
+
+   @XmlElement(name = "portlet-class",
+         required = true)
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getPortletClass()
+   {
+      return portletClass;
+   }
+
+   public void setPortletClass(String portletClass)
+   {
+      this.portletClass = portletClass;
+   }
+
+   @XmlElement(name = "display-name")
+   @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+   public LocalizedString getDisplayName()
+   {
+      return displayName;
+   }
+
+   public void setDisplayName(LocalizedString displayNames)
+   {
+      this.displayName = displayNames;
+   }
+
+   @XmlElement(name = "init-param")
+   public List<InitParamMetaData> getInitParams()
+   {
+      return initParams;
+   }
+
+   public void setInitParams(List<InitParamMetaData> initParams)
+   {
+      this.initParams = initParams;
+   }
+
+   @XmlElement(name = "expiration-cache")
+   public int getExpirationCache()
+   {
+      return expirationCache;
+   }
+
+   public void setExpirationCache(int expirationCache)
+   {
+      this.expirationCache = expirationCache;
+   }
+
+   @XmlElement(name = "cache-scope",
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS, type = PortletCacheScopeEnum.class)
+   public PortletCacheScopeEnum getCacheScope()
+   {
+      return cacheScope;
+   }
+
+   public void setCacheScope(PortletCacheScopeEnum cacheScope)
+   {
+      this.cacheScope = cacheScope;
+   }
+
+   @XmlElement(name = "supports",
+         required = true)
+   public List<SupportsMetaData> getSupports()
+   {
+      return supports;
+   }
+
+   public void setSupports(List<SupportsMetaData> supports)
+   {
+      this.supports = supports;
+   }
+
+   @XmlElement(name = "supported-locale")
+//   @XmlJavaTypeAdapter(SupportedLocaleAdapter.class)
+   public List<SupportedLocaleMetaData> getSupportedLocale()
+   {
+      return supportedLocale;
+   }
+
+   public void setSupportedLocale(List<SupportedLocaleMetaData> supportedLocale)
+   {
+      this.supportedLocale = supportedLocale;
+   }
+
+   @XmlElement(name = "resource-bundle")
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getResourceBundle()
+   {
+      return resourceBundle;
+   }
+
+   public void setResourceBundle(String resourceBundle)
+   {
+      this.resourceBundle = resourceBundle;
+   }
+
+   @XmlElement(name = "portlet-info")
+   public PortletInfoMetaData getPortletInfo()
+   {
+      return portletInfo;
+   }
+
+   public void setPortletInfo(PortletInfoMetaData portletInfo)
+   {
+      this.portletInfo = portletInfo;
+   }
+
+   @XmlElement(name = "portlet-preferences")
+   public PortletPreferencesMetaData getPortletPreferences()
+   {
+      return portletPreferences;
+   }
+
+   public void setPortletPreferences(PortletPreferencesMetaData portletPreferences)
+   {
+      this.portletPreferences = portletPreferences;
+   }
+
+   @XmlElement(name = "security-role-ref")
+   public List<SecurityRoleRefMetaData> getSecurityRoleRef()
+   {
+      return securityRoleRef;
+   }
+
+   public void setSecurityRoleRef(List<SecurityRoleRefMetaData> securityRoleRef)
+   {
+      this.securityRoleRef = securityRoleRef;
+   }
+
+   @XmlElement(name = "supported-processing-event",
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public List<EventDefinitionReferenceMetaData> getSupportedProcessingEvent()
+   {
+      return supportedProcessingEvent;
+   }
+
+   public void setSupportedProcessingEvent(List<EventDefinitionReferenceMetaData> supportedProcessingEvent)
+   {
+      this.supportedProcessingEvent = supportedProcessingEvent;
+   }
+
+   @XmlElement(name = "supported-publishing-event",
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public List<EventDefinitionReferenceMetaData> getSupportedPublishingEvent()
+   {
+      return supportedPublishingEvent;
+   }
+
+   public void setSupportedPublishingEvent(List<EventDefinitionReferenceMetaData> supportedPublishingEvent)
+   {
+      this.supportedPublishingEvent = supportedPublishingEvent;
+   }
+
+   @XmlElement(name = "supported-public-render-parameter",
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public List<String> getSupportedPublicRenderParameters()
+   {
+      return supportedPublicRenderParameters;
+   }
+
+   public void setSupportedPublicRenderParameters(List<String> supportedPublicRenderParameters)
+   {
+      this.supportedPublicRenderParameters = supportedPublicRenderParameters;
+   }
+
+   @XmlElement(name = "url-generation-listener",
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+//   @XmlJavaTypeAdapter(CollapsedStringListAdapter.class)
+   public List<String> getUrlGenerationListener()
+   {
+      return urlGenerationListener;
+   }
+
+   public void setUrlGenerationListener(List<String> urlGenerationListener)
+   {
+      this.urlGenerationListener = urlGenerationListener;
+   }
+
+   @XmlElement(name = "container-runtime-option",
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   @XmlJavaTypeAdapter(ContainerRuntimeAdapter.class)
+   public Map<String, List<String>> getContainerRuntimeOptions()
+   {
+      return containerRuntimeOptions;
+   }
+
+   public void setContainerRuntimeOptions(Map<String, List<String>> containerRuntimeOptions)
+   {
+      this.containerRuntimeOptions = containerRuntimeOptions;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletModeMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletModeMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletModeMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+ at XmlType(name = "portlet-modeType")
+public class PortletModeMetaData
+{
+
+   /** The portlet mode */
+   private String portletMode;
+
+   @XmlValue
+   public String getPortletMode()
+   {
+      return portletMode;
+   }
+
+   public void setPortletMode(String portletMode)
+   {
+      this.portletMode = portletMode;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferenceMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferenceMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferenceMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "portlet-preferenceType")
+public class PortletPreferenceMetaData
+{
+
+   /** The portlet preference id */
+   private String id;
+
+   /** The portlet preference name */
+   private String name;
+
+   /** The portlet preference value */
+   private List<String> value;
+
+   /** Is read only */
+   private boolean readOnly;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlElement(name = "value")
+   public List<String> getValue()
+   {
+      return value;
+   }
+
+   public void setValue(List<String> value)
+   {
+      this.value = value;
+   }
+
+   @XmlElement(name = "read-only")
+   public boolean isReadOnly()
+   {
+      return readOnly;
+   }
+
+   public void setReadOnly(boolean readOnly)
+   {
+      this.readOnly = readOnly;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferencesMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferencesMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/PortletPreferencesMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.portlet.test.metadata.impl.adapter.PortletPreferencesListAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "portlet-preferencesType")
+public class PortletPreferencesMetaData
+{
+
+   /** The portlet preferences id */
+   private String id;
+
+   /** The portlet preferences */
+   private Map<String, PortletPreferenceMetaData> portletPreferences;
+
+   /** The portlet preference validator */
+   private String preferenceValidator;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "preference")
+   @XmlJavaTypeAdapter(PortletPreferencesListAdapter.class)
+   public Map<String, PortletPreferenceMetaData> getPortletPreferences()
+   {
+      return portletPreferences;
+   }
+
+   public void setPortletPreferences(Map<String, PortletPreferenceMetaData> portletPreferences)
+   {
+      this.portletPreferences = portletPreferences;
+   }
+
+   @XmlElement(name = "preferences-validator")
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public String getPreferenceValidator()
+   {
+      return preferenceValidator;
+   }
+
+   public void setPreferenceValidator(String preferenceValidator)
+   {
+      this.preferenceValidator = preferenceValidator;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SecurityRoleRefMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SecurityRoleRefMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SecurityRoleRefMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+ at XmlType(name = "security-role-refType")
+public class SecurityRoleRefMetaData extends DescribeableMetaData
+{
+
+   /** The security role ref id */
+   private String id;
+
+   /** The role name */
+   private String roleName;
+
+   /** The role link */
+   private String roleLink;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "role-name")
+   public String getRoleName()
+   {
+      return roleName;
+   }
+
+   public void setRoleName(String roleName)
+   {
+      this.roleName = roleName;
+   }
+
+   @XmlElement(name = "role-link")
+   public String getRoleLink()
+   {
+      return roleLink;
+   }
+
+   public void setRoleLink(String roleLink)
+   {
+      this.roleLink = roleLink;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportedLocaleMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportedLocaleMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportedLocaleMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "supported-localeType")
+public class SupportedLocaleMetaData
+{
+
+   /** The supported locale */
+   private String locale;
+
+   @XmlValue
+   public String getLocale()
+   {
+      return locale;
+   }
+
+   public void setLocale(String locale)
+   {
+      this.locale = locale;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportsMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportsMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/SupportsMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "supportsType")
+public class SupportsMetaData
+{
+
+   /** The supports id */
+   @XmlAttribute(name = "id")
+   private String id;
+
+   /** The mime type */
+   private String mimeType;
+
+   /** The portletModes */
+   private List<PortletModeMetaData> portletModes;
+
+   /** The window states */
+   private List<WindowStateMetaData> windowStates;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "mime-type")
+   public String getMimeType()
+   {
+      return mimeType;
+   }
+
+   public void setMimeType(String mimeType)
+   {
+      this.mimeType = mimeType;
+   }
+
+   @XmlElement(name = "portlet-mode")
+   public List<PortletModeMetaData> getPortletModes()
+   {
+      return portletModes;
+   }
+
+   public void setPortletModes(List<PortletModeMetaData> portletModes)
+   {
+      this.portletModes = portletModes;
+   }
+
+   @XmlElement(name = "window-state",
+         namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+   public List<WindowStateMetaData> getWindowStates()
+   {
+      return windowStates;
+   }
+
+   public void setWindowStates(List<WindowStateMetaData> windowStates)
+   {
+      this.windowStates = windowStates;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/WindowStateMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/WindowStateMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/portlet/WindowStateMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.portlet;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "window-stateType")
+public class WindowStateMetaData
+{
+
+   /** The window state */
+   private String windowState;
+
+   @XmlValue
+   public String getWindowState()
+   {
+      return windowState;
+   }
+
+   public void setWindowState(String windowState)
+   {
+      this.windowState = windowState;
+   }
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/PortletCollectionMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/PortletCollectionMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/PortletCollectionMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.security;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "portlet-collectionType")
+public class PortletCollectionMetaData
+{
+   /** The portlet name List */
+   private List<String> portletNames;
+
+   @XmlElement(name = "portlet-name")
+   public List<String> getPortletNames()
+   {
+      return portletNames;
+   }
+
+   public void setPortletNames(List<String> portletNames)
+   {
+      this.portletNames = portletNames;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/SecurityConstraintMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/SecurityConstraintMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/SecurityConstraintMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.security;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.test.metadata.impl.adapter.LocalizedStringAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "security-constraintType")
+public class SecurityConstraintMetaData
+{
+
+   /** The security constraint id */
+   private String id;
+
+   /** The security constraint display name */
+   private LocalizedString displayName;
+
+   /** The portlet collection */
+   private PortletCollectionMetaData portletList;
+
+   /** The user data constraints */
+   private UserDataConstraintMetaData userDataConstraint;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "display-name")
+   @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+   public LocalizedString getDisplayName()
+   {
+      return displayName;
+   }
+
+   public void setDisplayName(LocalizedString displayName)
+   {
+      this.displayName = displayName;
+   }
+
+   @XmlElement(name = "portlet-collection")
+//   @XmlJavaTypeAdapter(PortletCollectionAdapter.class)
+   public PortletCollectionMetaData getPortletList()
+   {
+      return portletList;
+   }
+
+   public void setPortletList(PortletCollectionMetaData portletList)
+   {
+      this.portletList = portletList;
+   }
+
+   @XmlElement(name = "user-data-constraint")
+   public UserDataConstraintMetaData getUserDataConstraint()
+   {
+      return userDataConstraint;
+   }
+
+   public void setUserDataConstraint(UserDataConstraintMetaData userDataConstraint)
+   {
+      this.userDataConstraint = userDataConstraint;
+   }
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/TransportGuaranteeEnum.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/TransportGuaranteeEnum.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/TransportGuaranteeEnum.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.security;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * In most cases, the presence of the INTEGRAL or CONFIDENTIAL
+ * flag will indicate that the use of SSL is required.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+ at XmlEnum
+public enum TransportGuaranteeEnum {
+
+   /** does not require any transport guarantees */
+   NONE,
+   /** 
+    * requires the data sent between the client and the portlet
+    * in such way that it can't be changed in transit
+    */
+   INTEGRAL,
+   /**
+    * requires that the data be transmitted in a fashion that prevents
+    * other entities from observing the contents of the transmission
+    */
+   CONFIDENTIAL
+
+}

Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/UserDataConstraintMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/UserDataConstraintMetaData.java	                        (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/metadata/impl/security/UserDataConstraintMetaData.java	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.metadata.impl.security;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.test.metadata.impl.common.DescribeableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "user-data-constraint")
+public class UserDataConstraintMetaData extends DescribeableMetaData
+{
+
+   /** The user data constraint id */
+   private String id;
+
+   /** The user transport quarantee */
+   private TransportGuaranteeEnum transportQuarantee;
+
+   @XmlAttribute(name = "id")
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   @XmlElement(name = "transport-guarantee")
+   public TransportGuaranteeEnum getTransportQuarantee()
+   {
+      return transportQuarantee;
+   }
+
+   public void setTransportQuarantee(TransportGuaranteeEnum transportQuarantee)
+   {
+      this.transportQuarantee = transportQuarantee;
+   }
+}
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1-fail.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1-fail.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1-fail.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+             
+	<custom-portlet-mode id="cmode1">
+		<description>portletMode1</description>
+		<description xml:lang="de">eigener portlet modus</description>
+		<portlet-mode>Custom</portlet-mode>
+		<portal-managed>true</portal-managed>
+		<decoration-name>Portlet Mode One</decoration-name>
+		<decoration-name xml:lang="de">Eigener Portlet Modus Eins</decoration-name>
+	</custom-portlet-mode>
+
+	<custom-portlet-mode>
+		<decoration-name>Portlet Mode One</decoration-name>
+		<portlet-mode>Custom2</portlet-mode>
+		<portal-managed>false</portal-managed>
+	</custom-portlet-mode>
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+             
+	<custom-portlet-mode id="mode1">
+		<description>portletMode1</description>
+		<description xml:lang="de">eigener portlet modus</description>
+		<portlet-mode>Custom</portlet-mode>
+	</custom-portlet-mode>
+
+	<custom-portlet-mode>
+		<portlet-mode>Custom2</portlet-mode>
+	</custom-portlet-mode>
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/customPortletMode/portlet2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+
+	<custom-portlet-mode id="cmode1">
+		<description>portletMode1</description>
+		<description xml:lang="de">eigener portlet modus</description>
+		<portlet-mode>Custom</portlet-mode>
+		<portal-managed>true</portal-managed>
+		<decoration-name>Portlet Mode One</decoration-name>
+		<decoration-name xml:lang="de">Eigener Portlet Modus Eins</decoration-name>
+	</custom-portlet-mode>
+
+	<custom-portlet-mode>
+		<portlet-mode>Custom2</portlet-mode>
+		<portal-managed>false</portal-managed>
+		<decoration-name>Portlet Mode One</decoration-name>
+	</custom-portlet-mode>
+
+	<custom-portlet-mode>
+		<description>Portlet Mode Three</description>
+		<portlet-mode>Custom3</portlet-mode>
+	</custom-portlet-mode>
+
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+             
+	<custom-window-state id="foo">
+		<description>WindowState</description>
+		<description xml:lang="de">Offenes Fenster</description>
+		<window-state>windowState1</window-state>
+	</custom-window-state>
+
+	<custom-window-state>
+		<window-state>windowState2</window-state>
+	</custom-window-state>
+
+	<custom-window-state id="drei">
+		<window-state>windowState3</window-state>
+	</custom-window-state>
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/customWindowState/portlet2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+             
+	<custom-window-state id="foo">
+		<description>WindowState</description>
+		<description xml:lang="de">Offenes Fenster</description>
+		<window-state>windowState1</window-state>
+	</custom-window-state>
+
+	<custom-window-state>
+		<window-state>windowState2</window-state>
+	</custom-window-state>
+
+	<custom-window-state id="drei">
+		<window-state>windowState3</window-state>
+	</custom-window-state>
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/event/portlet-event1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/event/portlet-event1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/event/portlet-event1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+             
+	<event-definition id="shouldfail">
+		<name>MustFail</name>
+	</event-definition>
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2-fail.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2-fail.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2-fail.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+
+	<portlet id="portlet">
+		<portlet-name>Portlet2</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet session</title>
+		</portlet-info>
+		<supported-processing-event>
+			<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+		</supported-processing-event>
+		<supported-processing-event>
+			<name>hellouh</name>
+		</supported-processing-event>
+		
+		<supported-publishing-event>
+			<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+			<name>fooooo</name>
+		</supported-publishing-event>
+		<supported-publishing-event>
+			<name>hellouh</name>
+		</supported-publishing-event>
+	</portlet>
+
+	<event-definition>
+		<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+		<name>hellouh</name>
+		<alias>hello</alias>
+	</event-definition>
+
+
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/event/portlet-event2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+
+	<portlet id="portlet">
+		<portlet-name>Portlet2</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet session</title>
+		</portlet-info>
+		<supported-processing-event>
+			<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+		</supported-processing-event>
+		<supported-processing-event>
+			<name>hellouh</name>
+		</supported-processing-event>
+		
+		<supported-publishing-event>
+			<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+		</supported-publishing-event>
+		<supported-publishing-event>
+			<name>hellouh</name>
+		</supported-publishing-event>
+	</portlet>
+
+	<event-definition id="eventID">
+		<description>descriptionDefaultLanguage</description>
+		<description xml:lang="de">Beschreibung in Deutsch</description>
+		<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+		<value-type>
+			org.jboss.portal.event.invoke.refill.beer
+		</value-type>
+	</event-definition>
+
+	<event-definition>
+		<name>hellouh</name>
+		<alias>hello</alias>
+	</event-definition>
+
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+             
+	<filter>
+		<filter-name>testFilter</filter-name>
+	</filter>
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/filter/portlet-filter2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             version="2.0">
+             
+	<filter>
+		<description>test</description>
+		<description xml:lang="de">bla</description>
+		<display-name xml:lang="fr">foo</display-name>
+		<display-name>foobar</display-name>
+		<filter-name>testFilter</filter-name>
+		<filter-class>
+			org.jboss.portal.meta.NoExistingClass
+		</filter-class>
+		<lifecycle>ACTION_PHASE</lifecycle>
+		<lifecycle>RENDER_PHASE</lifecycle>
+		<init-param id="eins">
+			<description xml:lang="fr">biere</description>
+			<description>beer</description>
+			<name>foo</name>
+			<value>bar</value>
+		</init-param>
+		<init-param>
+			<name>test</name>
+			<value>testing</value>
+		</init-param>
+	</filter>
+
+	<filter>
+		<filter-name>testFilterZwei</filter-name>
+		<filter-class>org.jboss.portal.meta.NoExistingClass</filter-class>
+		<lifecycle>ACTION_PHASE</lifecycle>
+	</filter>
+	
+	<filter>
+		<filter-name>foo</filter-name>
+	</filter>
+	
+	<filter-mapping>
+		<filter-name>testFilter</filter-name>
+		<portlet-name>Portlet1</portlet-name>
+		<portlet-name>Portlet2</portlet-name>
+	</filter-mapping>
+
+	<filter-mapping>
+		<filter-name>testFilterZwei</filter-name>
+		<portlet-name>Portlet2</portlet-name>
+	</filter-mapping>
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/general/portlet1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/general/portlet1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/general/portlet1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+	<portlet>
+		<description>default</description>
+		<description xml:lang="fr">defaut</description>
+		<portlet-name>Portlet1</portlet-name>
+		<display-name>display</display-name>
+		<display-name xml:lang="fr">affichage</display-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortlet
+		</portlet-class>
+		<init-param>
+			<description>first parameter</description>
+			<description xml:lang="fr">premier parametre</description>
+			<name>one</name>
+			<value>1</value>
+		</init-param>
+		<init-param>
+			<description>second parameter</description>
+			<description xml:lang="fr">deuxieme parametre</description>
+			<name>two</name>
+			<value>2</value>
+		</init-param>
+		<expiration-cache>0</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>EDIT</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supports>
+			<mime-type>text/wml</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>MyResourceBundle</resource-bundle>
+		<portlet-info>
+			<title>very long portlet title</title>
+			<short-title>short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+			<preferences-validator>MyValidator</preferences-validator>
+		</portlet-preferences>
+		<security-role-ref>
+			<description>role with no link</description>
+			<description xml:lang="fr">role sans link</description>
+			<role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+		</security-role-ref>
+		<security-role-ref>
+			<description>role with link</description>
+			<description xml:lang="fr">role avec link</description>
+			<role-name>ROLE_NAME_WITH_LINK</role-name>
+			<role-link>ROLE_LINK</role-link>
+		</security-role-ref>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet2</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet session</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet3</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestDispatcherPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet request dispatcher</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet4</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestRedirectPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet redirection</title>
+		</portlet-info>
+	</portlet>
+
+
+	<portlet>
+		<portlet-name>Portlet5</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet preferences</title>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+		</portlet-preferences>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet6</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestResourceBundlePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>Portlet6</resource-bundle>
+		<portlet-info>
+			<title>Very long portlet title</title>
+			<short-title>Short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet7</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test exception during the action request</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet8</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecurityPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet security</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet9</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestUserInformationPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test user information</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet10</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletModePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet modes</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet11</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test https URL</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet12</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestCachedContentPortlet
+		</portlet-class>
+		<expiration-cache>60</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cached content</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet13</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.CrossContextSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cross session context</title>
+		</portlet-info>
+	</portlet>
+
+
+	<custom-portlet-mode>
+		<description>first mode</description>
+		<description xml:lang="fr">premier mode</description>
+		<portlet-mode>configure</portlet-mode>
+	</custom-portlet-mode>
+	<custom-portlet-mode>
+		<description>second mode</description>
+		<portlet-mode>inactive</portlet-mode>
+	</custom-portlet-mode>
+	<custom-window-state>
+		<description>first state</description>
+		<description xml:lang="fr">premier etat</description>
+		<window-state>blur</window-state>
+	</custom-window-state>
+	<custom-window-state>
+		<description>second state</description>
+		<window-state>black and white</window-state>
+	</custom-window-state>
+	<user-attribute>
+		<description>first attribute</description>
+		<description xml:lang="fr">premier attribut</description>
+		<name>att1</name>
+	</user-attribute>
+	<user-attribute>
+		<description>second attribute</description>
+		<name>att2</name>
+	</user-attribute>
+
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>Portlet1</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>Portlet1</portlet-name>
+			<portlet-name>Portlet4</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>INTEGRAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+
+</portlet-app>

Added: modules/portlet/trunk/test/src/resources/metadata/general/portlet2-jsr286.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/general/portlet2-jsr286.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/general/portlet2-jsr286.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+	<portlet>
+		<description>default</description>
+		<description xml:lang="fr">defaut</description>
+		<portlet-name>Portlet1</portlet-name>
+		<display-name>display</display-name>
+		<display-name xml:lang="fr">affichage</display-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortlet
+		</portlet-class>
+		<init-param>
+			<description>first parameter</description>
+			<description xml:lang="fr">premier parametre</description>
+			<name>one</name>
+			<value>1</value>
+		</init-param>
+		<init-param>
+			<description>second parameter</description>
+			<description xml:lang="fr">deuxieme parametre</description>
+			<name>two</name>
+			<value>2</value>
+		</init-param>
+		<expiration-cache>0</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>EDIT</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supports>
+			<mime-type>text/wml</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>MyResourceBundle</resource-bundle>
+		<portlet-info>
+			<title>very long portlet title</title>
+			<short-title>short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+			<preferences-validator>MyValidator</preferences-validator>
+		</portlet-preferences>
+		<security-role-ref>
+			<description>role with no link</description>
+			<description xml:lang="fr">role sans link</description>
+			<role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+		</security-role-ref>
+		<security-role-ref>
+			<description>role with link</description>
+			<description xml:lang="fr">role avec link</description>
+			<role-name>ROLE_NAME_WITH_LINK</role-name>
+			<role-link>ROLE_LINK</role-link>
+		</security-role-ref>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet2</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet session</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet3</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestDispatcherPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet request dispatcher</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet4</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestRedirectPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet redirection</title>
+		</portlet-info>
+	</portlet>
+
+
+	<portlet>
+		<portlet-name>Portlet5</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet preferences</title>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+		</portlet-preferences>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet6</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestResourceBundlePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>Portlet6</resource-bundle>
+		<portlet-info>
+			<title>Very long portlet title</title>
+			<short-title>Short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet7</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test exception during the action request</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet8</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecurityPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet security</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet9</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestUserInformationPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test user information</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet10</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletModePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet modes</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet11</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test https URL</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet12</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestCachedContentPortlet
+		</portlet-class>
+		<expiration-cache>60</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cached content</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet13</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.CrossContextSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cross session context</title>
+		</portlet-info>
+	</portlet>
+
+
+	<custom-portlet-mode>
+		<description>first mode</description>
+		<description xml:lang="fr">premier mode</description>
+		<portlet-mode>configure</portlet-mode>
+	</custom-portlet-mode>
+	<custom-portlet-mode>
+		<description>second mode</description>
+		<portlet-mode>inactive</portlet-mode>
+	</custom-portlet-mode>
+	<custom-window-state>
+		<description>first state</description>
+		<description xml:lang="fr">premier etat</description>
+		<window-state>blur</window-state>
+	</custom-window-state>
+	<custom-window-state>
+		<description>second state</description>
+		<window-state>black and white</window-state>
+	</custom-window-state>
+	<user-attribute>
+		<description>first attribute</description>
+		<description xml:lang="fr">premier attribut</description>
+		<name>att1</name>
+	</user-attribute>
+	<user-attribute>
+		<description>second attribute</description>
+		<name>att2</name>
+	</user-attribute>
+
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>Portlet1</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>Portlet1</portlet-name>
+			<portlet-name>Portlet4</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>INTEGRAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+	<resource-bundle>MyResourceBundle</resource-bundle>
+	<default-namespace>foobar</default-namespace>
+	
+	<public-render-parameter id="param1">
+		<description>Public render parameter one</description>
+		<identifier>blub</identifier>
+		<name>param1</name>
+		<alias>Parameter1</alias>
+		<alias>Parameter2</alias>
+	</public-render-parameter>
+	
+	<container-runtime-option>
+		<name>foo</name>
+		<value>foobar</value>
+		<value>foobar2</value>
+	</container-runtime-option>
+	
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/general/portlet2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/general/portlet2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/general/portlet2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+	<portlet>
+		<description>default</description>
+		<description xml:lang="fr">defaut</description>
+		<portlet-name>Portlet1</portlet-name>
+		<display-name>display</display-name>
+		<display-name xml:lang="fr">affichage</display-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortlet
+		</portlet-class>
+		<init-param>
+			<description>first parameter</description>
+			<description xml:lang="fr">premier parametre</description>
+			<name>one</name>
+			<value>1</value>
+		</init-param>
+		<init-param>
+			<description>second parameter</description>
+			<description xml:lang="fr">deuxieme parametre</description>
+			<name>two</name>
+			<value>2</value>
+		</init-param>
+		<expiration-cache>0</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>EDIT</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supports>
+			<mime-type>text/wml</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>MyResourceBundle</resource-bundle>
+		<portlet-info>
+			<title>very long portlet title</title>
+			<short-title>short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+			<preferences-validator>MyValidator</preferences-validator>
+		</portlet-preferences>
+		<security-role-ref>
+			<description>role with no link</description>
+			<description xml:lang="fr">role sans link</description>
+			<role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+		</security-role-ref>
+		<security-role-ref>
+			<description>role with link</description>
+			<description xml:lang="fr">role avec link</description>
+			<role-name>ROLE_NAME_WITH_LINK</role-name>
+			<role-link>ROLE_LINK</role-link>
+		</security-role-ref>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet2</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet session</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet3</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestDispatcherPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet request dispatcher</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet4</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestRedirectPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet redirection</title>
+		</portlet-info>
+	</portlet>
+
+
+	<portlet>
+		<portlet-name>Portlet5</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet preferences</title>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+		</portlet-preferences>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet6</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestResourceBundlePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>Portlet6</resource-bundle>
+		<portlet-info>
+			<title>Very long portlet title</title>
+			<short-title>Short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet7</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test exception during the action request</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet8</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecurityPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet security</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet9</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestUserInformationPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test user information</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet10</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletModePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet modes</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet11</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test https URL</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet12</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestCachedContentPortlet
+		</portlet-class>
+		<expiration-cache>60</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cached content</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet13</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.CrossContextSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cross session context</title>
+		</portlet-info>
+	</portlet>
+
+
+	<custom-portlet-mode>
+		<description>first mode</description>
+		<description xml:lang="fr">premier mode</description>
+		<portlet-mode>configure</portlet-mode>
+	</custom-portlet-mode>
+	<custom-portlet-mode>
+		<description>second mode</description>
+		<portlet-mode>inactive</portlet-mode>
+	</custom-portlet-mode>
+	<custom-window-state>
+		<description>first state</description>
+		<description xml:lang="fr">premier etat</description>
+		<window-state>blur</window-state>
+	</custom-window-state>
+	<custom-window-state>
+		<description>second state</description>
+		<window-state>black and white</window-state>
+	</custom-window-state>
+	<user-attribute>
+		<description>first attribute</description>
+		<description xml:lang="fr">premier attribut</description>
+		<name>att1</name>
+	</user-attribute>
+	<user-attribute>
+		<description>second attribute</description>
+		<name>att2</name>
+	</user-attribute>
+
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>Portlet1</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>Portlet1</portlet-name>
+			<portlet-name>Portlet4</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>INTEGRAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1-simple.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1-simple.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1-simple.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,10 @@
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+             
+	<portlet>
+		<portlet-name>foo</portlet-name>
+	</portlet>
+	
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/portlet/portlet1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,266 @@
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+	<portlet id="fragmichnicht">
+		<description>default</description>
+		<description xml:lang="fr">defaut</description>
+		<portlet-name>Portlet1</portlet-name>
+		<display-name>display</display-name>
+		<display-name xml:lang="fr">affichage</display-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortlet
+		</portlet-class>
+		<init-param>
+			<description>first parameter</description>
+			<description xml:lang="fr">premier parametre</description>
+			<name>one</name>
+			<value>1</value>
+		</init-param>
+		<init-param>
+			<description>second parameter</description>
+			<description xml:lang="fr">deuxieme parametre</description>
+			<name>two</name>
+			<value>2</value>
+		</init-param>
+		<expiration-cache>0</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>EDIT</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supports>
+			<mime-type>text/wml</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>MyResourceBundle</resource-bundle>
+		<portlet-info>
+			<title>very long portlet title</title>
+			<short-title>short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+			<preferences-validator>MyValidator</preferences-validator>
+		</portlet-preferences>
+		<security-role-ref>
+			<description>role with no link</description>
+			<description xml:lang="fr">role sans link</description>
+			<role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+		</security-role-ref>
+		<security-role-ref>
+			<description>role with link</description>
+			<description xml:lang="fr">role avec link</description>
+			<role-name>ROLE_NAME_WITH_LINK</role-name>
+			<role-link>ROLE_LINK</role-link>
+		</security-role-ref>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet2</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet session</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet3</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestDispatcherPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet request dispatcher</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet4</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestRedirectPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet redirection</title>
+		</portlet-info>
+	</portlet>
+
+
+	<portlet>
+		<portlet-name>Portlet5</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet preferences</title>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+		</portlet-preferences>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet6</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestResourceBundlePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>Portlet6</resource-bundle>
+		<portlet-info>
+			<title>Very long portlet title</title>
+			<short-title>Short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet7</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test exception during the action request</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet8</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecurityPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet security</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet9</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestUserInformationPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test user information</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet10</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletModePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet modes</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet11</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test https URL</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet12</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestCachedContentPortlet
+		</portlet-class>
+		<expiration-cache>60</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cached content</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet13</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.CrossContextSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cross session context</title>
+		</portlet-info>
+	</portlet>
+</portlet-app>

Added: modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2-jsr286.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2-jsr286.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2-jsr286.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,118 @@
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+	<portlet id="fragmichnicht2">
+		<description>default</description>
+		<description xml:lang="fr">defaut</description>
+		<portlet-name>Portlet1</portlet-name>
+		<display-name>display</display-name>
+		<display-name xml:lang="fr">affichage</display-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortlet
+		</portlet-class>
+		<init-param>
+			<description>first parameter</description>
+			<description xml:lang="fr">premier parametre</description>
+			<name>one</name>
+			<value>1</value>
+		</init-param>
+		<init-param>
+			<description>second parameter</description>
+			<description xml:lang="fr">deuxieme parametre</description>
+			<name>two</name>
+			<value>2</value>
+		</init-param>
+		<expiration-cache>0</expiration-cache>
+		<cache-scope>PUBLIC</cache-scope>
+		<supports>
+			<mime-type>text/html</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>EDIT</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+			<window-state>MAXIMIZED</window-state>
+			<window-state>NORMAL</window-state>
+		</supports>
+		<supports id="foo">
+			<mime-type>text/wml</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+			<window-state>NORMAL</window-state>
+			<window-state>CUSTOM</window-state>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>MyResourceBundle</resource-bundle>
+		<portlet-info>
+			<title>very long portlet title</title>
+			<short-title>short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+			<preferences-validator>MyValidator</preferences-validator>
+		</portlet-preferences>
+		<security-role-ref>
+			<description>role with no link</description>
+			<description xml:lang="fr">role sans link</description>
+			<role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+		</security-role-ref>
+		<security-role-ref>
+			<description>role with link</description>
+			<description xml:lang="fr">role avec link</description>
+			<role-name>ROLE_NAME_WITH_LINK</role-name>
+			<role-link>ROLE_LINK</role-link>
+		</security-role-ref>
+		<supported-processing-event>
+			<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+		</supported-processing-event>
+		<supported-publishing-event>
+			<qname xmlns:x="http://example.com/testEvents">x:portletEvent</qname>
+		</supported-publishing-event>
+		
+		<supported-public-render-parameter>foo</supported-public-render-parameter>
+		<supported-public-render-parameter>bar</supported-public-render-parameter>
+		<supported-public-render-parameter>foo2</supported-public-render-parameter>
+		<supported-public-render-parameter>foo2bar</supported-public-render-parameter>
+		
+		<url-generation-listener>
+			org.jboss.portal.test.url.generation.listener
+		</url-generation-listener>
+		<url-generation-listener>
+			org.jboss.portal.test.url.generation.listener.foo
+		</url-generation-listener>
+		
+		<container-runtime-option>
+			<name>option1</name>
+			<value>value1</value>
+			<value>value2</value>
+		</container-runtime-option>
+		
+		<container-runtime-option>
+			<name>option2</name>
+			<value>value3</value>
+		</container-runtime-option>
+		
+	</portlet>
+
+
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/portlet/portlet2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,268 @@
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+	<portlet id="fragmichnicht2">
+		<description>default</description>
+		<description xml:lang="fr">defaut</description>
+		<portlet-name>Portlet1</portlet-name>
+		<display-name>display</display-name>
+		<display-name xml:lang="fr">affichage</display-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortlet
+		</portlet-class>
+		<init-param>
+			<description>first parameter</description>
+			<description xml:lang="fr">premier parametre</description>
+			<name>one</name>
+			<value>1</value>
+		</init-param>
+		<init-param>
+			<description>second parameter</description>
+			<description xml:lang="fr">deuxieme parametre</description>
+			<name>two</name>
+			<value>2</value>
+		</init-param>
+		<expiration-cache>0</expiration-cache>
+		<cache-scope>PUBLIC</cache-scope>
+		<supports>
+			<mime-type>text/html</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>EDIT</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supports id="foo">
+			<mime-type>text/wml</mime-type>
+			<portlet-mode>VIEW</portlet-mode>
+			<portlet-mode>HELP</portlet-mode>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>MyResourceBundle</resource-bundle>
+		<portlet-info>
+			<title>very long portlet title</title>
+			<short-title>short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+			<preferences-validator>MyValidator</preferences-validator>
+		</portlet-preferences>
+		<security-role-ref>
+			<description>role with no link</description>
+			<description xml:lang="fr">role sans link</description>
+			<role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+		</security-role-ref>
+		<security-role-ref>
+			<description>role with link</description>
+			<description xml:lang="fr">role avec link</description>
+			<role-name>ROLE_NAME_WITH_LINK</role-name>
+			<role-link>ROLE_LINK</role-link>
+		</security-role-ref>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet2</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet session</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet3</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestDispatcherPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet request dispatcher</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet4</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestRedirectPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet redirection</title>
+		</portlet-info>
+	</portlet>
+
+
+	<portlet>
+		<portlet-name>Portlet5</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>test the portlet preferences</title>
+		</portlet-info>
+		<portlet-preferences>
+			<preference>
+				<name>one</name>
+				<value>1</value>
+			</preference>
+			<preference>
+				<name>two</name>
+				<value>2</value>
+				<read-only>false</read-only>
+			</preference>
+			<preference>
+				<name>three</name>
+				<value>3</value>
+				<read-only>true</read-only>
+			</preference>
+			<preference>
+				<name>all</name>
+				<value>1</value>
+				<value>2</value>
+				<value>3</value>
+			</preference>
+		</portlet-preferences>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet6</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestResourceBundlePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<supported-locale>en</supported-locale>
+		<supported-locale>fr</supported-locale>
+		<resource-bundle>Portlet6</resource-bundle>
+		<portlet-info>
+			<title>Very long portlet title</title>
+			<short-title>Short portlet title</short-title>
+			<keywords>a,b,c,d,e,f</keywords>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet7</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test exception during the action request</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet8</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecurityPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet security</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet9</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestUserInformationPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test user information</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet10</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestPortletModePortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test portlet modes</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet11</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test https URL</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet12</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.TestCachedContentPortlet
+		</portlet-class>
+		<expiration-cache>60</expiration-cache>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>Test cached content</title>
+		</portlet-info>
+	</portlet>
+
+	<portlet>
+		<portlet-name>Portlet13</portlet-name>
+		<portlet-class>
+			org.jboss.portal.test.portlet.CrossContextSessionPortlet
+		</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+		</supports>
+		<portlet-info>
+			<title>p13</title>
+		</portlet-info>
+	</portlet>
+	
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/portlet-app_1_0.xsd
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/portlet-app_1_0.xsd	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/portlet-app_1_0.xsd	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,682 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema
+	targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+	xmlns="http://www.w3.org/2001/XMLSchema"
+	xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified" attributeFormDefault="unqualified"
+	version="1.0" xml:lang="en">
+	<annotation>
+		<documentation>
+			This is the XML Schema for the Portlet 1.0 deployment
+			descriptor.
+		</documentation>
+	</annotation>
+	<annotation>
+		<documentation>
+			The following conventions apply to all J2EE deployment
+			descriptor elements unless indicated otherwise. - In
+			elements that specify a pathname to a file within the same
+			JAR file, relative filenames (i.e., those not starting with
+			"/") are considered relative to the root of the JAR file's
+			namespace. Absolute filenames (i.e., those starting with
+			"/") also specify names in the root of the JAR file's
+			namespace. In general, relative names are preferred. The
+			exception is .war files where absolute names are preferred
+			for consistency with the Servlet API.
+		</documentation>
+	</annotation>
+	<!-- *********************************************************** -->
+	<import namespace="http://www.w3.org/XML/1998/namespace"
+		schemaLocation="http://www.w3.org/2001/xml.xsd" />
+	<element name="portlet-app" type="portlet:portlet-appType">
+		<annotation>
+			<documentation>
+				The portlet-app element is the root of the deployment
+				descriptor for a portlet application. This element has a
+				required attribute version to specify to which version
+				of the schema the deployment descriptor conforms.
+			</documentation>
+		</annotation>
+		<unique name="portlet-name-uniqueness">
+			<annotation>
+				<documentation>
+					The portlet element contains the name of a portlet.
+					This name must be unique within the portlet
+					application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:portlet" />
+			<field xpath="portlet:portlet-name" />
+		</unique>
+		<unique name="custom-portlet-mode-uniqueness">
+			<annotation>
+				<documentation>
+					The custom-portlet-mode element contains the
+					portlet-mode. This portlet mode must be unique
+					within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-portlet-mode" />
+			<field xpath="portlet:portlet-mode" />
+		</unique>
+		<unique name="custom-window-state-uniqueness">
+			<annotation>
+				<documentation>
+					The custom-window-state element contains the
+					window-state. This window state must be unique
+					within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-window-state" />
+			<field xpath="portlet:window-state" />
+		</unique>
+		<unique name="user-attribute-name-uniqueness">
+			<annotation>
+				<documentation>
+					The user-attribute element contains the name the
+					attribute. This name must be unique within the
+					portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:user-attribute" />
+			<field xpath="portlet:name" />
+		</unique>
+	</element>
+	<complexType name="portlet-appType">
+		<sequence>
+			<element name="portlet" type="portlet:portletType"
+				minOccurs="0" maxOccurs="unbounded">
+				<unique name="init-param-name-uniqueness">
+					<annotation>
+						<documentation>
+							The init-param element contains the name the
+							attribute. This name must be unique within
+							the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:init-param" />
+					<field xpath="portlet:name" />
+				</unique>
+				<unique name="supports-mime-type-uniqueness">
+					<annotation>
+						<documentation>
+							The supports element contains the supported
+							mime-type. This mime type must be unique
+							within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:supports" />
+					<field xpath="mime-type" />
+				</unique>
+				<unique name="preference-name-uniqueness">
+					<annotation>
+						<documentation>
+							The preference element contains the name the
+							preference. This name must be unique within
+							the portlet.
+						</documentation>
+					</annotation>
+					<selector
+						xpath="portlet:portlet-preferences/portlet:preference" />
+					<field xpath="portlet:name" />
+				</unique>
+				<unique name="security-role-ref-name-uniqueness">
+					<annotation>
+						<documentation>
+							The security-role-ref element contains the
+							role-name. This role name must be unique
+							within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:security-role-ref" />
+					<field xpath="portlet:role-name" />
+				</unique>
+			</element>
+			<element name="custom-portlet-mode"
+				type="portlet:custom-portlet-modeType" minOccurs="0"
+				maxOccurs="unbounded" />
+			<element name="custom-window-state"
+				type="portlet:custom-window-stateType" minOccurs="0"
+				maxOccurs="unbounded" />
+			<element name="user-attribute"
+				type="portlet:user-attributeType" minOccurs="0"
+				maxOccurs="unbounded" />
+			<element name="security-constraint"
+				type="portlet:security-constraintType" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="version" type="string" use="required" />
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="custom-portlet-modeType">
+		<annotation>
+			<documentation>
+				A custom portlet mode that one or more portlets in this
+				portlet application supports. Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="portlet-mode"
+				type="portlet:portlet-modeType" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="custom-window-stateType">
+		<annotation>
+			<documentation>
+				A custom window state that one or more portlets in this
+				portlet application supports. Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="window-state"
+				type="portlet:window-stateType" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="expiration-cacheType">
+		<annotation>
+			<documentation>
+				Expriation-cache defines expiration-based caching for
+				this portlet. The parameter indicates the time in
+				seconds after which the portlet output expires. -1
+				indicates that the output never expires. Used in:
+				portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="int" />
+		</simpleContent>
+	</complexType>
+	<complexType name="init-paramType">
+		<annotation>
+			<documentation>
+				The init-param element contains a name/value pair as an
+				initialization param of the portlet Used in:portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="name" type="portlet:nameType" />
+			<element name="value" type="portlet:valueType" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="keywordsType">
+		<annotation>
+			<documentation>
+				Locale specific keywords associated with this portlet.
+				The kewords are separated by commas. Used in:
+				portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="mime-typeType">
+		<annotation>
+			<documentation>
+				MIME type name, e.g. "text/html". The MIME type may also
+				contain the wildcard character '*', like "text/*" or
+				"*/*". Used in: supports
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="nameType">
+		<annotation>
+			<documentation>
+				The name element contains the name of a parameter. Used
+				in: init-param, ...
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="portletType">
+		<annotation>
+			<documentation>
+				The portlet element contains the declarative data of a
+				portlet. Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="portlet-name"
+				type="portlet:portlet-nameType" />
+			<element name="display-name" type="portlet:display-nameType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="portlet-class"
+				type="portlet:portlet-classType" />
+			<element name="init-param" type="portlet:init-paramType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="expiration-cache"
+				type="portlet:expiration-cacheType" minOccurs="0" />
+			<element name="supports" type="portlet:supportsType"
+				maxOccurs="unbounded" />
+			<element name="supported-locale"
+				type="portlet:supported-localeType" minOccurs="0"
+				maxOccurs="unbounded" />
+			<choice>
+				<sequence>
+					<element name="resource-bundle"
+						type="portlet:resource-bundleType" />
+					<element name="portlet-info"
+						type="portlet:portlet-infoType" minOccurs="0" />
+				</sequence>
+				<element name="portlet-info"
+					type="portlet:portlet-infoType" />
+			</choice>
+			<element name="portlet-preferences"
+				type="portlet:portlet-preferencesType" minOccurs="0" />
+			<element name="security-role-ref"
+				type="portlet:security-role-refType" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<simpleType name="portlet-classType">
+		<annotation>
+			<documentation>
+				The portlet-class element contains the fully qualified
+				class name of the portlet. Used in: portlet
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType" />
+	</simpleType>
+	<complexType name="portlet-collectionType">
+		<annotation>
+			<documentation>
+				The portlet-collectionType is used to identify a subset
+				of portlets within a portlet application to which a
+				security constraint applies. Used in:
+				security-constraint
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="portlet-name" type="portlet:portlet-nameType"
+				maxOccurs="unbounded" />
+		</sequence>
+	</complexType>
+	<complexType name="portlet-infoType">
+		<sequence>
+			<element name="title" type="portlet:titleType" />
+			<element name="short-title" type="portlet:short-titleType"
+				minOccurs="0" />
+			<element name="keywords" type="portlet:keywordsType"
+				minOccurs="0" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="portlet-modeType">
+		<annotation>
+			<documentation>
+				Portlet modes. The specification pre-defines the
+				following values as valid portlet mode constants:
+				"edit", "help", "view". Portlet mode names are not case
+				sensitive. Used in: custom-portlet-mode, supports
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-nameType">
+		<annotation>
+			<documentation>
+				The portlet-name element contains the canonical name of
+				the portlet. Each portlet name is unique within the
+				portlet application. Used in: portlet, portlet-mapping
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-preferencesType">
+		<annotation>
+			<documentation>
+				Portlet persistent preference store. Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="preference" type="portlet:preferenceType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="preferences-validator"
+				type="portlet:preferences-validatorType" minOccurs="0" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="preferenceType">
+		<annotation>
+			<documentation>
+				Persistent preference values that may be used for
+				customization and personalization by the portlet. Used
+				in: portlet-preferences
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="name" type="portlet:nameType" />
+			<element name="value" type="portlet:valueType" minOccurs="0"
+				maxOccurs="unbounded" />
+			<element name="read-only" type="portlet:read-onlyType"
+				minOccurs="0" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<simpleType name="preferences-validatorType">
+		<annotation>
+			<documentation>
+				The class specified under preferences-validator
+				implements the PreferencesValidator interface to
+				validate the preferences settings. Used in:
+				portlet-preferences
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType" />
+	</simpleType>
+	<simpleType name="read-onlyType">
+		<annotation>
+			<documentation>
+				read-only indicates that a setting cannot be changed in
+				any of the standard portlet modes ("view","edit" or
+				"help"). Per default all preferences are modifiable.
+				Valid values are: - true for read-only - false for
+				modifiable Used in: preferences
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="true" />
+			<enumeration value="false" />
+		</restriction>
+	</simpleType>
+	<complexType name="resource-bundleType">
+		<annotation>
+			<documentation>
+				Filename of the resource bundle containing the language
+				specific portlet informations in different languages.
+				Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="role-linkType">
+		<annotation>
+			<documentation>
+				The role-link element is a reference to a defined
+				security role. The role-link element must contain the
+				name of one of the security roles defined in the
+				security-role elements. Used in: security-role-ref
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="security-constraintType">
+		<annotation>
+			<documentation>
+				The security-constraintType is used to associate
+				intended security constraints with one or more portlets.
+				Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="display-name" type="portlet:display-nameType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="portlet-collection"
+				type="portlet:portlet-collectionType" />
+			<element name="user-data-constraint"
+				type="portlet:user-data-constraintType" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="security-role-refType">
+		<annotation>
+			<documentation>
+				The security-role-ref element contains the declaration
+				of a security role reference in the code of the web
+				application. The declaration consists of an optional
+				description, the security role name used in the code,
+				and an optional link to a security role. If the security
+				role is not specified, the Deployer must choose an
+				appropriate security role. The value of the role name
+				element must be the String used as the parameter to the
+				EJBContext.isCallerInRole(String roleName) method or the
+				HttpServletRequest.isUserInRole(String role) method.
+				Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="role-name" type="portlet:role-nameType" />
+			<element name="role-link" type="portlet:role-linkType"
+				minOccurs="0" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="short-titleType">
+		<annotation>
+			<documentation>
+				Locale specific short version of the static title. Used
+				in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="supportsType">
+		<annotation>
+			<documentation>
+				Supports indicates the portlet modes a portlet supports
+				for a specific content type. All portlets must support
+				the view mode. Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="mime-type" type="portlet:mime-typeType" />
+			<element name="portlet-mode" type="portlet:portlet-modeType"
+				minOccurs="0" maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="supported-localeType">
+		<annotation>
+			<documentation>
+				Indicated the locales the portlet supports. Used in:
+				portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="titleType">
+		<annotation>
+			<documentation>
+				Locale specific static title for this portlet. Used in:
+				portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<simpleType name="transport-guaranteeType">
+		<annotation>
+			<documentation>
+				The transport-guaranteeType specifies that the
+				communication between client and portlet should be NONE,
+				INTEGRAL, or CONFIDENTIAL. NONE means that the portlet
+				does not require any transport guarantees. A value of
+				INTEGRAL means that the portlet requires that the data
+				sent between the client and portlet be sent in such a
+				way that it can't be changed in transit. CONFIDENTIAL
+				means that the portlet requires that the data be
+				transmitted in a fashion that prevents other entities
+				from observing the contents of the transmission. In most
+				cases, the presence of the INTEGRAL or CONFIDENTIAL flag
+				will indicate that the use of SSL is required. Used in:
+				user-data-constraint
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="NONE" />
+			<enumeration value="INTEGRAL" />
+			<enumeration value="CONFIDENTIAL" />
+		</restriction>
+	</simpleType>
+	<complexType name="user-attributeType">
+		<annotation>
+			<documentation>
+				User attribute defines a user specific attribute that
+				the portlet application needs. The portlet within this
+				application can access this attribute via the request
+				parameter USER_INFO map. Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="name" type="portlet:nameType" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="user-data-constraintType">
+		<annotation>
+			<documentation>
+				The user-data-constraintType is used to indicate how
+				data communicated between the client and portlet should
+				be protected. Used in: security-constraint
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType"
+				minOccurs="0" maxOccurs="unbounded" />
+			<element name="transport-guarantee"
+				type="portlet:transport-guaranteeType" />
+		</sequence>
+		<attribute name="id" type="string" use="optional" />
+	</complexType>
+	<complexType name="valueType">
+		<annotation>
+			<documentation>
+				The value element contains the value of a parameter.
+				Used in: init-param
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<complexType name="window-stateType">
+		<annotation>
+			<documentation>
+				Portlet window state. Window state names are not case
+				sensitive. Used in: custom-window-state
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string" />
+		</simpleContent>
+	</complexType>
+	<!--- everything below is copied from j2ee_1_4.xsd -->
+	<complexType name="descriptionType">
+		<annotation>
+			<documentation>
+				The description element is used to provide text
+				describing the parent element. The description element
+				should include any information that the portlet
+				application war file producer wants to provide to the
+				consumer of the portlet application war file (i.e., to
+				the Deployer). Typically, the tools used by the portlet
+				application war file consumer will display the
+				description when processing the parent element that
+				contains the description. It has an optional attribute
+				xml:lang to indicate which language is used in the
+				description according to RFC 1766
+				(http://www.ietf.org/rfc/rfc1766.txt). The default value
+				of this attribute is English(“en”). Used in: init-param,
+				portlet, portlet-app, security-role
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string">
+				<attribute ref="xml:lang" />
+			</extension>
+		</simpleContent>
+	</complexType>
+	<complexType name="display-nameType">
+		<annotation>
+			<documentation>
+				The display-name type contains a short name that is
+				intended to be displayed by tools. It is used by
+				display-name elements. The display name need not be
+				unique. Example: ...
+				<display-name xml:lang="en">
+					Employee Self Service
+				</display-name>
+
+				It has an optional attribute xml:lang to indicate which
+				language is used in the description according to RFC
+				1766 (http://www.ietf.org/rfc/rfc1766.txt). The default
+				value of this attribute is English(“en”).
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string">
+				<attribute ref="xml:lang" />
+			</extension>
+		</simpleContent>
+	</complexType>
+	<simpleType name="fully-qualified-classType">
+		<annotation>
+			<documentation>
+				The elements that use this type designate the name of a
+				Java class or interface.
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string" />
+	</simpleType>
+	<simpleType name="role-nameType">
+		<annotation>
+			<documentation>
+				The role-nameType designates the name of a security
+				role.
+
+				The name must conform to the lexical rules for an
+				NMTOKEN.
+			</documentation>
+		</annotation>
+		<restriction base="NMTOKEN" />
+	</simpleType>
+	<simpleType name="string">
+		<annotation>
+			<documentation>
+				This is a special string datatype that is defined by
+				J2EE as a base type for defining collapsed strings. When
+				schemas require trailing/leading space elimination as
+				well as collapsing the existing whitespace, this base
+				type may be used.
+			</documentation>
+		</annotation>
+		<restriction base="string">
+			<whiteSpace value="collapse" />
+		</restriction>
+	</simpleType>
+</schema>

Added: modules/portlet/trunk/test/src/resources/metadata/portlet-app_2_0.xsd
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/portlet-app_2_0.xsd	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/portlet-app_2_0.xsd	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,836 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+		xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+		xmlns:xs="http://www.w3.org/2001/XMLSchema"
+		targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+		elementFormDefault="qualified"
+		attributeFormDefault="unqualified"
+		version="2.0"
+		xml:lang="en">
+		
+	<annotation>
+		<documentation>
+		This is the XML Schema for the Portlet 2.0 deployment descriptor.
+		</documentation>
+	</annotation>
+	<annotation>
+		<documentation>
+		The following conventions apply to all J2EE
+		deployment descriptor elements unless indicated otherwise.
+		- In elements that specify a pathname to a file within the
+		  same JAR file, relative filenames (i.e., those not
+		  starting with "/") are considered relative to the root of
+		  the JAR file's namespace.  Absolute filenames (i.e., those
+		  starting with "/") also specify names in the root of the
+		  JAR file's namespace.  In general, relative names are
+		  preferred.  The exception is .war files where absolute
+		  names are preferred for consistency with the Servlet API.
+		</documentation>
+	</annotation>
+	<!-- *********************************************************** -->
+	<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+	<element name="portlet-app" type="portlet:portlet-appType">
+		<annotation>
+			<documentation>
+			The portlet-app element is the root of the deployment descriptor
+			for a portlet application. This element has a required attribute version
+			to specify to which version of the schema the deployment descriptor
+			conforms. In order to be a valid JSR 286 portlet application the version
+			must have the value "2.0".
+			</documentation>
+		</annotation>
+		<unique name="portlet-name-uniqueness">
+			<annotation>
+				<documentation>
+				The portlet element contains the name of a portlet.
+				This name must be unique within the portlet application.
+				 </documentation>
+			</annotation>
+			<selector xpath="portlet:portlet"/>
+			<field xpath="portlet:portlet-name"/>
+		</unique>
+		<unique name="custom-portlet-mode-uniqueness">
+			<annotation>
+				<documentation>
+				The custom-portlet-mode element contains the portlet-mode.
+				This portlet mode must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-portlet-mode"/>
+			<field xpath="portlet:portlet-mode"/>
+		</unique>
+		<unique name="custom-window-state-uniqueness">
+			<annotation>
+				<documentation>
+				The custom-window-state element contains the window-state.
+				This window state must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:custom-window-state"/>
+			<field xpath="portlet:window-state"/>
+		</unique>
+		<unique name="user-attribute-name-uniqueness">
+			<annotation>
+				<documentation>
+				The user-attribute element contains the name the attribute.
+				This name must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:user-attribute"/>
+			<field xpath="portlet:name"/>
+		</unique>
+		<unique name="filter-name-uniqueness">
+			<annotation>
+				<documentation>
+				The filter element contains the name of a filter.
+				The name must be unique within the portlet application.
+				</documentation>
+			</annotation>
+			<selector xpath="portlet:filter"/>
+			<field xpath="portlet:filter-name"/>
+		</unique>
+	</element>
+	<complexType name="portlet-appType">
+		<sequence>
+			<element name="portlet" type="portlet:portletType" minOccurs="0" maxOccurs="unbounded">
+				<unique name="init-param-name-uniqueness">
+					<annotation>
+						<documentation>
+						The init-param element contains the name the attribute.
+						This name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:init-param"/>
+					<field xpath="portlet:name"/>
+				</unique>
+				<unique name="supports-mime-type-uniqueness">
+					<annotation>
+						<documentation>
+						The supports element contains the supported mime-type.
+						This mime type must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:supports"/>
+					<field xpath="mime-type"/>
+				</unique>
+				<unique name="preference-name-uniqueness">
+					<annotation>
+						<documentation>
+						The preference element contains the name the preference.
+						This name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:portlet-preferences/portlet:preference"/>
+					<field xpath="portlet:name"/>
+				</unique>
+				<unique name="security-role-ref-name-uniqueness">
+					<annotation>
+						<documentation>
+						The security-role-ref element contains the role-name.
+						This role name must be unique within the portlet.
+						</documentation>
+					</annotation>
+					<selector xpath="portlet:security-role-ref"/>
+					<field xpath="portlet:role-name"/>
+				</unique>
+			</element>
+			<element name="custom-portlet-mode" type="portlet:custom-portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="custom-window-state" type="portlet:custom-window-stateType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="user-attribute" type="portlet:user-attributeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="security-constraint" type="portlet:security-constraintType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="resource-bundle" type="portlet:resource-bundleType" minOccurs="0"/>
+			<element name="filter" type="portlet:filterType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="filter-mapping" type="portlet:filter-mappingType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="default-namespace" type="xs:anyURI" minOccurs="0"/>
+			<element name="event-definition" type="portlet:event-definitionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="public-render-parameter" type="portlet:public-render-parameterType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="container-runtime-option" type="portlet:container-runtime-optionType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="version" type="string" use="required"/>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="cache-scopeType">
+		<annotation>
+			<documentation>
+			Caching scope, allowed values are "private" indicating that the content should not be shared
+			across users and "public" indicating that the content may be shared across users.
+			The default value if not present is "private".
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="custom-portlet-modeType">
+		<annotation>
+			<documentation>
+			A custom portlet mode that one or more portlets in 
+			this portlet application supports.
+			If the portal does not need to provide some management functionality
+			for this portlet mode, the portal-managed element needs to be set
+			to "false", otherwise to "true". Default is "true".
+			If the portlet provides a decoration-name for this portlet mode the portal is
+			encouraged to use the provided name as key under which in the portlet
+			resource bundle the localized value of the decoration name is available.
+			If the portlet does not provide a resource bundle the portal should use
+			the name provided with the decoration-name tag.
+			decorations.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-mode" type="portlet:portlet-modeType"/>
+			<element name="portal-managed" type="portlet:portal-managedType" minOccurs="0"/>
+			<element name="decoration-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="custom-window-stateType">
+		<annotation>
+			<documentation>
+			A custom window state that one or more portlets in this 
+			portlet application supports.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="window-state" type="portlet:window-stateType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="expiration-cacheType">
+		<annotation>
+			<documentation>
+			Expriation-time defines the time in seconds after which the portlet output expires. 
+			-1 indicates that the output never expires.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="int"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="init-paramType">
+		<annotation>
+			<documentation>
+			The init-param element contains a name/value pair as an 
+			initialization param of the portlet
+			Used in:portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="keywordsType">
+		<annotation>
+			<documentation>
+			Locale specific keywords associated with this portlet.
+			The kewords are separated by commas.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="mime-typeType">
+		<annotation>
+			<documentation>
+			MIME type name, e.g. "text/html".
+			The MIME type may also contain the wildcard
+			character '*', like "text/*" or "*/*".
+			Used in: supports
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="nameType">
+		<annotation>
+			<documentation>
+			The name element contains the name of a parameter. 
+			Used in: init-param, ...
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portletType">
+		<annotation>
+			<documentation>
+			The portlet element contains the declarative data of a portlet. 
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-name" type="portlet:portlet-nameType"/>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-class" type="portlet:portlet-classType"/>
+			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="expiration-cache" type="portlet:expiration-cacheType" minOccurs="0"/>
+			<element name="cache-scope" type="portlet:cache-scopeType" minOccurs="0"/>
+			<element name="supports" type="portlet:supportsType" maxOccurs="unbounded"/>
+			<element name="supported-locale" type="portlet:supported-localeType" minOccurs="0" maxOccurs="unbounded"/>
+			<choice>
+				<sequence>
+					<element name="resource-bundle" type="portlet:resource-bundleType"/>
+					<element name="portlet-info" type="portlet:portlet-infoType" minOccurs="0"/>
+				</sequence>
+				<element name="portlet-info" type="portlet:portlet-infoType"/>
+			</choice>
+			<element name="portlet-preferences" type="portlet:portlet-preferencesType" minOccurs="0"/>
+			<element name="security-role-ref" type="portlet:security-role-refType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="supported-processing-event" type="portlet:event-definition-referenceType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="supported-publishing-event" type="portlet:event-definition-referenceType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="supported-public-render-parameter" type="string" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="url-generation-listener" type="portlet:fully-qualified-classType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="container-runtime-option" type="portlet:container-runtime-optionType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<simpleType name="portlet-classType">
+		<annotation>
+			<documentation>
+			 The portlet-class element contains the fully
+			 qualified class name of the portlet.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType"/>
+	</simpleType>
+	<complexType name="container-runtime-optionType">
+		<annotation>
+			<documentation>
+			 The container-runtime-option element contains settings
+			 for the portlet container that the portlet expects to be honored
+			 at runtime. These settings may re-define default portlet container
+			 behavior, like the javax.portlet.escapeXml setting that disables
+			 XML encoding of URLs produced by the portlet tag library as
+			 default.
+			 Names with the javax.portlet prefix are reserved for the Java
+			 Portlet Specification.
+			Used in: portlet-app, portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="filter-mappingType">
+		<annotation>
+			<documentation>
+			Declaration of the filter mappings in this portlet
+			application is done by using filter-mappingType.
+			The container uses the filter-mapping
+			declarations to decide which filters to apply to a request,
+			and in what order. To determine which filters to
+			apply it matches filter-mapping declarations on the
+			portlet-name and the lifecyle phase defined in the
+			filter element. The order in which filters are invoked 
+			is the order in which filter-mapping declarations 
+			that match appear in the list of filter-mapping elements.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="filter-name" type="portlet:filter-nameType"/>
+			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="filterType">
+		<annotation>
+			<documentation>
+				The filter element specifies a filter that can transform the 
+				content of portlet requests and portlet responses. 
+				Filters can access the initialization parameters declared in 
+				the deployment descriptor at runtime via the FilterConfig 
+				interface.
+				A filter can be restricted to one or more lifecycle phases
+				of the portlet. Valid entries for lifecycle are:
+				ACTION_PHASE, EVENT_PHASE, RENDER_PHASE,
+				RESOURCE_PHASE
+				Used in: portlet-app
+				</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="filter-name" type="portlet:filter-nameType"/>
+			<element name="filter-class" type="portlet:fully-qualified-classType"/>
+			<element name="lifecycle" type="string" maxOccurs="unbounded"/>
+			<element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="portlet-collectionType">
+		<annotation>
+			<documentation>
+			The portlet-collectionType is used to identify a subset
+			of portlets within a portlet application to which a 
+			security constraint applies.
+			Used in: security-constraint
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>
+		</sequence>
+	</complexType>
+	<complexType name="event-definitionType">
+		<annotation>
+			<documentation>
+			The event-definitionType is used to declare events the portlet can either
+			receive or emit.
+			The name must be unique and must be the one the 
+			portlet is using in its code for referencing this event.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<choice>
+				<element name="qname" type="xs:QName"/>
+				<element name="name" type="string"/>
+			</choice>
+			<element name="alias" type="xs:QName" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="value-type" type="portlet:fully-qualified-classType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="event-definition-referenceType">
+		<annotation>
+			<documentation>
+			The event-definition-referenceType is used to refernece events 
+			declared with the event-definition element on application level.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<choice>
+			<element name="qname" type="xs:QName"/>
+			<element name="name" type="string"/>
+		</choice>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="portlet-infoType">
+		<sequence>
+			<element name="title" type="portlet:titleType" minOccurs="0"/>
+			<element name="short-title" type="portlet:short-titleType" minOccurs="0"/>
+			<element name="keywords" type="portlet:keywordsType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<simpleType name="portal-managedType">
+		<annotation>
+			<documentation>
+			portal-managed indicates if a custom portlet mode
+			needs to be managed by the portal or not.
+			Per default all custom portlet modes are portal managed.
+			Valid values are: 
+			- true for portal-managed
+			- false for not portal managed
+			Used in: custom-portlet-modes
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="true"/>
+			<enumeration value="false"/>
+		</restriction>
+	</simpleType>
+	<complexType name="portlet-modeType">
+		<annotation>
+			<documentation>
+			Portlet modes. The specification pre-defines the following values 
+			as valid portlet mode constants: 
+			"edit", "help", "view".
+			Portlet mode names are not case sensitive.
+			Used in: custom-portlet-mode, supports
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-nameType">
+		<annotation>
+			<documentation>
+			The portlet-name element contains the canonical name of the 
+			portlet. Each portlet name is unique within the portlet 
+			application.
+			Used in: portlet, filter-mapping
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="portlet-preferencesType">
+		<annotation>
+			<documentation>
+			Portlet persistent preference store.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="preference" type="portlet:preferenceType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="preferences-validator" type="portlet:preferences-validatorType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="preferenceType">
+		<annotation>
+			<documentation>
+			Persistent preference values that may be used for customization 
+			and personalization by the portlet.
+			Used in: portlet-preferences
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="name" type="portlet:nameType"/>
+			<element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="read-only" type="portlet:read-onlyType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<simpleType name="preferences-validatorType">
+		<annotation>
+			<documentation>
+			The class specified under preferences-validator implements
+			the PreferencesValidator interface to validate the 
+			preferences settings.
+			Used in: portlet-preferences
+			</documentation>
+		</annotation>
+		<restriction base="portlet:fully-qualified-classType"/>
+	</simpleType>
+	<simpleType name="read-onlyType">
+		<annotation>
+			<documentation>
+			read-only indicates that a setting cannot
+			be changed in any of the standard portlet modes 
+			("view","edit" or "help").
+			Per default all preferences are modifiable.
+			Valid values are: 
+			- true for read-only
+			- false for modifiable
+			Used in: preferences
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="true"/>
+			<enumeration value="false"/>
+		</restriction>
+	</simpleType>
+	<complexType name="resource-bundleType">
+		<annotation>
+			<documentation>
+			Name of the resource bundle containing the language specific 
+			portlet informations in different languages (Filename without
+			the language specific part (e.g. _en) and the ending (.properties).
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="role-linkType">
+		<annotation>
+			<documentation>
+			The role-link element is a reference to a defined security role. 
+			The role-link element must contain the name of one of the 
+			security roles defined in the security-role elements.
+			Used in: security-role-ref
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="security-constraintType">
+		<annotation>
+			<documentation>
+			The security-constraintType is used to associate
+			intended security constraints with one or more portlets.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="portlet-collection" type="portlet:portlet-collectionType"/>
+			<element name="user-data-constraint" type="portlet:user-data-constraintType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="security-role-refType">
+		<annotation>
+			<documentation>
+			The security-role-ref element contains the declaration of a 
+			security role reference in the code of the web application. The 
+			declaration consists of an optional description, the security 
+			role name used in the code, and an optional link to a security 
+			role. If the security role is not specified, the Deployer must 
+			choose an appropriate security role.
+			The value of the role name element must be the String used 
+			as the parameter to the 
+			EJBContext.isCallerInRole(String roleName) method
+			or the HttpServletRequest.isUserInRole(String role) method.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="role-name" type="portlet:role-nameType"/>
+			<element name="role-link" type="portlet:role-linkType" minOccurs="0"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="public-render-parameterType">
+		<annotation>
+			<documentation>
+			The public-render-parameters defines a render parameter that is allowed to be public
+			and thus be shared with other portlets.
+			The identifier must be used for referencing this public render parameter in the portlet code.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="identifier" type="string"/>
+			<choice>
+				<element name="qname" type="xs:QName"/>
+				<element name="name" type="string"/>
+			</choice>
+			<element name="alias" type="xs:QName" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="short-titleType">
+		<annotation>
+			<documentation>
+			Locale specific short version of the static title.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="supportsType">
+		<annotation>
+			<documentation>
+			Supports indicates the portlet modes a 
+			portlet supports for a specific content type. All portlets must 
+			support the view mode. 
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="mime-type" type="portlet:mime-typeType"/>
+			<element name="portlet-mode" type="portlet:portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="window-state" type="portlet:window-stateType" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="supported-localeType">
+		<annotation>
+			<documentation>
+			Indicated the locales the portlet supports.
+			Used in: portlet
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="titleType">
+		<annotation>
+			<documentation>
+			Locale specific static title for this portlet.
+			Used in: portlet-info
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<simpleType name="transport-guaranteeType">
+		<annotation>
+			<documentation>
+			The transport-guaranteeType specifies that 
+			the communication between client and portlet should 
+			be NONE, INTEGRAL, or CONFIDENTIAL. 
+			NONE means that the portlet does not
+			require any transport guarantees. A value of 
+			INTEGRAL means that the portlet requires that the 
+			data sent between the client and portlet be sent in 
+			such a way that it can't be changed in transit. 
+			CONFIDENTIAL means that the portlet requires 
+			that the data be transmitted in a fashion that
+			prevents other entities from observing the contents 
+			of the transmission. 
+			In most cases, the presence of the INTEGRAL or
+			CONFIDENTIAL flag will indicate that the use 
+			of SSL is required.
+ 			Used in: user-data-constraint
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string">
+			<enumeration value="NONE"/>
+			<enumeration value="INTEGRAL"/>
+			<enumeration value="CONFIDENTIAL"/>
+		</restriction>
+	</simpleType>
+	<complexType name="user-attributeType">
+		<annotation>
+			<documentation>
+			User attribute defines a user specific attribute that the
+			portlet application needs. The portlet within this application 
+			can access this attribute via the request parameter USER_INFO
+			map.
+			Used in: portlet-app
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="name" type="portlet:nameType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="user-data-constraintType">
+		<annotation>
+			<documentation>
+			The user-data-constraintType is used to indicate how
+			data communicated between the client and portlet should be
+			protected.
+			Used in: security-constraint
+			</documentation>
+		</annotation>
+		<sequence>
+			<element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+			<element name="transport-guarantee" type="portlet:transport-guaranteeType"/>
+		</sequence>
+		<attribute name="id" type="string" use="optional"/>
+	</complexType>
+	<complexType name="valueType">
+		<annotation>
+			<documentation>
+			The value element contains the value of a parameter.
+			Used in: init-param
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<complexType name="window-stateType">
+		<annotation>
+			<documentation>
+			Portlet window state. Window state names are not case sensitive.
+			Used in: custom-window-state
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string"/>
+		</simpleContent>
+	</complexType>
+	<!--- everything below is copied from j2ee_1_4.xsd -->
+	<complexType name="descriptionType">
+		<annotation>
+			<documentation>
+			The description element is used to provide text describing the 
+			parent element. The description element should include any 
+			information that the portlet application war file producer wants
+			to provide to the consumer of the portlet application war file 
+			(i.e., to the Deployer). Typically, the tools used by the 
+			portlet application war file consumer will display the 
+			description when processing the parent element that contains the 
+			description. It has an optional attribute xml:lang to indicate 
+			which language is used in the description according to 
+			RFC 1766 (http://www.ietf.org/rfc/rfc1766.txt). The default
+			value of this attribute is English(“en”).
+			Used in: init-param, portlet, portlet-app, security-role
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="string">
+				<attribute ref="xml:lang"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<complexType name="display-nameType">
+		<annotation>
+			<documentation>
+			The display-name type contains a short name that is intended
+			to be displayed by tools. It is used by display-name
+			elements.  The display name need not be unique.
+			Example:
+				...
+  			<display-name xml:lang="en">Employee Self Service</display-name>
+
+			It has an optional attribute xml:lang to indicate 
+			which language is used in the description according to 
+			RFC 1766 (http://www.ietf.org/rfc/rfc1766.txt). The default
+			value of this attribute is English(“en”).
+			</documentation>
+		</annotation>
+		<simpleContent>
+			<extension base="portlet:string">
+				<attribute ref="xml:lang"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+	<simpleType name="fully-qualified-classType">
+		<annotation>
+			<documentation>
+			The elements that use this type designate the name of a
+			Java class or interface.
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string"/>
+	</simpleType>
+	<simpleType name="role-nameType">
+		<annotation>
+			<documentation>
+			The role-nameType designates the name of a security role.
+
+			The name must conform to the lexical rules for an NMTOKEN.
+			</documentation>
+		</annotation>
+		<restriction base="NMTOKEN"/>
+	</simpleType>
+	<simpleType name="string">
+		<annotation>
+			<documentation>
+			This is a special string datatype that is defined by J2EE 
+			as a base type for defining collapsed strings. When 
+			schemas require trailing/leading space elimination as 
+			well as collapsing the existing whitespace, this base 
+			type may be used.
+			</documentation>
+		</annotation>
+		<restriction base="string">
+			<whiteSpace value="collapse"/>
+		</restriction>
+	</simpleType>
+	<simpleType name="filter-nameType">
+		<annotation>
+			<documentation>
+			The logical name of the filter is declare
+			by using filter-nameType. This name is used to map the
+			filter.  Each filter name is unique within the portlet
+			application.
+			Used in: filter, filter-mapping
+			</documentation>
+		</annotation>
+		<restriction base="portlet:string"/>
+	</simpleType>
+</schema>

Added: modules/portlet/trunk/test/src/resources/metadata/renderParameter/portlet2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/renderParameter/portlet2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/renderParameter/portlet2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,20 @@
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+
+	<public-render-parameter>
+		<description>render parameter foo</description>
+		<identifier>blah</identifier>
+		<name>renderParameter1</name>
+		<alias>fooo</alias>
+		<alias>rP1</alias>
+	</public-render-parameter>
+
+	<public-render-parameter>
+		<identifier>blub</identifier>
+		<qname xmlns:x="http://someurl.com">x:foo</qname>
+		<alias xmlns:s="http://someurl.alias.com">s:foo</alias>
+	</public-render-parameter>
+
+</portlet-app>

Added: modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+     
+     <portlet>
+     	<portlet-name>foo</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     </portlet>
+     
+     <portlet>
+     	<portlet-name>foobar</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     </portlet>
+     
+	<security-constraint id="foo">
+		<display-name>test</display-name>
+		<display-name xml:lang="de">Test</display-name>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+			<portlet-name>foobar</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<description>fooConstraint</description>
+			<description xml:lang="de">FooConstraint</description>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/security/portlet1-fail2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+     
+     <portlet>
+     	<portlet-name>foo</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     </portlet>
+     
+	<security-constraint id="foo">
+		<display-name>test</display-name>
+		<display-name xml:lang="de">Test</display-name>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+			<portlet-name>foobar</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<description>fooConstraint</description>
+			<description xml:lang="de">FooConstraint</description>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/security/portlet1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/security/portlet1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/security/portlet1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+     
+     <portlet>
+     	<portlet-name>foo</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     	<portlet-info>
+     		<title>Foo</title>
+     	</portlet-info>
+     </portlet>
+     
+     <portlet>
+     	<portlet-name>foobar</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     	<portlet-info>
+     		<title>FooBar</title>
+     	</portlet-info>
+     </portlet>
+     
+	<security-constraint id="foo">
+		<display-name>test</display-name>
+		<display-name xml:lang="de">Test</display-name>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+			<portlet-name>foobar</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<description>fooConstraint</description>
+			<description xml:lang="de">FooConstraint</description>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>INTEGRAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+             
+     <portlet>
+     	<portlet-name>foo</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     </portlet>
+     
+     <portlet>
+     	<portlet-name>foobar</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     </portlet>
+     
+	<security-constraint id="foo">
+		<display-name>test</display-name>
+		<display-name xml:lang="de">Test</display-name>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+			<portlet-name>foobar</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<description>fooConstraint</description>
+			<description xml:lang="de">FooConstraint</description>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/security/portlet2-fail2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+             
+     <portlet>
+     	<portlet-name>foo</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     </portlet>
+     
+	<security-constraint id="foo">
+		<display-name>test</display-name>
+		<display-name xml:lang="de">Test</display-name>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+			<portlet-name>foobar</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<description>fooConstraint</description>
+			<description xml:lang="de">FooConstraint</description>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/security/portlet2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/security/portlet2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/security/portlet2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	~ JBoss, a division of Red Hat                                              ~
+	~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+	~ contributors as indicated by the @authors tag. See the                    ~
+	~ copyright.txt in the distribution for a full listing of                   ~
+	~ individual contributors.                                                  ~
+	~                                                                           ~
+	~ This is free software; you can redistribute it and/or modify it           ~
+	~ under the terms of the GNU Lesser General Public License as               ~
+	~ published by the Free Software Foundation; either version 2.1 of          ~
+	~ the License, or (at your option) any later version.                       ~
+	~                                                                           ~
+	~ This software is distributed in the hope that it will be useful,          ~
+	~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+	~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+	~ Lesser General Public License for more details.                           ~
+	~                                                                           ~
+	~ You should have received a copy of the GNU Lesser General Public          ~
+	~ License along with this software; if not, write to the Free               ~
+	~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+	~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+             
+     <portlet>
+     	<portlet-name>foo</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     	<portlet-info>
+     		<title>Foo</title>
+     	</portlet-info>
+     </portlet>
+     
+     <portlet>
+     	<portlet-name>foobar</portlet-name>
+     	<portlet-class>org.jboss.portal.foo</portlet-class>
+     	<supports>
+     		<mime-type>text/html</mime-type>
+     		<portlet-mode>VIEW</portlet-mode>
+     	</supports>
+     	<portlet-info>
+     		<title>FooBar</title>
+     	</portlet-info>
+     </portlet>
+     
+	<security-constraint id="foo">
+		<display-name>test</display-name>
+		<display-name xml:lang="de">Test</display-name>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+			<portlet-name>foobar</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<description>fooConstraint</description>
+			<description xml:lang="de">FooConstraint</description>
+			<transport-guarantee>NONE</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+	<security-constraint>
+		<portlet-collection>
+			<portlet-name>foo</portlet-name>
+		</portlet-collection>
+		<user-data-constraint>
+			<transport-guarantee>INTEGRAL</transport-guarantee>
+		</user-data-constraint>
+	</security-constraint>
+	
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet1.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet1.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet1.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,17 @@
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="1.0">
+             
+	<user-attribute id="notFoo">
+		<name>blub</name>
+	</user-attribute>
+   
+	<user-attribute id="realFoo">
+		<description>foobar</description>
+		<description xml:lang="de">fuhbar</description>
+		<name>foo</name>
+	</user-attribute>
+             
+             
+</portlet-app>
\ No newline at end of file

Added: modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet2.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet2.xml	                        (rev 0)
+++ modules/portlet/trunk/test/src/resources/metadata/userAttribute/portlet2.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -0,0 +1,17 @@
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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"
+             version="2.0">
+             
+	<user-attribute id="notFoo">
+		<name>blub</name>
+	</user-attribute>
+   
+	<user-attribute id="realFoo">
+		<description>foobar</description>
+		<description xml:lang="de">fuhbar</description>
+		<name>foo</name>
+	</user-attribute>
+             
+             
+</portlet-app>
\ No newline at end of file

Modified: modules/portlet/trunk/test/src/resources/test/local-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/test/local-jboss-unit.xml	2007-11-26 14:16:33 UTC (rev 9106)
+++ modules/portlet/trunk/test/src/resources/test/local-jboss-unit.xml	2007-11-26 14:17:59 UTC (rev 9107)
@@ -19,5 +19,32 @@
          <class name="org.jboss.portal.portlet.test.StringCodecTestCase">
          </class>
       </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.CustomPortletModeTestEverythingTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.CustomWindowStateTestEverythingTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.EventTestEverythingTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.FilterTestEverythingTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.GeneralMetaDataTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.PortletTestEverythingTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.RenderParameterTestEverythingTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.SecurityConstraintTestEverythingTestCase" />
+      </test>
+      <test>
+         <class name="org.jboss.portal.portlet.test.metadata.UserAttributeTestEverythingTestCase" />
+      </test>
    </pojo>
 </jboss-unit>




More information about the portal-commits mailing list