Author: julien(a)jboss.com
Date: 2008-01-12 20:34:39 -0500 (Sat, 12 Jan 2008)
New Revision: 9488
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/DefaultNamespaceTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/DefaultNamespaceTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/NoEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/ProcessingEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingProcessingEventTestCase.java
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/web.xml
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
Log:
- added test cases for event names when no default namespace is declared
- added test case to check the default namespace value from the portlet config
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-13
00:40:13 UTC (rev 9487)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -355,7 +355,17 @@
{
QName name = getName(eventDefinitionReferenceMD.getQname(),
eventDefinitionReferenceMD.getName());
ContainerEventInfo event = events.get(name);
- portletEvents.addConsumedEvent(event);
+
+ //
+ if (event != null)
+ {
+ portletEvents.addConsumedEvent(event);
+ }
+ else
+ {
+ log.error("Portlet " + portletMD.getPortletName() + "
references the event " + name + " that is not " +
+ "declared at the application level");
+ }
}
//
@@ -363,7 +373,17 @@
{
QName name = getName(eventDefinitionReferenceMD.getQname(),
eventDefinitionReferenceMD.getName());
ContainerEventInfo event = events.get(name);
- portletEvents.addProducedEvent(event);
+
+ //
+ if (event != null)
+ {
+ portletEvents.addProducedEvent(event);
+ }
+ else
+ {
+ log.error("Portlet " + portletMD.getPortletName() + "
references the event " + name + " that is not " +
+ "declared at the application level");
+ }
}
//
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-13
00:40:13 UTC (rev 9487)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -74,14 +74,16 @@
List<QName> publishingEventQNames = new ArrayList<QName>();
for (EventInfo event : portletInfo.getEvents().getProducedEvents())
{
- publishingEventQNames.add(event.getName());
+ QName eventName = event.getName();
+ publishingEventQNames.add(eventName);
}
//
List<QName> processingEventQNames = new ArrayList<QName>();
for (EventInfo event : portletInfo.getEvents().getConsumedEvents())
{
- processingEventQNames.add(event.getName());
+ QName eventName = event.getName();
+ processingEventQNames.add(eventName);
}
//
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/DefaultNamespaceTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/DefaultNamespaceTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/DefaultNamespaceTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfig;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class DefaultNamespaceTestCase
+{
+ public DefaultNamespaceTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP5.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ assertEquals("urn:default-namespace", cfg.getDefaultNamespace());
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java 2008-01-13
00:40:13 UTC (rev 9487)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -69,7 +69,7 @@
Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
assertNotNull(processingEvents);
List<QName> processingEventList = Tools.toList(processingEvents);
- assertEquals(6, processingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES.size(),
processingEventList.size());
assertEquals(PublishingEventTestCase.EVENT_NAMES, new
HashSet<QName>(processingEventList));
//
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java 2008-01-13
00:40:13 UTC (rev 9487)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -75,7 +75,7 @@
Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
assertNotNull(publishingEvents);
List<QName> publishingEventList = Tools.toList(publishingEvents);
- assertEquals(6, publishingEventList.size());
+ assertEquals(EVENT_NAMES.size(), publishingEventList.size());
assertEquals(EVENT_NAMES, new HashSet<QName>(publishingEventList));
//
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java 2008-01-13
00:40:13 UTC (rev 9487)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -64,14 +64,14 @@
Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
assertNotNull(publishingEvents);
List<QName> publishingEventList = Tools.toList(publishingEvents);
- assertEquals(6, publishingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES.size(),
publishingEventList.size());
assertEquals(PublishingEventTestCase.EVENT_NAMES, new
HashSet<QName>(publishingEventList));
//
Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
assertNotNull(processingEvents);
List<QName> processingEventList = Tools.toList(processingEvents);
- assertEquals(6, processingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES.size(),
processingEventList.size());
assertEquals(PublishingEventTestCase.EVENT_NAMES, new
HashSet<QName>(processingEventList));
//
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/DefaultNamespaceTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/DefaultNamespaceTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/DefaultNamespaceTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfignonamespace;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.xml.XMLConstants;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class DefaultNamespaceTestCase
+{
+ public DefaultNamespaceTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP5.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ assertEquals(XMLConstants.NULL_NS_URI, cfg.getDefaultNamespace());
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/NoEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/NoEventTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/NoEventTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfignonamespace;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import java.util.Enumeration;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class NoEventTestCase
+{
+ public NoEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ assertFalse(publishingEvents.hasMoreElements());
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ assertFalse(processingEvents.hasMoreElements());
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/ProcessingEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/ProcessingEventTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/ProcessingEventTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfignonamespace;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertFalse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class ProcessingEventTestCase
+{
+ public ProcessingEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ assertFalse(publishingEvents.hasMoreElements());
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ List<QName> processingEventList = Tools.toList(processingEvents);
+ assertEquals(PublishingEventTestCase.EVENT_NAMES.size(),
processingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES, new
HashSet<QName>(processingEventList));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingEventTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingEventTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfignonamespace;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import javax.xml.XMLConstants;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class PublishingEventTestCase
+{
+
+ static final Set<QName> EVENT_NAMES = Collections.unmodifiableSet(Tools.toSet(
+ new QName("urn:explicit-namespace-1", "event1"),
+ new QName("urn:explicit-namespace-2", "event2"),
+ new QName(XMLConstants.NULL_NS_URI, "event3")
+ ));
+
+
+ public PublishingEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP2.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ List<QName> publishingEventList = Tools.toList(publishingEvents);
+ assertEquals(EVENT_NAMES.size(), publishingEventList.size());
+ assertEquals(EVENT_NAMES, new HashSet<QName>(publishingEventList));
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ assertFalse(processingEvents.hasMoreElements());
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingProcessingEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingProcessingEventTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfignonamespace/PublishingProcessingEventTestCase.java 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfignonamespace;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class PublishingProcessingEventTestCase
+{
+ public PublishingProcessingEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP4.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ List<QName> publishingEventList = Tools.toList(publishingEvents);
+ assertEquals(PublishingEventTestCase.EVENT_NAMES.size(),
publishingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES, new
HashSet<QName>(publishingEventList));
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ List<QName> processingEventList = Tools.toList(processingEvents);
+ assertEquals(PublishingEventTestCase.EVENT_NAMES.size(),
processingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES, new
HashSet<QName>(processingEventList));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-01-13 00:40:13 UTC (rev 9487)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-01-13 01:34:39 UTC (rev 9488)
@@ -219,6 +219,7 @@
<package-misc-test test="log4j"/>
<package-jsr286-tck-test test="portletconfig"/>
+ <package-jsr286-tck-test test="portletconfignonamespace"/>
<jar jarfile="${test.temp.lib}/portlet-test-lib.jar">
<fileset dir="${target}/test-classes"/>
Modified:
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml 2008-01-13
00:40:13 UTC (rev 9487)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml 2008-01-13
01:34:39 UTC (rev 9488)
@@ -131,6 +131,14 @@
</supported-publishing-event>
</portlet>
+ <portlet>
+ <portlet-name>UniversalTestPortletE</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP5</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ </portlet>
+
<default-namespace>urn:default-namespace</default-namespace>
<event-definition>
Added:
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/portlet.xml 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-publishing-event>
+ <qname
xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname
xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>event3</name>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletC</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <qname
xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname
xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>event3</name>
+ </supported-processing-event>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletD</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <qname
xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname
xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>event3</name>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <qname
xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname
xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>event3</name>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletE</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP5</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ </portlet>
+
+ <event-definition>
+ <qname xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </event-definition>
+
+ <event-definition>
+ <qname xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </event-definition>
+
+ <event-definition>
+ <name>event3</name>
+ </event-definition>
+
+</portlet-app>
Added:
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfignonamespace-war/WEB-INF/web.xml 2008-01-13
01:34:39 UTC (rev 9488)
@@ -0,0 +1,32 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <listener>
+
<listener-class>org.jboss.portal.unit.PortletTestSuite</listener-class>
+ </listener>
+</web-app>
Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-01-13
00:40:13 UTC (rev 9487)
+++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-01-13
01:34:39 UTC (rev 9488)
@@ -5,6 +5,7 @@
xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
<!--Spec TCK Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-tck-dispatcher.war"/>
@@ -49,8 +50,10 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-tck-windowstates.war"/>
</generic>
+-->
<!--API Tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-api-actionrequest.war"/>
@@ -103,8 +106,10 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-api-windowstate.war"/>
</generic>
+-->
<!--Ext Tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-ext-dispatcher.war"/>
@@ -145,12 +150,17 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-ext-nocache.war"/>
</generic>
+-->
<!--Spec TCK Assertions tests-->
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-tck-portletconfig.war"/>
</generic>
+ <generic>
+ <class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
+ <property name="archiveId"
value="test-jsr286-tck-portletconfignonamespace.war"/>
+ </generic>
<!--Misc Tests-->
<!--