gatein SVN: r6750 - in portal/trunk: component/portal/src/test/java/org/exoplatform/portal and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-26 16:39:45 -0400 (Sun, 26 Jun 2011)
New Revision: 6750
Removed:
portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd
Modified:
portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java
portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
Log:
GTNPORTAL-1946 : no need for 1.2.1 XSD, 1.2 is still in development and not final
Modified: portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd
===================================================================
--- portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd 2011-06-25 12:30:48 UTC (rev 6749)
+++ portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd 2011-06-26 20:39:45 UTC (rev 6750)
@@ -18,6 +18,12 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
+<!--
+ DISCLAIMER :
+ - THIS FILE IS NOT YET FINAL AND IS SUBJECT TO CHANGES
+ - IT WILL BE CONSIDERED AS AN API (I.E FINAL) WHEN GATEIN 3.2 WILL BE RELEASED
+ -->
+
<xs:schema
targetNamespace="http://www.gatein.org/xml/ns/gatein_objects_1_2"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2"
@@ -160,8 +166,10 @@
<xs:complexType name="portletApplicationType">
<xs:sequence>
- <xs:element name="portlet" type="portletType" minOccurs="1" maxOccurs="1"/>
- <xs:element name="theme" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:choice>
+ <xs:element name="portlet" type="portletType"/>
+ <xs:element name="wsrp" type="xs:string"/>
+ </xs:choice>
<xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="access-permissions" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="show-info-bar" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
Deleted: portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd
===================================================================
--- portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd 2011-06-25 12:30:48 UTC (rev 6749)
+++ portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd 2011-06-26 20:39:45 UTC (rev 6750)
@@ -1,222 +0,0 @@
-<?xml version="1.0"?>
-<!--
- ~ Copyright (C) 2009 eXo Platform SAS.
- ~
- ~ 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.
- -->
-
-<xs:schema
- targetNamespace="http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0">
-
- <!-- A top page element -->
- <xs:element name="page" type="pageType"/>
-
- <!-- A top page-set element -->
- <xs:element name="page-set" type="pageSetType"/>
-
- <!-- A top portal-config element -->
- <xs:element name="portal-config" type="portalConfigType"/>
-
- <!-- A top container element -->
- <xs:element name="container" type="containerType"/>
-
- <!-- A top node-navigation element -->
- <xs:element name="node-navigation" type="nodeNavigationType"/>
-
- <!-- The type of a top navigation node -->
- <xs:complexType name="nodeNavigationType">
- <xs:sequence>
- <xs:element name="priority" type="xs:positiveInteger"/>
- <xs:element name="page-nodes" minOccurs="0" maxOccurs="1">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <!-- The type of a navigation node -->
- <xs:complexType name="nodeType">
- <xs:sequence>
- <xs:element name="uri" type="xs:string"/>
- <xs:element name="name" type="xs:string"/>
- <xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="start-publication-date" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="end-publication-date" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="visibility" type="visibility" default="DISPLAYED" minOccurs="0" maxOccurs="1"/>
- <xs:element name="page-reference" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:simpleType name="visibility">
- <xs:restriction base='xs:string'>
- <xs:enumeration value="DISPLAYED"/>
- <xs:enumeration value="HIDDEN"/>
- <xs:enumeration value="TEMPORAL"/>
- <xs:enumeration value="SYSTEM"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:complexType name="pageSetType">
- <xs:sequence>
- <xs:element name="page" type="pageType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="portalConfigType">
- <xs:sequence>
- <xs:element name="portal-name" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="locale" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="edit-permission" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="skin" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="properties" type="propertiesType" minOccurs="0" maxOccurs="1"/>
- <xs:element name="portal-layout" minOccurs="1" maxOccurs="1">
- <xs:complexType>
- <xs:group ref="containerChildrenGroup"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="propertiesType">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:element name="entry" type="propertiesEntryType" minOccurs="1" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="propertiesEntryType">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="key" type="xs:string"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:group name="containerChildrenGroup">
- <xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="portlet-application" type="portletApplicationType" minOccurs="1" maxOccurs="1"/>
- <xs:element name="gadget-application" type="gadgetApplicationType" minOccurs="1" maxOccurs="1"/>
- <xs:element name="container" type="containerType" minOccurs="1" maxOccurs="1"/>
- <xs:element name="page-body" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="site-body" type="xs:string" minOccurs="1" maxOccurs="1"/>
- </xs:choice>
- </xs:sequence>
- </xs:group>
-
- <xs:complexType name="pageType">
- <xs:sequence>
- <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="factory-id" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="edit-permission" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="show-max-window" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
- <xs:group ref="containerChildrenGroup"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="containerType">
- <xs:sequence>
- <xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="factory-id" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:group ref="containerChildrenGroup"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string"/>
- <xs:attribute name="template" type="xs:string"/>
- <xs:attribute name="attribute" type="xs:string"/>
- <xs:attribute name="width" type="xs:string"/>
- <xs:attribute name="height" type="xs:string"/>
- </xs:complexType>
-
- <xs:complexType name="portletApplicationType">
- <xs:sequence>
- <xs:choice>
- <xs:element name="portlet" type="portletType"/>
- <xs:element name="wsrp" type="xs:string"/>
- </xs:choice>
- <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="access-permissions" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="show-info-bar" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
- <xs:element name="show-application-state" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
- <xs:element name="show-application-mode" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
- <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="width" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="height" type="xs:string" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="gadgetApplicationType">
- <xs:sequence>
- <xs:element name="gadget" type="gadgetType" minOccurs="1" maxOccurs="1"/>
- <xs:element name="theme" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="access-permissions" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="show-info-bar" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
- <xs:element name="show-application-state" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
- <xs:element name="show-application-mode" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
- <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="width" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="height" type="xs:string" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="portletType">
- <xs:sequence>
- <xs:element name="application-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="portlet-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="preferences" type="portletPreferencesType" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="gadgetType">
- <xs:sequence>
- <xs:element name="gadget-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="portletPreferencesType">
- <xs:sequence>
- <xs:element name="preference" type="portletPreferenceType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="portletPreferenceType">
- <xs:sequence>
- <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
- <xs:element name="read-only" type="xs:string" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
\ No newline at end of file
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java 2011-06-25 12:30:48 UTC (rev 6749)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java 2011-06-26 20:39:45 UTC (rev 6750)
@@ -59,6 +59,6 @@
{
assertHash("d0591b0a022a0c2929e1aed8979857cd", "gatein_objects_1_0.xsd");
assertHash("99ae24c9bbfe1b59e066756a29ab6c79", "gatein_objects_1_1.xsd");
- assertHash("616e7a91a5a841009f672af484f4861e", "gatein_objects_1_2.xsd");
+ assertHash("9a031c15ce0e2b4dd1e283458f590581", "gatein_objects_1_2.xsd");
}
}
Modified: portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
===================================================================
--- portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2011-06-25 12:30:48 UTC (rev 6749)
+++ portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2011-06-26 20:39:45 UTC (rev 6750)
@@ -24,8 +24,8 @@
<page-set
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2_1 http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2_1">
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
<page>
<name>wsrpConfiguration</name>
13 years, 6 months
gatein SVN: r6749 - components/pc/trunk/portlet/src/test/resources.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-25 08:30:48 -0400 (Sat, 25 Jun 2011)
New Revision: 6749
Removed:
components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml
Log:
remove legacy file
Deleted: components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml
===================================================================
--- components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml 2011-06-25 12:30:17 UTC (rev 6748)
+++ components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml 2011-06-25 12:30:48 UTC (rev 6749)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-unit
- xmlns="urn:jboss:jboss-unit:1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
- <pojo>
- <test>
- <class name="org.gatein.pc.test.portlet.state.LocalStoreProducerStatefulPortletInvokerTestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.test.portlet.state.RemoteStoreProducerStatefulPortletInvokerTestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.test.portlet.state.LocalStoreConsumerStatefulPortletInvokerTestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.test.portlet.state.RemoteStoreConsumerStatefulPortletInvokerTestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.test.portlet.state.StateConverterV0TestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.test.portlet.ParametersTestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.test.portlet.ContentBufferTestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.test.portlet.StateStringTestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.portlet.container.LifeCycle1TestCase"/>
- </test>
- <test>
- <class name="org.gatein.pc.portlet.container.LifeCycleReentranceDetectionTestCase"/>
- </test>
- </pojo>
-</jboss-unit>
13 years, 6 months
gatein SVN: r6748 - in components/pc/trunk/portlet: src/test/java/org/gatein/pc/portlet/container and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-25 08:30:17 -0400 (Sat, 25 Jun 2011)
New Revision: 6748
Added:
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1TestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTestCase.java
Removed:
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java
Modified:
components/pc/trunk/portlet/pom.xml
components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml
Log:
exclude **/*Test.java from surefire
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2011-06-25 08:13:38 UTC (rev 6747)
+++ components/pc/trunk/portlet/pom.xml 2011-06-25 12:30:17 UTC (rev 6748)
@@ -59,6 +59,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
+ <excludes>
+ <exclude>**/*Test.java</exclude>
+ </excludes>
</configuration>
</plugin>
<plugin>
Deleted: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java 2011-06-25 08:13:38 UTC (rev 6747)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java 2011-06-25 12:30:17 UTC (rev 6748)
@@ -1,383 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.gatein.pc.portlet.container;
-
-import junit.framework.TestCase;
-import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
-import org.gatein.pc.portlet.impl.container.PortletFilterLifeCycle;
-import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
-import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class LifeCycle1Test extends TestCase
-{
-
- ManagedObjectRegistryEventList events;
-
- PortletApplicationObjectSupport application;
- PortletApplicationLifeCycle applicationLC;
-
- PortletFilterObjectSupport filter;
- PortletContainerObjectSupport container;
- PortletFilterLifeCycle filterLC;
- PortletContainerLifeCycle containerLC;
-
- @Override
- protected void setUp() throws Exception
- {
- events = new ManagedObjectRegistryEventList();
-
- application = new PortletApplicationObjectSupport("application");
- applicationLC = new PortletApplicationLifeCycle(events, new PortletApplicationContextSupport(), application);
-
- filter = new PortletFilterObjectSupport("filter2");
- container = new PortletContainerObjectSupport("container2");
- filterLC = applicationLC.addPortletFilter(new PortletFilterContextSupport(), filter);
- containerLC = applicationLC.addPortletContainer(new PortletContainerContextSupport(), container);
- applicationLC.addDependency(filterLC, containerLC);
-
- applicationLC.create();
- }
-
- private void testState(
- int applicationStarted,
- int applicationStopped,
- LifeCycleStatus applicationStatus,
- int containerStarted,
- int containerStopped,
- LifeCycleStatus containerStatus,
- int filterStarted,
- int filterStopped,
- LifeCycleStatus filterStatus
- )
- {
- assertEquals(applicationStarted, application.getStarted());
- assertEquals(applicationStopped, application.getStopped());
- assertEquals(applicationStatus, applicationLC.getStatus());
- assertEquals(containerStarted, container.getStarted());
- assertEquals(containerStopped, container.getStopped());
- assertEquals(containerStatus, containerLC.getStatus());
- assertEquals(filterStarted, filter.getStarted());
- assertEquals(filterStopped, filter.getStopped());
- assertEquals(filterStatus, filterLC.getStatus());
- }
-
- public void testWiring()
- {
- events.assertAddedEvent(filterLC);
- events.assertAddedEvent(containerLC);
- events.assertEmpty();
-
- assertEquals(1, application.containers.size());
- assertSame(container, application.containers.get(container.getId()));
- assertEquals(1, application.filters.size());
- assertSame(filter, application.filters.get(filter.getId()));
-
- //
- assertSame(application, filter.application);
-
- //
- assertSame(application, container.application);
- assertEquals(1, container.filters.size());
- assertSame(filter, container.filters.get(filter.getId()));
- }
-
- public void testApplicationLifeCycle()
- {
- events.clear();
-
- //
- applicationLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED);
- events.assertStartedEvent(applicationLC);
- events.assertStartedEvent(filterLC);
- events.assertStartedEvent(containerLC);
- events.assertEmpty();
-
- //
- applicationLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED);
- events.assertEmpty();
-
- //
- applicationLC.managedStop();
-
- //
- testState(1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED);
- events.assertStoppedEvent(containerLC);
- events.assertStoppedEvent(filterLC);
- events.assertStoppedEvent(applicationLC);
- events.assertEmpty();
- }
-
- public void testFilterLifeCycle()
- {
- events.clear();
-
- //
- applicationLC.managedStart();
-
- //
- events.clear();
-
- // Filter stop triggers
- filterLC.managedStop();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED);
- events.assertStoppedEvent(containerLC);
- events.assertStoppedEvent(filterLC);
- events.assertEmpty();
-
- // Container does not start if its filter is stopped
- containerLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED);
- events.assertEmpty();
-
- // Filter start triggers container start
- filterLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.STARTED);
- events.assertStartedEvent(filterLC);
- events.assertStartedEvent(containerLC);
- events.assertEmpty();
- }
-
- public void testContainerLifeCycle()
- {
- events.clear();
-
- //
- applicationLC.managedStart();
-
- //
- events.clear();
-
- //
- containerLC.managedStop();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.STARTED);
- events.assertStoppedEvent(containerLC);
- events.assertEmpty();
-
- //
- containerLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED);
- events.assertStartedEvent(containerLC);
- events.assertEmpty();
- }
-
- public void testContainerFailsOnStart()
- {
- events.clear();
-
- //
- container.startCallback = ObjectSupport.FAILURE_CALLBACK;
-
- //
- applicationLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.FAILED, 1, 0, LifeCycleStatus.STARTED);
- events.assertStartedEvent(applicationLC);
- events.assertStartedEvent(filterLC);
- events.assertFailedEvent(containerLC);
- events.assertEmpty();
-
- //
- applicationLC.managedStop();
-
- //
- testState(1, 1, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.FAILED, 1, 1, LifeCycleStatus.STOPPED);
- events.assertStoppedEvent(filterLC);
- events.assertStoppedEvent(applicationLC);
- events.assertEmpty();
-
- //
- applicationLC.managedStart();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 2, 0, LifeCycleStatus.FAILED, 2, 1, LifeCycleStatus.STARTED);
- events.assertStartedEvent(applicationLC);
- events.assertStartedEvent(filterLC);
- events.assertEmpty();
-
- //
- containerLC.managedStart();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILED, 2, 1, LifeCycleStatus.STARTED);
- events.assertEmpty();
-
- //
- containerLC.managedStop();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILED, 2, 1, LifeCycleStatus.STARTED);
- events.assertEmpty();
-
- //
- filterLC.managedStop();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILED, 2, 2, LifeCycleStatus.STOPPED);
- events.assertStoppedEvent(filterLC);
- events.assertEmpty();
-
- //
- filterLC.managedStart();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 4, 0, LifeCycleStatus.FAILED, 3, 2, LifeCycleStatus.STARTED);
- events.assertStartedEvent(filterLC);
- events.assertEmpty();
- }
-
- public void testApplicationFailsOnStart()
- {
- events.clear();
-
- //
- application.startCallback = ObjectSupport.FAILURE_CALLBACK;
-
- //
- applicationLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED);
- events.assertFailedEvent(applicationLC);
- events.assertEmpty();
-
- //
- applicationLC.managedStart();
-
- //
- testState(2, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED);
- events.assertEmpty();
-
- //
- applicationLC.managedStop();
-
- //
- testState(2, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED);
- events.assertEmpty();
- }
-
- public void testFilterFailsOnStart()
- {
- events.clear();
-
- //
- filter.startCallback = ObjectSupport.FAILURE_CALLBACK;
-
- //
- applicationLC.managedStart();
-
- //
- testState(1, 0, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.FAILED);
- events.assertStartedEvent(applicationLC);
- events.assertFailedEvent(filterLC);
- events.assertEmpty();
-
- //
- applicationLC.managedStop();
-
- //
- testState(1, 1, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.FAILED);
- events.assertStoppedEvent(applicationLC);
- events.assertEmpty();
-
- //
- applicationLC.managedStart();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 2, 0, LifeCycleStatus.FAILED);
- events.assertStartedEvent(applicationLC);
- events.assertEmpty();
-
- //
- filterLC.managedStart();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 3, 0, LifeCycleStatus.FAILED);
- events.assertEmpty();
-
- //
- filterLC.managedStop();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 3, 0, LifeCycleStatus.FAILED);
- events.assertEmpty();
-
- //
- filterLC.managedStart();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 4, 0, LifeCycleStatus.FAILED);
- events.assertEmpty();
-
- //
- containerLC.managedStart();
-
- //
- testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 4, 0, LifeCycleStatus.FAILED);
- events.assertEmpty();
- }
-
- public void testContainerFailsOnStop()
- {
- container.stopCallback = ObjectSupport.FAILURE_CALLBACK;
-
- //
- testApplicationLifeCycle();
- }
-
- public void testApplicationFailsOnStop()
- {
- application.stopCallback = ObjectSupport.FAILURE_CALLBACK;
-
- //
- testApplicationLifeCycle();
- }
-
- public void testFilterFailsOnStop()
- {
- filter.stopCallback = ObjectSupport.FAILURE_CALLBACK;
-
- //
- testApplicationLifeCycle();
- }
-}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1TestCase.java (from rev 6747, components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1TestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1TestCase.java 2011-06-25 12:30:17 UTC (rev 6748)
@@ -0,0 +1,383 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.pc.portlet.container;
+
+import junit.framework.TestCase;
+import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
+import org.gatein.pc.portlet.impl.container.PortletFilterLifeCycle;
+import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
+import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class LifeCycle1TestCase extends TestCase
+{
+
+ ManagedObjectRegistryEventList events;
+
+ PortletApplicationObjectSupport application;
+ PortletApplicationLifeCycle applicationLC;
+
+ PortletFilterObjectSupport filter;
+ PortletContainerObjectSupport container;
+ PortletFilterLifeCycle filterLC;
+ PortletContainerLifeCycle containerLC;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ events = new ManagedObjectRegistryEventList();
+
+ application = new PortletApplicationObjectSupport("application");
+ applicationLC = new PortletApplicationLifeCycle(events, new PortletApplicationContextSupport(), application);
+
+ filter = new PortletFilterObjectSupport("filter2");
+ container = new PortletContainerObjectSupport("container2");
+ filterLC = applicationLC.addPortletFilter(new PortletFilterContextSupport(), filter);
+ containerLC = applicationLC.addPortletContainer(new PortletContainerContextSupport(), container);
+ applicationLC.addDependency(filterLC, containerLC);
+
+ applicationLC.create();
+ }
+
+ private void testState(
+ int applicationStarted,
+ int applicationStopped,
+ LifeCycleStatus applicationStatus,
+ int containerStarted,
+ int containerStopped,
+ LifeCycleStatus containerStatus,
+ int filterStarted,
+ int filterStopped,
+ LifeCycleStatus filterStatus
+ )
+ {
+ assertEquals(applicationStarted, application.getStarted());
+ assertEquals(applicationStopped, application.getStopped());
+ assertEquals(applicationStatus, applicationLC.getStatus());
+ assertEquals(containerStarted, container.getStarted());
+ assertEquals(containerStopped, container.getStopped());
+ assertEquals(containerStatus, containerLC.getStatus());
+ assertEquals(filterStarted, filter.getStarted());
+ assertEquals(filterStopped, filter.getStopped());
+ assertEquals(filterStatus, filterLC.getStatus());
+ }
+
+ public void testWiring()
+ {
+ events.assertAddedEvent(filterLC);
+ events.assertAddedEvent(containerLC);
+ events.assertEmpty();
+
+ assertEquals(1, application.containers.size());
+ assertSame(container, application.containers.get(container.getId()));
+ assertEquals(1, application.filters.size());
+ assertSame(filter, application.filters.get(filter.getId()));
+
+ //
+ assertSame(application, filter.application);
+
+ //
+ assertSame(application, container.application);
+ assertEquals(1, container.filters.size());
+ assertSame(filter, container.filters.get(filter.getId()));
+ }
+
+ public void testApplicationLifeCycle()
+ {
+ events.clear();
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED);
+ events.assertStartedEvent(applicationLC);
+ events.assertStartedEvent(filterLC);
+ events.assertStartedEvent(containerLC);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStop();
+
+ //
+ testState(1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED);
+ events.assertStoppedEvent(containerLC);
+ events.assertStoppedEvent(filterLC);
+ events.assertStoppedEvent(applicationLC);
+ events.assertEmpty();
+ }
+
+ public void testFilterLifeCycle()
+ {
+ events.clear();
+
+ //
+ applicationLC.managedStart();
+
+ //
+ events.clear();
+
+ // Filter stop triggers
+ filterLC.managedStop();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED);
+ events.assertStoppedEvent(containerLC);
+ events.assertStoppedEvent(filterLC);
+ events.assertEmpty();
+
+ // Container does not start if its filter is stopped
+ containerLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPPED, 1, 1, LifeCycleStatus.STOPPED);
+ events.assertEmpty();
+
+ // Filter start triggers container start
+ filterLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.STARTED);
+ events.assertStartedEvent(filterLC);
+ events.assertStartedEvent(containerLC);
+ events.assertEmpty();
+ }
+
+ public void testContainerLifeCycle()
+ {
+ events.clear();
+
+ //
+ applicationLC.managedStart();
+
+ //
+ events.clear();
+
+ //
+ containerLC.managedStop();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 1, 1, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.STARTED);
+ events.assertStoppedEvent(containerLC);
+ events.assertEmpty();
+
+ //
+ containerLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 2, 1, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.STARTED);
+ events.assertStartedEvent(containerLC);
+ events.assertEmpty();
+ }
+
+ public void testContainerFailsOnStart()
+ {
+ events.clear();
+
+ //
+ container.startCallback = ObjectSupport.FAILURE_CALLBACK;
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 1, 0, LifeCycleStatus.FAILED, 1, 0, LifeCycleStatus.STARTED);
+ events.assertStartedEvent(applicationLC);
+ events.assertStartedEvent(filterLC);
+ events.assertFailedEvent(containerLC);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStop();
+
+ //
+ testState(1, 1, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.FAILED, 1, 1, LifeCycleStatus.STOPPED);
+ events.assertStoppedEvent(filterLC);
+ events.assertStoppedEvent(applicationLC);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 2, 0, LifeCycleStatus.FAILED, 2, 1, LifeCycleStatus.STARTED);
+ events.assertStartedEvent(applicationLC);
+ events.assertStartedEvent(filterLC);
+ events.assertEmpty();
+
+ //
+ containerLC.managedStart();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILED, 2, 1, LifeCycleStatus.STARTED);
+ events.assertEmpty();
+
+ //
+ containerLC.managedStop();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILED, 2, 1, LifeCycleStatus.STARTED);
+ events.assertEmpty();
+
+ //
+ filterLC.managedStop();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 3, 0, LifeCycleStatus.FAILED, 2, 2, LifeCycleStatus.STOPPED);
+ events.assertStoppedEvent(filterLC);
+ events.assertEmpty();
+
+ //
+ filterLC.managedStart();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 4, 0, LifeCycleStatus.FAILED, 3, 2, LifeCycleStatus.STARTED);
+ events.assertStartedEvent(filterLC);
+ events.assertEmpty();
+ }
+
+ public void testApplicationFailsOnStart()
+ {
+ events.clear();
+
+ //
+ application.startCallback = ObjectSupport.FAILURE_CALLBACK;
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED);
+ events.assertFailedEvent(applicationLC);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(2, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStop();
+
+ //
+ testState(2, 0, LifeCycleStatus.FAILED, 0, 0, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED);
+ events.assertEmpty();
+ }
+
+ public void testFilterFailsOnStart()
+ {
+ events.clear();
+
+ //
+ filter.startCallback = ObjectSupport.FAILURE_CALLBACK;
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(1, 0, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.FAILED);
+ events.assertStartedEvent(applicationLC);
+ events.assertFailedEvent(filterLC);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStop();
+
+ //
+ testState(1, 1, LifeCycleStatus.STOPPED, 0, 0, LifeCycleStatus.STOPPED, 1, 0, LifeCycleStatus.FAILED);
+ events.assertStoppedEvent(applicationLC);
+ events.assertEmpty();
+
+ //
+ applicationLC.managedStart();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 2, 0, LifeCycleStatus.FAILED);
+ events.assertStartedEvent(applicationLC);
+ events.assertEmpty();
+
+ //
+ filterLC.managedStart();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 3, 0, LifeCycleStatus.FAILED);
+ events.assertEmpty();
+
+ //
+ filterLC.managedStop();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 3, 0, LifeCycleStatus.FAILED);
+ events.assertEmpty();
+
+ //
+ filterLC.managedStart();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 4, 0, LifeCycleStatus.FAILED);
+ events.assertEmpty();
+
+ //
+ containerLC.managedStart();
+
+ //
+ testState(2, 1, LifeCycleStatus.STARTED, 0, 0, LifeCycleStatus.STOPPED, 4, 0, LifeCycleStatus.FAILED);
+ events.assertEmpty();
+ }
+
+ public void testContainerFailsOnStop()
+ {
+ container.stopCallback = ObjectSupport.FAILURE_CALLBACK;
+
+ //
+ testApplicationLifeCycle();
+ }
+
+ public void testApplicationFailsOnStop()
+ {
+ application.stopCallback = ObjectSupport.FAILURE_CALLBACK;
+
+ //
+ testApplicationLifeCycle();
+ }
+
+ public void testFilterFailsOnStop()
+ {
+ filter.stopCallback = ObjectSupport.FAILURE_CALLBACK;
+
+ //
+ testApplicationLifeCycle();
+ }
+}
Deleted: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java 2011-06-25 08:13:38 UTC (rev 6747)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java 2011-06-25 12:30:17 UTC (rev 6748)
@@ -1,209 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.gatein.pc.portlet.container;
-
-import junit.framework.TestCase;
-import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
-import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
-import org.gatein.pc.portlet.impl.container.LifeCycle;
-import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class LifeCycleReentranceDetectionTest extends TestCase
-{
-
- PortletApplicationLifeCycle applicationLF;
- PortletApplicationObjectSupport application;
- PortletContainerLifeCycle containerLF;
- PortletContainerObjectSupport container;
-
- IllegalStateException ise;
-
- @Override
- protected void setUp() throws Exception
- {
- this.ise = null;
- }
-
- private class InvokeLifeCycleCallback implements ObjectSupport.Callback
- {
-
- /** . */
- private LifeCycle lifeCycle;
-
- /** . */
- private boolean invokeStart;
-
- /** . */
- private boolean rethrowISE;
-
- private InvokeLifeCycleCallback(LifeCycle lifeCycle, boolean invokeStart, boolean rethrowISE)
- {
- this.lifeCycle = lifeCycle;
- this.invokeStart = invokeStart;
- this.rethrowISE = rethrowISE;
- }
-
- public void execute()
- {
- try
- {
- if (invokeStart)
- {
- lifeCycle.managedStart();
- }
- else
- {
- lifeCycle.managedStop();
- }
- }
- catch (IllegalStateException e)
- {
- ise = e;
-
- //
- if (rethrowISE)
- {
- throw e;
- }
- }
- }
- }
-
- public void testApplicationReentersApplication1()
- {
- application = new PortletApplicationObjectSupport("application");
- applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
- application.startCallback = new InvokeLifeCycleCallback(applicationLF, true, false);
-
- //
- applicationLF.create();
-
- //
- applicationLF.managedStart();
-
- //
- assertNotNull(ise);
- assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
- }
-
- public void testApplicationReentersApplication2()
- {
- application = new PortletApplicationObjectSupport("application");
- applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
- application.startCallback = new InvokeLifeCycleCallback(applicationLF, true, true);
-
- //
- applicationLF.create();
-
- //
- applicationLF.managedStart();
-
- //
- assertNotNull(ise);
- assertEquals(LifeCycleStatus.FAILED, applicationLF.getStatus());
- }
-
- public void testContainerReentersContainer1()
- {
- application = new PortletApplicationObjectSupport("application");
- applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
- container = new PortletContainerObjectSupport("container");
- containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
- container.startCallback = new InvokeLifeCycleCallback(containerLF, true, false);
-
- //
- applicationLF.create();
-
- //
- applicationLF.managedStart();
-
- //
- assertNotNull(ise);
- assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
- assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus());
- }
-
- public void testContainerReentersContainer2()
- {
- application = new PortletApplicationObjectSupport("application");
- applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
- container = new PortletContainerObjectSupport("container");
- containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
- container.startCallback = new InvokeLifeCycleCallback(containerLF, true, true);
-
- //
- applicationLF.create();
-
- //
- applicationLF.managedStart();
-
- //
- assertNotNull(ise);
- assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
- assertEquals(LifeCycleStatus.FAILED, containerLF.getStatus());
- }
-
- public void testContainerReentersApplication1()
- {
- application = new PortletApplicationObjectSupport("application");
- applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
- container = new PortletContainerObjectSupport("container");
- containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
- container.startCallback = new InvokeLifeCycleCallback(applicationLF, true, false);
-
- //
- applicationLF.create();
-
- //
- applicationLF.managedStart();
-
- //
- assertNotNull(ise);
- assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
- assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus());
- }
-
- public void testContainerReentersApplication2()
- {
- application = new PortletApplicationObjectSupport("application");
- applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
- container = new PortletContainerObjectSupport("container");
- containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
- container.startCallback = new InvokeLifeCycleCallback(applicationLF, true, true);
-
- //
- applicationLF.create();
-
- //
- applicationLF.managedStart();
-
- //
- assertNotNull(ise);
- assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
- assertEquals(LifeCycleStatus.FAILED, containerLF.getStatus());
- }
-}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTestCase.java (from rev 6747, components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTestCase.java 2011-06-25 12:30:17 UTC (rev 6748)
@@ -0,0 +1,209 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.pc.portlet.container;
+
+import junit.framework.TestCase;
+import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
+import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
+import org.gatein.pc.portlet.impl.container.LifeCycle;
+import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class LifeCycleReentranceDetectionTestCase extends TestCase
+{
+
+ PortletApplicationLifeCycle applicationLF;
+ PortletApplicationObjectSupport application;
+ PortletContainerLifeCycle containerLF;
+ PortletContainerObjectSupport container;
+
+ IllegalStateException ise;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ this.ise = null;
+ }
+
+ private class InvokeLifeCycleCallback implements ObjectSupport.Callback
+ {
+
+ /** . */
+ private LifeCycle lifeCycle;
+
+ /** . */
+ private boolean invokeStart;
+
+ /** . */
+ private boolean rethrowISE;
+
+ private InvokeLifeCycleCallback(LifeCycle lifeCycle, boolean invokeStart, boolean rethrowISE)
+ {
+ this.lifeCycle = lifeCycle;
+ this.invokeStart = invokeStart;
+ this.rethrowISE = rethrowISE;
+ }
+
+ public void execute()
+ {
+ try
+ {
+ if (invokeStart)
+ {
+ lifeCycle.managedStart();
+ }
+ else
+ {
+ lifeCycle.managedStop();
+ }
+ }
+ catch (IllegalStateException e)
+ {
+ ise = e;
+
+ //
+ if (rethrowISE)
+ {
+ throw e;
+ }
+ }
+ }
+ }
+
+ public void testApplicationReentersApplication1()
+ {
+ application = new PortletApplicationObjectSupport("application");
+ applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
+ application.startCallback = new InvokeLifeCycleCallback(applicationLF, true, false);
+
+ //
+ applicationLF.create();
+
+ //
+ applicationLF.managedStart();
+
+ //
+ assertNotNull(ise);
+ assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
+ }
+
+ public void testApplicationReentersApplication2()
+ {
+ application = new PortletApplicationObjectSupport("application");
+ applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
+ application.startCallback = new InvokeLifeCycleCallback(applicationLF, true, true);
+
+ //
+ applicationLF.create();
+
+ //
+ applicationLF.managedStart();
+
+ //
+ assertNotNull(ise);
+ assertEquals(LifeCycleStatus.FAILED, applicationLF.getStatus());
+ }
+
+ public void testContainerReentersContainer1()
+ {
+ application = new PortletApplicationObjectSupport("application");
+ applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
+ container = new PortletContainerObjectSupport("container");
+ containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
+ container.startCallback = new InvokeLifeCycleCallback(containerLF, true, false);
+
+ //
+ applicationLF.create();
+
+ //
+ applicationLF.managedStart();
+
+ //
+ assertNotNull(ise);
+ assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
+ assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus());
+ }
+
+ public void testContainerReentersContainer2()
+ {
+ application = new PortletApplicationObjectSupport("application");
+ applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
+ container = new PortletContainerObjectSupport("container");
+ containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
+ container.startCallback = new InvokeLifeCycleCallback(containerLF, true, true);
+
+ //
+ applicationLF.create();
+
+ //
+ applicationLF.managedStart();
+
+ //
+ assertNotNull(ise);
+ assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
+ assertEquals(LifeCycleStatus.FAILED, containerLF.getStatus());
+ }
+
+ public void testContainerReentersApplication1()
+ {
+ application = new PortletApplicationObjectSupport("application");
+ applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
+ container = new PortletContainerObjectSupport("container");
+ containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
+ container.startCallback = new InvokeLifeCycleCallback(applicationLF, true, false);
+
+ //
+ applicationLF.create();
+
+ //
+ applicationLF.managedStart();
+
+ //
+ assertNotNull(ise);
+ assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
+ assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus());
+ }
+
+ public void testContainerReentersApplication2()
+ {
+ application = new PortletApplicationObjectSupport("application");
+ applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
+ container = new PortletContainerObjectSupport("container");
+ containerLF = applicationLF.addPortletContainer(new PortletContainerContextSupport(), container);
+ container.startCallback = new InvokeLifeCycleCallback(applicationLF, true, true);
+
+ //
+ applicationLF.create();
+
+ //
+ applicationLF.managedStart();
+
+ //
+ assertNotNull(ise);
+ assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
+ assertEquals(LifeCycleStatus.FAILED, containerLF.getStatus());
+ }
+}
Modified: components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml
===================================================================
--- components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml 2011-06-25 08:13:38 UTC (rev 6747)
+++ components/pc/trunk/portlet/src/test/resources/local-jboss-unit.xml 2011-06-25 12:30:17 UTC (rev 6748)
@@ -29,10 +29,10 @@
<class name="org.gatein.pc.test.portlet.StateStringTestCase"/>
</test>
<test>
- <class name="org.gatein.pc.portlet.container.LifeCycle1Test"/>
+ <class name="org.gatein.pc.portlet.container.LifeCycle1TestCase"/>
</test>
<test>
- <class name="org.gatein.pc.portlet.container.LifeCycleReentranceDetectionTest"/>
+ <class name="org.gatein.pc.portlet.container.LifeCycleReentranceDetectionTestCase"/>
</test>
</pojo>
</jboss-unit>
13 years, 6 months
gatein SVN: r6747 - in components/pc/trunk: docs/user-guide and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-06-25 04:13:38 -0400 (Sat, 25 Jun 2011)
New Revision: 6747
Modified:
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/pom.xml
Log:
- Fixed a couple of maven warnings:
+ Removed duplicated junit dependency.
+ Use project.name instead of pom.name.
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
+++ components/pc/trunk/docs/user-guide/pom.xml 2011-06-25 08:13:38 UTC (rev 6747)
@@ -1,6 +1,7 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gatein.pc</groupId>
@@ -13,8 +14,8 @@
<name>GateIn - Portlet Container (User Guide ${translation})</name>
<properties>
- <enforcer.skip>true</enforcer.skip>
- <translation>en-US</translation>
+ <enforcer.skip>true</enforcer.skip>
+ <translation>en-US</translation>
</properties>
<pluginRepositories>
@@ -42,69 +43,69 @@
</pluginRepositories>
<build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.1</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.gatein.doc</groupId>
- <artifactId>gatein-docbook-xslt</artifactId>
- <version>1.0.0-CR2</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.doc</groupId>
- <artifactId>gatein-jdocbook-style</artifactId>
- <version>1.0.0-CR2</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <sourceDirectory>${pom.basedir}/en</sourceDirectory>
- <imageResource>
- <directory>${pom.basedir}/en</directory>
- <includes>
- <include>images/**/*</include>
- </includes>
- </imageResource>
- <!--<cssResource>
- <directory>src/main/css</directory>
- </cssResource>-->
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath://xslt/org/gatein/pdf.xsl</stylesheetResource>
- <finalName>${pom.name}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/gatein/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/gatein/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>eclipse</formatName>
- <stylesheetResource>classpath:/xslt/org/gatein/eclipse.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
- <!-- could also locate the docbook dependency and inspect its version... -->
- <docbookVersion>1.74.0</docbookVersion>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.1</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.doc</groupId>
+ <artifactId>gatein-docbook-xslt</artifactId>
+ <version>1.0.0-CR2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.doc</groupId>
+ <artifactId>gatein-jdocbook-style</artifactId>
+ <version>1.0.0-CR2</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <!--<cssResource>
+ <directory>src/main/css</directory>
+ </cssResource>-->
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath://xslt/org/gatein/pdf.xsl</stylesheetResource>
+ <finalName>${project.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/gatein/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/gatein/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>classpath:/xslt/org/gatein/eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.74.0</docbookVersion>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
+++ components/pc/trunk/pom.xml 2011-06-25 08:13:38 UTC (rev 6747)
@@ -21,7 +21,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -214,7 +215,7 @@
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-log4j</artifactId>
<version>${version.jboss.logging}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.portals.bridges</groupId>
@@ -223,15 +224,10 @@
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-ant-tasks</artifactId>
+ <version>2.1.1</version>
</dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-ant-tasks</artifactId>
- <version>2.1.1</version>
- </dependency>
</dependencies>
</dependencyManagement>
@@ -271,14 +267,14 @@
<pluginManagement>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -291,8 +287,8 @@
<version>1.2.1</version>
</plugin>
<plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.6</version>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
13 years, 6 months
gatein SVN: r6746 - in components/pc/trunk: api and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-24 18:50:40 -0400 (Fri, 24 Jun 2011)
New Revision: 6746
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/test/core/pom.xml
Log:
improve a bit dependencies of project
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
+++ components/pc/trunk/api/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
@@ -57,7 +57,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.3.1</version>
<configuration>
<skip>false</skip>
</configuration>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
+++ components/pc/trunk/bridge/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
@@ -18,10 +18,5 @@
<groupId>org.apache.portals.bridges</groupId>
<artifactId>portals-bridges-common</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.portals.bridges</groupId>
- <artifactId>portals-bridges-common</artifactId>
- <version>${version.apache.portals.bridges}</version>
- </dependency>
</dependencies>
</project>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
+++ components/pc/trunk/controller/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
@@ -22,7 +22,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
+++ components/pc/trunk/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
@@ -216,6 +216,23 @@
<version>${version.jboss.logging}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.portals.bridges</groupId>
+ <artifactId>portals-bridges-common</artifactId>
+ <version>${version.apache.portals.bridges}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-ant-tasks</artifactId>
+ <version>2.1.1</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
@@ -229,6 +246,7 @@
</dependencies>
<build>
+
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -241,7 +259,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.1</version>
<configuration>
<archive>
<manifest>
@@ -254,12 +271,32 @@
<pluginManagement>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ <plugin>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit-tooling-maven2</artifactId>
<version>1.2.1</version>
</plugin>
<plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
+++ components/pc/trunk/portlet/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
@@ -42,7 +42,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
Modified: components/pc/trunk/test/core/pom.xml
===================================================================
--- components/pc/trunk/test/core/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
+++ components/pc/trunk/test/core/pom.xml 2011-06-24 22:50:40 UTC (rev 6746)
@@ -13,12 +13,6 @@
<dependency>
<groupId>org.gatein.common</groupId>
- <artifactId>common-mc</artifactId>
- </dependency>
-
-
- <dependency>
- <groupId>org.gatein.common</groupId>
<artifactId>common-logging</artifactId>
</dependency>
@@ -131,7 +125,6 @@
<artifactId>jboss-remoting</artifactId>
</dependency>
-
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
@@ -178,7 +171,6 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-ant-tasks</artifactId>
- <version>2.1.1</version>
</dependency>
</dependencies>
@@ -281,7 +273,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
<executions>
<execution>
<goals>
@@ -293,7 +284,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
<executions>
<execution>
<goals>
@@ -306,7 +296,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
@@ -326,9 +315,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.6</version>
- <dependencies>
- </dependencies>
<executions>
<execution>
<id>package-test</id>
13 years, 6 months
gatein SVN: r6745 - in components/pc/trunk: controller/src/test/java/org/gatein/pc/controller and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-24 18:31:03 -0400 (Fri, 24 Jun 2011)
New Revision: 6745
Modified:
components/pc/trunk/controller/pom.xml
components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/EventControllerContextFailureTestCase.java
components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestConstructorTestCase.java
components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestTestCase.java
components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerTestCase.java
components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/WiringEventControllerContext.java
components/pc/trunk/portlet/pom.xml
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java
Log:
use junit for controller module
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/controller/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
@@ -20,29 +20,11 @@
<!-- Dependencies for tests -->
<dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-remote</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
<scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-slide</groupId>
- <artifactId>webdavlib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </exclusion>
- </exclusions>
</dependency>
-
<dependency>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-portlet</artifactId>
@@ -58,45 +40,15 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>resolver</artifactId>
- </dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>xml-apis</artifactId>
- </dependency>
-
</dependencies>
<build>
<plugins>
<plugin>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-tooling-maven2</artifactId>
- <executions>
- <execution>
- <phase>test</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- </execution>
- </executions>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <failOnError>true</failOnError>
- <testsuites>
- <testsuite>
- <config>local-jboss-unit.xml</config>
- </testsuite>
- </testsuites>
- <reports>
- <xml>target/tests/reports/xml</xml>
- <html>target/tests/reports/html</html>
- </reports>
+ <skip>false</skip>
</configuration>
</plugin>
</plugins>
Modified: components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/EventControllerContextFailureTestCase.java
===================================================================
--- components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/EventControllerContextFailureTestCase.java 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/EventControllerContextFailureTestCase.java 2011-06-24 22:31:03 UTC (rev 6745)
@@ -36,23 +36,14 @@
import org.gatein.pc.controller.handlers.NoOpEventHandler;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
-import org.jboss.unit.api.pojo.annotations.Test;
-import org.jboss.unit.api.pojo.annotations.Create;
-import static org.jboss.unit.api.Assert.assertInstanceOf;
-import static org.jboss.unit.api.Assert.assertEquals;
-import static org.jboss.unit.api.Assert.assertTrue;
-import static org.jboss.unit.api.Assert.fail;
-import static org.jboss.unit.api.Assert.assertSame;
-
import javax.xml.namespace.QName;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class EventControllerContextFailureTestCase
+public class EventControllerContextFailureTestCase extends junit.framework.TestCase
{
public static final String DST_WINDOW_ID = "/webappdst.dst";
@@ -84,8 +75,8 @@
/** . */
private boolean called;
- @Create
- public void create()
+ @Override
+ protected void setUp() throws Exception
{
request = context.createActionRequest(PortletInvokerSupport.FOO_PORTLET_ID);
srcName = new QName("ns1", "src");
@@ -95,7 +86,6 @@
called = false;
}
- @Test
public void testEventControllerContextFailsDuringEventConsumedCallback() throws PortletInvokerException
{
WiringEventControllerContext ecc = new WiringEventControllerContext()
@@ -113,7 +103,7 @@
fooPortlet.addHandler(new EventProducerActionHandler(srcName));
barPortlet.addHandler(new NoOpEventHandler());
ControllerResponse response = controller.process(context, request);
- PageUpdateResponse updateResponse = assertInstanceOf(response, PageUpdateResponse.class);
+ PageUpdateResponse updateResponse = (PageUpdateResponse)response;
assertEquals(PortletResponse.DISTRIBUTION_DONE, updateResponse.getEventDistributionStatus());
assertTrue(called);
@@ -146,7 +136,6 @@
}
}
- @Test
public void testEventControllerContextFailsDuringEventProducedCallback() throws PortletInvokerException
{
AbstractEventControllerContext ecc = new AbstractEventControllerContext()
@@ -162,7 +151,7 @@
context.setEventControllerContext(ecc);
fooPortlet.addHandler(new EventProducerActionHandler(srcName));
ControllerResponse response = controller.process(context, request);
- PageUpdateResponse updateResponse = assertInstanceOf(response, PageUpdateResponse.class);
+ PageUpdateResponse updateResponse = (PageUpdateResponse)response;
assertEquals(PortletResponse.DISTRIBUTION_DONE, updateResponse.getEventDistributionStatus());
assertTrue(called);
@@ -193,7 +182,6 @@
}
}
- @Test
public void testEventControllerContextFailsDuringEventFailedCallback() throws PortletInvokerException
{
WiringEventControllerContext ecc = new WiringEventControllerContext()
@@ -211,7 +199,7 @@
fooPortlet.addHandler(new EventProducerActionHandler(srcName));
barPortlet.addHandler(new FailingEventHandler(new RuntimeException()));
ControllerResponse response = controller.process(context, request);
- PageUpdateResponse updateResponse = assertInstanceOf(response, PageUpdateResponse.class);
+ PageUpdateResponse updateResponse = (PageUpdateResponse)response;
assertEquals(PortletResponse.DISTRIBUTION_DONE, updateResponse.getEventDistributionStatus());
assertTrue(called);
@@ -244,7 +232,6 @@
}
}
- @Test
public void testEventControllerContextFailsDuringEventDiscardedCallback() throws PortletInvokerException
{
WiringEventControllerContext ecc = new WiringEventControllerContext()
@@ -262,7 +249,7 @@
context.setEventControllerContext(ecc);
fooPortlet.addHandler(new EventProducerActionHandler(srcName));
ControllerResponse response = controller.process(context, request);
- PageUpdateResponse updateResponse = assertInstanceOf(response, PageUpdateResponse.class);
+ PageUpdateResponse updateResponse = (PageUpdateResponse)response;
assertEquals(PortletResponse.DISTRIBUTION_DONE, updateResponse.getEventDistributionStatus());
assertTrue(called);
Modified: components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestConstructorTestCase.java
===================================================================
--- components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestConstructorTestCase.java 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestConstructorTestCase.java 2011-06-24 22:31:03 UTC (rev 6745)
@@ -31,8 +31,6 @@
import org.gatein.pc.api.StateString;
import org.gatein.pc.api.OpaqueStateString;
import org.gatein.common.util.ParameterMap;
-import static org.jboss.unit.api.Assert.*;
-import org.jboss.unit.api.pojo.annotations.Test;
import java.util.Map;
import java.util.Collections;
@@ -41,8 +39,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class PortletControllerRequestConstructorTestCase
+public class PortletControllerRequestConstructorTestCase extends junit.framework.TestCase
{
private String windowId = "foo";
@@ -53,7 +50,6 @@
private PortletPageNavigationalState pageNS = new StateControllerContextImpl(new PortletControllerContextSupport()).createPortletPageNavigationalState(false);
private Map<String, String[]> pageNSChanges = Collections.emptyMap();
- @Test
public void testWithNonNullArgs()
{
new PortletActionRequest(windowId, interactionState, body, windowNS, pageNS);
@@ -63,7 +59,6 @@
new PortletResourceRequest(windowId, "foo", resourceState, body, new PortletResourceRequest.PageScope(windowNS, pageNS));
}
- @Test
public void testWithNullWindowNavigationalState()
{
new PortletActionRequest(windowId, interactionState, body, null, pageNS);
@@ -71,7 +66,6 @@
new PortletResourceRequest(windowId, "foo", resourceState, body, new PortletResourceRequest.PageScope(null, pageNS));
}
- @Test
public void testNullPageNavigationalState()
{
new PortletActionRequest(windowId, interactionState, body, windowNS, null);
@@ -79,7 +73,6 @@
new PortletResourceRequest(windowId, "foo", resourceState, body, new PortletResourceRequest.PageScope(windowNS, null));
}
- @Test
public void testWithNullBody()
{
new PortletActionRequest(windowId, interactionState, null, windowNS, pageNS);
@@ -88,7 +81,6 @@
new PortletResourceRequest(windowId, "foo", resourceState, null, new PortletResourceRequest.PageScope(windowNS, pageNS));
}
- @Test
public void testWithNullResourceId()
{
new PortletResourceRequest(windowId, null, resourceState, body, new PortletResourceRequest.FullScope());
@@ -96,7 +88,6 @@
new PortletResourceRequest(windowId, null, resourceState, body, new PortletResourceRequest.PageScope(windowNS, pageNS));
}
- @Test
public void testNullWindowId()
{
try
@@ -141,7 +132,6 @@
}
}
- @Test
public void testNullInteractionState()
{
try
@@ -154,7 +144,6 @@
}
}
- @Test
public void testNullResourceState()
{
try
@@ -183,7 +172,6 @@
}
}
- @Test
public void testNullScope()
{
try
Modified: components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestTestCase.java
===================================================================
--- components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestTestCase.java 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerRequestTestCase.java 2011-06-24 22:31:03 UTC (rev 6745)
@@ -22,9 +22,7 @@
*/
package org.gatein.pc.controller;
-import static org.jboss.unit.api.Assert.*;
-
-import org.jboss.unit.api.pojo.annotations.Test;
+import junit.framework.TestCase;
import org.gatein.pc.portlet.support.PortletInvokerSupport;
import org.gatein.pc.portlet.support.PortletSupport;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
@@ -51,8 +49,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class PortletControllerRequestTestCase
+public class PortletControllerRequestTestCase extends TestCase
{
/** . */
@@ -85,7 +82,6 @@
/** . */
OpaqueStateString rs = new OpaqueStateString("rs");
- @Test
public void testPortletControllerActionRequest() throws PortletInvokerException
{
PortletSupport fooPortlet = invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -112,7 +108,6 @@
controller.process(context, action);
}
- @Test
public void testPortletControllerRenderRequest() throws PortletInvokerException
{
invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -120,7 +115,6 @@
controller.process(context, render);
}
- @Test
public void testPortletControllerResourceRequestFullScope() throws PortletInvokerException
{
PortletSupport fooPortlet = invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -150,7 +144,6 @@
controller.process(context, fullServing3);
}
- @Test
public void testPortletControllerResourceRequestPortletScope() throws PortletInvokerException
{
PortletSupport fooPortlet = invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -182,7 +175,6 @@
controller.process(context, portletServing3);
}
- @Test
public void testPortletControllerResourceRequestPageScope() throws PortletInvokerException
{
PortletSupport fooPortlet = invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
Modified: components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerTestCase.java
===================================================================
--- components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerTestCase.java 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/PortletControllerTestCase.java 2011-06-24 22:31:03 UTC (rev 6745)
@@ -22,6 +22,7 @@
*/
package org.gatein.pc.controller;
+import junit.framework.TestCase;
import org.gatein.pc.controller.request.ControllerRequest;
import org.gatein.pc.controller.request.PortletRenderRequest;
import org.gatein.pc.controller.state.PortletPageNavigationalState;
@@ -47,11 +48,7 @@
import org.gatein.pc.api.invocation.EventInvocation;
import org.gatein.common.util.Tools;
import org.gatein.pc.api.WindowState;
-import org.jboss.unit.api.pojo.annotations.Test;
-import org.jboss.unit.api.pojo.annotations.Create;
-import static org.jboss.unit.api.Assert.*;
-
import javax.xml.namespace.QName;
import java.util.HashMap;
@@ -59,8 +56,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class PortletControllerTestCase
+public class PortletControllerTestCase extends TestCase
{
/** . */
@@ -78,13 +74,12 @@
public static final QName SRC_NAME = new QName("ns1", "src");
public static final QName DST_NAME = new QName("ns2", "dest");
- @Create
- public void create()
+ @Override
+ protected void setUp() throws Exception
{
context.setEventControllerContext(eventControllerContext);
}
- @Test
public void testPortletControllerRenderRequest() throws PortletInvokerException
{
invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -93,8 +88,9 @@
PortletWindowNavigationalState windowNS = new PortletWindowNavigationalState(portletNS, org.gatein.pc.api.Mode.EDIT, WindowState.MAXIMIZED);
PortletRenderRequest render = new PortletRenderRequest(PortletInvokerSupport.FOO_PORTLET_ID, windowNS, new HashMap<String, String[]>(), pageNS);
ControllerResponse response = controller.process(context, render);
- PageUpdateResponse pageUpdate = assertInstanceOf(response, PageUpdateResponse.class);
- PortletPageNavigationalState pageNS2 = assertNotNull(pageUpdate.getPageNavigationalState());
+ PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
+ assertNotNull(pageUpdate.getPageNavigationalState());
+ PortletPageNavigationalState pageNS2 = pageUpdate.getPageNavigationalState();
assertEquals(Tools.toSet(PortletInvokerSupport.FOO_PORTLET_ID), pageNS2.getPortletWindowIds());
PortletWindowNavigationalState windowNS2 = pageNS2.getPortletWindowNavigationalState(PortletInvokerSupport.FOO_PORTLET_ID);
assertNotNull(windowNS2);
@@ -103,13 +99,11 @@
assertEquals(WindowState.MAXIMIZED, windowNS2.getWindowState());
}
- @Test
public void testAction() throws PortletInvokerException
{
testAction(false);
}
- @Test
public void testActionPublishesAnEvent() throws PortletInvokerException
{
testAction(true);
@@ -165,11 +159,13 @@
//
ControllerRequest request = context.createActionRequest(PortletInvokerSupport.FOO_PORTLET_ID);
ControllerResponse response = controller.process(context, request);
- PageUpdateResponse pageUpdate = assertInstanceOf(response, PageUpdateResponse.class);
- PortletPageNavigationalState pageNS = assertNotNull(pageUpdate.getPageNavigationalState());
+ PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
+ assertNotNull(pageUpdate.getPageNavigationalState());
+ PortletPageNavigationalState pageNS = pageUpdate.getPageNavigationalState();
//
- PortletWindowNavigationalState fooNS = assertNotNull(pageNS.getPortletWindowNavigationalState(PortletInvokerSupport.FOO_PORTLET_ID));
+ assertNotNull(pageNS.getPortletWindowNavigationalState(PortletInvokerSupport.FOO_PORTLET_ID));
+ PortletWindowNavigationalState fooNS = pageNS.getPortletWindowNavigationalState(PortletInvokerSupport.FOO_PORTLET_ID);
assertEquals(WindowState.MAXIMIZED, fooNS.getWindowState());
assertEquals(org.gatein.pc.api.Mode.EDIT, fooNS.getMode());
assertEquals(new OpaqueStateString("abc"), fooNS.getPortletNavigationalState());
@@ -180,7 +176,8 @@
assertEquals(Tools.toSet(PortletInvokerSupport.FOO_PORTLET_ID, PortletInvokerSupport.BAR_PORTLET_ID), pageNS.getPortletWindowIds());
//
- PortletWindowNavigationalState barNS = assertNotNull(pageNS.getPortletWindowNavigationalState(PortletInvokerSupport.BAR_PORTLET_ID));
+ assertNotNull(pageNS.getPortletWindowNavigationalState(PortletInvokerSupport.BAR_PORTLET_ID));
+ PortletWindowNavigationalState barNS = pageNS.getPortletWindowNavigationalState(PortletInvokerSupport.BAR_PORTLET_ID);
assertEquals(WindowState.MINIMIZED, barNS.getWindowState());
assertEquals(org.gatein.pc.api.Mode.HELP, barNS.getMode());
assertEquals(new OpaqueStateString("def"), barNS.getPortletNavigationalState());
@@ -191,7 +188,6 @@
}
}
- @Test
public void testActionThrowsPortletInvokerException() throws PortletInvokerException
{
final PortletInvokerException e = new PortletInvokerException();
@@ -218,7 +214,6 @@
}
}
- @Test
public void testProcessActionProducedEventIsDistributed() throws PortletInvokerException
{
PortletSupport fooPortlet = invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -304,7 +299,6 @@
barPortlet.assertInvocationCountIs(5);
}
- @Test
public void testEventFloodDetection() throws PortletInvokerException
{
PortletSupport fooPortlet = invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -321,7 +315,7 @@
fooPortlet.addHandler(eventProducerActionHandler);
fooPortlet.addHandler(eventProducerEventHandler);
ControllerResponse response = controller.process(context, request);
- PageUpdateResponse updateResponse = assertInstanceOf(response, PageUpdateResponse.class);
+ PageUpdateResponse updateResponse = (PageUpdateResponse)response;
assertEquals(PortletResponse.PRODUCED_EVENT_FLOODED, updateResponse.getEventDistributionStatus());
//
@@ -330,11 +324,10 @@
fooPortlet.addHandler(eventProducerActionHandler);
fooPortlet.addHandler(eventProducerEventHandler);
response = controller.process(context, request);
- updateResponse = assertInstanceOf(response, PageUpdateResponse.class);
+ updateResponse = (PageUpdateResponse)response;
assertEquals(PortletResponse.CONSUMED_EVENT_FLOODED, updateResponse.getEventDistributionStatus());
}
- @Test
public void testEventFloodInterruption() throws PortletInvokerException
{
PortletSupport fooPortlet = invoker.addPortlet(PortletInvokerSupport.FOO_PORTLET_ID);
@@ -356,7 +349,7 @@
});
fooPortlet.addHandler(eventProducerActionHandler);
ControllerResponse response = controller.process(context, request);
- PageUpdateResponse updateResponse = assertInstanceOf(response, PageUpdateResponse.class);
+ PageUpdateResponse updateResponse = (PageUpdateResponse)response;
assertEquals(PortletResponse.INTERRUPTED, updateResponse.getEventDistributionStatus());
}
}
Modified: components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/WiringEventControllerContext.java
===================================================================
--- components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/WiringEventControllerContext.java 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/controller/src/test/java/org/gatein/pc/controller/WiringEventControllerContext.java 2011-06-24 22:31:03 UTC (rev 6745)
@@ -27,8 +27,6 @@
import org.gatein.pc.controller.event.EventPhaseContext;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
-import static org.jboss.unit.api.Assert.*;
-
import javax.xml.namespace.QName;
import java.util.List;
import java.util.Map;
@@ -144,19 +142,19 @@
public PortletInvocationResponse assertConsumed()
{
- assertEquals(EVENT_CONSUMED, type);
+ junit.framework.Assert.assertEquals(EVENT_CONSUMED, type);
return (PortletInvocationResponse)data;
}
public Throwable assertFailed()
{
- assertEquals(EVENT_FAILED, type);
+ junit.framework.Assert.assertEquals(EVENT_FAILED, type);
return (Throwable)data;
}
public int assertDiscarded()
{
- assertEquals(EVENT_DISCARDED, type);
+ junit.framework.Assert.assertEquals(EVENT_DISCARDED, type);
return (Integer)data;
}
}
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/portlet/pom.xml 2011-06-24 22:31:03 UTC (rev 6745)
@@ -62,6 +62,17 @@
<skip>false</skip>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java 2011-06-24 22:04:40 UTC (rev 6744)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java 2011-06-24 22:31:03 UTC (rev 6745)
@@ -111,7 +111,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
- Assert.assertNotNull(invocation);
+ junit.framework.Assert.assertNotNull(invocation);
//
if (invocationCount == handlers.size())
13 years, 6 months
gatein SVN: r6744 - in components/pc/trunk: portal and 10 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-24 18:04:40 -0400 (Fri, 24 Jun 2011)
New Revision: 6744
Removed:
components/pc/trunk/mc/
Modified:
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portal/src/assemble/simple-portal-jboss42.xml
components/pc/trunk/portal/src/assemble/simple-portal-jboss51.xml
components/pc/trunk/portal/src/assemble/simple-portal-jboss6.xml
components/pc/trunk/portal/src/assemble/simple-portal-tomcat60.xml
components/pc/trunk/portal/src/assemble/simple-portal-tomcat70.xml
components/pc/trunk/test/core/pom.xml
components/pc/trunk/test/core/src/main/resources/common.xml
components/pc/trunk/test/servers/jboss42/pom.xml
components/pc/trunk/test/servers/jboss51/pom.xml
components/pc/trunk/test/servers/jboss6/pom.xml
components/pc/trunk/test/servers/jetty6/pom.xml
components/pc/trunk/test/servers/src/common/resources/common.xml
components/pc/trunk/test/servers/tomcat6/pom.xml
components/pc/trunk/test/servers/tomcat7/pom.xml
Log:
remove module mc
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -123,11 +123,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
<version>${project.version}</version>
</dependency>
@@ -290,7 +285,6 @@
<module>bridge</module>
<module>federation</module>
<module>management</module>
- <module>mc</module>
<module>test</module>
<module>portal</module>
<module>samples</module>
@@ -312,7 +306,6 @@
<module>api</module>
<module>portlet</module>
<module>controller</module>
- <module>mc</module>
<module>test</module>
</modules>
</profile>
@@ -322,7 +315,6 @@
<module>api</module>
<module>portlet</module>
<module>controller</module>
- <module>mc</module>
<module>portal</module>
<module>samples</module>
</modules>
@@ -337,7 +329,6 @@
<module>bridge</module>
<module>federation</module>
<module>management</module>
- <module>mc</module>
<module>portal</module>
<module>samples</module>
<module>docs</module>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/portal/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -51,10 +51,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
<dependency>
Modified: components/pc/trunk/portal/src/assemble/simple-portal-jboss42.xml
===================================================================
--- components/pc/trunk/portal/src/assemble/simple-portal-jboss42.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/portal/src/assemble/simple-portal-jboss42.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -34,7 +34,6 @@
<include>org.gatein.common:common-mc</include>
<include>org.gatein.pc:pc-controller</include>
- <include>org.gatein.pc:pc-mc</include>
<include>org.jboss:jboss-common-core</include>
<include>org.jboss.microcontainer:jboss-kernel</include>
Modified: components/pc/trunk/portal/src/assemble/simple-portal-jboss51.xml
===================================================================
--- components/pc/trunk/portal/src/assemble/simple-portal-jboss51.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/portal/src/assemble/simple-portal-jboss51.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -33,7 +33,6 @@
<include>org.gatein.common:common-mc</include>
<include>org.gatein.pc:pc-controller</include>
- <include>org.gatein.pc:pc-mc</include>
<include>org.jboss:jboss-common-core</include>
<include>org.jboss.microcontainer:jboss-dependency</include>
Modified: components/pc/trunk/portal/src/assemble/simple-portal-jboss6.xml
===================================================================
--- components/pc/trunk/portal/src/assemble/simple-portal-jboss6.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/portal/src/assemble/simple-portal-jboss6.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -33,7 +33,6 @@
<include>org.gatein.common:common-mc</include>
<include>org.gatein.pc:pc-controller</include>
- <include>org.gatein.pc:pc-mc</include>
<include>org.jboss:jboss-common-core</include>
<include>org.jboss.microcontainer:jboss-dependency</include>
Modified: components/pc/trunk/portal/src/assemble/simple-portal-tomcat60.xml
===================================================================
--- components/pc/trunk/portal/src/assemble/simple-portal-tomcat60.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/portal/src/assemble/simple-portal-tomcat60.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -43,7 +43,6 @@
<includes>
<include>org.gatein.common:common-mc</include>
<include>org.gatein.pc:pc-controller</include>
- <include>org.gatein.pc:pc-mc</include>
<include>jboss:jboss-common-logging-spi</include>
<include>jboss:jboss-common-logging-log4j</include>
Modified: components/pc/trunk/portal/src/assemble/simple-portal-tomcat70.xml
===================================================================
--- components/pc/trunk/portal/src/assemble/simple-portal-tomcat70.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/portal/src/assemble/simple-portal-tomcat70.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -43,7 +43,6 @@
<includes>
<include>org.gatein.common:common-mc</include>
<include>org.gatein.pc:pc-controller</include>
- <include>org.gatein.pc:pc-mc</include>
<include>jboss:jboss-common-logging-spi</include>
<include>jboss:jboss-common-logging-log4j</include>
Modified: components/pc/trunk/test/core/pom.xml
===================================================================
--- components/pc/trunk/test/core/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/core/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -37,10 +37,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
Modified: components/pc/trunk/test/core/src/main/resources/common.xml
===================================================================
--- components/pc/trunk/test/core/src/main/resources/common.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/core/src/main/resources/common.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -69,7 +69,6 @@
<path id="portal-portlet">
<pathelement location="${org.gatein.pc:pc-controller:jar}"/>
- <pathelement location="${org.gatein.pc:pc-mc:jar}"/>
</path>
<path id="portal-portlet-shared">
Modified: components/pc/trunk/test/servers/jboss42/pom.xml
===================================================================
--- components/pc/trunk/test/servers/jboss42/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/servers/jboss42/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -32,10 +32,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
Modified: components/pc/trunk/test/servers/jboss51/pom.xml
===================================================================
--- components/pc/trunk/test/servers/jboss51/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/servers/jboss51/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -31,10 +31,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
Modified: components/pc/trunk/test/servers/jboss6/pom.xml
===================================================================
--- components/pc/trunk/test/servers/jboss6/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/servers/jboss6/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -31,10 +31,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
Modified: components/pc/trunk/test/servers/jetty6/pom.xml
===================================================================
--- components/pc/trunk/test/servers/jetty6/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/servers/jetty6/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -31,10 +31,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
Modified: components/pc/trunk/test/servers/src/common/resources/common.xml
===================================================================
--- components/pc/trunk/test/servers/src/common/resources/common.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/servers/src/common/resources/common.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -69,7 +69,6 @@
<path id="portal-portlet">
<pathelement location="${org.gatein.pc:pc-controller:jar}"/>
- <pathelement location="${org.gatein.pc:pc-mc:jar}"/>
</path>
<path id="portal-portlet-shared">
Modified: components/pc/trunk/test/servers/tomcat6/pom.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat6/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/servers/tomcat6/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -31,10 +31,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
Modified: components/pc/trunk/test/servers/tomcat7/pom.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat7/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
+++ components/pc/trunk/test/servers/tomcat7/pom.xml 2011-06-24 22:04:40 UTC (rev 6744)
@@ -31,10 +31,6 @@
</dependency>
<dependency>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
</dependency>
13 years, 6 months
gatein SVN: r6743 - in components/pc/trunk: mc/src/test/java/org/gatein/pc/mc/metadata and 19 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-24 17:52:27 -0400 (Fri, 24 Jun 2011)
New Revision: 6743
Added:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationContextImpl.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployer.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployment.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletContainerContextImpl.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletFilterContextImpl.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/staxnav/
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/AbstractMetaDataTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ContainerRuntimeOptionTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomPortletModeTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomWindowStateTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/FilterTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/GeneralMetaDataTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ListenerTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/PortletTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/RenderParameterTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/SecurityConstraintTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/UserAttributeTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/resources/metadata/
components/pc/trunk/portlet/src/test/resources/metadata/filter/portlet-filter2.xml
components/pc/trunk/portlet/src/test/resources/metadata/general/portlet-app_2_0.xml
components/pc/trunk/portlet/src/test/resources/metadata/listener/
components/pc/trunk/portlet/src/test/resources/metadata/runtimeoption/
Removed:
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationContextImpl.java
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployment.java
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletContainerContextImpl.java
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletFilterContextImpl.java
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ContainerRuntimeOptionTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomPortletModeTestEverythingTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomWindowStateTestEverythingTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/EventTestEverythingTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/FilterTestEverythingTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/GeneralMetaDataTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ListenerTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/PortletTestEverythingTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/RenderParameterTestEverythingTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/SecurityConstraintTestEverythingTestCase.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/UserAttributeTestEverythingTestCase.java
components/pc/trunk/mc/src/test/resources/metadata/
components/pc/trunk/portlet/src/test/resources/metadata/filter/portlet-filter2.xml
components/pc/trunk/portlet/src/test/resources/metadata/general/portlet-app_2_0.xml
Modified:
components/pc/trunk/mc/src/test/resources/local-jboss-unit.xml
components/pc/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-portal-beans.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/staxnav/Element.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/staxnav/PortletApplicationMetaDataBuilder.java
components/pc/trunk/test/core/src/main/java/org/gatein/pc/test/TestPortletApplicationDeployer.java
components/pc/trunk/test/servers/jboss42/src/test/build.xml
components/pc/trunk/test/servers/jboss51/src/test/build.xml
components/pc/trunk/test/servers/jboss6/src/test/build.xml
components/pc/trunk/test/servers/jetty6/src/test/build.xml
components/pc/trunk/test/servers/tomcat6/src/test/build.xml
components/pc/trunk/test/servers/tomcat7/src/test/build.xml
Log:
move code from mc module to portlet module
Deleted: components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationContextImpl.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationContextImpl.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationContextImpl.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,72 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.gatein.pc.mc;
-
-import org.gatein.pc.portlet.container.PortletApplicationContext;
-import org.gatein.pc.portlet.container.managed.ManagedPortletApplication;
-import org.gatein.wci.WebApp;
-
-import javax.servlet.ServletContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletApplicationContextImpl implements PortletApplicationContext
-{
-
- /** . */
- private final WebApp webApp;
-
- ManagedPortletApplication managedPortletApplication;
-
- public PortletApplicationContextImpl(WebApp webApp)
- {
- this.webApp = webApp;
- }
-
- public ServletContext getServletContext()
- {
- return webApp.getServletContext();
- }
-
- public String getContextPath()
- {
- return webApp.getContextPath();
- }
-
- public ClassLoader getClassLoader()
- {
- return webApp.getClassLoader();
- }
-
- public void managedStart()
- {
- managedPortletApplication.managedStart();
- }
-
- public void managedStop()
- {
- managedPortletApplication.managedStop();
- }
-}
Deleted: components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,348 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.gatein.pc.mc;
-
-import org.gatein.common.logging.Logger;
-import org.gatein.common.io.IOTools;
-import org.gatein.common.logging.LoggerFactory;
-import org.gatein.pc.api.PortletInvoker;
-import org.gatein.pc.mc.staxnav.PortletApplicationMetaDataBuilder;
-import org.gatein.pc.portlet.container.ContainerPortletInvoker;
-import org.gatein.pc.portlet.container.PortletContainer;
-import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
-import org.gatein.pc.portlet.container.managed.ManagedObject;
-import org.gatein.pc.portlet.container.managed.ManagedObjectEvent;
-import org.gatein.pc.portlet.container.managed.ManagedObjectLifeCycleEvent;
-import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEvent;
-import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventBroadcaster;
-import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventListener;
-import org.gatein.pc.portlet.container.managed.ManagedPortletApplication;
-import org.gatein.pc.portlet.container.managed.PortletApplicationRegistry;
-import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
-import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.wci.ServletContainer;
-import org.gatein.wci.ServletContainerFactory;
-import org.gatein.wci.WebApp;
-import org.gatein.wci.WebAppEvent;
-import org.gatein.wci.WebAppLifeCycleEvent;
-import org.gatein.wci.WebAppListener;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletApplicationDeployer implements WebAppListener, PortletApplicationRegistry
-{
-
- /** . */
- private Logger log = LoggerFactory.getLogger(PortletApplicationDeployer.class);
-
- /** . */
- private PortletApplicationRegistry registry;
-
- /** . */
- private ServletContainer servletContainer;
-
- private ServletContainerFactory servletContainerFactory;
-
- /** . */
- private Map<String, PortletApplicationDeployment> deploymentMap = new HashMap<String, PortletApplicationDeployment>();
-
- /** . */
- private ClassLoader classLoader;
-
- /** . */
- private final Map<String, PortletApplicationLifeCycle> applications = new HashMap<String, PortletApplicationLifeCycle>();
-
- /** . */
- private ContainerPortletInvoker containerPortletInvoker;
-
- /** . */
- private ManagedObjectRegistryEventBroadcaster broadcaster;
-
- public PortletApplicationRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(PortletApplicationRegistry registry)
- {
- this.registry = registry;
- }
-
- public ServletContainer getServletContainer()
- {
- if (servletContainer == null)
- {
- servletContainer = servletContainerFactory.getServletContainer();
- }
- return servletContainer;
- }
-
- public void setServletContainer(ServletContainer servletContainer)
- {
- throw new UnsupportedOperationException("Inject ServletContainerFactory instead!");
- }
-
- public ServletContainerFactory getServletContainerFactory()
- {
- return servletContainerFactory;
- }
-
- public void setServletContainerFactory(ServletContainerFactory servletContainerFactory)
- {
- this.servletContainerFactory = servletContainerFactory;
- }
-
- public PortletInvoker getContainerPortletInvoker()
- {
- return containerPortletInvoker;
- }
-
- public void setContainerPortletInvoker(PortletInvoker containerPortletInvoker)
- {
- if (containerPortletInvoker instanceof ContainerPortletInvoker)
- {
- this.containerPortletInvoker = (ContainerPortletInvoker)containerPortletInvoker;
- }
- else
- {
- if (containerPortletInvoker == null)
- {
- return; // this method is called with null on shutdown
- }
- throw new IllegalArgumentException("PortletApplicationDeployer can only accept ContainerPortletInvokers!");
- }
- }
-
- public void onEvent(WebAppEvent event)
- {
- if (event instanceof WebAppLifeCycleEvent)
- {
- WebAppLifeCycleEvent lifeCycleEvent = (WebAppLifeCycleEvent)event;
- String cp = event.getWebApp().getContextPath();
- switch (lifeCycleEvent.getType())
- {
- case WebAppLifeCycleEvent.ADDED:
- log.debug("Going to install war file" + cp);
- add(event.getWebApp());
- log.debug("Installed war file" + cp);
- break;
- case WebAppLifeCycleEvent.REMOVED:
- try
- {
- log.debug("Going to uninstall war file" + cp);
- remove(event.getWebApp());
- log.debug("Uninstalled war file" + cp);
- }
- catch (Throwable e)
- {
- log.error("Uninstalled war file " + cp + " with an error", e);
- }
- break;
- }
- }
- }
-
- protected void add(WebApp webApp)
- {
- //
- PortletApplication10MetaData metaData = buildPortletApplicationMetaData(webApp);
- if (metaData != null)
- {
- ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- PortletApplicationDeployment deployment = new PortletApplicationDeployment(broadcaster, webApp, metaData);
- deploymentMap.put(webApp.getContextPath(), deployment);
- deployment.install();
-
- //
- PortletApplicationLifeCycle portletApplicationLifeCycle = deployment.getPortletApplicationLifeCycle();
- applications.put(portletApplicationLifeCycle.getId(), portletApplicationLifeCycle);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(oldCL);
- }
- }
- }
-
- private void remove(WebApp webApp)
- {
- PortletApplicationDeployment deployment = deploymentMap.remove(webApp.getContextPath());
- if (deployment != null)
- {
- PortletApplicationLifeCycle portletApplicationLifeCycle = deployment.getPortletApplicationLifeCycle();
- applications.remove(portletApplicationLifeCycle.getId());
-
- //
- ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- deployment.uninstall();
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(oldCL);
- }
- }
- }
-
- public void start()
- {
- broadcaster = new ManagedObjectRegistryEventBroadcaster();
- classLoader = Thread.currentThread().getContextClassLoader();
-
- //
- broadcaster.addListener(bridgeToInvoker);
- getServletContainer().addWebAppListener(this);
- }
-
- public void stop()
- {
- // This should generate remove web app event and in cascade clear the registry
- // as well as the portlet container invoker
- getServletContainer().removeWebAppListener(this);
-
- //
- classLoader = null;
- broadcaster = null;
- }
-
- protected PortletApplication10MetaData buildPortletApplicationMetaData(WebApp webApp)
- {
- try
- {
- URL url = webApp.getServletContext().getResource("/WEB-INF/portlet.xml");
- if (url != null)
- {
- InputStream in = null;
- try
- {
- in = IOTools.safeBufferedWrapper(url.openStream());
-
- //
- PortletApplicationMetaDataBuilder builder = new PortletApplicationMetaDataBuilder();
-
- //
- return builder.build(in);
-
-/*
- // Validate
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setSchemaValidation(false);
- unmarshaller.setValidation(false);
-
- //
- PortletApplicationModelFactory factory = new PortletApplicationModelFactory();
-
- // Unmarshal
- PortletApplication10MetaData portletApplicationMD = (PortletApplication10MetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory), null);
-
- //
- return portletApplicationMD;
-*/
- }
- finally
- {
- IOTools.safeClose(in);
- }
- }
- }
- catch (Exception e)
- {
- log.error("Cannot read portlet.xml", e);
- }
- return null;
- }
-
- public Collection<? extends ManagedPortletApplication> getManagedPortletApplications()
- {
- return applications.values();
- }
-
- public ManagedPortletApplication getManagedPortletApplication(String id)
- {
- return applications.get(id);
- }
-
- public void addListener(ManagedObjectRegistryEventListener listener)
- {
- broadcaster.addListener(listener);
- }
-
- public void removeListener(ManagedObjectRegistryEventListener listener)
- {
- broadcaster.addListener(listener);
- }
-
- /** Bridge managed object event to add/remove portlet container in portlet container invoker. */
- private final ManagedObjectRegistryEventListener bridgeToInvoker = new ManagedObjectRegistryEventListener()
- {
- public void onEvent(ManagedObjectRegistryEvent event)
- {
- if (event instanceof ManagedObjectEvent)
- {
- ManagedObjectEvent managedObjectEvent = (ManagedObjectEvent)event;
- ManagedObject managedObject = managedObjectEvent.getManagedObject();
-
- //
- if (managedObject instanceof PortletContainerLifeCycle)
- {
- PortletContainerLifeCycle portletContainerLifeCycle = (PortletContainerLifeCycle)managedObject;
- PortletContainer portletContainer = portletContainerLifeCycle.getPortletContainer();
-
- //
- if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
- {
- ManagedObjectLifeCycleEvent lifeCycleEvent = (ManagedObjectLifeCycleEvent)managedObjectEvent;
-
- //
- LifeCycleStatus status = lifeCycleEvent.getStatus();
-
- //
- if (status == LifeCycleStatus.STARTED)
- {
- containerPortletInvoker.addPortletContainer(portletContainer);
- }
- else
- {
- containerPortletInvoker.removePortletContainer(portletContainer);
- }
- }
- }
- }
- }
- };
-}
Deleted: components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployment.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployment.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployment.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,169 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.gatein.pc.mc;
-
-import org.gatein.common.logging.Logger;
-import org.gatein.common.logging.LoggerFactory;
-import org.gatein.pc.portlet.impl.info.ContainerInfoBuilder;
-import org.gatein.pc.portlet.impl.info.ContainerInfoBuilderContext;
-import org.gatein.pc.portlet.impl.info.ContainerPortletInfo;
-import org.gatein.pc.portlet.impl.info.ContainerFilterInfo;
-import org.gatein.pc.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
-import org.gatein.pc.portlet.impl.jsr168.PortletApplicationImpl;
-import org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl;
-import org.gatein.pc.portlet.impl.jsr168.PortletFilterImpl;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
-import org.gatein.pc.portlet.impl.container.PortletFilterLifeCycle;
-import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
-import org.gatein.pc.portlet.container.object.PortletApplicationObject;
-import org.gatein.pc.portlet.container.object.PortletContainerObject;
-import org.gatein.pc.portlet.container.object.PortletFilterObject;
-import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventListener;
-import org.gatein.wci.WebApp;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletApplicationDeployment
-{
-
- /** . */
- private final Logger log;
-
- /** . */
- private final WebApp webApp;
-
- /** . */
- private final PortletApplication10MetaData metaData;
-
- /** . */
- private final ManagedObjectRegistryEventListener listener;
-
- /** . */
- private PortletApplicationLifeCycle portletApplicationLifeCycle;
-
- public PortletApplicationDeployment(
- ManagedObjectRegistryEventListener listener,
- WebApp webApp,
- PortletApplication10MetaData metaData)
- {
- this.listener = listener;
- this.webApp = webApp;
- this.metaData = metaData;
- this.log = LoggerFactory.getLogger(PortletApplicationDeployment.class + "." + webApp.getContextPath().replace('.', '_'));
- }
-
- public PortletApplicationLifeCycle getPortletApplicationLifeCycle()
- {
- return portletApplicationLifeCycle;
- }
-
- void install()
- {
-
- log.debug("Starting installation");
-
- //
- ContainerInfoBuilderContext builderContext = new ContainerInfoBuilderContextImpl(metaData, webApp);
- ContainerInfoBuilder builder = new ContainerInfoBuilder(webApp.getContextPath(), metaData, builderContext);
- builder.build();
-
- //
- PortletApplicationObject portletApplicationObject = new PortletApplicationImpl(builder.getApplication());
- PortletApplicationContextImpl portletApplicationContext = new PortletApplicationContextImpl(webApp);
-
-
- //
- portletApplicationLifeCycle = new PortletApplicationLifeCycle(
- listener,
- portletApplicationContext,
- portletApplicationObject);
-
- // Needed for the managed callbacks
- portletApplicationContext.managedPortletApplication = portletApplicationLifeCycle;
-
- //
- for (ContainerFilterInfo filterInfo : builder.getApplication().getFilters().values())
- {
- PortletFilterObject portletFilterObject = new PortletFilterImpl(filterInfo);
- PortletFilterContextImpl portletFilterContext = new PortletFilterContextImpl();
-
- //
- PortletFilterLifeCycle portletFilterLifeCycle = portletApplicationLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject);
-
- // Needed for the managed callbacks
- portletFilterContext.managedPortletFilter = portletFilterLifeCycle;
- }
-
- //
- for (ContainerPortletInfo containerInfo : builder.getPortlets())
- {
- PortletContainerObject portletContainerObject = new PortletContainerImpl(containerInfo);
- PortletContainerContextImpl portletContainerContext = new PortletContainerContextImpl();
-
- //
- PortletContainerLifeCycle portletContainerLifeCycle = portletApplicationLifeCycle.addPortletContainer(portletContainerContext, portletContainerObject);
-
- // Needed for the managed callbacks
- portletContainerContext.managedPortletContainer = portletContainerLifeCycle;
-
- // Now create deps
- for (String filterRef : containerInfo.getFilterRefs())
- {
- PortletFilterLifeCycle portletFilterLifeCycle = portletApplicationLifeCycle.getManagedPortletFilter(filterRef);
-
- //
- if (portletFilterLifeCycle != null)
- {
- portletApplicationLifeCycle.addDependency(portletFilterLifeCycle, portletContainerLifeCycle);
- }
- else
- {
- // todo
- }
- }
- }
-
- //
- portletApplicationLifeCycle.create();
-
- //
- portletApplicationLifeCycle.managedStart();
-
- //
-
- }
-
- void uninstall()
- {
- log.debug("Uninstalling");
-
- //
- portletApplicationLifeCycle.managedStop();
-
- //
- log.debug("Uninstalled");
- }
-}
Deleted: components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletContainerContextImpl.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletContainerContextImpl.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletContainerContextImpl.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.gatein.pc.mc;
-
-import org.gatein.pc.portlet.container.PortletContainerContext;
-import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletContainerContextImpl implements PortletContainerContext
-{
-
- /** . */
- ManagedPortletContainer managedPortletContainer;
-
- public void managedStart()
- {
- managedPortletContainer.managedStart();
- }
-
- public void managedStop()
- {
- managedPortletContainer.managedStop();
- }
-}
Deleted: components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletFilterContextImpl.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletFilterContextImpl.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletFilterContextImpl.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,46 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.gatein.pc.mc;
-
-import org.gatein.pc.portlet.container.PortletFilterContext;
-import org.gatein.pc.portlet.container.managed.ManagedPortletFilter;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletFilterContextImpl implements PortletFilterContext
-{
-
- ManagedPortletFilter managedPortletFilter;
-
- public void managedStart()
- {
- managedPortletFilter.managedStart();
- }
-
- public void managedStop()
- {
- managedPortletFilter.managedStop();
- }
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,113 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-import org.gatein.pc.mc.staxnav.PortletApplicationMetaDataBuilder;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-
-import org.xml.sax.SAXException;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public abstract class AbstractMetaDataTestCase extends TestCase
-{
-
- /** Test parameter for using xml binding annotation. */
- public static final String ANNOTATION_BINDING = "annotation";
-
- /** Annotation or ObjectModelFactory parsing. */
- private String parser = ANNOTATION_BINDING;
-
- protected PortletApplication20MetaData _unmarshall10(String file) throws SAXException, IOException
- {
- return _unmarshall10(file, false);
- }
-
- protected PortletApplication20MetaData _unmarshall10(String file, boolean fail) throws SAXException, IOException
- {
- try
- {
- PortletApplicationMetaDataBuilder builder = new PortletApplicationMetaDataBuilder();
- String path = getPath(file);
- URL url = new URL(path);
- InputStream in = url.openStream();
- assertNotNull(in);
- PortletApplication20MetaData build = builder.build(in);
- if (fail)
- {
- throw new AssertionFailedError("Was expecting unmarshalling of " + file + " to fail");
- }
- return build;
- }
- catch (Exception e)
- {
- if (fail)
- {
- // OK
- return null;
- }
- else
- {
- throw fail(e);
- }
- }
- }
-
- protected final Error fail(Throwable t)
- {
- AssertionFailedError afe = new AssertionFailedError();
- afe.initCause(t);
- throw afe;
- }
-
- protected final Error fail(Throwable t, String msg)
- {
- AssertionFailedError afe = new AssertionFailedError(msg);
- afe.initCause(t);
- throw afe;
- }
-
- protected String getPath(String file)
- {
- URL url = Thread.currentThread().getContextClassLoader().getResource(file);
- if (url == null)
- {
- fail(file + " not found.");
- }
- return url.toString();
- }
-
- protected InputStream getStream(String file)
- {
- return Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
- }
-
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ContainerRuntimeOptionTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ContainerRuntimeOptionTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ContainerRuntimeOptionTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * 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.gatein.pc.mc.metadata;
-
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.common.ContainerRuntimeMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class ContainerRuntimeOptionTestCase extends AbstractMetaDataTestCase
-{
-
- public void test021() throws Exception
- {
- PortletApplication20MetaData md = _unmarshall10("metadata/runtimeoption/portlet.xml");
- PortletMetaData portlet = md.getPortlet("portlet-name");
- assertNotNull(portlet);
- Map<String, ContainerRuntimeMetaData> m = portlet.getContainerRuntimeOptions();
- assertEquals(Collections.singleton("portlet_container_runtime_option_name"), m.keySet());
- ContainerRuntimeMetaData option = m.get("portlet_container_runtime_option_name");
- assertEquals(Arrays.asList("portlet_container_runtime_option_value"), option.getValues());
- assertNull(md.getContainerRuntimeOptions());
- }
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomPortletModeTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomPortletModeTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomPortletModeTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,112 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.util.Locale;
-
-import org.gatein.pc.portlet.impl.metadata.CustomPortletModeMetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class CustomPortletModeTestEverythingTestCase extends AbstractMetaDataTestCase
-{
-
-
- public void test01()
- {
- try
- {
- String xmlFile = "metadata/customPortletMode/portlet1.xml";
-
- PortletApplication10MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication10MetaData);
- assertEquals("1.0", md.getVersion());
- assertNotNull(md.getCustomPortletModes());
-
- CustomPortletModeMetaData cmd1 = md.getCustomPortletModes().get("Custom");
- assertNotNull(cmd1);
- assertEquals("mode1", cmd1.getId());
- assertEquals("Custom", cmd1.getPortletMode());
- assertEquals("portletMode1", cmd1.getDescription().getDefaultString());
- assertEquals("eigener portlet modus", cmd1.getDescription().getString(new Locale("de"), false));
-
- assertNotNull(md.getCustomPortletModes().get("Custom2"));
- }
- catch (Exception e)
- {
- fail(e);
- }
- }
-
- public void test02()
- {
- try
- {
-
- String xmlFile = "metadata/customPortletMode/portlet2.xml";
-
- PortletApplication20MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- assertEquals("2.0", md.getVersion());
-
- CustomPortletModeMetaData cmd1 = md.getCustomPortletModes().get("Custom");
- assertNotNull(cmd1);
- assertEquals("Custom", cmd1.getPortletMode());
- assertEquals("portletMode1", cmd1.getDescription().getDefaultString());
- assertEquals(true, cmd1.isPortalManaged());
- assertEquals("cmode1", cmd1.getId());
-
- CustomPortletModeMetaData cmd2 = md.getCustomPortletModes().get("Custom2");
- assertNotNull(cmd2);
- assertEquals("Custom2", cmd2.getPortletMode());
- assertEquals(false, cmd2.isPortalManaged());
-
- CustomPortletModeMetaData cmd3 = md.getCustomPortletModes().get("Custom3");
- assertNotNull(cmd3);
- assertEquals("Custom3", cmd3.getPortletMode());
-
- // default value
- assertEquals(true, cmd3.isPortalManaged());
- assertEquals("eigener portlet modus", cmd1.getDescription().getString(new Locale("de"), false));
- assertEquals("Portlet Mode Three", cmd3.getDescription().getDefaultString());
-
-
- }
- catch (Exception e)
- {
- fail(e);
- }
- }
-
- public void test03() throws Exception
- {
- String xmlFile = "metadata/customPortletMode/portlet1-fail.xml";
- _unmarshall10(xmlFile, true);
- }
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomWindowStateTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomWindowStateTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomWindowStateTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,98 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.util.Locale;
-
-import org.gatein.pc.portlet.impl.metadata.CustomWindowStateMetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class CustomWindowStateTestEverythingTestCase extends AbstractMetaDataTestCase
-{
- public void test01()
- {
- try
- {
-
- String xmlFile = "metadata/customWindowState/portlet1.xml";
-
- PortletApplication10MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication10MetaData);
- assertEquals("1.0", md.getVersion());
-
- CustomWindowStateMetaData cws1 = md.getCustomWindowStates().get("windowState1");
- assertEquals("WindowState", cws1.getDescription().getDefaultString());
- assertEquals("windowState1", cws1.getWindowState());
- assertEquals("Offenes Fenster", cws1.getDescription().getString(new Locale("de"), false));
- assertEquals("foo", cws1.getId());
- CustomWindowStateMetaData cws2 = md.getCustomWindowStates().get("windowState2");
- assertNotNull(cws2);
-
- CustomWindowStateMetaData cws3 = md.getCustomWindowStates().get("windowState3");
- assertEquals("drei", cws3.getId());
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail();
- }
- }
-
- public void test02()
- {
- try
- {
-
- String xmlFile = "metadata/customWindowState/portlet2.xml";
-
- PortletApplication20MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- assertEquals("2.0", md.getVersion());
-
- CustomWindowStateMetaData cws1 = md.getCustomWindowStates().get("windowState1");
- assertEquals("WindowState", cws1.getDescription().getDefaultString());
- assertEquals("windowState1", cws1.getWindowState());
- assertEquals("Offenes Fenster", cws1.getDescription().getString(new Locale("de"), false));
- assertEquals("foo", cws1.getId());
-
- CustomWindowStateMetaData cws2 = md.getCustomWindowStates().get("windowState2");
- assertNotNull(cws2);
-
- CustomWindowStateMetaData cws3 = md.getCustomWindowStates().get("windowState3");
- assertEquals("drei", cws3.getId());
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail();
- }
- }
-
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/EventTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/EventTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/EventTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,123 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.util.Locale;
-
-import javax.xml.namespace.QName;
-
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.metadata.event.EventDefinitionMetaData;
-import org.gatein.pc.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class EventTestEverythingTestCase extends AbstractMetaDataTestCase
-{
-
- public void _test01()
- {
- try
- {
-
- String xmlFile = "metadata/event/portlet-event1.xml";
-
- _unmarshall10(xmlFile);
- fail();
- }
- catch (Exception e)
- {
- // ok
- }
- }
-
- public void test02()
- {
- try
- {
-
- String xmlFile = "metadata/event/portlet-event2.xml";
-
- PortletApplication20MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- 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);
-
- 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)
- {
- fail(e);
- }
- }
-
- // JULIEN : find a way to make that validated somehow
- public void _test021() throws Exception
- {
- // "Should fail: name and qname defined!"
- String xmlFile = "metadata/event/portlet-event2-fail.xml";
- _unmarshall10(xmlFile, true);
- }
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/FilterTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/FilterTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/FilterTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,97 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.util.Locale;
-
-import org.gatein.pc.api.LifeCyclePhase;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.common.InitParamMetaData;
-import org.gatein.pc.portlet.impl.metadata.filter.FilterMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class FilterTestEverythingTestCase extends AbstractMetaDataTestCase
-{
-
- public void test01() throws Exception
- {
- _unmarshall10("metadata/filter/portlet-filter1.xml", true);
- }
-
- public void test02()
- {
- try
- {
- String xmlFile = "metadata/filter/portlet-filter2.xml";
-
- PortletApplication20MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
-
- FilterMetaData filter = md.getFilter("testFilter");
- assertNotNull(filter);
- assertEquals("org.jboss.portal.meta.NoExistingClass", filter.getFilterClass());
- assertEquals("testFilter", filter.getFilterName());
- assertEquals(LifeCyclePhase.ACTION, filter.getLifecycle().get(0));
- assertEquals(LifeCyclePhase.RENDER, 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);
- assertEquals("test", ip2.getName());
- assertEquals("testing", ip2.getValue());
- assertNull(ip2.getId());
-
- //
- FilterMetaData filter2 = md.getFilter("testFilterZwei");
- assertEquals("testFilterZwei", filter2.getFilterName());
- assertEquals(LifeCyclePhase.ACTION, filter2.getLifecycle().get(0));
-
- // Filter mapping
- assertEquals("Portlet1", md.getFilterMapping().get(0).getPortletNames().get(0));
- assertEquals("Portlet2", md.getFilterMapping().get(0).getPortletNames().get(1));
-
- assertEquals("Portlet2", md.getFilterMapping().get(1).getPortletNames().get(0));
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail();
- }
- }
-
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/GeneralMetaDataTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/GeneralMetaDataTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/GeneralMetaDataTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,141 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.net.URI;
-import java.util.Locale;
-
-import org.gatein.pc.portlet.impl.metadata.ListenerMetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.PublicRenderParameterMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class GeneralMetaDataTestCase extends AbstractMetaDataTestCase
-{
-
- public void test01()
- {
- try
- {
- PortletApplication10MetaData md = _unmarshall10("metadata/general/portlet1.xml");
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication10MetaData);
- assertEquals("1.0", md.getVersion());
- }
- catch (Exception e)
- {
- throw fail(e, "No exception expected");
- }
- }
-
- public void test02()
- {
- try
- {
- PortletApplication20MetaData md = _unmarshall10("metadata/general/portlet2.xml");
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- assertEquals("2.0", md.getVersion());
- }
- catch (Exception e)
- {
- throw fail(e, "No exception expected");
- }
- }
-
- public void test021()
- {
- try
- {
- PortletApplication20MetaData md = _unmarshall10("metadata/general/portlet2-jsr286.xml");
- assertEquals("2.0", md.getVersion());
- assertTrue(md instanceof PortletApplication20MetaData);
-
- assertEquals("MyResourceBundle", md.getResourceBundle());
- assertEquals(new URI("foobar"), md.getDefaultNamespace());
-
- PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
-
- assertEquals("Public render parameter one", prp1.getDescription().getDefaultString());
- assertEquals("param1", prp1.getId());
- 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").getValues().get(0));
- assertEquals("foobar2", md.getContainerRuntimeOption("foo").getValues().get(1));
-
- ListenerMetaData listener1 = md.getListeners().get(0);
- assertNotNull(listener1);
- assertEquals("listener.MyListener", listener1.getListenerClass());
- assertEquals("Mein Zuh\u00f6rer Eins", listener1.getDisplayName().getString(new Locale("de"), false));
- assertEquals("Beschreibung", listener1.getDescription().getString(new Locale("de"), false));
-
- assertNotNull(md.getListeners().get(1));
-
- assertEquals("MyResourceBundle", md.getResourceBundle());
- assertEquals(new URI("foobar"), md.getDefaultNamespace());
- }
- catch (Exception e)
- {
- throw fail(e, "No exception expected");
- }
- }
-
- public void test01_generated()
- {
- try
- {
- PortletApplication10MetaData md = _unmarshall10("metadata/general/portlet-app_1_0.xml");
-
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication10MetaData);
- assertEquals("1.0", md.getVersion());
- assertNotNull(md.getCustomPortletModes());
-
- }
- catch(Exception e)
- {
- throw fail(e, "No exception expected");
- }
- }
-
- public void test02_generated()
- {
- try
- {
- PortletApplication20MetaData md = _unmarshall10("metadata/general/portlet-app_2_0.xml");
- assertEquals("2.0", md.getVersion());
- assertTrue(md instanceof PortletApplication20MetaData);
- }
- catch(Exception e)
- {
- throw fail(e, "No exception expected");
- }
- }
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ListenerTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ListenerTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ListenerTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * 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.gatein.pc.mc.metadata;
-
-import org.gatein.pc.portlet.impl.metadata.ListenerMetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class ListenerTestCase extends AbstractMetaDataTestCase
-{
-
- public void test021()
- {
- try
- {
- PortletApplication20MetaData md = _unmarshall10("metadata/listener/portlet2.xml");
- List<ListenerMetaData> listeners = md.getListeners();
- assertNotNull(listeners);
- assertEquals(1, listeners.size());
- ListenerMetaData listenerMD = listeners.get(0);
- assertNotNull(listenerMD);
- assertEquals("MyListener", listenerMD.getListenerClass());
- }
- catch (Exception e)
- {
- throw fail(e, "No exception expected");
- }
- }
-
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/PortletTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/PortletTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/PortletTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,496 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.util.List;
-import java.util.Locale;
-
-import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.WindowState;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletMetaDataConstants;
-import org.gatein.pc.portlet.impl.metadata.common.InitParamMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.PortletCacheScopeEnum;
-import org.gatein.pc.portlet.impl.metadata.portlet.PortletInfoMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.SupportsMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class PortletTestEverythingTestCase extends AbstractMetaDataTestCase
-{
-
- public void test01()
- {
- try
- {
- String xmlFile = "metadata/portlet/portlet1.xml";
-
- PortletApplication10MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication10MetaData);
- assertEquals("1.0", md.getVersion());
-
- Locale fr = new Locale("fr");
- Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
-
- PortletMetaData p1 = md.getPortlet("Portlet1");
- assertNotNull(p1);
- assertEquals(md, p1.getPortletApplication());
- 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(org.gatein.pc.api.Mode.create("VIEW"), smd1.getPortletModes().get(0).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("EDIT"), smd1.getPortletModes().get(1).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd1.getPortletModes().get(2).getPortletMode());
-
- SupportsMetaData smd2 = p1.getSupports().get(1);
- assertEquals("text/wml", smd2.getMimeType());
- assertEquals(org.gatein.pc.api.Mode.create("VIEW"), smd2.getPortletModes().get(0).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd2.getPortletModes().get(1).getPortletMode());
-
- assertEquals("MyResourceBundle", p1.getResourceBundle());
-
- List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
- assertEquals(3, localeList.size());
- assertEquals("en", localeList.get(0).getLocale());
- assertEquals("fr", localeList.get(1).getLocale());
- assertEquals("fr_FR", localeList.get(2).getLocale());
-
- 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(md, p2.getPortletApplication());
- 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());
-
- // default value should be 0
- assertEquals(0, p2.getExpirationCache());
-
- PortletMetaData p3 = md.getPortlet("Portlet3");
- assertNotNull(p3);
- assertEquals(md, p3.getPortletApplication());
-
- PortletMetaData p4 = md.getPortlet("Portlet4");
- assertNotNull(p4);
- assertEquals(md, p4.getPortletApplication());
-
- PortletMetaData p5 = md.getPortlet("Portlet5");
- assertNotNull(p5);
- assertEquals(md, p5.getPortletApplication());
- 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(md, p6.getPortletApplication());
- assertEquals("Portlet6", p6.getResourceBundle());
- assertEquals(3, p6.getSupportedLocale().size());
- assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
- assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
- assertEquals("fr_FR", p6.getSupportedLocale().get(2).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)
- {
- throw fail(e);
- }
- }
-
- public void test02()
- {
- try
- {
- String xmlFile = "metadata/portlet/portlet2.xml";
-
- PortletApplication20MetaData md = this._unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- assertEquals("2.0", md.getVersion());
-
- 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(org.gatein.pc.api.Mode.create("VIEW"), smd1.getPortletModes().get(0).getPortletMode());
- assertEquals(Mode.create("EDIT"), smd1.getPortletModes().get(1).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd1.getPortletModes().get(2).getPortletMode());
-
- SupportsMetaData smd2 = p1.getSupports().get(1);
- assertEquals("text/wml", smd2.getMimeType());
- assertEquals(org.gatein.pc.api.Mode.create("VIEW"), smd2.getPortletModes().get(0).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd2.getPortletModes().get(1).getPortletMode());
-
- List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
- assertEquals(3, localeList.size());
- assertEquals("en", localeList.get(0).getLocale());
- assertEquals("fr", localeList.get(1).getLocale());
- assertEquals("fr_FR", localeList.get(2).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(3, p6.getSupportedLocale().size());
- assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
- assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
- assertEquals("fr_FR", p6.getSupportedLocale().get(2).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)
- {
- throw fail(e);
- }
- }
-
- public void test021()
- {
- try
- {
- String xmlFile = "metadata/portlet/portlet2-jsr286.xml";
-
- PortletApplication20MetaData md = this._unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- assertEquals("2.0", md.getVersion());
-
- 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(org.gatein.pc.api.Mode.create("VIEW"), smd1.getPortletModes().get(0).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("EDIT"), smd1.getPortletModes().get(1).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd1.getPortletModes().get(2).getPortletMode());
- // window state jsr 286
- assertEquals(WindowState.create("MAXIMIZED"), smd1.getWindowStates().get(0).getWindowState());
- assertEquals(WindowState.create("NORMAL"), smd1.getWindowStates().get(1).getWindowState());
-
- SupportsMetaData smd2 = p1.getSupports().get(1);
- assertEquals("foo", smd2.getId());
- assertEquals("text/wml", smd2.getMimeType());
- assertEquals(org.gatein.pc.api.Mode.create("VIEW"), smd2.getPortletModes().get(0).getPortletMode());
- assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd2.getPortletModes().get(1).getPortletMode());
- // window state jsr 286
- assertEquals(WindowState.create("NORMAL"), smd2.getWindowStates().get(0).getWindowState());
- assertEquals(WindowState.create("CUSTOM"), smd2.getWindowStates().get(1).getWindowState());
-
- List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
- assertEquals(3, localeList.size());
- assertEquals("en", localeList.get(0).getLocale());
- assertEquals("fr", localeList.get(1).getLocale());
- assertEquals("fr_FR", localeList.get(2).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));
-
- assertTrue(p1.getContainerRuntimeOptions().containsKey("option1"));
- assertTrue(p1.getContainerRuntimeOptions().containsKey("option2"));
- assertEquals("value1", p1.getContainerRuntimeOptions().get("option1").getValues().get(0));
- assertEquals("value2", p1.getContainerRuntimeOptions().get("option1").getValues().get(1));
- assertEquals("value3", p1.getContainerRuntimeOptions().get("option2").getValues().get(0));
- }
- catch (Exception e)
- {
- throw fail(e);
- }
- }
-
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/RenderParameterTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/RenderParameterTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/RenderParameterTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,75 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.PublicRenderParameterMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class RenderParameterTestEverythingTestCase extends AbstractMetaDataTestCase
-{
-
- public void test02()
- {
- try
- {
-
- String xmlFile = "metadata/renderParameter/portlet2.xml";
-
- PortletApplication20MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- assertEquals("2.0", md.getVersion());
-
- PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
- assertNotNull(prp1);
-
- assertEquals("blah", prp1.getIdentifier());
- assertEquals("renderParameter1", prp1.getName());
-
-
- PublicRenderParameterMetaData prp2 = md.getPublicRenderParameters().get(1);
- assertEquals("foo", prp2.getQname().getLocalPart());
- assertEquals("x", prp2.getQname().getPrefix());
- assertEquals("http://someurl.com", prp2.getQname().getNamespaceURI());
-
- assertEquals("fooo", prp1.getAlias().get(0).getLocalPart());
- assertEquals("rP1", prp1.getAlias().get(1).getLocalPart());
-
- assertEquals("foo", prp2.getAlias().get(0).getLocalPart());
- assertEquals("http://someurl.alias.com", prp2.getAlias().get(0).getNamespaceURI());
- assertEquals("s", prp2.getAlias().get(0).getPrefix());
-
- assertEquals("render parameter foo", prp1.getDescription().getDefaultString());
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail();
- }
- }
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/SecurityConstraintTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/SecurityConstraintTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/SecurityConstraintTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,209 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.util.Locale;
-
-import org.gatein.pc.api.TransportGuarantee;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
-import org.gatein.pc.portlet.impl.metadata.security.SecurityConstraintMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class SecurityConstraintTestEverythingTestCase extends AbstractMetaDataTestCase
-{
-
- public void test01()
- {
- try
- {
-
- String xmlFile = "metadata/security/portlet1.xml";
-
- PortletApplication10MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication10MetaData);
- assertEquals("1.0", md.getVersion());
-
- SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
- assertNotNull(scd1);
- assertEquals("test", scd1.getDisplayName().getDefaultString());
- assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
- assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint().getTransportGuarantee());
-
- assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
- assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
- assertEquals("foo", scd1.getId());
-
- SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
- assertNotNull(scd2);
- assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstraint().getTransportGuarantee());
- assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
- assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
- assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
-
- 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)
- {
- fail(e);
- }
- }
-
- /*
- 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
- }
- }
- */
-
- public void test02()
- {
- try
- {
-
- String xmlFile = "metadata/security/portlet2.xml";
-
- PortletApplication20MetaData md = this._unmarshall10( xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
- assertEquals("2.0", md.getVersion());
-
- SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
- assertNotNull(scd1);
- assertEquals("test", scd1.getDisplayName().getDefaultString());
- assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
- assertEquals("foo", scd1.getId());
-
- assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint().getTransportGuarantee());
- assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
- assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
-
-
- SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
- assertNotNull(scd2);
- assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstraint().getTransportGuarantee());
- assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
- assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
- assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
-
- try
- {
- scd2.getPortletList().getPortletNames().get(1);
- fail("2nd security constraint should only contain one element,");
- }
- catch (IndexOutOfBoundsException e)
- {
- // expected java.lang.IndexOutOfBoundsException
- }
-
- }
- catch (Exception e)
- {
- fail(e);
- }
- }
- /*
- 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
- }
- }
- */
-}
Deleted: components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/UserAttributeTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/UserAttributeTestEverythingTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/UserAttributeTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,95 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.mc.metadata;
-
-import java.util.Locale;
-
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.gatein.pc.portlet.impl.metadata.UserAttributeMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class UserAttributeTestEverythingTestCase extends AbstractMetaDataTestCase
-{
-
- public void test01()
- {
- try
- {
- String xmlFile = "metadata/userAttribute/portlet1.xml";
-
- PortletApplication10MetaData md = _unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication10MetaData);
-
- 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();
- }
- }
-
- public void test02()
- {
- try
- {
- String xmlFile = "metadata/userAttribute/portlet2.xml";
-
- PortletApplication20MetaData md = this._unmarshall10(xmlFile);
- assertNotNull(md);
- assertTrue(md instanceof PortletApplication20MetaData);
-
- 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();
- }
- }
-
-}
Modified: components/pc/trunk/mc/src/test/resources/local-jboss-unit.xml
===================================================================
--- components/pc/trunk/mc/src/test/resources/local-jboss-unit.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/mc/src/test/resources/local-jboss-unit.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -5,63 +5,63 @@
xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
<pojo>
<test>
- <class name="org.gatein.pc.mc.metadata.CustomPortletModeTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.CustomPortletModeTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.CustomWindowStateTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.CustomWindowStateTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.EventTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.EventTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.FilterTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.FilterTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.GeneralMetaDataTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.GeneralMetaDataTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.PortletTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.PortletTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.RenderParameterTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.RenderParameterTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.SecurityConstraintTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.SecurityConstraintTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
</parameter>
</test>
<test>
- <class name="org.gatein.pc.mc.metadata.UserAttributeTestEverythingTestCase" />
+ <class name="org.gatein.pc.portlet.deployment.UserAttributeTestEverythingTestCase" />
<parameter name="parser">
<value>annotation</value>
<value>factory</value>
Modified: components/pc/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-portal-beans.xml
===================================================================
--- components/pc/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-portal-beans.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-portal-beans.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -23,7 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="PortletApplicationDeployer" class="org.gatein.pc.mc.PortletApplicationDeployer">
+ <bean name="PortletApplicationDeployer" class="org.gatein.pc.portlet.impl.deployment.PortletApplicationDeployer">
<alias>PortletApplicationRegistry</alias>
<property name="servletContainerFactory"><inject bean="ServletContainerFactory"/></property>
<property name="containerPortletInvoker"><inject bean="ContainerPortletInvoker"/></property>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/portlet/pom.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -36,6 +36,10 @@
<artifactId>ccpp</artifactId>
</dependency>
<dependency>
+ <groupId>org.staxnav</groupId>
+ <artifactId>staxnav.core</artifactId>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
Copied: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationContextImpl.java (from rev 6681, components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationContextImpl.java)
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationContextImpl.java (rev 0)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationContextImpl.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.pc.portlet.impl.deployment;
+
+import org.gatein.pc.portlet.container.PortletApplicationContext;
+import org.gatein.pc.portlet.container.managed.ManagedPortletApplication;
+import org.gatein.wci.WebApp;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletApplicationContextImpl implements PortletApplicationContext
+{
+
+ /** . */
+ private final WebApp webApp;
+
+ ManagedPortletApplication managedPortletApplication;
+
+ public PortletApplicationContextImpl(WebApp webApp)
+ {
+ this.webApp = webApp;
+ }
+
+ public ServletContext getServletContext()
+ {
+ return webApp.getServletContext();
+ }
+
+ public String getContextPath()
+ {
+ return webApp.getContextPath();
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return webApp.getClassLoader();
+ }
+
+ public void managedStart()
+ {
+ managedPortletApplication.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletApplication.managedStop();
+ }
+}
Copied: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployer.java (from rev 6740, components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java)
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployer.java (rev 0)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployer.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,335 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.pc.portlet.impl.deployment;
+
+import org.gatein.common.logging.Logger;
+import org.gatein.common.io.IOTools;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.portlet.impl.deployment.staxnav.PortletApplicationMetaDataBuilder;
+import org.gatein.pc.portlet.container.ContainerPortletInvoker;
+import org.gatein.pc.portlet.container.PortletContainer;
+import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
+import org.gatein.pc.portlet.container.managed.ManagedObject;
+import org.gatein.pc.portlet.container.managed.ManagedObjectEvent;
+import org.gatein.pc.portlet.container.managed.ManagedObjectLifeCycleEvent;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEvent;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventBroadcaster;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventListener;
+import org.gatein.pc.portlet.container.managed.ManagedPortletApplication;
+import org.gatein.pc.portlet.container.managed.PortletApplicationRegistry;
+import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
+import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.wci.ServletContainer;
+import org.gatein.wci.ServletContainerFactory;
+import org.gatein.wci.WebApp;
+import org.gatein.wci.WebAppEvent;
+import org.gatein.wci.WebAppLifeCycleEvent;
+import org.gatein.wci.WebAppListener;
+import org.staxnav.ValueType;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletApplicationDeployer implements WebAppListener, PortletApplicationRegistry
+{
+
+ /** . */
+ private Logger log = LoggerFactory.getLogger(PortletApplicationDeployer.class);
+
+ /** . */
+ private PortletApplicationRegistry registry;
+
+ /** . */
+ private ServletContainer servletContainer;
+
+ private ServletContainerFactory servletContainerFactory;
+
+ /** . */
+ private Map<String, PortletApplicationDeployment> deploymentMap = new HashMap<String, PortletApplicationDeployment>();
+
+ /** . */
+ private ClassLoader classLoader;
+
+ /** . */
+ private final Map<String, PortletApplicationLifeCycle> applications = new HashMap<String, PortletApplicationLifeCycle>();
+
+ /** . */
+ private ContainerPortletInvoker containerPortletInvoker;
+
+ /** . */
+ private ManagedObjectRegistryEventBroadcaster broadcaster;
+
+ public PortletApplicationRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(PortletApplicationRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public ServletContainer getServletContainer()
+ {
+ if (servletContainer == null)
+ {
+ servletContainer = servletContainerFactory.getServletContainer();
+ }
+ return servletContainer;
+ }
+
+ public void setServletContainer(ServletContainer servletContainer)
+ {
+ throw new UnsupportedOperationException("Inject ServletContainerFactory instead!");
+ }
+
+ public ServletContainerFactory getServletContainerFactory()
+ {
+ return servletContainerFactory;
+ }
+
+ public void setServletContainerFactory(ServletContainerFactory servletContainerFactory)
+ {
+ this.servletContainerFactory = servletContainerFactory;
+ }
+
+ public PortletInvoker getContainerPortletInvoker()
+ {
+ return containerPortletInvoker;
+ }
+
+ public void setContainerPortletInvoker(PortletInvoker containerPortletInvoker)
+ {
+ if (containerPortletInvoker instanceof ContainerPortletInvoker)
+ {
+ this.containerPortletInvoker = (ContainerPortletInvoker)containerPortletInvoker;
+ }
+ else
+ {
+ if (containerPortletInvoker == null)
+ {
+ return; // this method is called with null on shutdown
+ }
+ throw new IllegalArgumentException("PortletApplicationDeployer can only accept ContainerPortletInvokers!");
+ }
+ }
+
+ public void onEvent(WebAppEvent event)
+ {
+ if (event instanceof WebAppLifeCycleEvent)
+ {
+ WebAppLifeCycleEvent lifeCycleEvent = (WebAppLifeCycleEvent)event;
+ String cp = event.getWebApp().getContextPath();
+ switch (lifeCycleEvent.getType())
+ {
+ case WebAppLifeCycleEvent.ADDED:
+ log.debug("Going to install war file" + cp);
+ add(event.getWebApp());
+ log.debug("Installed war file" + cp);
+ break;
+ case WebAppLifeCycleEvent.REMOVED:
+ try
+ {
+ log.debug("Going to uninstall war file" + cp);
+ remove(event.getWebApp());
+ log.debug("Uninstalled war file" + cp);
+ }
+ catch (Throwable e)
+ {
+ log.error("Uninstalled war file " + cp + " with an error", e);
+ }
+ break;
+ }
+ }
+ }
+
+ protected void add(WebApp webApp)
+ {
+ //
+ PortletApplication10MetaData metaData = buildPortletApplicationMetaData(webApp);
+ if (metaData != null)
+ {
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ PortletApplicationDeployment deployment = new PortletApplicationDeployment(broadcaster, webApp, metaData);
+ deploymentMap.put(webApp.getContextPath(), deployment);
+ deployment.install();
+
+ //
+ PortletApplicationLifeCycle portletApplicationLifeCycle = deployment.getPortletApplicationLifeCycle();
+ applications.put(portletApplicationLifeCycle.getId(), portletApplicationLifeCycle);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+ }
+ }
+
+ private void remove(WebApp webApp)
+ {
+ PortletApplicationDeployment deployment = deploymentMap.remove(webApp.getContextPath());
+ if (deployment != null)
+ {
+ PortletApplicationLifeCycle portletApplicationLifeCycle = deployment.getPortletApplicationLifeCycle();
+ applications.remove(portletApplicationLifeCycle.getId());
+
+ //
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ deployment.uninstall();
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+ }
+ }
+
+ public void start()
+ {
+ broadcaster = new ManagedObjectRegistryEventBroadcaster();
+ classLoader = Thread.currentThread().getContextClassLoader();
+
+ //
+ broadcaster.addListener(bridgeToInvoker);
+ getServletContainer().addWebAppListener(this);
+ }
+
+ public void stop()
+ {
+ // This should generate remove web app event and in cascade clear the registry
+ // as well as the portlet container invoker
+ getServletContainer().removeWebAppListener(this);
+
+ //
+ classLoader = null;
+ broadcaster = null;
+ }
+
+ protected PortletApplication10MetaData buildPortletApplicationMetaData(WebApp webApp)
+ {
+ try
+ {
+ URL url = webApp.getServletContext().getResource("/WEB-INF/portlet.xml");
+ if (url != null)
+ {
+ InputStream in = null;
+ try
+ {
+ in = IOTools.safeBufferedWrapper(url.openStream());
+
+ //
+ ValueType vt = null;
+
+ //
+ PortletApplicationMetaDataBuilder builder = new PortletApplicationMetaDataBuilder();
+
+ //
+ return builder.build(in);
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot read portlet.xml", e);
+ }
+ return null;
+ }
+
+ public Collection<? extends ManagedPortletApplication> getManagedPortletApplications()
+ {
+ return applications.values();
+ }
+
+ public ManagedPortletApplication getManagedPortletApplication(String id)
+ {
+ return applications.get(id);
+ }
+
+ public void addListener(ManagedObjectRegistryEventListener listener)
+ {
+ broadcaster.addListener(listener);
+ }
+
+ public void removeListener(ManagedObjectRegistryEventListener listener)
+ {
+ broadcaster.addListener(listener);
+ }
+
+ /** Bridge managed object event to add/remove portlet container in portlet container invoker. */
+ private final ManagedObjectRegistryEventListener bridgeToInvoker = new ManagedObjectRegistryEventListener()
+ {
+ public void onEvent(ManagedObjectRegistryEvent event)
+ {
+ if (event instanceof ManagedObjectEvent)
+ {
+ ManagedObjectEvent managedObjectEvent = (ManagedObjectEvent)event;
+ ManagedObject managedObject = managedObjectEvent.getManagedObject();
+
+ //
+ if (managedObject instanceof PortletContainerLifeCycle)
+ {
+ PortletContainerLifeCycle portletContainerLifeCycle = (PortletContainerLifeCycle)managedObject;
+ PortletContainer portletContainer = portletContainerLifeCycle.getPortletContainer();
+
+ //
+ if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
+ {
+ ManagedObjectLifeCycleEvent lifeCycleEvent = (ManagedObjectLifeCycleEvent)managedObjectEvent;
+
+ //
+ LifeCycleStatus status = lifeCycleEvent.getStatus();
+
+ //
+ if (status == LifeCycleStatus.STARTED)
+ {
+ containerPortletInvoker.addPortletContainer(portletContainer);
+ }
+ else
+ {
+ containerPortletInvoker.removePortletContainer(portletContainer);
+ }
+ }
+ }
+ }
+ }
+ };
+}
Copied: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployment.java (from rev 6681, components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployment.java)
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployment.java (rev 0)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletApplicationDeployment.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,169 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.pc.portlet.impl.deployment;
+
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.pc.portlet.impl.info.ContainerInfoBuilder;
+import org.gatein.pc.portlet.impl.info.ContainerInfoBuilderContext;
+import org.gatein.pc.portlet.impl.info.ContainerPortletInfo;
+import org.gatein.pc.portlet.impl.info.ContainerFilterInfo;
+import org.gatein.pc.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
+import org.gatein.pc.portlet.impl.jsr168.PortletApplicationImpl;
+import org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl;
+import org.gatein.pc.portlet.impl.jsr168.PortletFilterImpl;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
+import org.gatein.pc.portlet.impl.container.PortletFilterLifeCycle;
+import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
+import org.gatein.pc.portlet.container.object.PortletApplicationObject;
+import org.gatein.pc.portlet.container.object.PortletContainerObject;
+import org.gatein.pc.portlet.container.object.PortletFilterObject;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventListener;
+import org.gatein.wci.WebApp;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletApplicationDeployment
+{
+
+ /** . */
+ private final Logger log;
+
+ /** . */
+ private final WebApp webApp;
+
+ /** . */
+ private final PortletApplication10MetaData metaData;
+
+ /** . */
+ private final ManagedObjectRegistryEventListener listener;
+
+ /** . */
+ private PortletApplicationLifeCycle portletApplicationLifeCycle;
+
+ public PortletApplicationDeployment(
+ ManagedObjectRegistryEventListener listener,
+ WebApp webApp,
+ PortletApplication10MetaData metaData)
+ {
+ this.listener = listener;
+ this.webApp = webApp;
+ this.metaData = metaData;
+ this.log = LoggerFactory.getLogger(PortletApplicationDeployment.class + "." + webApp.getContextPath().replace('.', '_'));
+ }
+
+ public PortletApplicationLifeCycle getPortletApplicationLifeCycle()
+ {
+ return portletApplicationLifeCycle;
+ }
+
+ void install()
+ {
+
+ log.debug("Starting installation");
+
+ //
+ ContainerInfoBuilderContext builderContext = new ContainerInfoBuilderContextImpl(metaData, webApp);
+ ContainerInfoBuilder builder = new ContainerInfoBuilder(webApp.getContextPath(), metaData, builderContext);
+ builder.build();
+
+ //
+ PortletApplicationObject portletApplicationObject = new PortletApplicationImpl(builder.getApplication());
+ PortletApplicationContextImpl portletApplicationContext = new PortletApplicationContextImpl(webApp);
+
+
+ //
+ portletApplicationLifeCycle = new PortletApplicationLifeCycle(
+ listener,
+ portletApplicationContext,
+ portletApplicationObject);
+
+ // Needed for the managed callbacks
+ portletApplicationContext.managedPortletApplication = portletApplicationLifeCycle;
+
+ //
+ for (ContainerFilterInfo filterInfo : builder.getApplication().getFilters().values())
+ {
+ PortletFilterObject portletFilterObject = new PortletFilterImpl(filterInfo);
+ PortletFilterContextImpl portletFilterContext = new PortletFilterContextImpl();
+
+ //
+ PortletFilterLifeCycle portletFilterLifeCycle = portletApplicationLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject);
+
+ // Needed for the managed callbacks
+ portletFilterContext.managedPortletFilter = portletFilterLifeCycle;
+ }
+
+ //
+ for (ContainerPortletInfo containerInfo : builder.getPortlets())
+ {
+ PortletContainerObject portletContainerObject = new PortletContainerImpl(containerInfo);
+ PortletContainerContextImpl portletContainerContext = new PortletContainerContextImpl();
+
+ //
+ PortletContainerLifeCycle portletContainerLifeCycle = portletApplicationLifeCycle.addPortletContainer(portletContainerContext, portletContainerObject);
+
+ // Needed for the managed callbacks
+ portletContainerContext.managedPortletContainer = portletContainerLifeCycle;
+
+ // Now create deps
+ for (String filterRef : containerInfo.getFilterRefs())
+ {
+ PortletFilterLifeCycle portletFilterLifeCycle = portletApplicationLifeCycle.getManagedPortletFilter(filterRef);
+
+ //
+ if (portletFilterLifeCycle != null)
+ {
+ portletApplicationLifeCycle.addDependency(portletFilterLifeCycle, portletContainerLifeCycle);
+ }
+ else
+ {
+ // todo
+ }
+ }
+ }
+
+ //
+ portletApplicationLifeCycle.create();
+
+ //
+ portletApplicationLifeCycle.managedStart();
+
+ //
+
+ }
+
+ void uninstall()
+ {
+ log.debug("Uninstalling");
+
+ //
+ portletApplicationLifeCycle.managedStop();
+
+ //
+ log.debug("Uninstalled");
+ }
+}
Copied: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletContainerContextImpl.java (from rev 6681, components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletContainerContextImpl.java)
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletContainerContextImpl.java (rev 0)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletContainerContextImpl.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.pc.portlet.impl.deployment;
+
+import org.gatein.pc.portlet.container.PortletContainerContext;
+import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletContainerContextImpl implements PortletContainerContext
+{
+
+ /** . */
+ ManagedPortletContainer managedPortletContainer;
+
+ public void managedStart()
+ {
+ managedPortletContainer.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletContainer.managedStop();
+ }
+}
Copied: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletFilterContextImpl.java (from rev 6681, components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletFilterContextImpl.java)
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletFilterContextImpl.java (rev 0)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/PortletFilterContextImpl.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.pc.portlet.impl.deployment;
+
+import org.gatein.pc.portlet.container.PortletFilterContext;
+import org.gatein.pc.portlet.container.managed.ManagedPortletFilter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletFilterContextImpl implements PortletFilterContext
+{
+
+ ManagedPortletFilter managedPortletFilter;
+
+ public void managedStart()
+ {
+ managedPortletFilter.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletFilter.managedStop();
+ }
+}
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/staxnav/Element.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/Element.java 2011-06-24 19:41:41 UTC (rev 6738)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/staxnav/Element.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.pc.mc.staxnav;
+package org.gatein.pc.portlet.impl.deployment.staxnav;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/staxnav/PortletApplicationMetaDataBuilder.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/PortletApplicationMetaDataBuilder.java 2011-06-24 19:41:41 UTC (rev 6738)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/deployment/staxnav/PortletApplicationMetaDataBuilder.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.pc.mc.staxnav;
+package org.gatein.pc.portlet.impl.deployment.staxnav;
import org.gatein.common.i18n.LocaleFormat;
import org.gatein.common.i18n.LocalizedString;
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/AbstractMetaDataTestCase.java (from rev 6740, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/AbstractMetaDataTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/AbstractMetaDataTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.gatein.pc.portlet.deployment;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+import org.gatein.pc.portlet.impl.deployment.staxnav.PortletApplicationMetaDataBuilder;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+
+import org.xml.sax.SAXException;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class AbstractMetaDataTestCase extends TestCase
+{
+
+ /** Test parameter for using xml binding annotation. */
+ public static final String ANNOTATION_BINDING = "annotation";
+
+ /** Annotation or ObjectModelFactory parsing. */
+ private String parser = ANNOTATION_BINDING;
+
+ protected PortletApplication20MetaData _unmarshall10(String file) throws SAXException, IOException
+ {
+ return _unmarshall10(file, false);
+ }
+
+ protected PortletApplication20MetaData _unmarshall10(String file, boolean fail) throws SAXException, IOException
+ {
+ try
+ {
+ PortletApplicationMetaDataBuilder builder = new PortletApplicationMetaDataBuilder();
+ String path = getPath(file);
+ URL url = new URL(path);
+ InputStream in = url.openStream();
+ assertNotNull(in);
+ PortletApplication20MetaData build = builder.build(in);
+ if (fail)
+ {
+ throw new AssertionFailedError("Was expecting unmarshalling of " + file + " to fail");
+ }
+ return build;
+ }
+ catch (Exception e)
+ {
+ if (fail)
+ {
+ // OK
+ return null;
+ }
+ else
+ {
+ throw fail(e);
+ }
+ }
+ }
+
+ protected final Error fail(Throwable t)
+ {
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(t);
+ throw afe;
+ }
+
+ protected final Error fail(Throwable t, String msg)
+ {
+ AssertionFailedError afe = new AssertionFailedError(msg);
+ afe.initCause(t);
+ throw afe;
+ }
+
+ protected String getPath(String file)
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(file);
+ if (url == null)
+ {
+ fail(file + " not found.");
+ }
+ return url.toString();
+ }
+
+ protected InputStream getStream(String file)
+ {
+ return Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
+ }
+
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ContainerRuntimeOptionTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ContainerRuntimeOptionTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ContainerRuntimeOptionTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ContainerRuntimeOptionTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.gatein.pc.portlet.deployment;
+
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.common.ContainerRuntimeMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ContainerRuntimeOptionTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test021() throws Exception
+ {
+ PortletApplication20MetaData md = _unmarshall10("metadata/runtimeoption/portlet.xml");
+ PortletMetaData portlet = md.getPortlet("portlet-name");
+ assertNotNull(portlet);
+ Map<String, ContainerRuntimeMetaData> m = portlet.getContainerRuntimeOptions();
+ assertEquals(Collections.singleton("portlet_container_runtime_option_name"), m.keySet());
+ ContainerRuntimeMetaData option = m.get("portlet_container_runtime_option_name");
+ assertEquals(Arrays.asList("portlet_container_runtime_option_value"), option.getValues());
+ assertNull(md.getContainerRuntimeOptions());
+ }
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomPortletModeTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomPortletModeTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomPortletModeTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomPortletModeTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -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.gatein.pc.portlet.deployment;
+
+import java.util.Locale;
+
+import org.gatein.pc.portlet.impl.metadata.CustomPortletModeMetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomPortletModeTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+
+ public void test01()
+ {
+ try
+ {
+ String xmlFile = "metadata/customPortletMode/portlet1.xml";
+
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+ assertNotNull(md.getCustomPortletModes());
+
+ CustomPortletModeMetaData cmd1 = md.getCustomPortletModes().get("Custom");
+ assertNotNull(cmd1);
+ assertEquals("mode1", cmd1.getId());
+ assertEquals("Custom", cmd1.getPortletMode());
+ assertEquals("portletMode1", cmd1.getDescription().getDefaultString());
+ assertEquals("eigener portlet modus", cmd1.getDescription().getString(new Locale("de"), false));
+
+ assertNotNull(md.getCustomPortletModes().get("Custom2"));
+ }
+ catch (Exception e)
+ {
+ fail(e);
+ }
+ }
+
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/customPortletMode/portlet2.xml";
+
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ CustomPortletModeMetaData cmd1 = md.getCustomPortletModes().get("Custom");
+ assertNotNull(cmd1);
+ assertEquals("Custom", cmd1.getPortletMode());
+ assertEquals("portletMode1", cmd1.getDescription().getDefaultString());
+ assertEquals(true, cmd1.isPortalManaged());
+ assertEquals("cmode1", cmd1.getId());
+
+ CustomPortletModeMetaData cmd2 = md.getCustomPortletModes().get("Custom2");
+ assertNotNull(cmd2);
+ assertEquals("Custom2", cmd2.getPortletMode());
+ assertEquals(false, cmd2.isPortalManaged());
+
+ CustomPortletModeMetaData cmd3 = md.getCustomPortletModes().get("Custom3");
+ assertNotNull(cmd3);
+ assertEquals("Custom3", cmd3.getPortletMode());
+
+ // default value
+ assertEquals(true, cmd3.isPortalManaged());
+ assertEquals("eigener portlet modus", cmd1.getDescription().getString(new Locale("de"), false));
+ assertEquals("Portlet Mode Three", cmd3.getDescription().getDefaultString());
+
+
+ }
+ catch (Exception e)
+ {
+ fail(e);
+ }
+ }
+
+ public void test03() throws Exception
+ {
+ String xmlFile = "metadata/customPortletMode/portlet1-fail.xml";
+ _unmarshall10(xmlFile, true);
+ }
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomWindowStateTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomWindowStateTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomWindowStateTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/CustomWindowStateTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * 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.gatein.pc.portlet.deployment;
+
+import java.util.Locale;
+
+import org.gatein.pc.portlet.impl.metadata.CustomWindowStateMetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomWindowStateTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+ public void test01()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/customWindowState/portlet1.xml";
+
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+
+ CustomWindowStateMetaData cws1 = md.getCustomWindowStates().get("windowState1");
+ assertEquals("WindowState", cws1.getDescription().getDefaultString());
+ assertEquals("windowState1", cws1.getWindowState());
+ assertEquals("Offenes Fenster", cws1.getDescription().getString(new Locale("de"), false));
+ assertEquals("foo", cws1.getId());
+ CustomWindowStateMetaData cws2 = md.getCustomWindowStates().get("windowState2");
+ assertNotNull(cws2);
+
+ CustomWindowStateMetaData cws3 = md.getCustomWindowStates().get("windowState3");
+ assertEquals("drei", cws3.getId());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/customWindowState/portlet2.xml";
+
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ CustomWindowStateMetaData cws1 = md.getCustomWindowStates().get("windowState1");
+ assertEquals("WindowState", cws1.getDescription().getDefaultString());
+ assertEquals("windowState1", cws1.getWindowState());
+ assertEquals("Offenes Fenster", cws1.getDescription().getString(new Locale("de"), false));
+ assertEquals("foo", cws1.getId());
+
+ CustomWindowStateMetaData cws2 = md.getCustomWindowStates().get("windowState2");
+ assertNotNull(cws2);
+
+ CustomWindowStateMetaData cws3 = md.getCustomWindowStates().get("windowState3");
+ assertEquals("drei", cws3.getId());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/EventTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -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.gatein.pc.portlet.deployment;
+
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.event.EventDefinitionMetaData;
+import org.gatein.pc.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class EventTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ public void _test01()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/event/portlet-event1.xml";
+
+ _unmarshall10(xmlFile);
+ fail();
+ }
+ catch (Exception e)
+ {
+ // ok
+ }
+ }
+
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/event/portlet-event2.xml";
+
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ 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);
+
+ 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)
+ {
+ fail(e);
+ }
+ }
+
+ // JULIEN : find a way to make that validated somehow
+ public void _test021() throws Exception
+ {
+ // "Should fail: name and qname defined!"
+ String xmlFile = "metadata/event/portlet-event2-fail.xml";
+ _unmarshall10(xmlFile, true);
+ }
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/FilterTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/FilterTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/FilterTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/FilterTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -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.gatein.pc.portlet.deployment;
+
+import java.util.Locale;
+
+import org.gatein.pc.api.LifeCyclePhase;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.common.InitParamMetaData;
+import org.gatein.pc.portlet.impl.metadata.filter.FilterMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FilterTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test01() throws Exception
+ {
+ _unmarshall10("metadata/filter/portlet-filter1.xml", true);
+ }
+
+ public void test02()
+ {
+ try
+ {
+ String xmlFile = "metadata/filter/portlet-filter2.xml";
+
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+
+ FilterMetaData filter = md.getFilter("testFilter");
+ assertNotNull(filter);
+ assertEquals("org.jboss.portal.meta.NoExistingClass", filter.getFilterClass());
+ assertEquals("testFilter", filter.getFilterName());
+ assertEquals(LifeCyclePhase.ACTION, filter.getLifecycle().get(0));
+ assertEquals(LifeCyclePhase.RENDER, 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);
+ assertEquals("test", ip2.getName());
+ assertEquals("testing", ip2.getValue());
+ assertNull(ip2.getId());
+
+ //
+ FilterMetaData filter2 = md.getFilter("testFilterZwei");
+ assertEquals("testFilterZwei", filter2.getFilterName());
+ assertEquals(LifeCyclePhase.ACTION, filter2.getLifecycle().get(0));
+
+ // Filter mapping
+ assertEquals("Portlet1", md.getFilterMapping().get(0).getPortletNames().get(0));
+ assertEquals("Portlet2", md.getFilterMapping().get(0).getPortletNames().get(1));
+
+ assertEquals("Portlet2", md.getFilterMapping().get(1).getPortletNames().get(0));
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/GeneralMetaDataTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/GeneralMetaDataTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/GeneralMetaDataTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/GeneralMetaDataTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,141 @@
+/******************************************************************************
+ * 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.gatein.pc.portlet.deployment;
+
+import java.net.URI;
+import java.util.Locale;
+
+import org.gatein.pc.portlet.impl.metadata.ListenerMetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.PublicRenderParameterMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class GeneralMetaDataTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test01()
+ {
+ try
+ {
+ PortletApplication10MetaData md = _unmarshall10("metadata/general/portlet1.xml");
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+ }
+ catch (Exception e)
+ {
+ throw fail(e, "No exception expected");
+ }
+ }
+
+ public void test02()
+ {
+ try
+ {
+ PortletApplication20MetaData md = _unmarshall10("metadata/general/portlet2.xml");
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+ }
+ catch (Exception e)
+ {
+ throw fail(e, "No exception expected");
+ }
+ }
+
+ public void test021()
+ {
+ try
+ {
+ PortletApplication20MetaData md = _unmarshall10("metadata/general/portlet2-jsr286.xml");
+ assertEquals("2.0", md.getVersion());
+ assertTrue(md instanceof PortletApplication20MetaData);
+
+ assertEquals("MyResourceBundle", md.getResourceBundle());
+ assertEquals(new URI("foobar"), md.getDefaultNamespace());
+
+ PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
+
+ assertEquals("Public render parameter one", prp1.getDescription().getDefaultString());
+ assertEquals("param1", prp1.getId());
+ 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").getValues().get(0));
+ assertEquals("foobar2", md.getContainerRuntimeOption("foo").getValues().get(1));
+
+ ListenerMetaData listener1 = md.getListeners().get(0);
+ assertNotNull(listener1);
+ assertEquals("listener.MyListener", listener1.getListenerClass());
+ assertEquals("Mein Zuh\u00f6rer Eins", listener1.getDisplayName().getString(new Locale("de"), false));
+ assertEquals("Beschreibung", listener1.getDescription().getString(new Locale("de"), false));
+
+ assertNotNull(md.getListeners().get(1));
+
+ assertEquals("MyResourceBundle", md.getResourceBundle());
+ assertEquals(new URI("foobar"), md.getDefaultNamespace());
+ }
+ catch (Exception e)
+ {
+ throw fail(e, "No exception expected");
+ }
+ }
+
+ public void test01_generated()
+ {
+ try
+ {
+ PortletApplication10MetaData md = _unmarshall10("metadata/general/portlet-app_1_0.xml");
+
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+ assertNotNull(md.getCustomPortletModes());
+
+ }
+ catch(Exception e)
+ {
+ throw fail(e, "No exception expected");
+ }
+ }
+
+ public void test02_generated()
+ {
+ try
+ {
+ PortletApplication20MetaData md = _unmarshall10("metadata/general/portlet-app_2_0.xml");
+ assertEquals("2.0", md.getVersion());
+ assertTrue(md instanceof PortletApplication20MetaData);
+ }
+ catch(Exception e)
+ {
+ throw fail(e, "No exception expected");
+ }
+ }
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ListenerTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ListenerTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ListenerTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/ListenerTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.gatein.pc.portlet.deployment;
+
+import org.gatein.pc.portlet.impl.metadata.ListenerMetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ListenerTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test021()
+ {
+ try
+ {
+ PortletApplication20MetaData md = _unmarshall10("metadata/listener/portlet2.xml");
+ List<ListenerMetaData> listeners = md.getListeners();
+ assertNotNull(listeners);
+ assertEquals(1, listeners.size());
+ ListenerMetaData listenerMD = listeners.get(0);
+ assertNotNull(listenerMD);
+ assertEquals("MyListener", listenerMD.getListenerClass());
+ }
+ catch (Exception e)
+ {
+ throw fail(e, "No exception expected");
+ }
+ }
+
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/PortletTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/PortletTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/PortletTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/PortletTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,496 @@
+/******************************************************************************
+ * 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.gatein.pc.portlet.deployment;
+
+import java.util.List;
+import java.util.Locale;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletMetaDataConstants;
+import org.gatein.pc.portlet.impl.metadata.common.InitParamMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletCacheScopeEnum;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletInfoMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.SupportsMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test01()
+ {
+ try
+ {
+ String xmlFile = "metadata/portlet/portlet1.xml";
+
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+
+ Locale fr = new Locale("fr");
+ Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
+
+ PortletMetaData p1 = md.getPortlet("Portlet1");
+ assertNotNull(p1);
+ assertEquals(md, p1.getPortletApplication());
+ 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(org.gatein.pc.api.Mode.create("VIEW"), smd1.getPortletModes().get(0).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("EDIT"), smd1.getPortletModes().get(1).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd1.getPortletModes().get(2).getPortletMode());
+
+ SupportsMetaData smd2 = p1.getSupports().get(1);
+ assertEquals("text/wml", smd2.getMimeType());
+ assertEquals(org.gatein.pc.api.Mode.create("VIEW"), smd2.getPortletModes().get(0).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd2.getPortletModes().get(1).getPortletMode());
+
+ assertEquals("MyResourceBundle", p1.getResourceBundle());
+
+ List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+ assertEquals(3, localeList.size());
+ assertEquals("en", localeList.get(0).getLocale());
+ assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals("fr_FR", localeList.get(2).getLocale());
+
+ 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(md, p2.getPortletApplication());
+ 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());
+
+ // default value should be 0
+ assertEquals(0, p2.getExpirationCache());
+
+ PortletMetaData p3 = md.getPortlet("Portlet3");
+ assertNotNull(p3);
+ assertEquals(md, p3.getPortletApplication());
+
+ PortletMetaData p4 = md.getPortlet("Portlet4");
+ assertNotNull(p4);
+ assertEquals(md, p4.getPortletApplication());
+
+ PortletMetaData p5 = md.getPortlet("Portlet5");
+ assertNotNull(p5);
+ assertEquals(md, p5.getPortletApplication());
+ 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(md, p6.getPortletApplication());
+ assertEquals("Portlet6", p6.getResourceBundle());
+ assertEquals(3, p6.getSupportedLocale().size());
+ assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
+ assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+ assertEquals("fr_FR", p6.getSupportedLocale().get(2).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)
+ {
+ throw fail(e);
+ }
+ }
+
+ public void test02()
+ {
+ try
+ {
+ String xmlFile = "metadata/portlet/portlet2.xml";
+
+ PortletApplication20MetaData md = this._unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ 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(org.gatein.pc.api.Mode.create("VIEW"), smd1.getPortletModes().get(0).getPortletMode());
+ assertEquals(Mode.create("EDIT"), smd1.getPortletModes().get(1).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd1.getPortletModes().get(2).getPortletMode());
+
+ SupportsMetaData smd2 = p1.getSupports().get(1);
+ assertEquals("text/wml", smd2.getMimeType());
+ assertEquals(org.gatein.pc.api.Mode.create("VIEW"), smd2.getPortletModes().get(0).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd2.getPortletModes().get(1).getPortletMode());
+
+ List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+ assertEquals(3, localeList.size());
+ assertEquals("en", localeList.get(0).getLocale());
+ assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals("fr_FR", localeList.get(2).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(3, p6.getSupportedLocale().size());
+ assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
+ assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+ assertEquals("fr_FR", p6.getSupportedLocale().get(2).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)
+ {
+ throw fail(e);
+ }
+ }
+
+ public void test021()
+ {
+ try
+ {
+ String xmlFile = "metadata/portlet/portlet2-jsr286.xml";
+
+ PortletApplication20MetaData md = this._unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ 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(org.gatein.pc.api.Mode.create("VIEW"), smd1.getPortletModes().get(0).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("EDIT"), smd1.getPortletModes().get(1).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd1.getPortletModes().get(2).getPortletMode());
+ // window state jsr 286
+ assertEquals(WindowState.create("MAXIMIZED"), smd1.getWindowStates().get(0).getWindowState());
+ assertEquals(WindowState.create("NORMAL"), smd1.getWindowStates().get(1).getWindowState());
+
+ SupportsMetaData smd2 = p1.getSupports().get(1);
+ assertEquals("foo", smd2.getId());
+ assertEquals("text/wml", smd2.getMimeType());
+ assertEquals(org.gatein.pc.api.Mode.create("VIEW"), smd2.getPortletModes().get(0).getPortletMode());
+ assertEquals(org.gatein.pc.api.Mode.create("HELP"), smd2.getPortletModes().get(1).getPortletMode());
+ // window state jsr 286
+ assertEquals(WindowState.create("NORMAL"), smd2.getWindowStates().get(0).getWindowState());
+ assertEquals(WindowState.create("CUSTOM"), smd2.getWindowStates().get(1).getWindowState());
+
+ List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+ assertEquals(3, localeList.size());
+ assertEquals("en", localeList.get(0).getLocale());
+ assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals("fr_FR", localeList.get(2).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));
+
+ assertTrue(p1.getContainerRuntimeOptions().containsKey("option1"));
+ assertTrue(p1.getContainerRuntimeOptions().containsKey("option2"));
+ assertEquals("value1", p1.getContainerRuntimeOptions().get("option1").getValues().get(0));
+ assertEquals("value2", p1.getContainerRuntimeOptions().get("option1").getValues().get(1));
+ assertEquals("value3", p1.getContainerRuntimeOptions().get("option2").getValues().get(0));
+ }
+ catch (Exception e)
+ {
+ throw fail(e);
+ }
+ }
+
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/RenderParameterTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/RenderParameterTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/RenderParameterTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/RenderParameterTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.gatein.pc.portlet.deployment;
+
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.PublicRenderParameterMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class RenderParameterTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/renderParameter/portlet2.xml";
+
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
+ assertNotNull(prp1);
+
+ assertEquals("blah", prp1.getIdentifier());
+ assertEquals("renderParameter1", prp1.getName());
+
+
+ PublicRenderParameterMetaData prp2 = md.getPublicRenderParameters().get(1);
+ assertEquals("foo", prp2.getQname().getLocalPart());
+ assertEquals("x", prp2.getQname().getPrefix());
+ assertEquals("http://someurl.com", prp2.getQname().getNamespaceURI());
+
+ assertEquals("fooo", prp1.getAlias().get(0).getLocalPart());
+ assertEquals("rP1", prp1.getAlias().get(1).getLocalPart());
+
+ assertEquals("foo", prp2.getAlias().get(0).getLocalPart());
+ assertEquals("http://someurl.alias.com", prp2.getAlias().get(0).getNamespaceURI());
+ assertEquals("s", prp2.getAlias().get(0).getPrefix());
+
+ assertEquals("render parameter foo", prp1.getDescription().getDefaultString());
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/SecurityConstraintTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/SecurityConstraintTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/SecurityConstraintTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/SecurityConstraintTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,209 @@
+/******************************************************************************
+ * 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.gatein.pc.portlet.deployment;
+
+import java.util.Locale;
+
+import org.gatein.pc.api.TransportGuarantee;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletMetaData;
+import org.gatein.pc.portlet.impl.metadata.security.SecurityConstraintMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class SecurityConstraintTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test01()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/security/portlet1.xml";
+
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+
+ SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
+ assertNotNull(scd1);
+ assertEquals("test", scd1.getDisplayName().getDefaultString());
+ assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
+ assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint().getTransportGuarantee());
+
+ assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
+ assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
+ assertEquals("foo", scd1.getId());
+
+ SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
+ assertNotNull(scd2);
+ assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstraint().getTransportGuarantee());
+ assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
+ assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
+ assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
+
+ 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)
+ {
+ fail(e);
+ }
+ }
+
+ /*
+ 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
+ }
+ }
+ */
+
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/security/portlet2.xml";
+
+ PortletApplication20MetaData md = this._unmarshall10( xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
+ assertNotNull(scd1);
+ assertEquals("test", scd1.getDisplayName().getDefaultString());
+ assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
+ assertEquals("foo", scd1.getId());
+
+ assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint().getTransportGuarantee());
+ assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
+ assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
+
+
+ SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
+ assertNotNull(scd2);
+ assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstraint().getTransportGuarantee());
+ assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
+ assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
+ assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
+
+ try
+ {
+ scd2.getPortletList().getPortletNames().get(1);
+ fail("2nd security constraint should only contain one element,");
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ // expected java.lang.IndexOutOfBoundsException
+ }
+
+ }
+ catch (Exception e)
+ {
+ fail(e);
+ }
+ }
+ /*
+ 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
+ }
+ }
+ */
+}
Copied: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/UserAttributeTestEverythingTestCase.java (from rev 6738, components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/UserAttributeTestEverythingTestCase.java)
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/UserAttributeTestEverythingTestCase.java (rev 0)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/UserAttributeTestEverythingTestCase.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -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.gatein.pc.portlet.deployment;
+
+import java.util.Locale;
+
+import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.UserAttributeMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UserAttributeTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ public void test01()
+ {
+ try
+ {
+ String xmlFile = "metadata/userAttribute/portlet1.xml";
+
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+
+ 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();
+ }
+ }
+
+ public void test02()
+ {
+ try
+ {
+ String xmlFile = "metadata/userAttribute/portlet2.xml";
+
+ PortletApplication20MetaData md = this._unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+
+ 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();
+ }
+ }
+
+}
Deleted: components/pc/trunk/portlet/src/test/resources/metadata/filter/portlet-filter2.xml
===================================================================
--- components/pc/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml 2011-06-20 16:49:45 UTC (rev 6681)
+++ components/pc/trunk/portlet/src/test/resources/metadata/filter/portlet-filter2.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,73 +0,0 @@
-<?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
Copied: components/pc/trunk/portlet/src/test/resources/metadata/filter/portlet-filter2.xml (from rev 6738, components/pc/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml)
===================================================================
--- components/pc/trunk/portlet/src/test/resources/metadata/filter/portlet-filter2.xml (rev 0)
+++ components/pc/trunk/portlet/src/test/resources/metadata/filter/portlet-filter2.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,75 @@
+<?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>
Deleted: components/pc/trunk/portlet/src/test/resources/metadata/general/portlet-app_2_0.xml
===================================================================
--- components/pc/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml 2011-06-20 16:49:45 UTC (rev 6681)
+++ components/pc/trunk/portlet/src/test/resources/metadata/general/portlet-app_2_0.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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"
- id="id">
- <portlet id="id">
- <description xml:lang="en">description</description>
- <portlet-name>portlet-name</portlet-name>
- <display-name xml:lang="en">display-name</display-name>
- <portlet-class>portlet-class</portlet-class>
- <init-param id="id">
- <description xml:lang="en">description</description>
- <name>name</name>
- <value>value</value>
- </init-param>
- <expiration-cache>0</expiration-cache>
- <cache-scope>PRIVATE</cache-scope>
- <supports id="id">
- <mime-type>mime-type</mime-type>
- <portlet-mode>portlet-mode</portlet-mode>
- <window-state>window-state</window-state>
- </supports>
- <supported-locale>supported-locale</supported-locale>
- <resource-bundle>resource-bundle</resource-bundle>
- <portlet-info id="id">
- <title>title</title>
- <short-title>short-title</short-title>
- <keywords>keywords</keywords>
- </portlet-info>
- <portlet-preferences id="id">
- <preference id="id">
- <name>name</name>
- <value>value</value>
- <read-only>true</read-only>
- </preference>
- <preferences-validator>preferences-validator</preferences-validator>
- </portlet-preferences>
- <security-role-ref id="id">
- <description xml:lang="en">description</description>
- <role-name>NMTOKEN</role-name>
- <role-link>role-link</role-link>
- </security-role-ref>
- <supported-processing-event id="id">
- <qname>QName</qname>
- </supported-processing-event>
- <supported-publishing-event id="id">
- <qname>QName</qname>
- </supported-publishing-event>
- <supported-public-render-parameter>supported-public-render-parameter</supported-public-render-parameter>
- <container-runtime-option>
- <name>name</name>
- <value>value</value>
- </container-runtime-option>
- </portlet>
- <custom-portlet-mode id="id">
- <description xml:lang="en">description</description>
- <portlet-mode>portlet-mode</portlet-mode>
- <portal-managed>true</portal-managed>
- </custom-portlet-mode>
- <custom-window-state id="id">
- <description xml:lang="en">description</description>
- <window-state>window-state</window-state>
- </custom-window-state>
- <user-attribute id="id">
- <description xml:lang="en">description</description>
- <name>name</name>
- </user-attribute>
- <security-constraint id="id">
- <display-name xml:lang="en">display-name</display-name>
- <portlet-collection>
- <portlet-name>portlet-name</portlet-name>
- </portlet-collection>
- <user-data-constraint id="id">
- <description xml:lang="en">description</description>
- <transport-guarantee>CONFIDENTIAL</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
- <resource-bundle>resource-bundle</resource-bundle>
- <filter>
- <description xml:lang="en">description</description>
- <display-name xml:lang="en">display-name</display-name>
- <filter-name>filter-name</filter-name>
- <filter-class>filter-class</filter-class>
- <lifecycle>RENDER_PHASE</lifecycle>
- <init-param id="">
- <description xml:lang="en">description</description>
- <name>name</name>
- <value>value</value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>filter-name</filter-name>
- <portlet-name>portlet-name</portlet-name>
- </filter-mapping>
- <default-namespace>http://tempuri.org</default-namespace>
- <event-definition id="id">
- <description xml:lang="en">description</description>
- <qname>QName</qname>
- <alias>QName</alias>
- <value-type>value-type</value-type>
- </event-definition>
- <public-render-parameter id="id">
- <description xml:lang="en">description</description>
- <identifier>identifier</identifier>
- <qname>QName</qname>
- <alias>QName</alias>
- </public-render-parameter>
- <listener id="id">
- <description xml:lang="en">description</description>
- <display-name xml:lang="en">display-name</display-name>
- <listener-class>listener-class</listener-class>
- </listener>
- <container-runtime-option>
- <name>name</name>
- <value>value</value>
- </container-runtime-option>
-</portlet-app>
Copied: components/pc/trunk/portlet/src/test/resources/metadata/general/portlet-app_2_0.xml (from rev 6738, components/pc/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml)
===================================================================
--- components/pc/trunk/portlet/src/test/resources/metadata/general/portlet-app_2_0.xml (rev 0)
+++ components/pc/trunk/portlet/src/test/resources/metadata/general/portlet-app_2_0.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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"
+ id="id">
+ <portlet id="id">
+ <description xml:lang="en">description</description>
+ <portlet-name>portlet-name</portlet-name>
+ <display-name xml:lang="en">display-name</display-name>
+ <portlet-class>portlet-class</portlet-class>
+ <init-param id="id">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ <value>value</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <cache-scope>PRIVATE</cache-scope>
+ <supports id="id">
+ <mime-type>mime-type</mime-type>
+ <portlet-mode>portlet-mode</portlet-mode>
+ <window-state>window-state</window-state>
+ </supports>
+ <supported-locale>supported-locale</supported-locale>
+ <resource-bundle>resource-bundle</resource-bundle>
+ <portlet-info id="id">
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ <portlet-preferences id="id">
+ <preference id="id">
+ <name>name</name>
+ <value>value</value>
+ <read-only>true</read-only>
+ </preference>
+ <preferences-validator>preferences-validator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref id="id">
+ <description xml:lang="en">description</description>
+ <role-name>NMTOKEN</role-name>
+ <role-link>role-link</role-link>
+ </security-role-ref>
+ <supported-processing-event id="id">
+ <qname>QName</qname>
+ </supported-processing-event>
+ <supported-publishing-event id="id">
+ <qname>QName</qname>
+ </supported-publishing-event>
+ <supported-public-render-parameter>supported-public-render-parameter</supported-public-render-parameter>
+ <container-runtime-option>
+ <name>portlet_container_runtime_option_name</name>
+ <value>portlet_container_runtime_option_value</value>
+ </container-runtime-option>
+ </portlet>
+ <custom-portlet-mode id="id">
+ <description xml:lang="en">description</description>
+ <portlet-mode>portlet-mode</portlet-mode>
+ <portal-managed>true</portal-managed>
+ </custom-portlet-mode>
+ <custom-window-state id="id">
+ <description xml:lang="en">description</description>
+ <window-state>window-state</window-state>
+ </custom-window-state>
+ <user-attribute id="id">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ </user-attribute>
+ <security-constraint id="id">
+ <display-name xml:lang="en">display-name</display-name>
+ <portlet-collection>
+ <portlet-name>portlet-name</portlet-name>
+ </portlet-collection>
+ <user-data-constraint id="id">
+ <description xml:lang="en">description</description>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <resource-bundle>resource-bundle</resource-bundle>
+ <filter>
+ <description xml:lang="en">description</description>
+ <display-name xml:lang="en">display-name</display-name>
+ <filter-name>filter-name</filter-name>
+ <filter-class>filter-class</filter-class>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ <init-param id="">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ <value>value</value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>filter-name</filter-name>
+ <portlet-name>portlet-name</portlet-name>
+ </filter-mapping>
+ <default-namespace>http://tempuri.org</default-namespace>
+ <event-definition id="id">
+ <description xml:lang="en">description</description>
+ <qname>QName</qname>
+ <alias>QName</alias>
+ <value-type>value-type</value-type>
+ </event-definition>
+ <public-render-parameter id="id">
+ <description xml:lang="en">description</description>
+ <identifier>identifier</identifier>
+ <qname>QName</qname>
+ <alias>QName</alias>
+ </public-render-parameter>
+ <listener id="id">
+ <description xml:lang="en">description</description>
+ <display-name xml:lang="en">display-name</display-name>
+ <listener-class>listener-class</listener-class>
+ </listener>
+ <container-runtime-option>
+ <name>application_container_runtime_option_name</name>
+ <value>application_container_runtime_option_value</value>
+ </container-runtime-option>
+</portlet-app>
Modified: components/pc/trunk/test/core/src/main/java/org/gatein/pc/test/TestPortletApplicationDeployer.java
===================================================================
--- components/pc/trunk/test/core/src/main/java/org/gatein/pc/test/TestPortletApplicationDeployer.java 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/test/core/src/main/java/org/gatein/pc/test/TestPortletApplicationDeployer.java 2011-06-24 21:52:27 UTC (rev 6743)
@@ -24,7 +24,7 @@
package org.gatein.pc.test;
import org.gatein.wci.WebApp;
-import org.gatein.pc.mc.PortletApplicationDeployer;
+import org.gatein.pc.portlet.impl.deployment.PortletApplicationDeployer;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
Modified: components/pc/trunk/test/servers/jboss42/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss42/src/test/build.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/test/servers/jboss42/src/test/build.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -18,11 +18,11 @@
<path refid="portal-common"/>
<path refid="portal-web"/>
<path refid="portal-portlet"/>
- <path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
<path id="JBoss-4.2-shared">
+ <path refid="staxnav"/>
<path refid="portal-common-shared"/>
<path refid="portal-web-shared"/>
<path refid="portal-portlet-shared"/>
Modified: components/pc/trunk/test/servers/jboss51/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss51/src/test/build.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/test/servers/jboss51/src/test/build.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -18,11 +18,11 @@
<path refid="portal-common"/>
<path refid="portal-web"/>
<path refid="portal-portlet"/>
- <path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
<path id="JBoss-5.1-shared">
+ <path refid="staxnav"/>
<path refid="portal-common-shared"/>
<path refid="portal-web-shared"/>
<path refid="portal-portlet-shared"/>
Modified: components/pc/trunk/test/servers/jboss6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss6/src/test/build.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/test/servers/jboss6/src/test/build.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -18,11 +18,11 @@
<path refid="portal-common"/>
<path refid="portal-web"/>
<path refid="portal-portlet"/>
- <path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
<path id="JBoss-6-shared">
+ <path refid="staxnav"/>
<path refid="portal-common-shared"/>
<path refid="portal-web-shared"/>
<path refid="portal-portlet-shared"/>
Modified: components/pc/trunk/test/servers/jetty6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jetty6/src/test/build.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/test/servers/jetty6/src/test/build.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -19,7 +19,6 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
- <path refid="staxnav"/>
<pathelement path="${apache-xerces:xercesImpl:jar}"/>
<pathelement path="${apache-xerces:resolver:jar}"/>
<pathelement path="${apache-xerces.xml-apis:jar}"/>
@@ -27,6 +26,7 @@
</path>
<path id="Jetty-6.1-shared">
+ <path refid="staxnav"/>
<path refid="portal-common-shared"/>
<path refid="portal-web-shared"/>
<path refid="portal-portlet-shared"/>
Modified: components/pc/trunk/test/servers/tomcat6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat6/src/test/build.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/test/servers/tomcat6/src/test/build.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -19,13 +19,13 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
- <path refid="staxnav"/>
<pathelement location="${apache-xerces:xercesImpl:jar}"/>
<pathelement location="${apache-xerces:xml-apis:jar}"/>
<pathelement location="${apache-xerces:resolver:jar}"/>
</path>
<path id="Tomcat-6.0-shared">
+ <path refid="staxnav"/>
<path refid="portal-common-shared"/>
<path refid="portal-web-shared"/>
<path refid="portal-portlet-shared"/>
Modified: components/pc/trunk/test/servers/tomcat7/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat7/src/test/build.xml 2011-06-24 20:54:47 UTC (rev 6742)
+++ components/pc/trunk/test/servers/tomcat7/src/test/build.xml 2011-06-24 21:52:27 UTC (rev 6743)
@@ -19,7 +19,6 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
- <path refid="staxnav"/>
<pathelement path="${apache-xerces:xercesImpl:jar}"/>
<pathelement path="${apache-xerces:resolver:jar}"/>
<pathelement path="${apache-xerces.xml-apis:jar}"/>
@@ -27,6 +26,7 @@
</path>
<path id="Tomcat-7.0-shared">
+ <path refid="staxnav"/>
<path refid="portal-common-shared"/>
<path refid="portal-web-shared"/>
<path refid="portal-portlet-shared"/>
13 years, 6 months
gatein SVN: r6742 - in components/pc/trunk: portlet and 6 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-24 16:54:47 -0400 (Fri, 24 Jun 2011)
New Revision: 6742
Removed:
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentTypesTestCase.java
Modified:
components/pc/trunk/mc/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/ManagedObjectRegistryEventList.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentBufferTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ParametersTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/StateStringTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/AbstractInfoTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CacheInfoTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CapabilitiesInfoTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/MetaInfoTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/ModeInfoTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/PreferenceInfoTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/SecurityInfoTest.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/navigation/StateStringTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/StateConverterV0TestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ValueMapAssert.java
Log:
switched portlet module to junit
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/mc/pom.xml 2011-06-24 20:54:47 UTC (rev 6742)
@@ -33,7 +33,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.3.1</version>
<configuration>
<skip>false</skip>
</configuration>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/pom.xml 2011-06-24 20:54:47 UTC (rev 6742)
@@ -35,32 +35,12 @@
<groupId>javax.ccpp</groupId>
<artifactId>ccpp</artifactId>
</dependency>
-
- <!--TEST SCOPE-->
<dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-remote</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
<scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-slide</groupId>
- <artifactId>webdavlib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </exclusion>
- </exclusions>
</dependency>
-
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
@@ -69,156 +49,15 @@
</dependencies>
-
- <profiles>
- <!--By default Annotation Processing Tool related classes need to be disabled-->
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <testExcludes>
- <exclude>org/gatein/pc/test/unit/reports/*</exclude>
- </testExcludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>apt</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.myfaces.tobago</groupId>
- <artifactId>maven-apt-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <configuration>
- <factory>org.gatein.pc.test.unit.reports.TestCaseAPF</factory>
- <force>true</force>
- <target>1.5</target>
- <nocompile>true</nocompile>
- <showWarnings>true</showWarnings>
- </configuration>
- <goals>
- <goal>testExecute</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>sun.jdk</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- <scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
- </profile>
-
- <!--On MacOSX the tools.jar should be already in the classpath-->
- <profile>
- <id>apt-mac</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.myfaces.tobago</groupId>
- <artifactId>maven-apt-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <configuration>
- <factory>org.gatein.pc.test.unit.reports.TestCaseAPF</factory>
- <force>true</force>
- <target>1.5</target>
- <nocompile>true</nocompile>
- <showWarnings>true</showWarnings>
- </configuration>
- <goals>
- <goal>testExecute</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- </profiles>
-
-
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <!--In 2.1 there is http://jira.codehaus.org/browse/MJAR-30-->
- <!--2.2 should be used but SNAPSHOT is unstable for now-->
- <version>2.1</version>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <includes>
- <include>org/**</include>
- </includes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-tooling-maven2</artifactId>
- <executions>
- <execution>
- <phase>test</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- </execution>
- </executions>
+ <artifactId>maven-surefire-plugin</artifactId>
<configuration>
-
- <!--Uncomment if needed-->
- <!--<jpda>false</jpda>-->
- <!--<jpdaPort>9000</jpdaPort>-->
- <!--<jpdaSuspend>true</jpdaSuspend>-->
- <failOnError>true</failOnError>
- <!--<assertions>true</assertions>-->
- <testsuites>
- <testsuite>
- <config>local-jboss-unit.xml</config>
- </testsuite>
- </testsuites>
- <reports>
- <xml>target/tests/reports/xml</xml>
- <html>target/tests/reports/html</html>
- </reports>
+ <skip>false</skip>
</configuration>
</plugin>
-
</plugins>
</build>
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycle1Test.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,21 +22,17 @@
******************************************************************************/
package org.gatein.pc.portlet.container;
-import org.jboss.unit.api.pojo.annotations.Test;
-import org.jboss.unit.api.pojo.annotations.Create;
+import junit.framework.TestCase;
import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
import org.gatein.pc.portlet.impl.container.PortletFilterLifeCycle;
import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class LifeCycle1Test
+public class LifeCycle1Test extends TestCase
{
ManagedObjectRegistryEventList events;
@@ -49,8 +45,8 @@
PortletFilterLifeCycle filterLC;
PortletContainerLifeCycle containerLC;
- @Create
- public void create()
+ @Override
+ protected void setUp() throws Exception
{
events = new ManagedObjectRegistryEventList();
@@ -89,7 +85,6 @@
assertEquals(filterStatus, filterLC.getStatus());
}
- @Test
public void testWiring()
{
events.assertAddedEvent(filterLC);
@@ -110,7 +105,6 @@
assertSame(filter, container.filters.get(filter.getId()));
}
- @Test
public void testApplicationLifeCycle()
{
events.clear();
@@ -143,7 +137,6 @@
events.assertEmpty();
}
- @Test
public void testFilterLifeCycle()
{
events.clear();
@@ -180,7 +173,6 @@
events.assertEmpty();
}
- @Test
public void testContainerLifeCycle()
{
events.clear();
@@ -208,7 +200,6 @@
events.assertEmpty();
}
- @Test
public void testContainerFailsOnStart()
{
events.clear();
@@ -275,7 +266,6 @@
events.assertEmpty();
}
- @Test
public void testApplicationFailsOnStart()
{
events.clear();
@@ -306,7 +296,6 @@
events.assertEmpty();
}
- @Test
public void testFilterFailsOnStart()
{
events.clear();
@@ -368,7 +357,6 @@
events.assertEmpty();
}
- @Test
public void testContainerFailsOnStop()
{
container.stopCallback = ObjectSupport.FAILURE_CALLBACK;
@@ -377,7 +365,6 @@
testApplicationLifeCycle();
}
- @Test
public void testApplicationFailsOnStop()
{
application.stopCallback = ObjectSupport.FAILURE_CALLBACK;
@@ -386,7 +373,6 @@
testApplicationLifeCycle();
}
- @Test
public void testFilterFailsOnStop()
{
filter.stopCallback = ObjectSupport.FAILURE_CALLBACK;
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/LifeCycleReentranceDetectionTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,21 +22,17 @@
******************************************************************************/
package org.gatein.pc.portlet.container;
-import org.jboss.unit.api.pojo.annotations.Test;
-import org.jboss.unit.api.pojo.annotations.Create;
+import junit.framework.TestCase;
import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
import org.gatein.pc.portlet.impl.container.LifeCycle;
import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class LifeCycleReentranceDetectionTest
+public class LifeCycleReentranceDetectionTest extends TestCase
{
PortletApplicationLifeCycle applicationLF;
@@ -46,8 +42,8 @@
IllegalStateException ise;
- @Create
- public void create()
+ @Override
+ protected void setUp() throws Exception
{
this.ise = null;
}
@@ -97,8 +93,7 @@
}
}
- @Test
- public void applicationReentersApplication1()
+ public void testApplicationReentersApplication1()
{
application = new PortletApplicationObjectSupport("application");
applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
@@ -115,8 +110,7 @@
assertEquals(LifeCycleStatus.STARTED, applicationLF.getStatus());
}
- @Test
- public void applicationReentersApplication2()
+ public void testApplicationReentersApplication2()
{
application = new PortletApplicationObjectSupport("application");
applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
@@ -133,8 +127,7 @@
assertEquals(LifeCycleStatus.FAILED, applicationLF.getStatus());
}
- @Test
- public void containerReentersContainer1()
+ public void testContainerReentersContainer1()
{
application = new PortletApplicationObjectSupport("application");
applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
@@ -154,8 +147,7 @@
assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus());
}
- @Test
- public void containerReentersContainer2()
+ public void testContainerReentersContainer2()
{
application = new PortletApplicationObjectSupport("application");
applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
@@ -175,8 +167,7 @@
assertEquals(LifeCycleStatus.FAILED, containerLF.getStatus());
}
- @Test
- public void containerReentersApplication1()
+ public void testContainerReentersApplication1()
{
application = new PortletApplicationObjectSupport("application");
applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
@@ -196,8 +187,7 @@
assertEquals(LifeCycleStatus.STARTED, containerLF.getStatus());
}
- @Test
- public void containerReentersApplication2()
+ public void testContainerReentersApplication2()
{
application = new PortletApplicationObjectSupport("application");
applicationLF = new PortletApplicationLifeCycle(new PortletApplicationContextSupport(), application);
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/ManagedObjectRegistryEventList.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/ManagedObjectRegistryEventList.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/container/ManagedObjectRegistryEventList.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.gatein.pc.portlet.container;
+import junit.framework.Assert;
import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventListener;
import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEvent;
import org.gatein.pc.portlet.container.managed.ManagedObject;
@@ -31,8 +32,6 @@
import java.util.LinkedList;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -51,7 +50,7 @@
public void assertAddedEvent(ManagedObject managedObject)
{
ManagedObjectAddedEvent event = nextEvent(ManagedObjectAddedEvent.class);
- assertSame(managedObject, event.getManagedObject());
+ Assert.assertSame(managedObject, event.getManagedObject());
}
public void assertStartedEvent(ManagedObject managedObject)
@@ -72,13 +71,13 @@
public void assertLifeCycleEvent(ManagedObject managedObject, LifeCycleStatus status)
{
ManagedObjectLifeCycleEvent event = nextEvent(ManagedObjectLifeCycleEvent.class);
- assertSame(managedObject, event.getManagedObject());
- assertEquals(status, event.getStatus());
+ Assert.assertSame(managedObject, event.getManagedObject());
+ Assert.assertEquals(status, event.getStatus());
}
public void assertEmpty()
{
- assertTrue(list.isEmpty());
+ Assert.assertTrue(list.isEmpty());
}
public void clear()
@@ -88,7 +87,9 @@
private <T extends ManagedObjectRegistryEvent> T nextEvent(Class<T> type)
{
- assertFalse(list.isEmpty());
- return assertInstanceOf(list.removeFirst(), type);
+ Assert.assertFalse(list.isEmpty());
+ ManagedObjectRegistryEvent first = list.removeFirst();
+ Assert.assertTrue(type.isInstance(first));
+ return type.cast(first);
}
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/support/PortletSupport.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.gatein.pc.portlet.support;
+import junit.framework.Assert;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.Portlet;
@@ -32,7 +33,6 @@
import org.gatein.pc.api.invocation.RenderInvocation;
import org.gatein.pc.api.invocation.ResourceInvocation;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
-import static org.jboss.unit.api.Assert.*;
import java.util.ArrayList;
import java.util.Map;
@@ -106,12 +106,12 @@
public void assertInvocationCountIs(int expectedInvocationCount)
{
- assertEquals(expectedInvocationCount, invocationCount);
+ Assert.assertEquals(expectedInvocationCount, invocationCount);
}
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
- assertNotNull(invocation);
+ Assert.assertNotNull(invocation);
//
if (invocationCount == handlers.size())
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentBufferTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentBufferTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentBufferTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,24 +22,21 @@
******************************************************************************/
package org.gatein.pc.test.portlet;
-import org.jboss.unit.api.pojo.annotations.Test;
+import junit.framework.TestCase;
import org.gatein.pc.portlet.impl.jsr168.ContentBuffer;
-import static org.jboss.unit.api.Assert.*;
-import static org.jboss.unit.api.Assert.assertEquals;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
+import java.util.Arrays;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class ContentBufferTestCase
+public class ContentBufferTestCase extends TestCase
{
- @Test
public void testResetChars()
{
ContentBuffer buffer = new ContentBuffer();
@@ -50,7 +47,6 @@
assertEquals("", buffer.getChars());
}
- @Test
public void testResetBytes() throws IOException
{
ContentBuffer buffer = new ContentBuffer();
@@ -58,10 +54,9 @@
OutputStream out = buffer.getOutputStream();
out.write("foo".getBytes("UTF8"));
buffer.reset();
- assertEquals(new byte[0], buffer.getBytes());
+ assertEquals(0, buffer.getBytes().length);
}
- @Test
public void testResetAfterCommit()
{
ContentBuffer buffer = new ContentBuffer();
@@ -77,7 +72,6 @@
}
}
- @Test
public void testCommit()
{
ContentBuffer buffer = new ContentBuffer();
@@ -87,7 +81,6 @@
assertTrue(buffer.isCommited());
}
- @Test
public void testWriteCharsAfterCommit()
{
ContentBuffer buffer = new ContentBuffer();
@@ -100,7 +93,6 @@
assertEquals("foo", buffer.getChars());
}
- @Test
public void testWriteCharsAndCommit()
{
ContentBuffer buffer = new ContentBuffer();
@@ -114,7 +106,6 @@
assertEquals("foobar", buffer.getChars());
}
- @Test
public void testWriteBytesAfterCommit() throws IOException
{
ContentBuffer buffer = new ContentBuffer();
@@ -124,10 +115,9 @@
assertNotNull(out);
out.write("foo".getBytes("UTF8"));
out.close();
- assertEquals("foo".getBytes("UTF8"), buffer.getBytes());
+ assertTrue(Arrays.equals("foo".getBytes("UTF8"), buffer.getBytes()));
}
- @Test
public void testWriteBytesAndCommit() throws IOException
{
ContentBuffer buffer = new ContentBuffer();
@@ -138,10 +128,9 @@
assertNotNull(out);
out.write("bar".getBytes("UTF8"));
out.close();
- assertEquals("foobar".getBytes("UTF8"), buffer.getBytes());
+ assertTrue(Arrays.equals("foobar".getBytes("UTF8"), buffer.getBytes()));
}
- @Test
public void testFlushWriterDoesCommit()
{
ContentBuffer buffer = new ContentBuffer();
@@ -152,7 +141,6 @@
assertTrue(buffer.isCommited());
}
- @Test
public void testCloseWriterDoesCommit()
{
ContentBuffer buffer = new ContentBuffer();
@@ -163,7 +151,6 @@
assertTrue(buffer.isCommited());
}
- @Test
public void testFlushStreamDoesCommit() throws IOException
{
ContentBuffer buffer = new ContentBuffer();
@@ -174,8 +161,7 @@
assertTrue(buffer.isCommited());
}
- @Test
- public void testClosestreamDoesCommit() throws IOException
+ public void testClosestreamDoesCommit() throws IOException
{
ContentBuffer buffer = new ContentBuffer();
buffer.setContentType("text/html");
Deleted: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentTypesTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentTypesTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ContentTypesTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -1,89 +0,0 @@
-/******************************************************************************
- * 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.gatein.pc.test.portlet;
-
-import org.gatein.pc.api.Mode;
-import org.gatein.pc.portlet.impl.info.ContainerCapabilitiesInfo;
-
-import java.util.Collection;
-
-import static org.jboss.unit.api.Assert.*;
-import org.jboss.unit.api.pojo.annotations.Test;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 6720 $
- * @since 2.4
- */
-// @Test
-public class ContentTypesTestCase
-{
- private ContainerCapabilitiesInfo contentTypes;
-
- public ContentTypesTestCase()
- {
- contentTypes = new ContainerCapabilitiesInfo();
- ContainerCapabilitiesInfo md = new ContainerCapabilitiesInfo();
- md.add("text/html", org.gatein.pc.api.Mode.EDIT);
- md.add("text/html", Mode.HELP );
- md.add("text/html", org.gatein.pc.api.Mode.VIEW);
- md.add("text/xml", org.gatein.pc.api.Mode.VIEW);
- md.add("*", org.gatein.pc.api.Mode.VIEW);
-// md.add("*/*", new Mode[]{});
-// md.add("text/*", new Mode[]{});
-
- // should this be allowed?
-// md.add(new ContentTypeMetaData("pipo/pipo", new Mode[]{}));
- }
-
- @Test
- public void testGetAllModes()
- {
- Collection modes = contentTypes.getAllModes();
- assertEquals(3, modes.size());
- assertTrue(modes.contains(org.gatein.pc.api.Mode.EDIT));
- assertTrue(modes.contains(Mode.HELP));
- assertTrue(modes.contains(Mode.VIEW));
- }
-
- @Test
- public void testIsModeSupported()
- {
- }
-
- @Test
- public void testGetSupportedModes()
- {
- }
-
- public void testIsContentTypeSupported()
- {
- }
-
-
- @Test
- public void testIsModeSupportedFor()
- {
- }
-}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ParametersTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ParametersTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/ParametersTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,28 +22,23 @@
******************************************************************************/
package org.gatein.pc.test.portlet;
+import junit.framework.TestCase;
import org.gatein.pc.portlet.impl.jsr168.PortletParameterMap;
import org.gatein.pc.portlet.support.info.NavigationInfoSupport;
import org.gatein.pc.portlet.support.info.ParameterInfoSupport;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import static org.jboss.unit.api.Assert.*;
-import static org.jboss.unit.api.Assert.assertEquals;
-import org.jboss.unit.api.pojo.annotations.Test;
-import org.jboss.unit.api.pojo.annotations.Create;
-import org.jboss.unit.api.pojo.annotations.Destroy;
-
import javax.xml.namespace.QName;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6639 $
*/
-@Test
-public class ParametersTestCase
+public class ParametersTestCase extends TestCase
{
public ParametersTestCase()
@@ -53,21 +48,18 @@
private NavigationInfoSupport navigation;
private PortletParameterMap map;
- @Create
public void setUp()
{
navigation = new NavigationInfoSupport();
map = new PortletParameterMap(navigation);
}
- @Destroy
public void tearDown()
{
map = null;
navigation = null;
}
- @Test
public void testGetWithNullName()
{
try
@@ -80,14 +72,12 @@
}
}
- @Test
public void testSet()
{
map.setParameterValue("a", "b");
assertEquals(map.getParameterValue("a"), "b");
}
- @Test
public void testSetWithNullName()
{
try
@@ -100,7 +90,6 @@
}
}
- @Test
public void testSetWithNullValue()
{
try
@@ -113,7 +102,6 @@
}
}
-// @Test
// public void testRemoveWithNullName()
// {
// try
@@ -126,7 +114,6 @@
// }
// }
-// @Test
// public void testRemove()
// {
// param.setValue("a", "b");
@@ -134,7 +121,6 @@
// assertEquals(param.getValue("a"), null);
// }
- @Test
public void testSetValues()
{
map.setParameterValues("a", new String[]{"b", "c"});
@@ -143,7 +129,6 @@
assertEquals(map.getParameterValue("a"), "b");
}
- @Test
public void testSetValuesWithNullName()
{
try
@@ -156,7 +141,6 @@
}
}
- @Test
public void testSetValuesWithNullValues()
{
try
@@ -169,7 +153,6 @@
}
}
- @Test
public void testSetValuesWithZeroLengthValues()
{
try
@@ -182,7 +165,6 @@
}
}
- @Test
public void testSetValuesWithOneNullValue()
{
try
@@ -206,7 +188,6 @@
// assertTrue(Arrays.equals(param.getValues("c"), new String[]{"d", "e"}));
// }
- @Test
public void testBlah()
{
navigation.addPublicParameter(new ParameterInfoSupport("foo", new QName("", "foo")));
@@ -218,21 +199,20 @@
Map<String, String[]> privateMap = map.getPrivateMapSnapshot();
assertEquals(1, privateMap.size());
- assertEquals(new String[]{"daa"}, privateMap.get("juu"));
+ assertEquals(Arrays.asList("daa"), Arrays.asList(privateMap.get("juu")));
assertEquals(null, privateMap.get("abc"));
Map<String, String[]> publicMap = map.getPublicMapSnapshot();
assertEquals(2, publicMap.size());
- assertEquals(new String[]{"bar"}, publicMap.get("foo"));
- assertEquals(new String[]{}, publicMap.get("abc"));
+ assertEquals(Arrays.asList("bar"), Arrays.asList(publicMap.get("foo")));
+ assertEquals(Collections.<String>emptyList(), Arrays.asList(publicMap.get("abc")));
Map<String, String[]> combinedMap = map.getMap();
assertEquals(2, combinedMap.size());
- assertEquals(new String[]{"bar"}, combinedMap.get("foo"));
- assertEquals(new String[]{"daa"}, combinedMap.get("juu"));
+ assertEquals(Arrays.asList("bar"), Arrays.asList(combinedMap.get("foo")));
+ assertEquals(Arrays.asList("daa"), Arrays.asList(combinedMap.get("juu")));
}
-// @Test
// public void testReplaceWithNullMap()
// {
// try
@@ -245,7 +225,6 @@
// }
// }
-// @Test
// public void testReplaceWithInvalidMap()
// {
// Map[] maps = buildInvalidMaps();
@@ -265,7 +244,6 @@
// }
// }
-// @Test
// public void testReplace()
// {
// param.setValue("a", "b");
@@ -282,7 +260,6 @@
// assertEquals(param.getValues("h"), new String[]{"_i"});
// }
-// @Test
// public void testAppendWithInvalidMap()
// {
// Map[] maps = buildInvalidMaps();
@@ -305,7 +282,6 @@
// }
// }
-// @Test
// public void testAppend()
// {
// param.setValue("a", "b");
@@ -323,7 +299,6 @@
// assertEquals(param.getValues("h"), new String[]{"_i"});
// }
-// @Test
// public void testClear()
// {
// param.setValue("a", "b");
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/StateStringTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/StateStringTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/StateStringTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,12 +22,11 @@
******************************************************************************/
package org.gatein.pc.test.portlet;
+import junit.framework.TestCase;
import org.gatein.common.util.MapBuilder;
import org.gatein.pc.api.OpaqueStateString;
import org.gatein.pc.api.ParametersStateString;
import org.gatein.pc.api.StateString;
-import static org.jboss.unit.api.Assert.assertEquals;
-import org.jboss.unit.api.pojo.annotations.Test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -40,11 +39,9 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-@Test
-public class StateStringTestCase
+public class StateStringTestCase extends TestCase
{
- @Test
public void testMarshalling() throws IOException
{
check(new OpaqueStateString("blah"));
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/AbstractInfoTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/AbstractInfoTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/AbstractInfoTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,133 +22,116 @@
******************************************************************************/
package org.gatein.pc.test.portlet.info;
-import org.gatein.pc.portlet.container.managed.PortletApplicationRegistry;
-import org.jboss.unit.info.TestInfo;
-import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
-import org.jboss.unit.remote.driver.RemoteTestDriver;
-import org.jboss.unit.remote.RequestContext;
-import org.jboss.unit.remote.ResponseContext;
-import org.jboss.unit.driver.impl.composite.CompositeTestDriver;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.DriverCommand;
-import org.jboss.unit.driver.DriverContext;
-import org.jboss.unit.driver.DriverException;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.response.FailureResponse;
-import org.jboss.unit.driver.command.StartTestCommand;
-import org.jboss.unit.Failure;
-import org.jboss.unit.TestId;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public abstract class AbstractInfoTest implements RemoteTestDriver
+public abstract class AbstractInfoTest // implements RemoteTestDriver
{
-
- /** The test id. */
- protected final String testCaseId;
-
- /** The test info. */
- protected final TestInfo testInfo;
-
- /** . */
- protected PortletApplicationRegistry registry;
-
- /** The controller. */
- protected CompositeTestDriver testDriverContainer;
-
- /** Not really used for now, we need the concept of non http test context. */
- private RequestContext testContext;
-
+//
+// /** The test id. */
+// protected final String testCaseId;
+//
+// /** The test info. */
+// protected final TestInfo testInfo;
+//
+// /** . */
+// protected PortletApplicationRegistry registry;
+//
+// /** The controller. */
+// protected CompositeTestDriver testDriverContainer;
+//
+// /** Not really used for now, we need the concept of non http test context. */
+// private RequestContext testContext;
+//
public AbstractInfoTest(String testCaseId)
{
- if (testCaseId == null)
- {
- throw new IllegalArgumentException("No null test case id accepted");
- }
-
- //
- this.testCaseId = testCaseId;
- this.testInfo = new SimpleTestSuiteInfo(testCaseId);
+// if (testCaseId == null)
+// {
+// throw new IllegalArgumentException("No null test case id accepted");
+// }
+//
+// //
+// this.testCaseId = testCaseId;
+// this.testInfo = new SimpleTestSuiteInfo(testCaseId);
}
-
- public void pushContext(TestId testId, RequestContext requestContext)
- {
- this.testContext = requestContext;
- }
-
- public ResponseContext popContext(TestId testId)
- {
- return null;
- }
-
- public PortletApplicationRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(PortletApplicationRegistry registry)
- {
- this.registry = registry;
- }
-
- public CompositeTestDriver getTestDriverRegistry()
- {
- return testDriverContainer;
- }
-
-
- public void initDriver(DriverContext driverContext) throws DriverException
- {
- }
-
- public void destroyDriver()
- {
- }
-
- public void setTestDriverRegistry(CompositeTestDriver testDriverContainer)
- {
- this.testDriverContainer = testDriverContainer;
- }
-
- public void create() throws Exception
- {
- testDriverContainer.mount(this);
- }
-
- public void destroy()
- {
- testDriverContainer.unmount(this);
- }
-
- public TestInfo getInfo()
- {
- return testInfo;
- }
-
- public DriverResponse invoke(TestId testId, DriverCommand cmd)
- {
- if (cmd instanceof StartTestCommand)
- {
- try
- {
- execute();
-
- //
- return new EndTestResponse();
- }
- catch (Exception e)
- {
- return new FailureResponse(Failure.createFailure(e));
- }
- }
- else
- {
- return new FailureResponse(Failure.createAssertionFailure("Unexpected command"));
- }
- }
-
- protected abstract void execute();
-
+//
+// public void pushContext(TestId testId, RequestContext requestContext)
+// {
+// this.testContext = requestContext;
+// }
+//
+// public ResponseContext popContext(TestId testId)
+// {
+// return null;
+// }
+//
+// public PortletApplicationRegistry getRegistry()
+// {
+// return registry;
+// }
+//
+// public void setRegistry(PortletApplicationRegistry registry)
+// {
+// this.registry = registry;
+// }
+//
+// public CompositeTestDriver getTestDriverRegistry()
+// {
+// return testDriverContainer;
+// }
+//
+//
+// public void initDriver(DriverContext driverContext) throws DriverException
+// {
+// }
+//
+// public void destroyDriver()
+// {
+// }
+//
+// public void setTestDriverRegistry(CompositeTestDriver testDriverContainer)
+// {
+// this.testDriverContainer = testDriverContainer;
+// }
+//
+// public void create() throws Exception
+// {
+// testDriverContainer.mount(this);
+// }
+//
+// public void destroy()
+// {
+// testDriverContainer.unmount(this);
+// }
+//
+// public TestInfo getInfo()
+// {
+// return testInfo;
+// }
+//
+// public DriverResponse invoke(TestId testId, DriverCommand cmd)
+// {
+// if (cmd instanceof StartTestCommand)
+// {
+// try
+// {
+// execute();
+//
+// //
+// return new EndTestResponse();
+// }
+// catch (Exception e)
+// {
+// return new FailureResponse(Failure.createFailure(e));
+// }
+// }
+// else
+// {
+// return new FailureResponse(Failure.createAssertionFailure("Unexpected command"));
+// }
+// }
+//
+// protected abstract void execute();
+//
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CacheInfoTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CacheInfoTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CacheInfoTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,12 +22,6 @@
******************************************************************************/
package org.gatein.pc.test.portlet.info;
-import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
-import org.gatein.pc.api.info.CacheInfo;
-import org.gatein.pc.api.info.PortletInfo;
-
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
* @version $Revision: 7954 $
@@ -40,12 +34,12 @@
super("CacheInfoTest");
}
- public void execute()
- {
- ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("CachePortlet");
- PortletInfo info = container.getInfo();
- CacheInfo cacheInfo = info.getCache();
- assertEquals(65, cacheInfo.getExpirationSecs());
- //TODO:implement getReferenceType();
- }
+// public void execute()
+// {
+// ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("CachePortlet");
+// PortletInfo info = container.getInfo();
+// CacheInfo cacheInfo = info.getCache();
+// assertEquals(65, cacheInfo.getExpirationSecs());
+// //TODO:implement getReferenceType();
+// }
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CapabilitiesInfoTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CapabilitiesInfoTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/CapabilitiesInfoTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -23,22 +23,6 @@
package org.gatein.pc.test.portlet.info;
-import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.WindowState;
-import org.gatein.common.net.media.MediaType;
-import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
-import org.gatein.pc.api.info.CapabilitiesInfo;
-import org.gatein.pc.api.info.ModeInfo;
-import org.gatein.pc.api.info.PortletInfo;
-import org.gatein.pc.api.info.WindowStateInfo;
-
-import static org.jboss.unit.api.Assert.*;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Set;
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 6720 $
@@ -53,109 +37,109 @@
public void execute()
{
- ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("CapabilitiesPortlet");
- PortletInfo info = container.getInfo();
- CapabilitiesInfo capInfo = info.getCapabilities();
-
- //TODO: finish locales asserts
- // locales should at least contain Locale.ENGLISH
- Set allLocales = capInfo.getAllLocales();
- assertNotNull(allLocales);
- assertTrue(allLocales.contains(Locale.ENGLISH));
-
- //check mime types
- Set<MediaType> types = capInfo.getMediaTypes();
- String[] mt = new String[types.size()];
- int count = 0;
- for (Iterator i = types.iterator(); i.hasNext();)
- {
- Object o = i.next();
- mt[count++] = (String)o;
- }
- assertEquals(new String[]{"text/vnd.wap.wml", "text/html"}, mt);
-
- //check all modes
- Set modeInfos = capInfo.getAllModes();
- Set modes = extractModes(modeInfos);
-
- assertTrue(modes.contains(org.gatein.pc.api.Mode.VIEW));
- assertTrue(modes.contains(org.gatein.pc.api.Mode.HELP));
- assertTrue(modes.contains(Mode.EDIT));
-
- //check text/html modes
- modeInfos = capInfo.getModes(MediaType.TEXT_HTML);
- modes = extractModes(modeInfos);
- assertEquals(2, modes.size());
- assertTrue(modes.contains(org.gatein.pc.api.Mode.VIEW));
- assertTrue(modes.contains(org.gatein.pc.api.Mode.HELP));
-
- //check text/vnd.wap.wml modes
- modeInfos = capInfo.getModes(MediaType.create("text/vnd.wap.wml"));
- modes = extractModes(modeInfos);
- assertEquals(2, modes.size());
- assertTrue(modes.contains(org.gatein.pc.api.Mode.VIEW));
- assertTrue(modes.contains(org.gatein.pc.api.Mode.EDIT));
-
- //check undeclared
- modeInfos = capInfo.getModes(MediaType.create("text/undeclared"));
- modes = extractModes(modeInfos);
- assertEquals(0, modes.size());
-
- //check all window states
- Set stateInfos = capInfo.getAllWindowStates();
- Set states = extractWindowStates(stateInfos);
- assertEquals(3, states.size());
- assertTrue(states.contains(org.gatein.pc.api.WindowState.NORMAL));
- assertTrue(states.contains(org.gatein.pc.api.WindowState.MINIMIZED));
- assertTrue(states.contains(org.gatein.pc.api.WindowState.MAXIMIZED));
-
- //check for text/html
- stateInfos = capInfo.getWindowStates(MediaType.TEXT_HTML);
- states = extractWindowStates(stateInfos);
- assertEquals(3, states.size());
- assertTrue(states.contains(org.gatein.pc.api.WindowState.NORMAL));
- assertTrue(states.contains(WindowState.MINIMIZED));
- assertTrue(states.contains(org.gatein.pc.api.WindowState.MAXIMIZED));
-
- //simple check for text/vnd.wap.wml
- //TODO:is this really expected behaviour? shouldn't it return no states as this is unsupported by portal one?
- states = capInfo.getWindowStates(MediaType.create("text/vnd.wap.wml"));
- assertEquals(3, states.size());
-
- //check undeclared
- states = capInfo.getWindowStates(MediaType.create("undeclared/mime"));
- assertEquals(0, states.size());
-
- //fail();
-
- //throw new UnsupportedOperationException("CapabilitiesInfoTest: Finish implementation!");
+// ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("CapabilitiesPortlet");
+// PortletInfo info = container.getInfo();
+// CapabilitiesInfo capInfo = info.getCapabilities();
+//
+// //TODO: finish locales asserts
+// // locales should at least contain Locale.ENGLISH
+// Set allLocales = capInfo.getAllLocales();
+// assertNotNull(allLocales);
+// assertTrue(allLocales.contains(Locale.ENGLISH));
+//
+// //check mime types
+// Set<MediaType> types = capInfo.getMediaTypes();
+// String[] mt = new String[types.size()];
+// int count = 0;
+// for (Iterator i = types.iterator(); i.hasNext();)
+// {
+// Object o = i.next();
+// mt[count++] = (String)o;
+// }
+// assertEquals(new String[]{"text/vnd.wap.wml", "text/html"}, mt);
+//
+// //check all modes
+// Set modeInfos = capInfo.getAllModes();
+// Set modes = extractModes(modeInfos);
+//
+// assertTrue(modes.contains(org.gatein.pc.api.Mode.VIEW));
+// assertTrue(modes.contains(org.gatein.pc.api.Mode.HELP));
+// assertTrue(modes.contains(Mode.EDIT));
+//
+// //check text/html modes
+// modeInfos = capInfo.getModes(MediaType.TEXT_HTML);
+// modes = extractModes(modeInfos);
+// assertEquals(2, modes.size());
+// assertTrue(modes.contains(org.gatein.pc.api.Mode.VIEW));
+// assertTrue(modes.contains(org.gatein.pc.api.Mode.HELP));
+//
+// //check text/vnd.wap.wml modes
+// modeInfos = capInfo.getModes(MediaType.create("text/vnd.wap.wml"));
+// modes = extractModes(modeInfos);
+// assertEquals(2, modes.size());
+// assertTrue(modes.contains(org.gatein.pc.api.Mode.VIEW));
+// assertTrue(modes.contains(org.gatein.pc.api.Mode.EDIT));
+//
+// //check undeclared
+// modeInfos = capInfo.getModes(MediaType.create("text/undeclared"));
+// modes = extractModes(modeInfos);
+// assertEquals(0, modes.size());
+//
+// //check all window states
+// Set stateInfos = capInfo.getAllWindowStates();
+// Set states = extractWindowStates(stateInfos);
+// assertEquals(3, states.size());
+// assertTrue(states.contains(org.gatein.pc.api.WindowState.NORMAL));
+// assertTrue(states.contains(org.gatein.pc.api.WindowState.MINIMIZED));
+// assertTrue(states.contains(org.gatein.pc.api.WindowState.MAXIMIZED));
+//
+// //check for text/html
+// stateInfos = capInfo.getWindowStates(MediaType.TEXT_HTML);
+// states = extractWindowStates(stateInfos);
+// assertEquals(3, states.size());
+// assertTrue(states.contains(org.gatein.pc.api.WindowState.NORMAL));
+// assertTrue(states.contains(WindowState.MINIMIZED));
+// assertTrue(states.contains(org.gatein.pc.api.WindowState.MAXIMIZED));
+//
+// //simple check for text/vnd.wap.wml
+// //TODO:is this really expected behaviour? shouldn't it return no states as this is unsupported by portal one?
+// states = capInfo.getWindowStates(MediaType.create("text/vnd.wap.wml"));
+// assertEquals(3, states.size());
+//
+// //check undeclared
+// states = capInfo.getWindowStates(MediaType.create("undeclared/mime"));
+// assertEquals(0, states.size());
+//
+// //fail();
+//
+// //throw new UnsupportedOperationException("CapabilitiesInfoTest: Finish implementation!");
}
- public Set extractWindowStates(Set infos)
- {
- Set states = new HashSet();
-
- for (Iterator i = infos.iterator(); i.hasNext();)
- {
- WindowStateInfo info = (WindowStateInfo)i.next();
- org.gatein.pc.api.WindowState state = info.getWindowState();
- assertEquals(state.toString(), (info.getWindowStateName()));
- states.add(state);
- }
- return states;
- }
-
- public Set extractModes(Set infos)
- {
- Set modes = new HashSet();
-
- for (Iterator i = infos.iterator(); i.hasNext();)
- {
- ModeInfo info = (ModeInfo)i.next();
- Mode mode = info.getMode();
- assertEquals(mode.toString(), (info.getModeName()));
- modes.add(mode);
- }
- return modes;
- }
+// public Set extractWindowStates(Set infos)
+// {
+// Set states = new HashSet();
+//
+// for (Iterator i = infos.iterator(); i.hasNext();)
+// {
+// WindowStateInfo info = (WindowStateInfo)i.next();
+// org.gatein.pc.api.WindowState state = info.getWindowState();
+// assertEquals(state.toString(), (info.getWindowStateName()));
+// states.add(state);
+// }
+// return states;
+// }
+//
+// public Set extractModes(Set infos)
+// {
+// Set modes = new HashSet();
+//
+// for (Iterator i = infos.iterator(); i.hasNext();)
+// {
+// ModeInfo info = (ModeInfo)i.next();
+// Mode mode = info.getMode();
+// assertEquals(mode.toString(), (info.getModeName()));
+// modes.add(mode);
+// }
+// return modes;
+// }
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/MetaInfoTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/MetaInfoTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/MetaInfoTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,15 +22,6 @@
******************************************************************************/
package org.gatein.pc.test.portlet.info;
-import org.gatein.common.i18n.LocalizedString;
-import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
-import org.gatein.pc.api.info.MetaInfo;
-import org.gatein.pc.api.info.PortletInfo;
-
-import static org.jboss.unit.api.Assert.*;
-
-import java.util.Locale;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6818 $
@@ -45,23 +36,23 @@
public void execute()
{
- ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("NoBundlePortlet");
- PortletInfo info = container.getInfo();
- MetaInfo metaInfo = info.getMeta();
-
- //
- LocalizedString title = metaInfo.getMetaValue(MetaInfo.TITLE);
- String titleEn = title.getString(Locale.ENGLISH, false);
- assertEquals("title", titleEn);
-
- //
- LocalizedString shortTitle = metaInfo.getMetaValue(MetaInfo.SHORT_TITLE);
- String shortTitleEn = shortTitle.getString(Locale.ENGLISH, false);
- assertEquals("short-title", shortTitleEn);
-
- //
- LocalizedString keywords = metaInfo.getMetaValue(MetaInfo.KEYWORDS);
- String keywordsEn = keywords.getString(Locale.ENGLISH, false);
- assertEquals("keywords", keywordsEn);
+// ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("NoBundlePortlet");
+// PortletInfo info = container.getInfo();
+// MetaInfo metaInfo = info.getMeta();
+//
+// //
+// LocalizedString title = metaInfo.getMetaValue(MetaInfo.TITLE);
+// String titleEn = title.getString(Locale.ENGLISH, false);
+// assertEquals("title", titleEn);
+//
+// //
+// LocalizedString shortTitle = metaInfo.getMetaValue(MetaInfo.SHORT_TITLE);
+// String shortTitleEn = shortTitle.getString(Locale.ENGLISH, false);
+// assertEquals("short-title", shortTitleEn);
+//
+// //
+// LocalizedString keywords = metaInfo.getMetaValue(MetaInfo.KEYWORDS);
+// String keywordsEn = keywords.getString(Locale.ENGLISH, false);
+// assertEquals("keywords", keywordsEn);
}
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/ModeInfoTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/ModeInfoTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/ModeInfoTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,18 +22,6 @@
******************************************************************************/
package org.gatein.pc.test.portlet.info;
-import org.gatein.pc.api.Mode;
-import org.gatein.common.net.media.MediaType;
-import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
-import org.gatein.pc.api.info.CapabilitiesInfo;
-import org.gatein.pc.api.info.ModeInfo;
-
-import static org.jboss.unit.api.Assert.*;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
* @version $Revision: 7954 $
@@ -46,49 +34,49 @@
super("ModeInfoTest");
}
- public void execute()
- {
- ManagedPortletContainer container1 = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("ModePortlet1");
- ManagedPortletContainer container2 = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("ModePortlet2");
- CapabilitiesInfo capaInfo = container1.getInfo().getCapabilities();
-
- //Portlet 1 with VIEW, EDIT, HELP
- Set modeInfos = capaInfo.getModes(MediaType.TEXT_HTML);
-
- //shoule be 3 modes
- assertEquals(3, modeInfos.size());
-
- Set portletModes = new HashSet();
- for (Iterator i = modeInfos.iterator(); i.hasNext();)
- {
- ModeInfo mode = (ModeInfo)i.next();
- portletModes.add(mode.getMode());
- assertEquals(mode.getModeName(), mode.getMode().toString());
- }
-
-
- assertTrue(portletModes.contains(org.gatein.pc.api.Mode.VIEW));
- assertTrue(portletModes.contains(Mode.HELP));
- assertTrue(portletModes.contains(Mode.EDIT));
-
- //Portlet 2 with only VIEW
- capaInfo = container2.getInfo().getCapabilities();
- modeInfos = capaInfo.getModes(MediaType.TEXT_HTML);
-
- //shoule be 1 mode
- assertEquals(1, modeInfos.size());
-
-
- portletModes = new HashSet();
- for (Iterator i = modeInfos.iterator(); i.hasNext();)
- {
- ModeInfo mode = (ModeInfo)i.next();
- portletModes.add(mode.getMode());
- assertEquals(mode.getModeName(), mode.getMode().toString());
- }
-
- assertTrue(portletModes.contains(Mode.VIEW));
- assertTrue(!portletModes.contains(Mode.HELP));
- assertTrue(!portletModes.contains(Mode.EDIT));
- }
+// public void execute()
+// {
+// ManagedPortletContainer container1 = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("ModePortlet1");
+// ManagedPortletContainer container2 = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("ModePortlet2");
+// CapabilitiesInfo capaInfo = container1.getInfo().getCapabilities();
+//
+// //Portlet 1 with VIEW, EDIT, HELP
+// Set modeInfos = capaInfo.getModes(MediaType.TEXT_HTML);
+//
+// //shoule be 3 modes
+// assertEquals(3, modeInfos.size());
+//
+// Set portletModes = new HashSet();
+// for (Iterator i = modeInfos.iterator(); i.hasNext();)
+// {
+// ModeInfo mode = (ModeInfo)i.next();
+// portletModes.add(mode.getMode());
+// assertEquals(mode.getModeName(), mode.getMode().toString());
+// }
+//
+//
+// assertTrue(portletModes.contains(org.gatein.pc.api.Mode.VIEW));
+// assertTrue(portletModes.contains(Mode.HELP));
+// assertTrue(portletModes.contains(Mode.EDIT));
+//
+// //Portlet 2 with only VIEW
+// capaInfo = container2.getInfo().getCapabilities();
+// modeInfos = capaInfo.getModes(MediaType.TEXT_HTML);
+//
+// //shoule be 1 mode
+// assertEquals(1, modeInfos.size());
+//
+//
+// portletModes = new HashSet();
+// for (Iterator i = modeInfos.iterator(); i.hasNext();)
+// {
+// ModeInfo mode = (ModeInfo)i.next();
+// portletModes.add(mode.getMode());
+// assertEquals(mode.getModeName(), mode.getMode().toString());
+// }
+//
+// assertTrue(portletModes.contains(Mode.VIEW));
+// assertTrue(!portletModes.contains(Mode.HELP));
+// assertTrue(!portletModes.contains(Mode.EDIT));
+// }
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/PreferenceInfoTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/PreferenceInfoTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/PreferenceInfoTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,18 +22,6 @@
******************************************************************************/
package org.gatein.pc.test.portlet.info;
-import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
-import org.gatein.pc.portlet.impl.info.ContainerPreferenceInfo;
-import org.gatein.pc.portlet.impl.info.ContainerPreferencesInfo;
-import org.gatein.pc.api.info.PortletInfo;
-
-import static org.jboss.unit.api.Assert.*;
-
-import java.util.Locale;
-import java.util.Set;
-import java.util.List;
-import java.util.Arrays;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 6720 $
@@ -46,56 +34,56 @@
super("PreferenceInfoTest");
}
- public void execute()
- {
- ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("PreferenceInfoPortlet");
-
- //
- PortletInfo info = container.getInfo();
- ContainerPreferencesInfo prefsInfo = (ContainerPreferencesInfo)info.getPreferences();
-
- //
- ContainerPreferenceInfo prefInfo = prefsInfo.getContainerPreference("localized_pref");
- assertEquals("localized_pref", prefInfo.getKey());
- assertEquals("english localized description", prefInfo.getDescription().getString(Locale.ENGLISH, false));
- assertEquals("polish localized description", prefInfo.getDescription().getString(new Locale("pl"), false));
- assertEquals("english_localized_name", prefInfo.getDisplayName().getString(Locale.ENGLISH, false));
- assertEquals("polish_localized_name", prefInfo.getDisplayName().getString(new Locale("pl"), false));
-
- //
- Set keys = prefsInfo.getKeys();
- assertTrue(keys.contains("localized_pref"));
- assertTrue(keys.contains("single_pref"));
- assertTrue(keys.contains("multi_pref"));
- assertTrue(keys.contains("single_pref_bis"));
- assertTrue(keys.contains("multi_pref_bis"));
-
- //
- prefInfo = prefsInfo.getContainerPreference("single_pref");
- assertEquals("single_pref", prefInfo.getKey());
- List<String> values = prefInfo.getDefaultValue();
- assertEquals(Arrays.asList("single_pref_value"), values);
- assertTrue(!prefInfo.isReadOnly().booleanValue());
-
- //
- prefInfo = prefsInfo.getContainerPreference("multi_pref");
- assertEquals("multi_pref", prefInfo.getKey());
- values = prefInfo.getDefaultValue();
- assertEquals(Arrays.asList("multi_pref_value_1", "multi_pref_value_2"), values);
- assertTrue(!prefInfo.isReadOnly().booleanValue());
-
- //
- prefInfo = prefsInfo.getContainerPreference("single_pref_bis");
- assertEquals("single_pref_bis", prefInfo.getKey());
- values = prefInfo.getDefaultValue();
- assertEquals(Arrays.asList("single_pref_value"), values);
- assertTrue(prefInfo.isReadOnly().booleanValue());
-
- //
- prefInfo = prefsInfo.getContainerPreference("multi_pref_bis");
- assertEquals("multi_pref_bis", prefInfo.getKey());
- values = prefInfo.getDefaultValue();
- assertEquals(Arrays.asList("multi_pref_value_1", "multi_pref_value_2"), values);
- assertTrue(prefInfo.isReadOnly().booleanValue());
- }
+// public void execute()
+// {
+// ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("PreferenceInfoPortlet");
+//
+// //
+// PortletInfo info = container.getInfo();
+// ContainerPreferencesInfo prefsInfo = (ContainerPreferencesInfo)info.getPreferences();
+//
+// //
+// ContainerPreferenceInfo prefInfo = prefsInfo.getContainerPreference("localized_pref");
+// assertEquals("localized_pref", prefInfo.getKey());
+// assertEquals("english localized description", prefInfo.getDescription().getString(Locale.ENGLISH, false));
+// assertEquals("polish localized description", prefInfo.getDescription().getString(new Locale("pl"), false));
+// assertEquals("english_localized_name", prefInfo.getDisplayName().getString(Locale.ENGLISH, false));
+// assertEquals("polish_localized_name", prefInfo.getDisplayName().getString(new Locale("pl"), false));
+//
+// //
+// Set keys = prefsInfo.getKeys();
+// assertTrue(keys.contains("localized_pref"));
+// assertTrue(keys.contains("single_pref"));
+// assertTrue(keys.contains("multi_pref"));
+// assertTrue(keys.contains("single_pref_bis"));
+// assertTrue(keys.contains("multi_pref_bis"));
+//
+// //
+// prefInfo = prefsInfo.getContainerPreference("single_pref");
+// assertEquals("single_pref", prefInfo.getKey());
+// List<String> values = prefInfo.getDefaultValue();
+// assertEquals(Arrays.asList("single_pref_value"), values);
+// assertTrue(!prefInfo.isReadOnly().booleanValue());
+//
+// //
+// prefInfo = prefsInfo.getContainerPreference("multi_pref");
+// assertEquals("multi_pref", prefInfo.getKey());
+// values = prefInfo.getDefaultValue();
+// assertEquals(Arrays.asList("multi_pref_value_1", "multi_pref_value_2"), values);
+// assertTrue(!prefInfo.isReadOnly().booleanValue());
+//
+// //
+// prefInfo = prefsInfo.getContainerPreference("single_pref_bis");
+// assertEquals("single_pref_bis", prefInfo.getKey());
+// values = prefInfo.getDefaultValue();
+// assertEquals(Arrays.asList("single_pref_value"), values);
+// assertTrue(prefInfo.isReadOnly().booleanValue());
+//
+// //
+// prefInfo = prefsInfo.getContainerPreference("multi_pref_bis");
+// assertEquals("multi_pref_bis", prefInfo.getKey());
+// values = prefInfo.getDefaultValue();
+// assertEquals(Arrays.asList("multi_pref_value_1", "multi_pref_value_2"), values);
+// assertTrue(prefInfo.isReadOnly().booleanValue());
+// }
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/SecurityInfoTest.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/SecurityInfoTest.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/info/SecurityInfoTest.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,13 +22,6 @@
******************************************************************************/
package org.gatein.pc.test.portlet.info;
-import org.gatein.pc.api.TransportGuarantee;
-import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
-import org.gatein.pc.api.info.PortletInfo;
-import org.gatein.pc.api.info.SecurityInfo;
-
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 6720 $
@@ -41,36 +34,36 @@
super("SecurityInfoTest");
}
- public void execute()
- {
- //This asserts only .isRemotable() as rest is checked in other tests
-
- ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet1");
- PortletInfo info = container.getInfo();
- SecurityInfo secInfo = info.getSecurity();
-
- secInfo = info.getSecurity();
- assertEquals(2, secInfo.getTransportGuarantees().size());
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
- //assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
-
-
- container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet2");
- info = container.getInfo();
-
- secInfo = info.getSecurity();
- assertEquals(3, secInfo.getTransportGuarantees().size());
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
-
-
- container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet3");
- info = container.getInfo();
- secInfo = info.getSecurity();
- assertEquals(2, secInfo.getTransportGuarantees().size());
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
- }
+// public void execute()
+// {
+// //This asserts only .isRemotable() as rest is checked in other tests
+//
+// ManagedPortletContainer container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet1");
+// PortletInfo info = container.getInfo();
+// SecurityInfo secInfo = info.getSecurity();
+//
+// secInfo = info.getSecurity();
+// assertEquals(2, secInfo.getTransportGuarantees().size());
+// assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
+// //assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+// assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+//
+//
+// container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet2");
+// info = container.getInfo();
+//
+// secInfo = info.getSecurity();
+// assertEquals(3, secInfo.getTransportGuarantees().size());
+// assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+// assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
+// assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+//
+//
+// container = registry.getManagedPortletApplication("/test-info").getManagedPortletContainer("SecuredPortlet3");
+// info = container.getInfo();
+// secInfo = info.getSecurity();
+// assertEquals(2, secInfo.getTransportGuarantees().size());
+// assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+// assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+// }
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/navigation/StateStringTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/navigation/StateStringTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/navigation/StateStringTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -23,25 +23,21 @@
package org.gatein.pc.test.portlet.navigation;
+import junit.framework.TestCase;
import org.gatein.pc.api.ParametersStateString;
import org.gatein.pc.api.StateString;
-import static org.jboss.unit.api.Assert.assertEquals;
-import static org.jboss.unit.api.Assert.assertNotNull;
-import org.jboss.unit.api.pojo.annotations.Test;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 5976 $
* @since 2.4 (Apr 30, 2006)
*/
-@Test
-public class StateStringTestCase
+public class StateStringTestCase extends TestCase
{
public static final String NAME1 = "param1";
public static final String VALUE1 = "value1";
public static final String VALUE2 = "value2";
- @Test
public void testNavigationalState() throws Exception
{
ParametersStateString ns = ParametersStateString.create();
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,6 +22,8 @@
*/
package org.gatein.pc.test.portlet.state;
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
import org.gatein.common.util.Tools;
import org.gatein.common.i18n.LocalizedString;
import org.gatein.pc.api.InvalidPortletIdException;
@@ -48,10 +50,6 @@
import org.gatein.pc.portlet.state.SimplePropertyMap;
import org.gatein.pc.portlet.state.producer.PortletState;
-import static org.jboss.unit.api.Assert.*;
-
-import org.jboss.unit.api.pojo.annotations.Test;
-
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -63,7 +61,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public abstract class AbstractStatefulPortletInvokerTestCase
+public abstract class AbstractStatefulPortletInvokerTestCase extends TestCase
{
public static final String PORTLET_ID = "/foo.PortletId";
public static final String NON_EXISTING_PORTLET_ID = "/foo.NonExistingPortletId";
@@ -205,7 +203,9 @@
}
catch (PortletInvokerException e)
{
- fail(e);
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(e);
+ throw afe;
}
}
else
@@ -218,7 +218,9 @@
}
catch (PortletInvokerException e)
{
- fail(e);
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(e);
+ throw afe;
}
}
}
@@ -252,7 +254,6 @@
return createPOPRef(info);
}
- @Test
public void testCloneWithNullContext() throws Exception
{
try
@@ -266,7 +267,6 @@
assertNoExistingState();
}
- @Test
public void testCloneNonExistingPOP() throws Exception
{
PortletContext popCtx = createNonExistingPOPRef();
@@ -281,7 +281,6 @@
assertNoExistingState();
}
- @Test
public void testCloneNonExistingCCP() throws Exception
{
PortletContext ccpCtx = createNonExistingLocalCCPRef();
@@ -296,7 +295,6 @@
assertNoExistingState();
}
-// @Test
// public void testCloneInvalidCCP() throws Exception
// {
// PortletContext ccpCtx = getProducer().wrapCCP("InvalidPortletId");
@@ -311,7 +309,6 @@
// assertNoExistingState();
// }
- @Test
public void testCloneInvalidPOP() throws Exception
{
PortletContext popCtx = createInvalidPOPRef();
@@ -326,7 +323,6 @@
assertNoExistingState();
}
- @Test
public void testClonePortlet() throws Exception
{
PortletInfoSupport info = new PortletInfoSupport();
@@ -370,7 +366,6 @@
assertEquals("MyPortlet", def.getString(Locale.ENGLISH, true));
}
- @Test
public void testGetWithNullId() throws Exception
{
try
@@ -383,7 +378,6 @@
}
}
- @Test
public void testGetNonExistingPOP() throws Exception
{
PortletContext pop = createNonExistingPOPRef();
@@ -397,7 +391,6 @@
}
}
- @Test
public void testGetNonExistingCCP() throws Exception
{
PortletContext ccpCtx = createNonExistingLocalCCPRef();
@@ -411,7 +404,6 @@
}
}
- @Test
public void testGetInvalidPOP() throws Exception
{
PortletContext popCtx = createInvalidPOPRef();
@@ -425,7 +417,6 @@
}
}
-// @Test
// public void testGetInvalidCCP() throws Exception
// {
// PortletContext ccpId = getProducer().wrapCCP("InvalidPortletId");
@@ -439,7 +430,6 @@
// }
// }
- @Test
public void testDestroyWithNullId() throws Exception
{
try
@@ -452,7 +442,6 @@
}
}
- @Test
public void testDestroyPOP() throws Exception
{
PortletContext popCtx = createPOPRef();
@@ -462,7 +451,6 @@
assertEquals(getPortletId(popCtx), failure.getPortletId());
}
- @Test
public void testDestroyCCP() throws Exception
{
PortletContext popCtx = createPOPRef();
@@ -482,7 +470,6 @@
// assertEquals(ccpId.getId(), failure.getPortletId());
// }
- @Test
public void testDestroyNonExistingCCP() throws Exception
{
PortletContext ccpCtx = createNonExistingLocalCCPRef();
@@ -492,7 +479,6 @@
assertEquals(getPortletId(ccpCtx), failure.getPortletId());
}
- @Test
public void testGetPropertiesWithNullPortlet() throws Exception
{
try
@@ -513,7 +499,6 @@
}
}
- @Test
public void testGetNonExistingPOPProperties() throws Exception
{
PortletContext popCtx = createNonExistingPOPRef();
@@ -535,7 +520,6 @@
}
}
- @Test
public void testGetInvalidPOPProperties() throws Exception
{
PortletContext popCtx = createInvalidPOPRef();
@@ -557,7 +541,6 @@
}
}
- @Test
public void testGetNonExistingCCPProperties() throws Exception
{
PortletContext ccpCtx = createNonExistingLocalCCPRef();
@@ -579,7 +562,6 @@
}
}
-// @Test
// public void testGetInvalidCCPProperties() throws Exception
// {
// PortletContext ccpId = getProducer().wrapCCP("InvalidPortletId");
@@ -601,7 +583,6 @@
// }
// }
- @Test
public void testGetPOPWithNullKeys() throws Exception
{
PortletContext popCtx = createPOPRef();
@@ -615,7 +596,6 @@
}
}
- @Test
public void testGetCCPWithNullKeys() throws Exception
{
PortletContext ccpCtx = createLocalCCPRef();
@@ -629,7 +609,6 @@
}
}
- @Test
public void testGetPOPProperties() throws Exception
{
PortletInfoSupport info = new PortletInfoSupport();
@@ -651,7 +630,6 @@
ValueMapAssert.assertEquals(expectedProps, props);
}
- @Test
public void testGetCCPProperties() throws Exception
{
PortletInfoSupport info = new PortletInfoSupport();
@@ -686,7 +664,6 @@
ValueMapAssert.assertEquals(expectedProps, props);
}
- @Test
public void testSetPropertiesWithNullId() throws Exception
{
try
@@ -699,7 +676,6 @@
}
}
- @Test
public void testSetPropertiesWithNullProperties() throws Exception
{
PortletContext ccpCtx = createLocalCCPRef();
@@ -713,7 +689,6 @@
}
}
- @Test
public void testSetPOPProperties() throws Exception
{
PortletContext popCtx = createPOPRef();
@@ -727,7 +702,6 @@
}
}
- @Test
public void testSetNonExistingCCPProperties() throws Exception
{
PortletContext ccpCtx = createNonExistingLocalCCPRef();
@@ -741,7 +715,6 @@
}
}
- @Test
public void testSetCCPProperties() throws Exception
{
PortletInfoSupport info = new PortletInfoSupport();
@@ -796,13 +769,11 @@
ValueMapAssert.assertEquals(expectedProps, ccpProps);
}
- @Test
public void testInvokeCloneBeforeWritePOPWithUpdate() throws Exception
{
invokeCloneBeforeWriteWithUpdate(true);
}
- @Test
public void testInvokeCloneBeforeWriteCCPWithUpdate() throws Exception
{
invokeCloneBeforeWriteWithUpdate(false);
@@ -862,7 +833,6 @@
assertCloneDoesNotExist(cloneRef);
}
- @Test
public void testInvokeReadOnlyWithUpdate() throws Exception
{
final Boolean[] ise = {Boolean.FALSE};
@@ -903,7 +873,6 @@
assertEquals(Boolean.TRUE, ise[0]);
}
- @Test
public void testInvokeReadWriteWithUpdate() throws Exception
{
PortletInfoSupport info = new PortletInfoSupport();
@@ -978,7 +947,6 @@
}
}
- @Test
public void testExportNullPortletContext() throws Exception
{
try
@@ -993,7 +961,6 @@
assertNoExistingState();
}
- @Test
public void testExportsNonExisitngPOP() throws Exception
{
PortletContext popCTX = createNonExistingPOPRef();
@@ -1009,7 +976,6 @@
assertNoExistingState();
}
- @Test
public void testExportNonExisitngCCP() throws Exception
{
PortletContext ccpCTX = createNonExistingLocalCCPRef();
@@ -1025,7 +991,6 @@
assertNoExistingState();
}
- @Test
public void testExportInvalidPOP() throws Exception
{
PortletContext popCtx = createInvalidPOPRef();
@@ -1040,7 +1005,6 @@
assertNoExistingState();
}
- @Test
public void testExportPortlet() throws Exception
{
PropertyMap expectedProperties = new SimplePropertyMap();
@@ -1126,7 +1090,6 @@
}
- @Test
public void testImportNullPortletContext() throws Exception
{
try
@@ -1141,7 +1104,6 @@
assertNoExistingState();
}
- @Test
public void testImportsNonExisitngPOP() throws Exception
{
PortletContext popCTX = createNonExistingPOPRef();
@@ -1157,7 +1119,6 @@
assertNoExistingState();
}
- @Test
public void testImportNonExisitngCCP() throws Exception
{
PortletContext ccpCTX = createNonExistingLocalCCPRef();
@@ -1173,7 +1134,6 @@
assertNoExistingState();
}
- @Test
public void testImportInvalidPOP() throws Exception
{
PortletContext popCtx = createInvalidPOPRef();
@@ -1188,7 +1148,6 @@
assertNoExistingState();
}
- @Test
public void testImport() throws Exception
{
//This will create the portlet into the container and check that it doesn't have any properties set
@@ -1211,5 +1170,4 @@
//Make sure that this new portlet has the properties we want
assertEquals(propertyMap, getProperties(importedPortletContext));
}
-
}
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -45,10 +45,6 @@
import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
import org.gatein.pc.portlet.state.producer.ProducerPortlet;
-import static org.jboss.unit.api.Assert.*;
-
-import org.jboss.unit.api.pojo.annotations.Create;
-
import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -57,7 +53,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ConsumerStatefulPortletInvokerTestCase extends AbstractStatefulPortletInvokerTestCase
+public abstract class ConsumerStatefulPortletInvokerTestCase extends AbstractStatefulPortletInvokerTestCase
{
public ConsumerStatefulPortletInvokerTestCase(boolean persistLocally)
{
@@ -85,7 +81,6 @@
/** . */
protected StateConverter stateConverter;
- @Create
public void setUp() throws Exception
{
consumer = new ConsumerPortletInvoker();
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -42,15 +42,11 @@
import org.gatein.pc.portlet.support.PortletInvokerSupport;
import org.gatein.pc.portlet.support.PortletSupport;
import org.gatein.pc.portlet.support.info.PortletInfoSupport;
-import org.jboss.unit.api.pojo.annotations.Create;
-import org.jboss.unit.api.pojo.annotations.Test;
import java.util.Collections;
import java.util.List;
import java.util.Set;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6691 $
@@ -78,8 +74,8 @@
/** . */
protected StateConverter stateConverter;
- @Create
- public void create() throws Exception
+ @Override
+ protected void setUp() throws Exception
{
producer = new ProducerPortletInvoker();
container = new PortletInvokerSupport();
@@ -252,7 +248,6 @@
return producer.exportPortlet(PortletStateType.OPAQUE, originalPortletContext);
}
- @Test
public void testGetStatus() throws Exception
{
PortletInfoSupport info = new PortletInfoSupport();
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/StateConverterV0TestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/StateConverterV0TestCase.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/StateConverterV0TestCase.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.gatein.pc.test.portlet.state;
+import junit.framework.TestCase;
import org.gatein.pc.portlet.impl.state.StateConverterV0;
import org.gatein.pc.api.PortletStateType;
import org.gatein.pc.api.state.PropertyMap;
@@ -30,9 +31,6 @@
import org.gatein.pc.portlet.state.StateConverter;
import org.gatein.pc.portlet.state.producer.PortletState;
-import static org.jboss.unit.api.Assert.*;
-import org.jboss.unit.api.pojo.annotations.Test;
-
import java.util.Arrays;
import java.util.ArrayList;
@@ -40,13 +38,11 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-@Test
-public class StateConverterV0TestCase
+public class StateConverterV0TestCase extends TestCase
{
private final StateConverter converter = new StateConverterV0();
- @Test
public void testIAE() throws StateConversionException
{
try
@@ -67,7 +63,6 @@
}
}
- @Test
public void testAlteredMagic() throws StateConversionException
{
byte[] bytes = converter.marshall(PortletStateType.OPAQUE, new PortletState("foo"));
@@ -85,7 +80,6 @@
}
}
- @Test
public void testBadVersionNumber() throws StateConversionException
{
byte[] bytes = converter.marshall(PortletStateType.OPAQUE,new PortletState("foo"));
@@ -100,7 +94,6 @@
}
}
- @Test
public void testWorks() throws Exception
{
assertWorks(new PortletState("foo"));
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ValueMapAssert.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ValueMapAssert.java 2011-06-24 20:51:14 UTC (rev 6741)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ValueMapAssert.java 2011-06-24 20:54:47 UTC (rev 6742)
@@ -22,18 +22,17 @@
******************************************************************************/
package org.gatein.pc.test.portlet.state;
+import junit.framework.Assert;
import org.gatein.pc.api.state.PropertyMap;
import java.util.HashSet;
import java.util.List;
-import org.jboss.unit.api.Assert;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5448 $
*/
-public class ValueMapAssert
+public class ValueMapAssert extends Assert
{
public static void assertEquals(PropertyMap vm1, PropertyMap vm2)
{
@@ -41,24 +40,22 @@
{
if (vm2 != null)
{
- Assert.fail("Value map should be null");
+ fail("Value map should be null");
}
}
else
{
if (vm2 == null)
{
- Assert.fail("Value map should not be null");
+ fail("Value map should not be null");
}
- Assert.assertEquals("Value maps don't have the same keys", new HashSet<String>(vm1.keySet()), new HashSet<String>(vm2.keySet()));
+ assertEquals("Value maps don't have the same keys", new HashSet<String>(vm1.keySet()), new HashSet<String>(vm2.keySet()));
for (String key : vm1.keySet())
{
List<String> v1 = vm1.getProperty(key);
List<String> v2 = vm2.getProperty(key);
- Assert.assertEquals("Values for key " + key + " are not equals", v1, v2);
+ assertEquals("Values for key " + key + " are not equals", v1, v2);
}
}
}
-
-
}
13 years, 6 months
gatein SVN: r6741 - in portal/trunk: component/portal/src/main/java/org/exoplatform/portal/config/serialize and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-06-24 16:51:14 -0400 (Fri, 24 Jun 2011)
New Revision: 6741
Added:
portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
Log:
- GTNPORTAL-1946: Added <wsrp> element to GateIn objects model so that WSRP portlets can be specified in pages.xml files.
Copied: portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd (from rev 6721, portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd)
===================================================================
--- portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd (rev 0)
+++ portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd 2011-06-24 20:51:14 UTC (rev 6741)
@@ -0,0 +1,222 @@
+<?xml version="1.0"?>
+<!--
+ ~ Copyright (C) 2009 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<xs:schema
+ targetNamespace="http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <!-- A top page element -->
+ <xs:element name="page" type="pageType"/>
+
+ <!-- A top page-set element -->
+ <xs:element name="page-set" type="pageSetType"/>
+
+ <!-- A top portal-config element -->
+ <xs:element name="portal-config" type="portalConfigType"/>
+
+ <!-- A top container element -->
+ <xs:element name="container" type="containerType"/>
+
+ <!-- A top node-navigation element -->
+ <xs:element name="node-navigation" type="nodeNavigationType"/>
+
+ <!-- The type of a top navigation node -->
+ <xs:complexType name="nodeNavigationType">
+ <xs:sequence>
+ <xs:element name="priority" type="xs:positiveInteger"/>
+ <xs:element name="page-nodes" minOccurs="0" maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <!-- The type of a navigation node -->
+ <xs:complexType name="nodeType">
+ <xs:sequence>
+ <xs:element name="uri" type="xs:string"/>
+ <xs:element name="name" type="xs:string"/>
+ <xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="start-publication-date" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="end-publication-date" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="visibility" type="visibility" default="DISPLAYED" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="page-reference" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:simpleType name="visibility">
+ <xs:restriction base='xs:string'>
+ <xs:enumeration value="DISPLAYED"/>
+ <xs:enumeration value="HIDDEN"/>
+ <xs:enumeration value="TEMPORAL"/>
+ <xs:enumeration value="SYSTEM"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="pageSetType">
+ <xs:sequence>
+ <xs:element name="page" type="pageType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="portalConfigType">
+ <xs:sequence>
+ <xs:element name="portal-name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="locale" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="edit-permission" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="skin" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="properties" type="propertiesType" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="portal-layout" minOccurs="1" maxOccurs="1">
+ <xs:complexType>
+ <xs:group ref="containerChildrenGroup"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="propertiesType">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="entry" type="propertiesEntryType" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="propertiesEntryType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="key" type="xs:string"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:group name="containerChildrenGroup">
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="portlet-application" type="portletApplicationType" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="gadget-application" type="gadgetApplicationType" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="container" type="containerType" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="page-body" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="site-body" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:group>
+
+ <xs:complexType name="pageType">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="factory-id" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="edit-permission" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="show-max-window" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+ <xs:group ref="containerChildrenGroup"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="containerType">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="factory-id" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:group ref="containerChildrenGroup"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string"/>
+ <xs:attribute name="template" type="xs:string"/>
+ <xs:attribute name="attribute" type="xs:string"/>
+ <xs:attribute name="width" type="xs:string"/>
+ <xs:attribute name="height" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="portletApplicationType">
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="portlet" type="portletType"/>
+ <xs:element name="wsrp" type="xs:string"/>
+ </xs:choice>
+ <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="access-permissions" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="show-info-bar" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="show-application-state" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="show-application-mode" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="width" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="height" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="gadgetApplicationType">
+ <xs:sequence>
+ <xs:element name="gadget" type="gadgetType" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="theme" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="access-permissions" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="show-info-bar" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="show-application-state" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="show-application-mode" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="width" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="height" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="portletType">
+ <xs:sequence>
+ <xs:element name="application-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="portlet-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="preferences" type="portletPreferencesType" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="gadgetType">
+ <xs:sequence>
+ <xs:element name="gadget-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="portletPreferencesType">
+ <xs:sequence>
+ <xs:element name="preference" type="portletPreferenceType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="portletPreferenceType">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="read-only" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java 2011-06-24 20:01:11 UTC (rev 6740)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java 2011-06-24 20:51:14 UTC (rev 6741)
@@ -102,6 +102,7 @@
//
Application<?> app;
+ TransientApplicationState state;
if ("application".equals(m_name))
{
String instanceId = ctx.parseElementText(m_uri, "instance-id");
@@ -112,7 +113,6 @@
String ownerId = instanceId.substring(i0 + 1, i1);
String persistenceid = instanceId.substring(i1 + 2);
String[] persistenceChunks = split("/", persistenceid);
- TransientApplicationState<Portlet> state;
if (persistenceChunks.length == 2)
{
state = new TransientApplicationState<Portlet>(
@@ -131,9 +131,8 @@
ownerId,
persistenceChunks[2]);
}
- Application<Portlet> application = Application.createPortletApplication();
- application.setState(state);
- app = application;
+ app = Application.createPortletApplication();
+ app.setState(state);
}
// Since we don't support dashboard's here, this only works for gadgets using the gadget wrapper portlet.
else if ("gadget-application".equals(m_name))
@@ -144,18 +143,31 @@
// Once the gadget portlet wrapper is able to use gadget userPref's, include parsing logic here.
// Gadget gadget = new Gadget();
// gadget.setUserPref();
- TransientApplicationState<Gadget> state = new TransientApplicationState<Gadget>(gadgetName, gadget);
- Application<Gadget> application = Application.createGadgetApplication();
- application.setState(state);
- app = application;
+ state = new TransientApplicationState<Gadget>(gadgetName, gadget);
+ app = Application.createGadgetApplication();
+ app.setState(state);
ctx.parsePastEndTag(m_uri, "gadget");
}
else
{
- ctx.parsePastStartTag(m_uri, "portlet");
- String applicationName = ctx.parseElementText(m_uri, "application-ref");
- String portletName = ctx.parseElementText(m_uri, "portlet-ref");
- TransientApplicationState<Portlet> state;
+ String contentId;
+ boolean isWSRP = false;
+ if(ctx.isAt(m_uri, "wsrp"))
+ {
+ contentId = ctx.parseElementText(m_uri, "wsrp");
+ app = Application.createWSRPApplication();
+ isWSRP = true;
+ }
+ else
+ {
+
+ ctx.parsePastStartTag(m_uri, "portlet");
+ String applicationName = ctx.parseElementText(m_uri, "application-ref");
+ String portletName = ctx.parseElementText(m_uri, "portlet-ref");
+ contentId = applicationName + "/" + portletName;
+ app = Application.createPortletApplication();
+ }
+
if (ctx.isAt(m_uri, "preferences"))
{
PortletBuilder builder = new PortletBuilder();
@@ -166,16 +178,19 @@
builder.add(value.getName(), value.getValues(), value.isReadOnly());
}
ctx.parsePastEndTag(m_uri, "preferences");
- state = new TransientApplicationState<Portlet>(applicationName + "/" + portletName, builder.build());
+ state = new TransientApplicationState(contentId, builder.build());
}
else
{
- state = new TransientApplicationState<Portlet>(applicationName + "/" + portletName, null);
+ state = new TransientApplicationState(contentId, null);
}
- Application<Portlet> application = Application.createPortletApplication();
- application.setState(state);
- app = application;
- ctx.parsePastEndTag(m_uri, "portlet");
+
+ if(!isWSRP)
+ {
+ ctx.parsePastEndTag(m_uri, "portlet");
+ }
+
+ app.setState(state);
}
//
Modified: portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
===================================================================
--- portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2011-06-24 20:01:11 UTC (rev 6740)
+++ portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2011-06-24 20:51:14 UTC (rev 6741)
@@ -24,8 +24,8 @@
<page-set
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_1 http://www.gatein.org/xml/ns/gatein_objects_1_1"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_1">
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2_1 http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2_1">
<page>
<name>wsrpConfiguration</name>
@@ -41,6 +41,12 @@
<access-permissions>manager:/platform/administrators</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
+ <!--<portlet-application>
+ <wsrp>selfv2./richFacesPortlet.richFacesPortlet</wsrp>
+ <title>RichFaces</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>-->
</page>
</page-set>
13 years, 6 months