Author: julien_viet
Date: 2011-06-24 15:41:41 -0400 (Fri, 24 Jun 2011)
New Revision: 6738
Added:
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/Element.java
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/PortletApplicationMetaDataBuilder.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/ListenerTestCase.java
components/pc/trunk/mc/src/test/resources/metadata/listener/
components/pc/trunk/mc/src/test/resources/metadata/listener/portlet2.xml
components/pc/trunk/mc/src/test/resources/metadata/runtimeoption/
components/pc/trunk/mc/src/test/resources/metadata/runtimeoption/portlet.xml
Modified:
components/pc/trunk/mc/pom.xml
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java
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/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/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/filter/portlet-filter2.xml
components/pc/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml
components/pc/trunk/pom.xml
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/metadata/PortletApplication10MetaData.java
components/pc/trunk/test/core/src/main/resources/common.xml
components/pc/trunk/test/core/src/test/java/org/gatein/pc/test/portlet/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.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/pom.xml
components/pc/trunk/test/servers/src/common/resources/common.xml
components/pc/trunk/test/servers/tomcat6/src/test/build.xml
components/pc/trunk/test/servers/tomcat7/src/test/build.xml
Log:
GTNPC-66 : Rewrite portlet xml parsing using staxnav
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2011-06-24 16:38:34 UTC (rev 6737)
+++ components/pc/trunk/mc/pom.xml 2011-06-24 19:41:41 UTC (rev 6738)
@@ -19,9 +19,10 @@
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
</dependency>
+
<dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit</artifactId>
+ <groupId>org.staxnav</groupId>
+ <artifactId>staxnav.core</artifactId>
</dependency>
<dependency>
@@ -33,32 +34,16 @@
</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>
- <configuration>
- <failOnError>true</failOnError>
- <testsuites>
- <testsuite>
- <config>local-jboss-unit.xml</config>
- </testsuite>
- </testsuites>
- <reports>
- <xml>target/tests/reports/xml/local</xml>
- <html>target/tests/reports/html/local</html>
- </reports>
- </configuration>
- </plugin>-->
- </plugins>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
</project>
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -26,6 +26,7 @@
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;
@@ -281,7 +282,14 @@
{
in = IOTools.safeBufferedWrapper(url.openStream());
- // Validate
+ //
+ PortletApplicationMetaDataBuilder builder = new
PortletApplicationMetaDataBuilder();
+
+ //
+ return builder.build(in);
+
+/*
+ // Validate
Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
unmarshaller.setNamespaceAware(true);
unmarshaller.setSchemaValidation(false);
@@ -295,6 +303,7 @@
//
return portletApplicationMD;
+*/
}
finally
{
@@ -302,14 +311,10 @@
}
}
}
- catch (IOException e)
+ catch (Exception e)
{
log.error("Cannot read portlet.xml", e);
}
- catch (JBossXBException e)
- {
- log.error("Cannot parse portlet.xml", e);
- }
return null;
}
Added: components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/Element.java
===================================================================
--- components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/Element.java
(rev 0)
+++ components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/Element.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -0,0 +1,139 @@
+/*
+ * 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.staxnav;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public enum Element
+{
+
+
+
+ portlet_app,
+
+ portlet,
+
+ description,
+
+ portlet_name,
+
+ display_name,
+
+ portlet_class,
+
+ init_param,
+
+ name,
+
+ value,
+
+ expiration_cache,
+
+ cache_scope,
+
+ supports,
+
+ mime_type,
+
+ portlet_mode,
+
+ window_state,
+
+ supported_locale,
+
+ resource_bundle,
+
+ portlet_info,
+
+ title,
+
+ short_title,
+
+ keywords,
+
+ portlet_preferences,
+
+ preference,
+
+ read_only,
+
+ preferences_validator,
+
+ security_role_ref,
+
+ role_name,
+
+ role_link,
+
+ supported_processing_event,
+
+ qname,
+
+ supported_publishing_event,
+
+ supported_public_render_parameter,
+
+ container_runtime_option,
+
+ custom_portlet_mode,
+
+ portal_managed,
+
+ custom_window_state,
+
+ user_attribute,
+
+ security_constraint,
+
+ portlet_collection,
+
+ user_data_constraint,
+
+ transport_guarantee,
+
+ filter,
+
+ filter_name,
+
+ filter_class,
+
+ lifecycle,
+
+ filter_mapping,
+
+ default_namespace,
+
+ event_definition,
+
+ alias,
+
+ value_type,
+
+ public_render_parameter,
+
+ listener,
+
+ listener_class,
+
+ identifier,
+
+}
Added:
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/PortletApplicationMetaDataBuilder.java
===================================================================
---
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/PortletApplicationMetaDataBuilder.java
(rev 0)
+++
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/staxnav/PortletApplicationMetaDataBuilder.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -0,0 +1,576 @@
+/*
+ * 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.staxnav;
+
+import org.gatein.common.i18n.LocaleFormat;
+import org.gatein.common.i18n.LocalizedString;
+import org.gatein.common.util.ConversionException;
+import org.gatein.pc.api.LifeCyclePhase;
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.TransportGuarantee;
+import org.gatein.pc.api.WindowState;
+import org.gatein.pc.portlet.impl.metadata.CustomPortletModeMetaData;
+import org.gatein.pc.portlet.impl.metadata.CustomWindowStateMetaData;
+import org.gatein.pc.portlet.impl.metadata.ListenerMetaData;
+import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
+import org.gatein.pc.portlet.impl.metadata.PublicRenderParameterMetaData;
+import org.gatein.pc.portlet.impl.metadata.UserAttributeMetaData;
+import org.gatein.pc.portlet.impl.metadata.common.ContainerRuntimeMetaData;
+import org.gatein.pc.portlet.impl.metadata.common.InitParamMetaData;
+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.filter.FilterMappingMetaData;
+import org.gatein.pc.portlet.impl.metadata.filter.FilterMetaData;
+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.PortletModeMetaData;
+import org.gatein.pc.portlet.impl.metadata.portlet.PortletPreferenceMetaData;
+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;
+import org.gatein.pc.portlet.impl.metadata.portlet.WindowStateMetaData;
+import org.gatein.pc.portlet.impl.metadata.security.PortletCollectionMetaData;
+import org.gatein.pc.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.gatein.pc.portlet.impl.metadata.security.UserDataConstraintMetaData;
+import org.staxnav.Naming;
+import org.staxnav.StaxNavException;
+import org.staxnav.StaxNavigator;
+import org.staxnav.StaxNavigatorImpl;
+import org.staxnav.ValueType;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import java.io.InputStream;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import static
org.gatein.pc.portlet.impl.metadata.PortletMetaDataConstants.DEFAULT_LOCALE;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class PortletApplicationMetaDataBuilder
+{
+
+ private static final EnumSet<Element> NAME_OR_QNAME = EnumSet.of(Element.name,
Element.qname);
+
+ private static final ValueType<PortletCacheScopeEnum> PORTLET_CACHE_SCOPE =
ValueType.get(PortletCacheScopeEnum.class);
+
+ private static final ValueType<TransportGuarantee> TRANSPORT_GUARANTEE =
ValueType.get(TransportGuarantee.class);
+
+ private static final ValueType<LifeCyclePhase> LIFE_CYCLE = new
ValueType<LifeCyclePhase>()
+ {
+ @Override
+ protected LifeCyclePhase parse(String s) throws Exception
+ {
+ if (s.endsWith("_PHASE"))
+ {
+ return LifeCyclePhase.valueOf(s.substring(0, s.length() - 6));
+ }
+ else
+ {
+ throw new IllegalArgumentException("Value " + s + " is not
legal");
+ }
+ }
+ };
+
+ private static final QName XML_LANG = new
QName("http://www.w3.org/XML/1998/namespace", "lang");
+
+ private static final String PORTLET_1_0 =
"http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
+ private static final String PORTLET_2_0 =
"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";
+
+ private LocalizedString readLocalizedString(StaxNavigator<Element> nav, Element
element) throws ConversionException
+ {
+ Map<Locale, String> descriptions = new LinkedHashMap<Locale,
String>();
+ while (nav.next(element))
+ {
+ String lang = nav.getAttribute(XML_LANG);
+ String description = nav.getContent();
+ Locale locale = LocaleFormat.DEFAULT.getLocale(lang == null ? DEFAULT_LOCALE :
lang);
+ descriptions.put(locale, description);
+ }
+ if (descriptions.size() > 0)
+ {
+ return new LocalizedString(descriptions, new Locale(DEFAULT_LOCALE));
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private QName readQName(StaxNavigator<Element> nav)
+ {
+ String val = nav.getContent();
+ int pos = val.indexOf(':');
+ if (pos == -1)
+ {
+ return new QName(val);
+ }
+ else
+ {
+ String prefix = val.substring(0, pos);
+ String localPart = val.substring(pos + 1);
+ String uri = nav.getNamespaceByPrefix(prefix);
+ if (uri == null)
+ {
+ throw new UnsupportedOperationException("todo");
+ }
+ else
+ {
+ return new QName(uri, localPart, prefix);
+ }
+ }
+ }
+
+ private Iterable<InitParamMetaData> readInitParams(StaxNavigator<Element>
nav) throws ConversionException
+ {
+ List<InitParamMetaData> list = Collections.emptyList();
+ while (nav.next(Element.init_param))
+ {
+ InitParamMetaData initParamMD = new InitParamMetaData();
+ initParamMD.setId(nav.getAttribute("id"));
+ initParamMD.setDescription(readLocalizedString(nav, Element.description));
+ initParamMD.setName(getContent(nav, Element.name));
+ initParamMD.setValue(getContent(nav, Element.value));
+ if (list.isEmpty())
+ {
+ list = new ArrayList<InitParamMetaData>();
+ }
+ list.add(initParamMD);
+ }
+ return list;
+ }
+
+ private String getContent(StaxNavigator<Element> nav, Element element)
+ {
+ if (nav.next(element))
+ {
+ return nav.getContent();
+ }
+ else
+ {
+ throw new StaxNavException(nav.getLocation(), "Was expecting elemnt "
+ element + " to be present");
+ }
+ }
+
+ public PortletApplication20MetaData build(InputStream is) throws Exception
+ {
+
+ PortletApplication20MetaData md = new PortletApplication20MetaData();
+
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader stream = factory.createXMLStreamReader(is);
+ StaxNavigator<Element> nav = new StaxNavigatorImpl<Element>(new
Naming.Enumerated.Simple<Element>(Element.class, null), stream);
+
+ nav.setTrimContent(true);
+
+ // For now we do it this way
+ // but it's not correct
+ String defaultNS = nav.getNamespaceByPrefix("");
+ int version;
+ if (PORTLET_1_0.equals(defaultNS))
+ {
+ md.setVersion("1.0");
+ version = 1;
+ }
+ else if (PORTLET_2_0.equals(defaultNS))
+ {
+ md.setVersion("2.0");
+ version = 2;
+ }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ //
+ assert Element.portlet_app == nav.getName();
+
+ //
+ if (nav.child() == null)
+ {
+ return md;
+ }
+
+ //
+ for (StaxNavigator<Element> portletNav : nav.fork(Element.portlet))
+ {
+ PortletMetaData portletMD = new PortletMetaData();
+
+ //
+ portletMD.setId(portletNav.getAttribute("id"));
+ portletMD.setDescription(readLocalizedString(portletNav, Element.description));
+ portletMD.setPortletName(getContent(portletNav, Element.portlet_name));
+ portletMD.setDisplayName(readLocalizedString(portletNav,
Element.display_name));
+ portletMD.setPortletClass(getContent(portletNav, Element.portlet_class));
+
+ //
+ for (InitParamMetaData initParamMD : readInitParams(portletNav))
+ {
+ portletMD.addInitParam(initParamMD);
+ }
+
+ //
+ if (portletNav.next(Element.expiration_cache))
+ {
+ portletMD.setExpirationCache(Integer.parseInt(portletNav.getContent()));
+ }
+ if (portletNav.next(Element.cache_scope))
+ {
+
portletMD.setCacheScope(PortletCacheScopeEnum.valueOf(portletNav.getContent()));
+ }
+
+ //
+ while (portletNav.next(Element.supports))
+ {
+ SupportsMetaData supportsMD = new SupportsMetaData();
+ supportsMD.setId(portletNav.getAttribute("id"));
+ supportsMD.setMimeType(getContent(portletNav, Element.mime_type));
+ while (portletNav.next(Element.portlet_mode)) {
+ PortletModeMetaData portletModeMD = new PortletModeMetaData();
+ portletModeMD.setPortletMode(Mode.create(portletNav.getContent()));
+ supportsMD.addPortletMode(portletModeMD);
+ }
+ while (portletNav.next(Element.window_state)) {
+ WindowStateMetaData windowStateMD = new WindowStateMetaData();
+
windowStateMD.setWindowState(WindowState.create(portletNav.getContent()));
+ supportsMD.addWindowState(windowStateMD);
+ }
+ portletMD.addSupport(supportsMD);
+ }
+
+ //
+ while (portletNav.next(Element.supported_locale))
+ {
+ SupportedLocaleMetaData supportedLocaleMD = new SupportedLocaleMetaData();
+ supportedLocaleMD.setLocale(portletNav.getContent());
+ portletMD.addSupportedLocale(supportedLocaleMD);
+ }
+ if (portletNav.next(Element.resource_bundle))
+ {
+ portletMD.setResourceBundle(portletNav.getContent());
+ }
+
+ //
+ if (portletNav.next(Element.portlet_info))
+ {
+ PortletInfoMetaData portletInfoMD = new PortletInfoMetaData();
+ if (portletNav.next(Element.title))
+ {
+ portletInfoMD.setTitle(portletNav.getContent());
+ }
+ if (portletNav.next(Element.short_title))
+ {
+ portletInfoMD.setShortTitle(portletNav.getContent());
+ }
+ if (portletNav.next(Element.keywords))
+ {
+ portletInfoMD.setKeywords(portletNav.getContent());
+ }
+ portletMD.setPortletInfo(portletInfoMD);
+ }
+
+ //
+ if (portletNav.next(Element.portlet_preferences))
+ {
+ PortletPreferencesMetaData portletPreferencesMD = new
PortletPreferencesMetaData();
+ while (portletNav.next(Element.preference))
+ {
+ PortletPreferenceMetaData portletPreferenceMD = new
PortletPreferenceMetaData();
+ portletPreferenceMD.setName(getContent(portletNav, Element.name));
+ while (portletNav.next(Element.value))
+ {
+ portletPreferenceMD.addValue(portletNav.getContent());
+ }
+ if (portletNav.next(Element.read_only))
+ {
+
portletPreferenceMD.setReadOnly(portletNav.parseContent(ValueType.BOOLEAN));
+ }
+ portletPreferencesMD.addPortletPreference(portletPreferenceMD);
+ }
+ if (portletNav.next(Element.preferences_validator))
+ {
+ portletPreferencesMD.setPreferenceValidator(portletNav.getContent());
+ }
+ portletMD.setPortletPreferences(portletPreferencesMD);
+ }
+
+ //
+ while (portletNav.next(Element.security_role_ref))
+ {
+ SecurityRoleRefMetaData securityRoleRefMD = new SecurityRoleRefMetaData();
+ securityRoleRefMD.setDescription(readLocalizedString(portletNav,
Element.description));
+ securityRoleRefMD.setRoleName(getContent(portletNav, Element.role_name));
+ if (portletNav.next(Element.role_link))
+ {
+ securityRoleRefMD.setRoleLink(portletNav.getContent());
+ }
+ portletMD.addSecurityRoleRef(securityRoleRefMD);
+ }
+
+ //
+ while (portletNav.next(Element.supported_processing_event) ||
portletNav.next(Element.supported_publishing_event))
+ {
+ boolean processing = portletNav.getName() ==
Element.supported_processing_event;
+ EventDefinitionReferenceMetaData eventDefinitionReferenceMD = new
EventDefinitionReferenceMetaData();
+ switch (portletNav.next(NAME_OR_QNAME))
+ {
+ case name:
+ eventDefinitionReferenceMD.setName(portletNav.getContent());
+ break;
+ case qname:
+ eventDefinitionReferenceMD.setQname(readQName(portletNav));
+ break;
+ }
+ if (processing)
+ {
+ portletMD.addSupportedProcessingEvent(eventDefinitionReferenceMD);
+ }
+ else
+ {
+ portletMD.addSupportedPublishingEvent(eventDefinitionReferenceMD);
+ }
+ }
+ while (portletNav.next(Element.supported_public_render_parameter))
+ {
+ portletMD.addSupportedPublicRenderParameter(portletNav.getContent());
+ }
+ while (portletNav.next(Element.container_runtime_option))
+ {
+ ContainerRuntimeMetaData containerRuntimeOptionMD = new
ContainerRuntimeMetaData();
+ containerRuntimeOptionMD.setName(getContent(portletNav, Element.name));
+ while (portletNav.next(Element.value))
+ {
+ containerRuntimeOptionMD.addValue(portletNav.getContent());
+ }
+ portletMD.addContainerRuntime(containerRuntimeOptionMD);
+ }
+
+ //
+ md.addPortlet(portletMD);
+ }
+
+ //
+ for (StaxNavigator<Element> customPortletModeNav :
nav.fork(Element.custom_portlet_mode))
+ {
+ CustomPortletModeMetaData customPortletModeMD = new
CustomPortletModeMetaData();
+ customPortletModeMD.setId(customPortletModeNav .getAttribute("id"));
+ customPortletModeMD.setDescription(readLocalizedString(customPortletModeNav ,
Element.description));
+ customPortletModeMD.setPortletMode(getContent(customPortletModeNav,
Element.portlet_mode));
+ if (customPortletModeNav .next(Element.portal_managed))
+ {
+ customPortletModeMD.setPortalManaged(customPortletModeNav
.parseContent(ValueType.BOOLEAN));
+ }
+ md.addCustomPortletMode(customPortletModeMD);
+ }
+
+ //
+ for (StaxNavigator<Element> customWindowStateNav :
nav.fork(Element.custom_window_state))
+ {
+ CustomWindowStateMetaData customWindowStateMD = new
CustomWindowStateMetaData();
+ customWindowStateMD.setId(customWindowStateNav.getAttribute("id"));
+ customWindowStateMD.setDescription(readLocalizedString(customWindowStateNav,
Element.description));
+ customWindowStateMD.setWindowState(getContent(customWindowStateNav,
Element.window_state));
+ md.addCustomWindowState(customWindowStateMD);
+ }
+
+ //
+ for (StaxNavigator<Element> userAttributeNav :
nav.fork(Element.user_attribute))
+ {
+ UserAttributeMetaData userAttributeMD = new UserAttributeMetaData();
+ userAttributeMD.setId(userAttributeNav.getAttribute("id"));
+ userAttributeMD.setDescription(readLocalizedString(userAttributeNav,
Element.description));
+ userAttributeMD.setName(getContent(userAttributeNav, Element.name));
+ md.addUserAttribute(userAttributeMD);
+ }
+
+ //
+ for (StaxNavigator<Element> securityConstraintNav :
nav.fork(Element.security_constraint))
+ {
+ SecurityConstraintMetaData securityConstraintMD = new
SecurityConstraintMetaData();
+ securityConstraintMD.setId(securityConstraintNav.getAttribute("id"));
+ securityConstraintMD.setDisplayName(readLocalizedString(securityConstraintNav,
Element.display_name));
+ if (securityConstraintNav.next() != Element.portlet_collection)
+ {
+ throw new StaxNavException(nav.getLocation(), "Was expecting a
portlet-collection element instead of " + securityConstraintNav.getName());
+ }
+ PortletCollectionMetaData portletCollectionMD = new
PortletCollectionMetaData();
+ while (securityConstraintNav.next(Element.portlet_name))
+ {
+ portletCollectionMD.addPortletname(securityConstraintNav.getContent());
+ }
+ securityConstraintMD.setPortletList(portletCollectionMD);
+ if (securityConstraintNav.next() != Element.user_data_constraint)
+ {
+ throw new StaxNavException(nav.getLocation(), "Was expecting a
security-constraint element instead of " + securityConstraintNav.getName());
+ }
+ UserDataConstraintMetaData userDataConstraintMD = new
UserDataConstraintMetaData();
+ userDataConstraintMD.setDescription(readLocalizedString(securityConstraintNav,
Element.description));
+ if (securityConstraintNav.next() != Element.transport_guarantee)
+ {
+ throw new StaxNavException(nav.getLocation(), "Was expecting a
transport-guarantee element instead of " + securityConstraintNav.getName());
+ }
+
userDataConstraintMD.setTransportGuarantee(securityConstraintNav.parseContent(TRANSPORT_GUARANTEE));
+ securityConstraintMD.setUserDataConstraint(userDataConstraintMD);
+ md.addSecurityConstraint(securityConstraintMD);
+ }
+
+ //
+ if (nav.find(Element.resource_bundle))
+ {
+ md.setResourceBundle(nav.getContent());
+ nav.next();
+ }
+
+ //
+ for (StaxNavigator<Element> filterNav : nav.fork(Element.filter))
+ {
+ if (version < 2)
+ {
+ throw new Exception("Cannot declare filter with " + PORTLET_1_0 +
" descriptor");
+ }
+ FilterMetaData filterMD = new FilterMetaData();
+ filterMD.setDescription(readLocalizedString(filterNav, Element.description));
+ filterMD.setDisplayName(readLocalizedString(filterNav, Element.display_name));
+ filterMD.setFilterName(getContent(filterNav, Element.filter_name));
+ filterMD.setFilterClass(getContent(filterNav, Element.filter_class));
+ while (filterNav.next(Element.lifecycle))
+ {
+ filterMD.addLifecycle(filterNav.parseContent(LIFE_CYCLE));
+ }
+ for (InitParamMetaData initParamMD : readInitParams(filterNav))
+ {
+ filterMD.addInitParam(initParamMD);
+ }
+ md.addFilter(filterMD);
+ }
+
+ //
+ for (StaxNavigator<Element> filterMappingNav :
nav.fork(Element.filter_mapping))
+ {
+ if (version < 2)
+ {
+ throw new Exception("Cannot declare filter mapping with " +
PORTLET_1_0 + " descriptor");
+ }
+ FilterMappingMetaData filterMappingMD = new FilterMappingMetaData();
+ filterMappingMD.setName(getContent(filterMappingNav, Element.filter_name));
+ while (filterMappingNav.next(Element.portlet_name))
+ {
+ filterMappingMD.addPortletName(filterMappingNav.getContent());
+ }
+ md.addFilterMapping(filterMappingMD);
+ }
+
+ //
+ if (nav.find(Element.default_namespace))
+ {
+ md.setDefaultNamespace(new URI(nav.getContent()));
+ nav.next();
+ }
+
+ //
+ for (StaxNavigator<Element> eventDefinitionNav :
nav.fork(Element.event_definition))
+ {
+ EventDefinitionMetaData eventDefinitionMD = new EventDefinitionMetaData();
+ eventDefinitionMD.setId(eventDefinitionNav.getAttribute("id"));
+ eventDefinitionMD.setDescription(readLocalizedString(eventDefinitionNav,
Element.description));
+ switch (eventDefinitionNav.next(NAME_OR_QNAME))
+ {
+ case name:
+ eventDefinitionMD.setName(eventDefinitionNav.getContent());
+ break;
+ case qname:
+ eventDefinitionMD.setQname(readQName(eventDefinitionNav));
+ break;
+ }
+ while (eventDefinitionNav.next(Element.alias))
+ {
+ QName name = readQName(eventDefinitionNav);
+ eventDefinitionMD.addAlias(name);
+ }
+ if (eventDefinitionNav.next(Element.value_type))
+ {
+ eventDefinitionMD.setValueType(eventDefinitionNav.getContent());
+ }
+ md.addEventDefinition(eventDefinitionMD);
+ }
+
+ //
+ for (StaxNavigator<Element> publicRenderParameterNav :
nav.fork(Element.public_render_parameter))
+ {
+ PublicRenderParameterMetaData publicRenderParameterMD = new
PublicRenderParameterMetaData();
+
publicRenderParameterMD.setId(publicRenderParameterNav.getAttribute("id"));
+
publicRenderParameterMD.setDescription(readLocalizedString(publicRenderParameterNav,
Element.description));
+ publicRenderParameterMD.setIdentifier(getContent(publicRenderParameterNav,
Element.identifier));
+ switch (publicRenderParameterNav.next(NAME_OR_QNAME))
+ {
+ case name:
+ publicRenderParameterMD.setName(publicRenderParameterNav.getContent());
+ break;
+ case qname:
+ publicRenderParameterMD.setQname(readQName(publicRenderParameterNav));
+ break;
+ }
+ while (publicRenderParameterNav.next(Element.alias))
+ {
+ QName name = readQName(publicRenderParameterNav);
+ publicRenderParameterMD.addAlias(name);
+ }
+ md.addPublicRenderParameter(publicRenderParameterMD);
+ }
+
+ //
+ for (StaxNavigator<Element> listenerNav : nav.fork(Element.listener))
+ {
+ ListenerMetaData listenerMD = new ListenerMetaData();
+ listenerMD.setId(listenerNav.getAttribute("id"));
+ listenerMD.setDescription(readLocalizedString(listenerNav,
Element.description));
+ listenerMD.setDisplayName(readLocalizedString(listenerNav,
Element.display_name));
+ listenerMD.setListenerClass(getContent(listenerNav, Element.listener_class));
+ md.addListener(listenerMD);
+ }
+
+ //
+ for (StaxNavigator<Element> containerRuntimeNav :
nav.fork(Element.container_runtime_option))
+ {
+ ContainerRuntimeMetaData containerRuntimeOptionMD = new
ContainerRuntimeMetaData();
+ containerRuntimeOptionMD.setName(getContent(containerRuntimeNav,
Element.name));
+ while (containerRuntimeNav.next(Element.value))
+ {
+ containerRuntimeOptionMD.addValue(containerRuntimeNav.getContent());
+ }
+ md.addContainerRuntime(containerRuntimeOptionMD);
+ }
+
+ //
+ return md;
+ }
+}
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -26,16 +26,18 @@
import java.io.InputStream;
import java.net.URL;
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
import org.gatein.pc.mc.metadata.factory.PortletApplicationModelFactory;
import org.gatein.pc.mc.metadata.impl.AnnotationPortletApplication10MetaData;
import org.gatein.pc.mc.metadata.impl.AnnotationPortletApplication20MetaData;
import org.gatein.pc.mc.metadata.impl.ValueTrimmingFilter;
+import org.gatein.pc.mc.staxnav.PortletApplicationMetaDataBuilder;
import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
import static org.gatein.pc.portlet.impl.metadata.PortletMetaDataConstants.*;
-import org.jboss.unit.api.pojo.annotations.Parameter;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -43,14 +45,15 @@
import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
import org.jboss.xb.builder.JBossXBBuilder;
import org.xml.sax.SAXException;
-import static org.jboss.unit.api.Assert.*;
import org.jboss.util.xml.JBossEntityResolver;
+import javax.xml.stream.XMLStreamException;
+
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
*/
-public abstract class AbstractMetaDataTestCase
+public abstract class AbstractMetaDataTestCase extends TestCase
{
/** Test parameter for using xml binding annotation. */
@@ -69,14 +72,8 @@
protected Unmarshaller unmarshaller = null;
/** Annotation or ObjectModelFactory parsing. */
- private String parser;
+ private String parser = ANNOTATION_BINDING;
- @Parameter(name = "parser")
- public void setParser(String parser)
- {
- this.parser = parser;
- }
-
static
{
try
@@ -99,6 +96,55 @@
}
}
+ protected PortletApplication20MetaData _unmarshall10(String file) throws
JBossXBException, SAXException, IOException
+ {
+ return _unmarshall10(file, false);
+ }
+
+ protected PortletApplication20MetaData _unmarshall10(String file, boolean fail) throws
JBossXBException, 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 PortletApplication10MetaData unmarshall10(String file) throws
JBossXBException, SAXException, IOException
{
if (ANNOTATION_BINDING.equals(parser))
@@ -111,7 +157,7 @@
}
else
{
- throw new IllegalArgumentException("Wrong parameter for parser.");
+ throw new IllegalArgumentException("Wrong parameter for parser: " +
parser);
}
}
@@ -127,7 +173,7 @@
}
else
{
- throw new IllegalArgumentException("Wrong parameter for parser.");
+ throw new IllegalArgumentException("Wrong parameter for parser: " +
parser);
}
}
Added:
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
(rev 0)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ContainerRuntimeOptionTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -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.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());
+ }
+}
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomPortletModeTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -27,10 +27,7 @@
import org.gatein.pc.portlet.impl.metadata.CustomPortletModeMetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -39,14 +36,13 @@
{
- @Test
public void test01()
{
try
{
String xmlFile = "metadata/customPortletMode/portlet1.xml";
- PortletApplication10MetaData md = unmarshall10(xmlFile);
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -67,7 +63,6 @@
}
}
- @Test
public void test02()
{
try
@@ -75,7 +70,7 @@
String xmlFile = "metadata/customPortletMode/portlet2.xml";
- PortletApplication20MetaData md = unmarshall20(xmlFile);
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -109,21 +104,9 @@
}
}
- @Test
- public void test03()
+ public void test03() throws Exception
{
- try
- {
-
- String xmlFile = "metadata/customPortletMode/portlet1-fail.xml";
-
- PortletApplication10MetaData md = unmarshall10(xmlFile);
- fail("portlet 2.0 properties are not allowed");
- }
- catch (Exception e)
- {
- // OK
- }
+ String xmlFile = "metadata/customPortletMode/portlet1-fail.xml";
+ _unmarshall10(xmlFile, true);
}
-
}
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/CustomWindowStateTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -27,17 +27,13 @@
import org.gatein.pc.portlet.impl.metadata.CustomWindowStateMetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
*/
public class CustomWindowStateTestEverythingTestCase extends AbstractMetaDataTestCase
{
- @Test
public void test01()
{
try
@@ -45,7 +41,7 @@
String xmlFile = "metadata/customWindowState/portlet1.xml";
- PortletApplication10MetaData md = unmarshall10(xmlFile);
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -68,7 +64,6 @@
}
}
- @Test
public void test02()
{
try
@@ -76,7 +71,7 @@
String xmlFile = "metadata/customWindowState/portlet2.xml";
- PortletApplication20MetaData md = unmarshall20(xmlFile);
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/EventTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -31,10 +31,7 @@
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;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -42,15 +39,14 @@
public class EventTestEverythingTestCase extends AbstractMetaDataTestCase
{
- @Test
- public void test01()
+ public void _test01()
{
try
{
String xmlFile = "metadata/event/portlet-event1.xml";
- unmarshall10(xmlFile);
+ _unmarshall10(xmlFile);
fail();
}
catch (Exception e)
@@ -59,7 +55,6 @@
}
}
- @Test
public void test02()
{
try
@@ -67,7 +62,7 @@
String xmlFile = "metadata/event/portlet-event2.xml";
- PortletApplication20MetaData md = unmarshall20(xmlFile);
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -114,32 +109,15 @@
}
catch (Exception e)
{
- e.printStackTrace();
- fail();
+ fail(e);
}
}
- @Test
- public void test021()
+ // JULIEN : find a way to make that validated somehow
+ public void _test021() throws Exception
{
- try
- {
-
- String xmlFile = "metadata/event/portlet-event2-fail.xml";
-
- PortletApplication10MetaData md = unmarshall10(xmlFile);
- assertNotNull(md);
- assertEquals("2.0", md.getVersion());
-
-// EventDefinitionMetaData edm = md.getEvents().get(0);
-
- fail("Should fail: choice and qname defined!");
- }
- catch (Exception e)
- {
- // ok
- }
+ // "Should fail: name and qname defined!"
+ String xmlFile = "metadata/event/portlet-event2-fail.xml";
+ _unmarshall10(xmlFile, true);
}
-
-
}
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/FilterTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -28,10 +28,7 @@
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;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -39,29 +36,18 @@
public class FilterTestEverythingTestCase extends AbstractMetaDataTestCase
{
- @Test
- public void test01()
+ public void test01() throws Exception
{
- try
- {
- unmarshall10("metadata/filter/portlet-filter1.xml");
- // no filters in jsr 168
- fail();
- }
- catch (Exception e)
- {
- // ok
- }
+ _unmarshall10("metadata/filter/portlet-filter1.xml", true);
}
- @Test
public void test02()
{
try
{
String xmlFile = "metadata/filter/portlet-filter2.xml";
- PortletApplication20MetaData md = unmarshall20(xmlFile);
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/GeneralMetaDataTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -29,10 +29,7 @@
import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
import org.gatein.pc.portlet.impl.metadata.PublicRenderParameterMetaData;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -40,44 +37,41 @@
public class GeneralMetaDataTestCase extends AbstractMetaDataTestCase
{
- @Test
public void test01()
{
try
{
- PortletApplication10MetaData md =
this.unmarshall10("metadata/general/portlet1.xml");
+ PortletApplication10MetaData md =
_unmarshall10("metadata/general/portlet1.xml");
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
}
catch (Exception e)
{
- fail(e, "No exception expected");
+ throw fail(e, "No exception expected");
}
}
- @Test
public void test02()
{
try
{
- PortletApplication20MetaData md =
unmarshall20("metadata/general/portlet2.xml");
+ PortletApplication20MetaData md =
_unmarshall10("metadata/general/portlet2.xml");
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
}
catch (Exception e)
{
- fail(e, "No exception expected");
+ throw fail(e, "No exception expected");
}
}
- @Test
public void test021()
{
try
{
- PortletApplication20MetaData md =
unmarshall20("metadata/general/portlet2-jsr286.xml");
+ PortletApplication20MetaData md =
_unmarshall10("metadata/general/portlet2-jsr286.xml");
assertEquals("2.0", md.getVersion());
assertTrue(md instanceof PortletApplication20MetaData);
@@ -103,19 +97,21 @@
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)
{
- fail(e, "No exception expected");
+ throw fail(e, "No exception expected");
}
}
- @Test
public void test01_generated()
{
try
{
- PortletApplication10MetaData md =
unmarshall10("metadata/general/portlet-app_1_0.xml");
+ PortletApplication10MetaData md =
_unmarshall10("metadata/general/portlet-app_1_0.xml");
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
@@ -125,22 +121,21 @@
}
catch(Exception e)
{
- fail(e, "No exception expected");
+ throw fail(e, "No exception expected");
}
}
- @Test
public void test02_generated()
{
try
{
- PortletApplication20MetaData md =
this.unmarshall20("metadata/general/portlet-app_2_0.xml");
+ PortletApplication20MetaData md =
_unmarshall10("metadata/general/portlet-app_2_0.xml");
assertEquals("2.0", md.getVersion());
assertTrue(md instanceof PortletApplication20MetaData);
}
catch(Exception e)
{
- fail(e, "No exception expected");
+ throw fail(e, "No exception expected");
}
}
}
Added:
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
(rev 0)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/ListenerTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -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.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");
+ }
+ }
+
+}
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/PortletTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -38,10 +38,7 @@
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;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -49,14 +46,13 @@
public class PortletTestEverythingTestCase extends AbstractMetaDataTestCase
{
- @Test
public void test01()
{
try
{
String xmlFile = "metadata/portlet/portlet1.xml";
- PortletApplication10MetaData md = unmarshall10(xmlFile);
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -212,19 +208,17 @@
}
catch (Exception e)
{
- e.printStackTrace();
- fail();
+ throw fail(e);
}
}
- @Test
public void test02()
{
try
{
String xmlFile = "metadata/portlet/portlet2.xml";
- PortletApplication20MetaData md = this.unmarshall20(xmlFile);
+ PortletApplication20MetaData md = this._unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -372,19 +366,17 @@
}
catch (Exception e)
{
- e.printStackTrace();
- fail();
+ throw fail(e);
}
}
- @Test
public void test021()
{
try
{
String xmlFile = "metadata/portlet/portlet2-jsr286.xml";
- PortletApplication20MetaData md = this.unmarshall20(xmlFile);
+ PortletApplication20MetaData md = this._unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -494,12 +486,10 @@
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)
{
- e.printStackTrace();
- fail();
+ throw fail(e);
}
}
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/RenderParameterTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -24,9 +24,7 @@
import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
import org.gatein.pc.portlet.impl.metadata.PublicRenderParameterMetaData;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -34,7 +32,6 @@
public class RenderParameterTestEverythingTestCase extends AbstractMetaDataTestCase
{
- @Test
public void test02()
{
try
@@ -42,7 +39,7 @@
String xmlFile = "metadata/renderParameter/portlet2.xml";
- PortletApplication20MetaData md = unmarshall20(xmlFile);
+ PortletApplication20MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -75,5 +72,4 @@
fail();
}
}
-
}
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/SecurityConstraintTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -29,9 +29,7 @@
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;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -39,7 +37,6 @@
public class SecurityConstraintTestEverythingTestCase extends AbstractMetaDataTestCase
{
- @Test
public void test01()
{
try
@@ -47,7 +44,7 @@
String xmlFile = "metadata/security/portlet1.xml";
- PortletApplication10MetaData md = unmarshall10(xmlFile);
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -87,8 +84,7 @@
}
catch (Exception e)
{
- e.printStackTrace();
- fail();
+ fail(e);
}
}
@@ -129,7 +125,6 @@
}
*/
- @Test
public void test02()
{
try
@@ -137,7 +132,7 @@
String xmlFile = "metadata/security/portlet2.xml";
- PortletApplication20MetaData md = this.unmarshall20( xmlFile);
+ PortletApplication20MetaData md = this._unmarshall10( xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -173,8 +168,7 @@
}
catch (Exception e)
{
- e.printStackTrace();
- fail();
+ fail(e);
}
}
/*
Modified:
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
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/UserAttributeTestEverythingTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -27,10 +27,7 @@
import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
import org.gatein.pc.portlet.impl.metadata.UserAttributeMetaData;
-import org.jboss.unit.api.pojo.annotations.Test;
-import static org.jboss.unit.api.Assert.*;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -38,14 +35,13 @@
public class UserAttributeTestEverythingTestCase extends AbstractMetaDataTestCase
{
- @Test
public void test01()
{
try
{
String xmlFile = "metadata/userAttribute/portlet1.xml";
- PortletApplication10MetaData md = unmarshall10(xmlFile);
+ PortletApplication10MetaData md = _unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
@@ -68,14 +64,13 @@
}
}
- @Test
public void test02()
{
try
{
String xmlFile = "metadata/userAttribute/portlet2.xml";
- PortletApplication20MetaData md = this.unmarshall20(xmlFile);
+ PortletApplication20MetaData md = this._unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
Modified: components/pc/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml
===================================================================
---
components/pc/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml 2011-06-24
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml 2011-06-24
19:41:41 UTC (rev 6738)
@@ -55,10 +55,12 @@
<lifecycle>ACTION_PHASE</lifecycle>
</filter>
+<!--
<filter>
<filter-name>foo</filter-name>
</filter>
-
+-->
+
<filter-mapping>
<filter-name>testFilter</filter-name>
<portlet-name>Portlet1</portlet-name>
@@ -70,4 +72,4 @@
<portlet-name>Portlet2</portlet-name>
</filter-mapping>
-</portlet-app>
\ No newline at end of file
+</portlet-app>
Modified: components/pc/trunk/mc/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-24
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml 2011-06-24
19:41:41 UTC (rev 6738)
@@ -49,8 +49,8 @@
</supported-publishing-event>
<supported-public-render-parameter>supported-public-render-parameter</supported-public-render-parameter>
<container-runtime-option>
- <name>name</name>
- <value>value</value>
+ <name>portlet_container_runtime_option_name</name>
+ <value>portlet_container_runtime_option_value</value>
</container-runtime-option>
</portlet>
<custom-portlet-mode id="id">
@@ -112,7 +112,7 @@
<listener-class>listener-class</listener-class>
</listener>
<container-runtime-option>
- <name>name</name>
- <value>value</value>
+ <name>application_container_runtime_option_name</name>
+ <value>application_container_runtime_option_value</value>
</container-runtime-option>
</portlet-app>
Added: components/pc/trunk/mc/src/test/resources/metadata/listener/portlet2.xml
===================================================================
--- components/pc/trunk/mc/src/test/resources/metadata/listener/portlet2.xml
(rev 0)
+++ components/pc/trunk/mc/src/test/resources/metadata/listener/portlet2.xml 2011-06-24
19:41:41 UTC (rev 6738)
@@ -0,0 +1,14 @@
+<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...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <listener>
+ <description>listener</description>
+ <description xml:lang="fr">ecouteur</description>
+ <display-name>the listener</display-name>
+ <display-name xml:lang="fr">l'ecouteur</display-name>
+ <listener-class>MyListener</listener-class>
+ </listener>
+
+</portlet-app>
Added: components/pc/trunk/mc/src/test/resources/metadata/runtimeoption/portlet.xml
===================================================================
--- components/pc/trunk/mc/src/test/resources/metadata/runtimeoption/portlet.xml
(rev 0)
+++
components/pc/trunk/mc/src/test/resources/metadata/runtimeoption/portlet.xml 2011-06-24
19:41:41 UTC (rev 6738)
@@ -0,0 +1,23 @@
+<?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...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>portlet-name</portlet-name>
+ <portlet-class>portlet-class</portlet-class>
+ <supports>
+ <mime-type>mime-type</mime-type>
+ </supports>
+ <container-runtime-option>
+ <name>portlet_container_runtime_option_name</name>
+ <value>portlet_container_runtime_option_value</value>
+ </container-runtime-option>
+ </portlet>
+<!--
+ <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/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2011-06-24 16:38:34 UTC (rev 6737)
+++ components/pc/trunk/pom.xml 2011-06-24 19:41:41 UTC (rev 6738)
@@ -184,6 +184,11 @@
<artifactId>standard</artifactId>
<version>${version.apache.taglibs}</version>
</dependency>
+ <dependency>
+ <groupId>org.staxnav</groupId>
+ <artifactId>staxnav.core</artifactId>
+ <version>0.9.3</version>
+ </dependency>
<dependency>
<groupId>org.codehaus.cargo</groupId>
Modified:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/metadata/PortletApplication10MetaData.java
===================================================================
---
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/metadata/PortletApplication10MetaData.java 2011-06-24
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/metadata/PortletApplication10MetaData.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -125,7 +125,7 @@
public PortletMetaData getPortlet(String portletName)
{
- return portlets.get(portletName);
+ return portlets != null ? portlets.get(portletName) : null;
}
public void addPortlet(PortletMetaData portlet)
Modified: components/pc/trunk/test/core/src/main/resources/common.xml
===================================================================
--- components/pc/trunk/test/core/src/main/resources/common.xml 2011-06-24 16:38:34 UTC
(rev 6737)
+++ components/pc/trunk/test/core/src/main/resources/common.xml 2011-06-24 19:41:41 UTC
(rev 6738)
@@ -50,6 +50,10 @@
<pathelement location="${org.jboss:jbossxb:jar}"/>
</path>
+ <path id="staxnav">
+ <pathelement location="${org.staxnav:staxnav.core:jar}"/>
+ </path>
+
<path id="portal-common">
</path>
Modified:
components/pc/trunk/test/core/src/test/java/org/gatein/pc/test/portlet/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.java
===================================================================
---
components/pc/trunk/test/core/src/test/java/org/gatein/pc/test/portlet/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.java 2011-06-24
16:38:34 UTC (rev 6737)
+++
components/pc/trunk/test/core/src/test/java/org/gatein/pc/test/portlet/jsr286/ext/dispatcher/AbstractDispatchedSessionTestCase.java 2011-06-24
19:41:41 UTC (rev 6738)
@@ -70,7 +70,8 @@
PortletSession session = request.getPortletSession(false);
assertNotNull(session);
assertTrue(session.isNew());
- assertEquals("foo_dispatched_value",
session.getAttribute("foo", sessionScope));
+ Object value = session.getAttribute("foo", sessionScope);
+ assertEquals("foo_dispatched_value", value);
//
return new InvokeGetResponse(response.createRenderURL().toString());
Modified: components/pc/trunk/test/servers/jboss42/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss42/src/test/build.xml 2011-06-24 16:38:34 UTC
(rev 6737)
+++ components/pc/trunk/test/servers/jboss42/src/test/build.xml 2011-06-24 19:41:41 UTC
(rev 6738)
@@ -19,6 +19,7 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-xb"/>
+ <path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/jboss51/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss51/src/test/build.xml 2011-06-24 16:38:34 UTC
(rev 6737)
+++ components/pc/trunk/test/servers/jboss51/src/test/build.xml 2011-06-24 19:41:41 UTC
(rev 6738)
@@ -19,6 +19,7 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-xb"/>
+ <path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/jboss6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss6/src/test/build.xml 2011-06-24 16:38:34 UTC
(rev 6737)
+++ components/pc/trunk/test/servers/jboss6/src/test/build.xml 2011-06-24 19:41:41 UTC
(rev 6738)
@@ -19,6 +19,7 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-xb"/>
+ <path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/jetty6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jetty6/src/test/build.xml 2011-06-24 16:38:34 UTC
(rev 6737)
+++ components/pc/trunk/test/servers/jetty6/src/test/build.xml 2011-06-24 19:41:41 UTC
(rev 6738)
@@ -20,6 +20,7 @@
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
<path refid="jboss-xb"/>
+ <path refid="staxnav"/>
<pathelement path="${apache-xerces:xercesImpl:jar}"/>
<pathelement path="${apache-xerces:resolver:jar}"/>
<pathelement path="${apache-xerces.xml-apis:jar}"/>
Modified: components/pc/trunk/test/servers/pom.xml
===================================================================
--- components/pc/trunk/test/servers/pom.xml 2011-06-24 16:38:34 UTC (rev 6737)
+++ components/pc/trunk/test/servers/pom.xml 2011-06-24 19:41:41 UTC (rev 6738)
@@ -64,7 +64,7 @@
</activation>
<modules>
<module>tomcat6</module>
- <module>tomcat7</module>
+ <!--<module>tomcat7</module>-->
<module>jboss51</module>
<module>jboss6</module>
<module>jetty6</module>
Modified: components/pc/trunk/test/servers/src/common/resources/common.xml
===================================================================
--- components/pc/trunk/test/servers/src/common/resources/common.xml 2011-06-24 16:38:34
UTC (rev 6737)
+++ components/pc/trunk/test/servers/src/common/resources/common.xml 2011-06-24 19:41:41
UTC (rev 6738)
@@ -50,6 +50,10 @@
<pathelement location="${org.jboss:jbossxb:jar}"/>
</path>
+ <path id="staxnav">
+ <pathelement location="${org.staxnav:staxnav.core:jar}"/>
+ </path>
+
<path id="portal-common">
</path>
Modified: components/pc/trunk/test/servers/tomcat6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat6/src/test/build.xml 2011-06-24 16:38:34 UTC
(rev 6737)
+++ components/pc/trunk/test/servers/tomcat6/src/test/build.xml 2011-06-24 19:41:41 UTC
(rev 6738)
@@ -20,6 +20,7 @@
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
<path refid="jboss-xb"/>
+ <path refid="staxnav"/>
<pathelement location="${apache-xerces:xercesImpl:jar}"/>
<pathelement location="${apache-xerces:xml-apis:jar}"/>
<pathelement location="${apache-xerces:resolver:jar}"/>
Modified: components/pc/trunk/test/servers/tomcat7/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat7/src/test/build.xml 2011-06-24 16:38:34 UTC
(rev 6737)
+++ components/pc/trunk/test/servers/tomcat7/src/test/build.xml 2011-06-24 19:41:41 UTC
(rev 6738)
@@ -20,6 +20,7 @@
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
<path refid="jboss-xb"/>
+ <path refid="staxnav"/>
<pathelement path="${apache-xerces:xercesImpl:jar}"/>
<pathelement path="${apache-xerces:resolver:jar}"/>
<pathelement path="${apache-xerces.xml-apis:jar}"/>