Author: julien(a)jboss.com
Date: 2007-11-07 12:20:52 -0500 (Wed, 07 Nov 2007)
New Revision: 8838
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/AttributeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ConstantsTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ParameterTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/PropertyTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/PropertyTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/RenderParameterTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalInfoTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PropertyTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedPortletModesTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedWindowStatesTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterNamesTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletContextTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletNameTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/AttributeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/DispatcherTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/InitParameterTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/MimeTypeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextNameTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourcePathsTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourceTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/VersionTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ConstructorTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/EqualsTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/HashCodeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ModesTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ReadOnlyTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ResetNullKeyThrowsNPETestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ValueTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/AttributeNamesTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/ConstantsTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/CreationTimeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/GetAttributeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/InvalidateTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/NewTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/RemoveAttributeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/SetAttributeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeAttributeNameTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeScopeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/ParameterTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/AttributeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ConstantsTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ParameterTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/PropertyTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ConstantsTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ContentTypeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/EncodeURLTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/PropertyTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/ConstructorTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/EqualsTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/HashCodeTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/StatesTestCase.java
Removed:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml
Log:
- update API test cases to new test model
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,82 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.actionrequest;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class ActionRequestAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-actionrequest.war");
-//
-// /**
-// * ActionRequest.getPortletInputStream()
-// * ActionRequest.getReader()
-// *
-// * TESTED in TCK assertions
-// */
-//
-// /**
-// * ActionRequest.setCharacterEncoding()
-// *
-// * it is owned by PortletContainer - implementation simply throw
IllegalStateException all the time
-// */
-//
-// //So here we go to PortletRequest interface asserts:
-//
-// /**
-// * ActionRequest.BASIC_AUTH
-// * ActionRequest.CLIENT_CERT_AUTH
-// * ActionRequest.DIGEST_AUTH
-// * ActionRequest.FORM_AUTH
-// * ActionRequest.USER_INFO
-// */
-// suite.addTest(new TestCase("Constants"));
-//
-// /**
-// * ActionRequest.getProperty()
-// * ActionRequest.getProperties()
-// */
-// suite.addTest(new TestCase("Property"));
-//
-// /**
-// * ActionRequest.getAttribute()
-// * ActionRequest.setAttribute()
-// * ActionRequest.removeAttribute()
-// */
-// suite.addTest(new TestCase("Attribute"));
-//
-// /**
-// * ActionRequest.getParameter()
-// * ActionRequest.getParameterValues()
-// */
-// suite.addTest(new TestCase("Parameter"));
-//
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,230 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.actionrequest;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class ActionRequestSequenceBuilder extends PortletTestSuite
-{
-
- //********************************
- //PortletRequest interface Asserts
- //********************************
-
- /**
- * ActionRequest.BASIC_AUTH ActionRequest.CLIENT_CERT_AUTH ActionRequest.DIGEST_AUTH
ActionRequest.FORM_AUTH
- * ActionRequest.USER_INFO
- */
- public void createConstantsCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Constants", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- assertEquals("javax.portlet.userinfo", ActionRequest.USER_INFO);
- assertEquals("BASIC", ActionRequest.BASIC_AUTH);
- assertEquals("FORM", ActionRequest.FORM_AUTH);
- assertEquals("CLIENT_CERT", ActionRequest.CLIENT_CERT_AUTH);
- assertEquals("DIGEST", ActionRequest.DIGEST_AUTH);
- return new EndTestResponse();
- }
- });
- }
-
- /** ActionRequest.getProperty() ActionRequest.getProperties() */
- public void createPropertyCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Property", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
- {
- try
- {
- request.getProperty(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.getProperties(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- }
- });
-
- seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- return new EndTestResponse();
- }
- });
- }
-
- /** ActionRequest.getAttribute() ActionRequest.setAttribute()
ActionRequest.removeAttribute() */
- public void createAttributeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Attribute", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
- {
-
- try
- {
- request.getAttribute(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.setAttribute(null, new Object());
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.removeAttribute(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- }
- }
- });
-
- seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new EndTestResponse();
- }
- });
- }
-
- /** ActionRequest.getParameter() ActionRequest.getParameterValues() */
- public void createParameterCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Parameter", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
- {
- try
- {
- request.getParameter(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.getParameterValues(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- }
- });
-
- seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/AttributeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/AttributeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/AttributeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * 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.jsr168.api.actionrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+
+/**
+ * ActionRequest.getAttribute() ActionRequest.setAttribute()
ActionRequest.removeAttribute()
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AttributeTestCase
+{
+ public AttributeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+
+ try
+ {
+ request.getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.setAttribute(null, new Object());
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ConstantsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ConstantsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ConstantsTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.jsr168.api.actionrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+
+/**
+ * ActionRequest.BASIC_AUTH ActionRequest.CLIENT_CERT_AUTH ActionRequest.DIGEST_AUTH
ActionRequest.FORM_AUTH
+ * ActionRequest.USER_INFO
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConstantsTestCase
+{
+ public ConstantsTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ assertEquals("javax.portlet.userinfo", ActionRequest.USER_INFO);
+ assertEquals("BASIC", ActionRequest.BASIC_AUTH);
+ assertEquals("FORM", ActionRequest.FORM_AUTH);
+ assertEquals("CLIENT_CERT", ActionRequest.CLIENT_CERT_AUTH);
+ assertEquals("DIGEST", ActionRequest.DIGEST_AUTH);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ParameterTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ParameterTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ParameterTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * 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.jsr168.api.actionrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+
+/**
+ * ActionRequest.getParameter() ActionRequest.getParameterValues()
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ParameterTestCase
+{
+ public ParameterTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ request.getParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getParameterValues(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/PropertyTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/PropertyTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/PropertyTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * 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.jsr168.api.actionrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+
+/**
+ * ActionRequest.getProperty() ActionRequest.getProperties()
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyTestCase
+{
+ public PropertyTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ request.getProperty(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getProperties(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,69 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.actionresponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class ActionResponseAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-actionresponse.war");
-//
-// /**
-// * ActionResponse.setWindowState()
-// * ActionResponse.setPortletMode()
-// *
-// * TESTED in TCK asserts
-// */
-//
-// /**
-// * ActionResponse.setRedirect()
-// *
-// * TESTED in TCK asserts
-// */
-//
-// /**
-// * ActionResponse.setRenderParameter()
-// * ActionResponse.setRenderParameter()
-// * ActionResponse.setRenderParameters()
-// */
-// suite.addTest(new TestCase("RenderParameter"));
-//
-// /**
-// * ActionResponse.setProperty()
-// * ActionResponse.addProperty()
-// */
-// suite.addTest(new TestCase("Property"));
-//
-// /**
-// * ActionResponse.encodeURL()
-// */
-// suite.addTest(new TestCase("EncodeURL"));
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,290 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.actionresponse;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class ActionResponseSequenceBuilder extends PortletTestSuite
-{
-
- /** ActionResponse.setRenderParameter() ActionResponse.setRenderParameter()
ActionResponse.setRenderParameters() */
- public void createRenderParameterCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("RenderParameter", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
- {
-
- String val = null;
- String[] vals = null;
-
- try
- {
- response.setRenderParameter("name", val);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
- try
- {
- response.setRenderParameter(null, "val");
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- response.setRenderParameter("name", vals);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- response.setRenderParameter(null, new String[]{"val1, val2"});
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- response.setRenderParameter(null, val);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- response.setRenderParameter(null, vals);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
-
- try
- {
- response.setRenderParameters(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- Map map = new HashMap();
-
- map.put("name", "val");
- map.put(null, "val");
-
- try
- {
- response.setRenderParameters(map);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- map = new HashMap();
- map.put("name", "val");
- map.put("name2", new Object());
-
- try
- {
- response.setRenderParameters(map);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- map = new HashMap();
- map.put("name", new String[]{"val"});
- map.put("name2", null);
-
- try
- {
- response.setRenderParameters(map);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
- }
- });
-
- seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new EndTestResponse();
- }
- });
- }
-
- //************************
- //PortletResponse methods:
- //************************
-
- /** ActionResponse.setProperty() ActionResponse.addProperty() */
- public void createPropertyCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Property", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
- {
- try
- {
- response.addProperty(null, "val");
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- response.setProperty(null, "val");
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- }
- });
-
- seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new EndTestResponse();
- }
- });
- }
-
- /** ActionResponse.encodeURL() */
- public void createEncodeURLCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("EncodeURL", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
- {
- try
- {
- response.encodeURL("not_absolute_and_not_slash_leading_path");
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- }
- });
-
- seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.actionresponse;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class EncodeURLTestCase
+{
+ public EncodeURLTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ response.encodeURL("not_absolute_and_not_slash_leading_path");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/PropertyTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/PropertyTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/PropertyTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.actionresponse;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyTestCase
+{
+ public PropertyTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ response.addProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ response.setProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/RenderParameterTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/RenderParameterTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/RenderParameterTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,191 @@
+/******************************************************************************
+ * 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.jsr168.api.actionresponse;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RenderParameterTestCase
+{
+ public RenderParameterTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+
+ String val = null;
+ String[] vals = null;
+
+ try
+ {
+ response.setRenderParameter("name", val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ response.setRenderParameter(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter("name", vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter(null, new String[]{"val1, val2"});
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter(null, val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter(null, vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+
+ try
+ {
+ response.setRenderParameters(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ Map map = new HashMap();
+
+ map.put("name", "val");
+ map.put(null, "val");
+
+ try
+ {
+ response.setRenderParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", "val");
+ map.put("name2", new Object());
+
+ try
+ {
+ response.setRenderParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", new String[]{"val"});
+ map.put("name2", null);
+
+ try
+ {
+ response.setRenderParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portalcontext;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortalContextAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-portalcontext.war");
-//
-// /**
-// * PortalContext.getSupportedPortletModes()
-// */
-// suite.addTest(new TestCase("SupportedPortletModes"));
-//
-// /**
-// * PortalContext.getSupportedWindowStates()
-// */
-// suite.addTest(new TestCase("SupportedWindowStates"));
-//
-// /**
-// * PortalContext.getPortalInfo()
-// */
-// suite.addTest(new TestCase("PortalInfo"));
-//
-// /**
-// * PortalContext.getProperty()
-// */
-// suite.addTest(new TestCase("Property"));
-//
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,154 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portalcontext;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.PortletMode;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.WindowState;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortalContextSequenceBuilder extends PortletTestSuite
-{
- /** PortalContext.getSupportedPortletModes() */
- public void createSupportedPortletModesCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("SupportedPortletModes", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- Enumeration modesEnum =
request.getPortalContext().getSupportedPortletModes();
-
- List modes = new LinkedList();
-
- while (modesEnum.hasMoreElements())
- {
- modes.add(modesEnum.nextElement());
- }
-
- //there should be three modes
- assertTrue(modes.size() == 3);
- assertTrue(modes.contains(PortletMode.VIEW));
- assertTrue(modes.contains(PortletMode.EDIT));
- assertTrue(modes.contains(PortletMode.HELP));
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortalContext.getSupportedWindowStates() */
- public void createSupportedWindowStatesCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("SupportedWindowStates", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- Enumeration statesEnum =
request.getPortalContext().getSupportedWindowStates();
-
- List states = new LinkedList();
-
- while (statesEnum.hasMoreElements())
- {
- states.add(statesEnum.nextElement());
- }
-
- //there should be three modes
- assertTrue(states.size() == 3);
- assertTrue(states.contains(WindowState.NORMAL));
- assertTrue(states.contains(WindowState.MAXIMIZED));
- assertTrue(states.contains(WindowState.MINIMIZED));
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortalContext.getPortalInfo() */
- public void createPortalInfoCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("PortalInfo", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- String info = request.getPortalContext().getPortalInfo();
-
- assertTrue(info.length() > 0);
- assertTrue(info.startsWith("JBossPortal"));
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortalContext.getProperty() */
- public void createPropertyCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Property", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- //assert Exception is thrown
- try
- {
- request.getPortalContext().getProperty(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
- return new EndTestResponse();
- }
- });
- }
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalInfoTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalInfoTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalInfoTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portalcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortalInfoTestCase
+{
+ public PortalInfoTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ String info = request.getPortalContext().getPortalInfo();
+
+ assertTrue(info.length() > 0);
+ assertTrue(info.startsWith("JBossPortal"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PropertyTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PropertyTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PropertyTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portalcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyTestCase
+{
+ public PropertyTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert Exception is thrown
+ try
+ {
+ request.getPortalContext().getProperty(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedPortletModesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedPortletModesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedPortletModesTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.jsr168.api.portalcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SupportedPortletModesTestCase
+{
+ public SupportedPortletModesTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ Enumeration modesEnum =
request.getPortalContext().getSupportedPortletModes();
+
+ List modes = new LinkedList();
+
+ while (modesEnum.hasMoreElements())
+ {
+ modes.add(modesEnum.nextElement());
+ }
+
+ //there should be three modes
+ assertTrue(modes.size() == 3);
+ assertTrue(modes.contains(PortletMode.VIEW));
+ assertTrue(modes.contains(PortletMode.EDIT));
+ assertTrue(modes.contains(PortletMode.HELP));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedWindowStatesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedWindowStatesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/SupportedWindowStatesTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portalcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SupportedWindowStatesTestCase
+{
+ public SupportedWindowStatesTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ Enumeration statesEnum =
request.getPortalContext().getSupportedWindowStates();
+
+ List states = new LinkedList();
+
+ while (statesEnum.hasMoreElements())
+ {
+ states.add(statesEnum.nextElement());
+ }
+
+ //there should be three modes
+ assertTrue(states.size() == 3);
+ assertTrue(states.contains(WindowState.NORMAL));
+ assertTrue(states.contains(WindowState.MAXIMIZED));
+ assertTrue(states.contains(WindowState.MINIMIZED));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterNamesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterNamesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterNamesTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletconfig;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+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.assertTrue;
+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 java.util.Enumeration;
+import java.util.List;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InitParameterNamesTestCase
+{
+ public InitParameterNamesTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+ Enumeration e = config.getInitParameterNames();
+
+ //should be EMPTY
+ assertTrue(!e.hasMoreElements());
+
+ //we do nothing. response will be rendered by other portlet. If failed there
will be
+ //two results so whole test case will fail;
+ return null;
+ }
+ });
+
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+
+ Enumeration enumer = config.getInitParameterNames();
+ //construct list from names enumeration
+ List names = new LinkedList();
+
+ while (enumer.hasMoreElements())
+ {
+ names.add(enumer.nextElement());
+ }
+
+ //assert it contains correct names
+ assertEquals(2, names.size());
+
+ assertTrue(names.contains("InitParamA"));
+ assertTrue(names.contains("InitParamB"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/InitParameterTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portletconfig;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP2;
+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 static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InitParameterTestCase
+{
+ public InitParameterTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+
+ //assert correct values
+ assertEquals("InitParamAValue",
config.getInitParameter("InitParamA"));
+ assertEquals("InitParamBValue",
config.getInitParameter("InitParamB"));
+
+ //assert param not exists
+ assertNull(config.getInitParameter("InitParamC"));
+
+ //assert IllegalArgumentException when name is null
+ try
+ {
+ config.getInitParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,64 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletconfig;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortletConfigAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-portletconfig.war");
-//
-// /**
-// * These are tested in TCKAssertion tests:
-// * PortletConfig.getResourceBundle
-// */
-//
-// /**
-// * PortletConfig.getPortletName()
-// */
-// suite.addTest(new TestCase("PortletName"));
-//
-// /**
-// * PortletConfig.getPortletContext()
-// */
-// suite.addTest(new TestCase("PortletContext"));
-//
-// /**
-// * PortletConfig.getInitParameter()
-// */
-// suite.addTest(new TestCase("InitParameter"));
-//
-// /**
-// * PortletConfig.getInitParameterNames()
-// */
-// suite.addTest(new TestCase("InitParameterNames"));
-//
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,189 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletconfig;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTP2;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletConfigSequenceBuilder extends PortletTestSuite
-{
-
- /** @portlet.api assert="PortletConfig.getPortletName()" */
- public void createPortletNameCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("PortletName", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
- PortletConfig config = aport.getPortletConfig();
- assertNotNull(config);
- assertEquals("TestUniversalPortletA", config.getPortletName());
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="PortletConfig.getPortletContext()" */
- public void createPortletContextCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("PortletContext", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
- PortletConfig config = aport.getPortletConfig();
-
- assertNotNull(config);
-
- PortletContext portletContext = config.getPortletContext();
-
- assertNotNull(portletContext);
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="PortletConfig.getInitParameter()" */
- public void createInitParameterCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("InitParameter", seq);
- seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
- PortletConfig config = aport.getPortletConfig();
-
- assertNotNull(config);
-
- //assert correct values
- assertEquals("InitParamAValue",
config.getInitParameter("InitParamA"));
- assertEquals("InitParamBValue",
config.getInitParameter("InitParamB"));
-
- //assert param not exists
- assertNull(config.getInitParameter("InitParamC"));
-
- //assert IllegalArgumentException when name is null
- try
- {
- config.getInitParameter(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="PortletConfig.getInitParameterNames()" */
- public void createInitParameterNamesCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("InitParameterNames", seq);
-
- //this portlet has no init params defined
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
- PortletConfig config = aport.getPortletConfig();
-
- assertNotNull(config);
- Enumeration e = config.getInitParameterNames();
-
- //should be EMPTY
- assertTrue(!e.hasMoreElements());
-
- //we do nothing. response will be rendered by other portlet. If failed there
will be
- //two results so whole test case will fail;
- return null;
- }
- });
-
- seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
- PortletConfig config = aport.getPortletConfig();
-
- assertNotNull(config);
-
- Enumeration enumer = config.getInitParameterNames();
- //construct list from names enumeration
- List names = new LinkedList();
-
- while (enumer.hasMoreElements())
- {
- names.add(enumer.nextElement());
- }
-
- //assert it contains correct names
- assertEquals(2, names.size());
-
- assertTrue(names.contains("InitParamA"));
- assertTrue(names.contains("InitParamB"));
-
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletContextTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletContextTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletContextTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portletconfig;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletContextTestCase
+{
+ public PortletContextTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+
+ PortletContext portletContext = config.getPortletContext();
+
+ assertNotNull(portletContext);
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletNameTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletNameTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletNameTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.jsr168.api.portletconfig;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletNameTestCase
+{
+ public PortletNameTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+ assertNotNull(config);
+ assertEquals("TestUniversalPortletA", config.getPortletName());
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/AttributeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/AttributeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/AttributeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AttributeTestCase
+{
+ public AttributeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ try
+ {
+ aport.getPortletContext().getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ aport.getPortletContext().setAttribute(null, null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ aport.getPortletContext().removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/DispatcherTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/DispatcherTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/DispatcherTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DispatcherTestCase
+{
+ public DispatcherTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ //when dispatcher is not obtained it should return null
+
//assertNull(aport.getPortletContext().getRequestDispatcher("/notExistingDispatcher.jsp"));
+
assertNull(aport.getPortletContext().getNamedDispatcher("NotExistingDispatcher"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/InitParameterTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/InitParameterTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/InitParameterTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InitParameterTestCase
+{
+ public InitParameterTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+
assertNull(aport.getPortletContext().getInitParameter("NotExistingParamName"));
+
+ try
+ {
+ aport.getPortletContext().getInitParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/MimeTypeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/MimeTypeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/MimeTypeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import static org.jboss.unit.api.Assert.assertNull;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MimeTypeTestCase
+{
+ public MimeTypeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ assertEquals("text/plain",
aport.getPortletContext().getMimeType("/simple_resource.txt"));
+
assertNull(aport.getPortletContext().getMimeType("/notExistingResource"));
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,93 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletcontext;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortletContextAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-portletcontext.war");
-//
-// /**
-// * PortletContext.getServerInfo()
-// */
-// suite.addTest(new TestCase("ServerInfo"));
-//
-// /**
-// * PortletContext.getRequestDispatcher()
-// * PortletContext.getNamedDispatcher()
-// */
-// suite.addTest(new TestCase("Dispatcher"));
-//
-// /**
-// * PortletContext.getResource()
-// * PortletContext.getResourceAsStream()
-// * tested in TCK asserts
-// */
-//
-// /**
-// * PortletContext.getMinorVersion()
-// * PortletContext.getMajorVersion()
-// */
-// suite.addTest(new TestCase("Version"));
-//
-// /**
-// * PortletContext.getMimeType()
-// */
-// suite.addTest(new TestCase("MimeType"));
-//
-// /**
-// * PortletContext.getResourcePaths()
-// */
-// suite.addTest(new TestCase("ResourcePaths"));
-//
-// /**
-// * PortletContext.getResource()
-// */
-// suite.addTest(new TestCase("Resource"));
-//
-// /**
-// * PortletContext.getAttribute()
-// * PortletContext.removeAttribute()
-// * PortletContext.setAttribute()
-// */
-// suite.addTest(new TestCase("Attribute"));
-//
-// /**
-// * PortletContext.getInitParameter()
-// */
-// suite.addTest(new TestCase("InitParameter"));
-//
-// /**
-// * PortletContext.getPortletContextName()
-// */
-// suite.addTest(new TestCase("PortletContextName"));
-//
-// return suite;
- }
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextNameTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextNameTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextNameTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletContextNameTestCase
+{
+ public PortletContextNameTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ assertEquals("PortletContext WebApp",
aport.getPortletContext().getPortletContextName());
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,288 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletcontext;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.TestContants;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.net.MalformedURLException;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletContextSequenceBuilder extends PortletTestSuite
-{
-
- /** . */
- private static final String VERSION_REGEX = "JBossPortal/[0-9]+\\.[0-9]+";
-
- /** . */
- private static final Pattern VERSION_PATTERN = Pattern.compile(VERSION_REGEX,
Pattern.CASE_INSENSITIVE);
-
- /** PortletContext.getServerInfo() */
- public void createServerInfoCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("ServerInfo", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
- String info = aport.getPortletContext().getServerInfo();
- boolean matches = VERSION_PATTERN.matcher(info).matches();
- assertTrue("Version " + info + " does not match the
format", matches);
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getRequestDispatcher() PortletContext.getNamedDispatcher() */
- public void createDispatcherCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Dispatcher", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
-
- //when dispatcher is not obtained it should return null
-
//assertNull(aport.getPortletContext().getRequestDispatcher("/notExistingDispatcher.jsp"));
-
assertNull(aport.getPortletContext().getNamedDispatcher("NotExistingDispatcher"));
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getMinorVersion() PortletContext.getMajorVersion() */
- public void createVersionCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Version", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
-
- assertEquals(TestContants.MINOR_VERSION,
aport.getPortletContext().getMinorVersion());
- assertEquals(TestContants.MAJOR_VERSION,
aport.getPortletContext().getMajorVersion());
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getMimeType() */
- public void createMimeTypeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("MimeType", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
- assertEquals("text/plain",
aport.getPortletContext().getMimeType("/simple_resource.txt"));
-
assertNull(aport.getPortletContext().getMimeType("/notExistingResource"));
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getResourcePaths() */
- public void createResourcePathsCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("ResourcePaths", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
-
-
assertNull(aport.getPortletContext().getResourcePaths("/NotExistingResourcePath/"));
-
- Set paths = aport.getPortletContext().getResourcePaths("/");
- assertTrue(paths.contains("/WEB-INF/"));
- assertTrue(paths.contains("/simple_resource.txt"));
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getResource() */
- public void createResourceCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Resource", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
-
- //wrong url format
- try
- {
- aport.getPortletContext().getResource("simple_resource.txt");
- fail();
- }
- catch (MalformedURLException e)
- {
- //expected
- }
-
- //not existing resource
- try
- {
-
assertNull(aport.getPortletContext().getResource("/NotExist.txt"));
- }
- catch (MalformedURLException e)
- {
- //something wrong?
- fail();
- }
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getAttribute() PortletContext.removeAttribute()
PortletContext.setAttribute() */
- public void createAttributeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Attribute", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
-
- try
- {
- aport.getPortletContext().getAttribute(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
- try
- {
- aport.getPortletContext().setAttribute(null, null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
- try
- {
- aport.getPortletContext().removeAttribute(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getInitParameter() */
- public void createInitParameterCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("InitParameter", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
-
-
assertNull(aport.getPortletContext().getInitParameter("NotExistingParamName"));
-
- try
- {
- aport.getPortletContext().getInitParameter(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletContext.getPortletContextName() */
- public void createPortletContextNameCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("PortletContextName", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
-
- assertEquals("PortletContext WebApp",
aport.getPortletContext().getPortletContextName());
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourcePathsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourcePathsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourcePathsTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ResourcePathsTestCase
+{
+ public ResourcePathsTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+
assertNull(aport.getPortletContext().getResourcePaths("/NotExistingResourcePath/"));
+
+ Set paths = aport.getPortletContext().getResourcePaths("/");
+ assertTrue(paths.contains("/WEB-INF/"));
+ assertTrue(paths.contains("/simple_resource.txt"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourceTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourceTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ResourceTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+import static org.jboss.unit.api.Assert.assertNull;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.net.MalformedURLException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ResourceTestCase
+{
+ public ResourceTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ //wrong url format
+ try
+ {
+ aport.getPortletContext().getResource("simple_resource.txt");
+ fail();
+ }
+ catch (MalformedURLException e)
+ {
+ //expected
+ }
+
+ //not existing resource
+ try
+ {
+
assertNull(aport.getPortletContext().getResource("/NotExist.txt"));
+ }
+ catch (MalformedURLException e)
+ {
+ //something wrong?
+ fail();
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServerInfoTestCase
+{
+
+ /** . */
+ private static final String VERSION_REGEX = "JBossPortal/[0-9]+\\.[0-9]+";
+
+ /** . */
+ private static final Pattern VERSION_PATTERN = Pattern.compile(VERSION_REGEX,
Pattern.CASE_INSENSITIVE);
+
+ public ServerInfoTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ String info = aport.getPortletContext().getServerInfo();
+ boolean matches = VERSION_PATTERN.matcher(info).matches();
+ assertTrue("Version " + info + " does not match the
format", matches);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/VersionTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/VersionTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/VersionTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.TestContants;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class VersionTestCase
+{
+ public VersionTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ assertEquals(TestContants.MINOR_VERSION,
aport.getPortletContext().getMinorVersion());
+ assertEquals(TestContants.MAJOR_VERSION,
aport.getPortletContext().getMajorVersion());
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ConstructorTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ConstructorTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ConstructorTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.jsr168.api.portletmode;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConstructorTestCase
+{
+ public ConstructorTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("testmode", "" + new
PortletMode("testmode"));
+ assertEquals("testmode", "" + new
PortletMode("TESTMODE"));
+ assertEquals("testmode", "" + new
PortletMode("TestMode"));
+ assertEquals("", "" + new PortletMode(""));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/EqualsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/EqualsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/EqualsTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portletmode;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class EqualsTestCase
+{
+ public EqualsTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletMode pm1 = new PortletMode("TestMode");
+ PortletMode pm2 = new PortletMode("TestMode");
+ PortletMode pm3 = new PortletMode("OtherMode");
+
+ //true
+ assertTrue(pm1.equals(pm2));
+ //false
+ assertTrue(!pm1.equals(pm3));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/HashCodeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/HashCodeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/HashCodeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.jsr168.api.portletmode;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HashCodeTestCase
+{
+ public HashCodeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletMode pm1 = new PortletMode("TestMode");
+ PortletMode pm2 = new PortletMode("TestMode");
+ PortletMode pm3 = new PortletMode("OtherMode");
+
+ //true
+ assertTrue(pm1.hashCode() == pm2.hashCode());
+ //false
+ assertTrue(pm1.hashCode() != pm3.hashCode());
+
+ //Hashcodes are constructed from strings
+ assertEquals("testmode".hashCode(), pm1.hashCode());
+ assertEquals("testmode".hashCode(), pm2.hashCode());
+ assertEquals("othermode".hashCode(), pm3.hashCode());
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ModesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ModesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/ModesTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletmode;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ModesTestCase
+{
+ public ModesTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("view", "" + PortletMode.VIEW);
+ assertEquals("edit", "" + PortletMode.EDIT);
+ assertEquals("help", "" + PortletMode.HELP);
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,60 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletmode;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortletModeAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-portletmode.war");
-//
-// /**
-// * PortletMode.VIEW
-// * PortletMode.EDIT
-// * PortletMode.HELP
-// */
-// suite.addTest(new TestCase("Modes"));
-//
-// /**
-// * PortletMode.PortletMode()
-// */
-// suite.addTest(new TestCase("Constructor"));
-//
-// /**
-// * @portlet.api assert="PortletConfig.equals()"
-// */
-// suite.addTest(new TestCase("Equals"));
-//
-// /**
-// * @portlet.api assert="PortletConfig.hashCode()"
-// */
-// suite.addTest(new TestCase("HashCode"));
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,138 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletmode;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-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.PortletMode;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletModeSequenceBuilder extends PortletTestSuite
-{
-
- /** @portlet.api assert="PortletMode.EDIT, PortletMode.HELP,
PortletMode.VIEW" */
- public void createModesCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Modes", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- assertEquals("view", "" + PortletMode.VIEW);
- assertEquals("edit", "" + PortletMode.EDIT);
- assertEquals("help", "" + PortletMode.HELP);
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="PortletMode.PortletMode()" */
- public void createConstructorCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Constructor", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- assertEquals("testmode", "" + new
PortletMode("testmode"));
- assertEquals("testmode", "" + new
PortletMode("TESTMODE"));
- assertEquals("testmode", "" + new
PortletMode("TestMode"));
- assertEquals("", "" + new PortletMode(""));
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="PortletConfig.equals()" */
- public void createEqualsCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Equals", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletMode pm1 = new PortletMode("TestMode");
- PortletMode pm2 = new PortletMode("TestMode");
- PortletMode pm3 = new PortletMode("OtherMode");
-
- //true
- assertTrue(pm1.equals(pm2));
- //false
- assertTrue(!pm1.equals(pm3));
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="PortletConfig.hashCode()" */
- public void createHashCodeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("HashCode", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletMode pm1 = new PortletMode("TestMode");
- PortletMode pm2 = new PortletMode("TestMode");
- PortletMode pm3 = new PortletMode("OtherMode");
-
- //true
- assertTrue(pm1.hashCode() == pm2.hashCode());
- //false
- assertTrue(pm1.hashCode() != pm3.hashCode());
-
- //Hashcodes are constructed from strings
- assertEquals("testmode".hashCode(), pm1.hashCode());
- assertEquals("testmode".hashCode(), pm2.hashCode());
- assertEquals("othermode".hashCode(), pm3.hashCode());
-
-
- return new EndTestResponse();
- }
- });
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletpreferences;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortletPreferencesAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new
TestSuite("test-jsr168-api-portletpreferences.war");
-//
-// /**
-// * PortletPreferences.isReadOnly()
-// */
-// suite.addTest(new TestCase("ReadOnly"));
-//
-// /**
-// * PortletPreferences.getValue()
-// * PortletPreferences.getValues()
-// * PortletPreferences.setValue()
-// * PortletPreferences.setValues()
-// */
-// suite.addTest(new TestCase("Value"));
-//
-// /**
-// * PortletPreferences.reset()
-// */
-// suite.addTest(new TestCase("ResetNullKeyThrowsNPE"));
-// suite.addTest(new TestCase("ZeroLengthArrayValue"));
-//
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,283 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletpreferences;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTP2;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-
-import static org.jboss.unit.api.Assert.*;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletURL;
-import javax.portlet.ReadOnlyException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ValidatorException;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletPreferencesSequenceBuilder extends PortletTestSuite
-{
-
- /** PortletPreferences.isReadOnly() */
- public void createReadOnlyCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("ReadOnly", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- try
- {
- request.getPreferences().isReadOnly(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
- return new EndTestResponse();
- }
- });
- }
-
- /**
- * PortletPreferences.getValue() PortletPreferences.getValues()
PortletPreferences.setValue()
- * PortletPreferences.setValues()
- */
- public void createValueCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Value", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException
- {
- PortletPreferences prefs = request.getPreferences();
-
- //correct
- try
- {
- prefs.getValue("name", null);
-
- }
- catch (IllegalArgumentException e)
- {
- fail();
- }
-
- try
- {
- prefs.getValues("name", null);
- }
- catch (IllegalArgumentException e)
- {
- fail();
- }
-
- //wrong
- try
- {
- prefs.getValue(null, "val");
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- prefs.getValues(null, new String[]{"val"});
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- //and the "set" ones
-
- //correct
- //(need user auth)
- /*try
- {
- prefs.setValue("name", null);
- }
- catch (IllegalArgumentException e)
- {
- fail();
- }
-
- try
- {
- prefs.setValues("name", null);
- }
- catch (IllegalArgumentException e)
- {
- fail();
- }*/
-
- //wrong
- try
- {
- prefs.setValue(null, null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- prefs.setValues(null, null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
- }
- });
-
- seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletPreferences.reset() */
- public void createResetNullKeyThrowsNPE(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("ResetNullKeyThrowsNPE", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws ReadOnlyException
- {
- try
- {
- request.getPreferences().reset(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
- return new EndTestResponse();
- }
- });
- }
-
- /**
- *
- */
- public void createZeroLengthArrayValue(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("ZeroLengthArrayValue", seq);
- seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletPreferences prefs = request.getPreferences();
-
- // With the default value coming from the portlet.xml descriptor
- String value = prefs.getValue("empty", "other");
- assertEquals("other", value);
- assertEquals(new String[0], prefs.getValues("empty", new
String[]{"other"}));
-
- //
- PortletURL url = response.createActionURL();
- return new InvokeGetResponse(url.toString());
- }
- });
- seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
- {
- PortletPreferences prefs = request.getPreferences();
-
- // Check it does not exist yet
- assertEquals("other", prefs.getValue("dynamic",
"other"));
- assertEquals(new String[]{"other"},
prefs.getValues("dynamic", new String[]{"other"}));
-
- // Set the value to the empty array and check we get the other value
- prefs.setValues("dynamic", new String[0]);
- assertEquals("other", prefs.getValue("dynamic",
"other"));
- assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
-
- // Commit change
- prefs.store();
-
- // Check we still have the other value
- assertEquals("other", prefs.getValue("dynamic",
"other"));
- assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
- }
- });
- seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletPreferences prefs = request.getPreferences();
-
- // Check we still have the other value
- assertEquals("other", prefs.getValue("dynamic",
"other"));
- assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
-
- //
- return new EndTestResponse();
- }
- });
- }
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ReadOnlyTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ReadOnlyTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ReadOnlyTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.jsr168.api.portletpreferences;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ReadOnlyTestCase
+{
+ public ReadOnlyTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ request.getPreferences().isReadOnly(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ResetNullKeyThrowsNPETestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ResetNullKeyThrowsNPETestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ResetNullKeyThrowsNPETestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.jsr168.api.portletpreferences;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ReadOnlyException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ResetNullKeyThrowsNPETestCase
+{
+ public ResetNullKeyThrowsNPETestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws ReadOnlyException
+ {
+ try
+ {
+ request.getPreferences().reset(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ValueTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ValueTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ValueTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,159 @@
+/******************************************************************************
+ * 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.jsr168.api.portletpreferences;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.PortletPreferences;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ValueTestCase
+{
+ public ValueTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ //correct
+ try
+ {
+ prefs.getValue("name", null);
+
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }
+
+ try
+ {
+ prefs.getValues("name", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }
+
+ //wrong
+ try
+ {
+ prefs.getValue(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ prefs.getValues(null, new String[]{"val"});
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ //and the "set" ones
+
+ //correct
+ //(need user auth)
+ /*try
+ {
+ prefs.setValue("name", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }
+
+ try
+ {
+ prefs.setValues("name", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }*/
+
+ //wrong
+ try
+ {
+ prefs.setValue(null, null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ prefs.setValues(null, null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/ZeroLengthArrayValueTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * 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.jsr168.api.portletpreferences;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.ValidatorException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ZeroLengthArrayValueTestCase
+{
+ public ZeroLengthArrayValueTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ // With the default value coming from the portlet.xml descriptor
+ String value = prefs.getValue("empty", "other");
+ assertEquals("other", value);
+ assertEquals(new String[0], prefs.getValues("empty", new
String[]{"other"}));
+
+ //
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+ seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check it does not exist yet
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("dynamic", new String[]{"other"}));
+
+ // Set the value to the empty array and check we get the other value
+ prefs.setValues("dynamic", new String[0]);
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
+
+ // Commit change
+ prefs.store();
+
+ // Check we still have the other value
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
+ }
+ });
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check we still have the other value
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/AttributeNamesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/AttributeNamesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/AttributeNamesTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AttributeNamesTestCase
+{
+ public AttributeNamesTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ //before invalidate
+ session.getAttributeNames();
+ session.getAttributeNames(PortletSession.APPLICATION_SCOPE);
+
+ session.invalidate();
+
+ //after invalidate
+
+ try
+ {
+ session.getAttributeNames();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ session.getAttributeNames(PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/ConstantsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/ConstantsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/ConstantsTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConstantsTestCase
+{
+ public ConstantsTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals(0x01, PortletSession.APPLICATION_SCOPE);
+ assertEquals(0x02, PortletSession.PORTLET_SCOPE);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/CreationTimeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/CreationTimeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/CreationTimeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CreationTimeTestCase
+{
+ public CreationTimeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ //before invalidate
+ session.getCreationTime();
+
+ session.invalidate();
+
+ //after invalidate
+ try
+ {
+ session.getCreationTime();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/GetAttributeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/GetAttributeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/GetAttributeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GetAttributeTestCase
+{
+ public GetAttributeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ try
+ {
+ session.getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ session.getAttribute(null, PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+
+ session.invalidate();
+
+ //After invalidate
+ try
+ {
+ session.getAttribute("name");
+ fail();
+ }
+ catch (IllegalStateException expecte)
+ {
+ }
+
+ try
+ {
+ session.getAttribute("name", PortletSession.PORTLET_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/InvalidateTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/InvalidateTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/InvalidateTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InvalidateTestCase
+{
+ public InvalidateTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ session.invalidate();
+
+ //one more...
+ try
+ {
+ session.invalidate();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/NewTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/NewTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/NewTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NewTestCase
+{
+ public NewTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ //before invalidation
+ session.isNew();
+
+ session.invalidate();
+
+ //after invalidation
+ try
+ {
+ session.isNew();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,79 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletsession;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortletSessionAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-portletsession.war");
-//
-// /**
-// * PortletSession.APPLICATION_SCOPE
-// * PortletSession.PORTLET_SCOPE
-// */
-// suite.addTest(new TestCase("Constants"));
-//
-// /**
-// * PortletSession.getAttribute()
-// */
-// suite.addTest(new TestCase("GetAttribute"));
-//
-// /**
-// * PortletSession.getAttributeNames()
-// */
-// suite.addTest(new TestCase("AttributeNames"));
-//
-// /**
-// * PortletSession.getCreationTime()
-// */
-// suite.addTest(new TestCase("CreationTime"));
-//
-// /**
-// * PortletSession.invalidate()
-// */
-// suite.addTest(new TestCase("Invalidate"));
-//
-// /**
-// * PortletSession.isNew()
-// */
-// suite.addTest(new TestCase("New"));
-//
-// /**
-// * PortletSession.removeAttribute()
-// */
-// suite.addTest(new TestCase("RemoveAttribute"));
-//
-// /**
-// * PortletSession.setAttribute()
-// */
-// suite.addTest(new TestCase("SetAttribute"));
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,371 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletsession;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-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.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletSessionSequenceBuilder extends PortletTestSuite
-{
-
- /** PortletSession.APPLICATION_SCOPE PortletSession.PORTLET_SCOPE */
- public void createConstantsCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Constants", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- assertEquals(0x01, PortletSession.APPLICATION_SCOPE);
- assertEquals(0x02, PortletSession.PORTLET_SCOPE);
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletSession.getAttribute() */
- public void createGetAttributeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("GetAttribute", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletSession session = request.getPortletSession();
-
- try
- {
- session.getAttribute(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- session.getAttribute(null, PortletSession.APPLICATION_SCOPE);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
-
- session.invalidate();
-
- //After invalidate
- try
- {
- session.getAttribute("name");
- fail();
- }
- catch (IllegalStateException expecte)
- {
- }
-
- try
- {
- session.getAttribute("name", PortletSession.PORTLET_SCOPE);
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletSession.getAttributeNames() */
- public void createAttributeNamesCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("AttributeNames", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletSession session = request.getPortletSession();
-
- //before invalidate
- session.getAttributeNames();
- session.getAttributeNames(PortletSession.APPLICATION_SCOPE);
-
- session.invalidate();
-
- //after invalidate
-
- try
- {
- session.getAttributeNames();
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
- try
- {
- session.getAttributeNames(PortletSession.APPLICATION_SCOPE);
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletSession.getCreationTime() */
- public void createCreationTimeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("CreationTime", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletSession session = request.getPortletSession();
-
- //before invalidate
- session.getCreationTime();
-
- session.invalidate();
-
- //after invalidate
- try
- {
- session.getCreationTime();
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletSession.invalidate() */
- public void createInvalidateCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Invalidate", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletSession session = request.getPortletSession();
-
- session.invalidate();
-
- //one more...
- try
- {
- session.invalidate();
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletSession.isNew() */
- public void createNewCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("New", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletSession session = request.getPortletSession();
-
- //before invalidation
- session.isNew();
-
- session.invalidate();
-
- //after invalidation
- try
- {
- session.isNew();
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletSession.removeAttribute() */
- public void createRemoveAttributeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("RemoveAttribute", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletSession session = request.getPortletSession();
-
- try
- {
- session.removeAttribute(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- session.removeAttribute(null, PortletSession.APPLICATION_SCOPE);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- //before invalidation
- session.removeAttribute("name");
- session.removeAttribute("name", PortletSession.APPLICATION_SCOPE);
-
- session.invalidate();
-
- //after invalidation
- try
- {
- session.removeAttribute("name");
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
- try
- {
- session.removeAttribute("name",
PortletSession.APPLICATION_SCOPE);
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** PortletSession.setAttribute() */
- public void createSetAttributeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("SetAttribute", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletSession session = request.getPortletSession();
-
- try
- {
- session.setAttribute(null, new Object());
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- session.setAttribute(null, new Object(),
PortletSession.APPLICATION_SCOPE);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- //before invalidation
- session.setAttribute("name", new Object());
- session.setAttribute("name", new Object(),
PortletSession.APPLICATION_SCOPE);
-
- session.invalidate();
-
- //after invalidation
- try
- {
- session.setAttribute("name", new Object());
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
- try
- {
- session.setAttribute("name", new Object(),
PortletSession.APPLICATION_SCOPE);
- fail();
- }
- catch (IllegalStateException expected)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/RemoveAttributeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/RemoveAttributeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/RemoveAttributeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoveAttributeTestCase
+{
+ public RemoveAttributeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ try
+ {
+ session.removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ session.removeAttribute(null, PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ //before invalidation
+ session.removeAttribute("name");
+ session.removeAttribute("name", PortletSession.APPLICATION_SCOPE);
+
+ session.invalidate();
+
+ //after invalidation
+ try
+ {
+ session.removeAttribute("name");
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ session.removeAttribute("name",
PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/SetAttributeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/SetAttributeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/SetAttributeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SetAttributeTestCase
+{
+ public SetAttributeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ try
+ {
+ session.setAttribute(null, new Object());
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ session.setAttribute(null, new Object(),
PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ //before invalidation
+ session.setAttribute("name", new Object());
+ session.setAttribute("name", new Object(),
PortletSession.APPLICATION_SCOPE);
+
+ session.invalidate();
+
+ //after invalidation
+ try
+ {
+ session.setAttribute("name", new Object());
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ session.setAttribute("name", new Object(),
PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeAttributeNameTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeAttributeNameTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeAttributeNameTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletsessionutil;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSessionUtil;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DecodeAttributeNameTestCase
+{
+ public DecodeAttributeNameTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ assertEquals("name",
PortletSessionUtil.decodeAttributeName("name"));
+ //PORTLET_SCOPE
+ assertEquals("name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.id?name"));
+ assertEquals("name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.some.strange.id?name"));
+ assertEquals("strange.long.name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.some.strange.id?strange.long.name"));
+
+
+ assertEquals("javaxx.portlet.p.strange.id?name",
PortletSessionUtil.decodeAttributeName("javaxx.portlet.p.strange.id?name"));
+ assertEquals("javax.portlet.p.strange.idname",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.strange.idname"));
+ assertEquals("javax.portlet.strange.id?name",
PortletSessionUtil.decodeAttributeName("javax.portlet.strange.id?name"));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeScopeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeScopeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/DecodeScopeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.portletsessionutil;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletSessionUtil;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DecodeScopeTestCase
+{
+ public DecodeScopeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("simpleName"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.p.name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("jjavax.portlet.p.id?name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("id?name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("portlet.p.id?name"));
+
+
+ assertEquals(PortletSession.PORTLET_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.p.id?name"));
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,49 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletsessionutil;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortletSessionUtilAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new
TestSuite("test-jsr168-api-portletsessionutil.war");
-//
-// /**
-// * PortletSessionUtil.decodeAttributeName();
-// */
-// suite.addTest(new TestCase("DecodeAttributeName"));
-//
-// /**
-// * PortletSessionUtil.decodeScope();
-// */
-// suite.addTest(new TestCase("DecodeScope"));
-//
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,95 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portletsessionutil;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-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.PortletSession;
-import javax.portlet.PortletSessionUtil;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletSessionUtilSequenceBuilder extends PortletTestSuite
-{
- public void createDecodeAttributeNameCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("DecodeAttributeName", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- assertEquals("name",
PortletSessionUtil.decodeAttributeName("name"));
- //PORTLET_SCOPE
- assertEquals("name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.id?name"));
- assertEquals("name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.some.strange.id?name"));
- assertEquals("strange.long.name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.some.strange.id?strange.long.name"));
-
-
- assertEquals("javaxx.portlet.p.strange.id?name",
PortletSessionUtil.decodeAttributeName("javaxx.portlet.p.strange.id?name"));
- assertEquals("javax.portlet.p.strange.idname",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.strange.idname"));
- assertEquals("javax.portlet.strange.id?name",
PortletSessionUtil.decodeAttributeName("javax.portlet.strange.id?name"));
-
-
- return new EndTestResponse();
- }
- });
- }
-
- public void createDecodeScopeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("DecodeScope", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("simpleName"));
- assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.name"));
- assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.p.name"));
- assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("jjavax.portlet.p.id?name"));
- assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("id?name"));
- assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("portlet.p.id?name"));
-
-
- assertEquals(PortletSession.PORTLET_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.p.id?name"));
- return new EndTestResponse();
- }
- });
- }
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/ParameterTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/ParameterTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/ParameterTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,176 @@
+/******************************************************************************
+ * 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.jsr168.api.portleturl;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ParameterTestCase
+{
+ public ParameterTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createRenderURL();
+
+ String val = null;
+ String[] vals = null;
+
+ try
+ {
+ url.setParameter("name", val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ url.setParameter(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter("name", vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter(null, new String[]{"val1, val2"});
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter(null, val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter(null, vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+
+ try
+ {
+ url.setParameters(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ Map map = new HashMap();
+
+ map.put("name", "val");
+ map.put(null, "val");
+
+ try
+ {
+ url.setParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", "val");
+ map.put("name2", new Object());
+
+ try
+ {
+ url.setParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", new String[]{"val"});
+ map.put("name2", null);
+
+ try
+ {
+ url.setParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portleturl;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class PortletURLAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-portleturl.war");
-//
-// /**
-// * PortletURL.setWindowState()
-// * PortletURL.setPortletMode()
-// *
-// * TESTED in TCK assertions
-// */
-//
-// /**
-// * PortletURL.setParameter()
-// * PortletURL.setParameter()
-// * PortletURL.setParameters()
-// */
-// suite.addTest(new TestCase("Parameter"));
-//
-// /**
-// * TODO: PortletURL.setSecure()
-// */
-//
-// /**
-// * PortletURL.toString()
-// *
-// * TESTED in most of assertions
-// */
-//
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,185 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.portleturl;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-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.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletURLSequenceBuilder extends PortletTestSuite
-{
-
- /** PortletURL.setParameter() PortletURL.setParameter() PortletURL.setParameters() */
- public void createParameterCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Parameter", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- PortletURL url = response.createRenderURL();
-
- String val = null;
- String[] vals = null;
-
- try
- {
- url.setParameter("name", val);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
-
- try
- {
- url.setParameter(null, "val");
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- url.setParameter("name", vals);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- url.setParameter(null, new String[]{"val1, val2"});
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- url.setParameter(null, val);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- try
- {
- url.setParameter(null, vals);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
-
- try
- {
- url.setParameters(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- Map map = new HashMap();
-
- map.put("name", "val");
- map.put(null, "val");
-
- try
- {
- url.setParameters(map);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- map = new HashMap();
- map.put("name", "val");
- map.put("name2", new Object());
-
- try
- {
- url.setParameters(map);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
- map = new HashMap();
- map.put("name", new String[]{"val"});
- map.put("name2", null);
-
- try
- {
- url.setParameters(map);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- //
- }
-
-
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/AttributeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/AttributeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/AttributeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -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.jsr168.api.renderrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AttributeTestCase
+{
+ public AttributeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ request.getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.setAttribute(null, new Object());
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ConstantsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ConstantsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ConstantsTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.renderrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConstantsTestCase
+{
+ public ConstantsTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("javax.portlet.userinfo", RenderRequest.USER_INFO);
+ assertEquals("BASIC", RenderRequest.BASIC_AUTH);
+ assertEquals("FORM", RenderRequest.FORM_AUTH);
+ assertEquals("CLIENT_CERT", RenderRequest.CLIENT_CERT_AUTH);
+ assertEquals("DIGEST", RenderRequest.DIGEST_AUTH);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ParameterTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ParameterTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/ParameterTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * 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.jsr168.api.renderrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ParameterTestCase
+{
+ public ParameterTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ request.getParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getParameterValues(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/PropertyTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/PropertyTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/PropertyTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.jsr168.api.renderrequest;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyTestCase
+{
+ public PropertyTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ try
+ {
+ request.getProperty(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getProperties(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,71 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.renderrequest;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class RenderRequestAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-renderrequest.war");
-//
-// //So... all methods are from PortletRequest
-//
-// //And here we go to PortletRequest interface asserts:
-//
-// /**
-// * RenderRequest.BASIC_AUTH
-// * RenderRequest.CLIENT_CERT_AUTH
-// * RenderRequest.DIGEST_AUTH
-// * RenderRequest.FORM_AUTH
-// * RenderRequest.USER_INFO
-// */
-// suite.addTest(new TestCase("Constants"));
-//
-// /**
-// * RenderRequest.getProperty()
-// * RenderRequest.getProperties()
-// */
-// suite.addTest(new TestCase("Property"));
-//
-// /**
-// * RenderRequest.getAttribute()
-// * RenderRequest.setAttribute()
-// * RenderRequest.removeAttribute()
-// */
-// suite.addTest(new TestCase("Attribute"));
-//
-// /**
-// * RenderRequest.getParameter()
-// * RenderRequest.getParameterValues()
-// */
-// suite.addTest(new TestCase("Parameter"));
-//
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,180 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.renderrequest;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class RenderRequestSequenceBuilder extends PortletTestSuite
-{
- //********************************
- //PortletRequest interface Asserts
- //********************************
-
- /**
- * RenderRequest.BASIC_AUTH RenderRequest.CLIENT_CERT_AUTH RenderRequest.DIGEST_AUTH
RenderRequest.FORM_AUTH
- * RenderRequest.USER_INFO
- */
- public void createConstantsCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Constants", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- assertEquals("javax.portlet.userinfo", RenderRequest.USER_INFO);
- assertEquals("BASIC", RenderRequest.BASIC_AUTH);
- assertEquals("FORM", RenderRequest.FORM_AUTH);
- assertEquals("CLIENT_CERT", RenderRequest.CLIENT_CERT_AUTH);
- assertEquals("DIGEST", RenderRequest.DIGEST_AUTH);
- return new EndTestResponse();
- }
- });
- }
-
- /** RenderRequest.getProperty() RenderRequest.getProperties() */
- public void createPropertyCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Property", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
-
- try
- {
- request.getProperty(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.getProperties(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
- /** RenderRequest.getAttribute() RenderRequest.setAttribute()
RenderRequest.removeAttribute() */
- public void createAttributeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Attribute", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- try
- {
- request.getAttribute(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.setAttribute(null, new Object());
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.removeAttribute(null);
- fail();
- }
- catch (IllegalArgumentException e)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
- /** RenderRequest.getParameter() RenderRequest.getParameterValues() */
- public void createParameterCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Parameter", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- try
- {
- request.getParameter(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- request.getParameterValues(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ConstantsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ConstantsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ConstantsTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.jsr168.api.renderresponse;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConstantsTestCase
+{
+ public ConstantsTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("portlet.expiration-cache",
RenderResponse.EXPIRATION_CACHE);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ContentTypeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ContentTypeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/ContentTypeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.jsr168.api.renderresponse;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentTypeTestCase
+{
+ public ContentTypeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ response.setContentType("UNSUPPORTED/TYPE");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/EncodeURLTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/EncodeURLTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/EncodeURLTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.jsr168.api.renderresponse;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class EncodeURLTestCase
+{
+ public EncodeURLTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ response.encodeURL("not_absolute_and_not_slash_leading_path");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/PropertyTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/PropertyTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/PropertyTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.jsr168.api.renderresponse;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyTestCase
+{
+ public PropertyTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ response.addProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ response.setProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,73 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.renderresponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class RenderResponseAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-renderresponse.war");
-//
-// /**
-// * RenderResponse.EXPIRATION_CACHE
-// */
-// suite.addTest(new TestCase("Constants"));
-//
-// /**
-// * RenderResponse.setContentType()
-// */
-// suite.addTest(new TestCase("ContentType"));
-//
-// /**
-// * RenderResponse.getWriter()
-// * RenderResponse.getPortletOutputStream()
-// *
-// * TESTED in TCK asserts
-// */
-//
-// /**
-// * RenderResponse.setBufferSize()
-// *
-// * TESTED in TCK asserts
-// * (and it's not implemented in portal now)
-// */
-//
-// /**
-// * ActionResponse.setProperty()
-// * ActionResponse.addProperty()
-// */
-// suite.addTest(new TestCase("Property"));
-//
-// /**
-// * ActionResponse.encodeURL()
-// */
-// suite.addTest(new TestCase("EncodeURL"));
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,146 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.renderresponse;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-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;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class RenderResponseSequenceBuilder extends PortletTestSuite
-{
-
- /** RenderResponse.EXPIRATION_CACHE */
- public void createConstantsCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Constants", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- assertEquals("portlet.expiration-cache",
RenderResponse.EXPIRATION_CACHE);
- return new EndTestResponse();
- }
- });
- }
-
- /** RenderResponse.setContentType() */
- public void createContentTypeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("ContentType", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- try
- {
- response.setContentType("UNSUPPORTED/TYPE");
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
- //************************
- //PortletResponse methods:
- //************************
-
- /** RenderResponse.setProperty() RenderResponse.addProperty() */
- public void createPropertyCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Property", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- try
- {
- response.addProperty(null, "val");
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- try
- {
- response.setProperty(null, "val");
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- return new EndTestResponse();
- }
- });
- }
-
- /** RenderResponse.encodeURL() */
- public void createEncodeURLCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("EncodeURL", seq);
-
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- try
- {
- response.encodeURL("not_absolute_and_not_slash_leading_path");
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- return new EndTestResponse();
- }
- });
- }
-
-
-}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/ConstructorTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/ConstructorTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/ConstructorTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.windowstate;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConstructorTestCase
+{
+ public ConstructorTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("teststate", "" + new
WindowState("teststate"));
+ assertEquals("teststate", "" + new
WindowState("TESTSTATE"));
+ assertEquals("teststate", "" + new
WindowState("TestState"));
+ assertEquals("", "" + new WindowState(""));
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/EqualsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/EqualsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/EqualsTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.jsr168.api.windowstate;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class EqualsTestCase
+{
+ public EqualsTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ WindowState ws1 = new WindowState("TestState");
+ WindowState ws2 = new WindowState("teststate");
+ WindowState ws3 = new WindowState("OtherState");
+
+ //true
+ assertTrue(ws1.equals(ws2));
+ //false
+ assertTrue(!ws1.equals(ws3));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/HashCodeTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/HashCodeTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/HashCodeTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.jsr168.api.windowstate;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertTrue;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HashCodeTestCase
+{
+ public HashCodeTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ WindowState ws1 = new WindowState("TestState");
+ WindowState ws2 = new WindowState("teststate");
+ WindowState ws3 = new WindowState("OtherState");
+
+ //true
+ assertTrue(ws1.hashCode() == ws2.hashCode());
+ //false
+ assertTrue(ws1.hashCode() != ws3.hashCode());
+
+ //Hashcodes are constructed from strings
+ assertEquals("teststate".hashCode(), ws1.hashCode());
+ assertEquals("teststate".hashCode(), ws2.hashCode());
+ assertEquals("otherstate".hashCode(), ws3.hashCode());
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/StatesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/StatesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/StatesTestCase.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.windowstate;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class StatesTestCase
+{
+ public StatesTestCase(PortletTest seq)
+ {
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("minimized", "" + WindowState.MINIMIZED);
+ assertEquals("maximized", "" + WindowState.MAXIMIZED);
+ assertEquals("normal", "" + WindowState.NORMAL);
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,60 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.windowstate;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5510 $
- */
-public class WindowStateAPITestSuite
-{
-
- public static void suite()
- {
-// TestSuite suite = new TestSuite("test-jsr168-api-windowstate.war");
-//
-// /**
-// * WindowState.MAXIMIZED
-// * WindowState.MINIMIZED
-// * WindowState.NORMAL
-// */
-// suite.addTest(new TestCase("States"));
-//
-// /**
-// * WindowState.WindowState()
-// */
-// suite.addTest(new TestCase("Constructor"));
-//
-// /**
-// * @portlet.api assert="WindowState.equals()"
-// */
-// suite.addTest(new TestCase("Equals"));
-//
-// /**
-// * @portlet.api assert="WindowState.hashCode()"
-// */
-// suite.addTest(new TestCase("HashCode"));
-//
-// return suite;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java 2007-11-07
17:20:52 UTC (rev 8838)
@@ -1,138 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.api.windowstate;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-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.WindowState;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class WindowStateSequenceBuilder extends PortletTestSuite
-{
-
- /** @portlet.api assert="WindowState.MINIMIZED WindowState.MAXIMIZED
WindowState.NORMAL" */
- public void createStatesCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("States", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- assertEquals("minimized", "" + WindowState.MINIMIZED);
- assertEquals("maximized", "" + WindowState.MAXIMIZED);
- assertEquals("normal", "" + WindowState.NORMAL);
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="WindowState.WindowState()" */
- public void createConstructorCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Constructor", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- assertEquals("teststate", "" + new
WindowState("teststate"));
- assertEquals("teststate", "" + new
WindowState("TESTSTATE"));
- assertEquals("teststate", "" + new
WindowState("TestState"));
- assertEquals("", "" + new WindowState(""));
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="WindowState.equals()" */
- public void createEqualsCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("Equals", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- WindowState ws1 = new WindowState("TestState");
- WindowState ws2 = new WindowState("teststate");
- WindowState ws3 = new WindowState("OtherState");
-
- //true
- assertTrue(ws1.equals(ws2));
- //false
- assertTrue(!ws1.equals(ws3));
-
-
- return new EndTestResponse();
- }
- });
- }
-
- /** @portlet.api assert="WindowState.hashCode()" */
- public void createHashCodeCase(PortletTestDriver registry)
- {
- PortletTest seq = new PortletTest();
- registry.addSequence("HashCode", seq);
- seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- WindowState ws1 = new WindowState("TestState");
- WindowState ws2 = new WindowState("teststate");
- WindowState ws3 = new WindowState("OtherState");
-
- //true
- assertTrue(ws1.hashCode() == ws2.hashCode());
- //false
- assertTrue(ws1.hashCode() != ws3.hashCode());
-
- //Hashcodes are constructed from strings
- assertEquals("teststate".hashCode(), ws1.hashCode());
- assertEquals("teststate".hashCode(), ws2.hashCode());
- assertEquals("otherstate".hashCode(), ws3.hashCode());
-
-
- return new EndTestResponse();
- }
- });
- }
-}
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.actionrequest.ActionRequestSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.actionresponse.ActionResponseSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portalcontext.PortalContextSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletconfig.PortletConfigSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -28,6 +28,6 @@
<web-app>
<display-name>PortletContext WebApp</display-name>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletcontext.PortletContextSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletmode.PortletModeSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletpreferences.PortletPreferencesSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletsession.PortletSessionSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletsessionutil.PortletSessionUtilSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portleturl.PortletURLSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.renderrequest.RenderRequestSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.renderresponse.RenderResponseSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>
Modified:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml 2007-11-07
15:15:08 UTC (rev 8837)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml 2007-11-07
17:20:52 UTC (rev 8838)
@@ -27,6 +27,6 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<listener>
-
<listener-class>org.jboss.portal.test.portlet.jsr168.api.windowstate.WindowStateSequenceBuilder</listener-class>
+
<listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
</listener>
</web-app>