[jboss-svn-commits] JBoss Portal SVN: r5510 - in trunk: cms/src/main/org/jboss/portal/test/cms/clustering common common/src/main/org/jboss/portal/common common/src/main/org/jboss/portal/common/junit/ant common/src/main/org/jboss/portal/common/test common/src/main/org/jboss/portal/common/test/driver common/src/main/org/jboss/portal/common/test/driver/command common/src/main/org/jboss/portal/common/test/driver/response common/src/main/org/jboss/portal/common/test/info common/src/main/org/jboss/portal/common/test/junit common/src/main/org/jboss/portal/common/util portlet portlet/src/main/org/jboss/portal/portlet/impl/jsr168 portlet/src/main/org/jboss/portal/portlet/invocation/response portlet/src/main/org/jboss/portal/portlet/test portlet/src/main/org/jboss/portal/test/framework/portlet portlet/src/main/org/jboss/portal/test/framework/portlet/actions portlet/src/main/org/jboss/portal/test/framework/portlet/basictests portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/cla! sses portlet/src/main/org/jboss/portal/test/framework/portlet/components portlet/src/main/org/jboss/portal/test/portlet/ha/session portlet/src/main/org/jboss/portal/test/portlet/info portlet/src/main/org/jboss/portal/test/portlet/jsr168/api portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl portlet/src/main/or! g/jboss/portal/test/portlet/jsr168/api/renderrequest portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher por
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Oct 30 08:38:35 EST 2006
Author: julien at jboss.com
Date: 2006-10-30 08:35:25 -0500 (Mon, 30 Oct 2006)
New Revision: 5510
Added:
trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java
trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java
trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java
trunk/common/src/main/org/jboss/portal/common/test/
trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameter.java
trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameter.java
trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java
trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java
trunk/common/src/main/org/jboss/portal/common/test/driver/
trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java
trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java
trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java
trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java
trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java
trunk/common/src/main/org/jboss/portal/common/test/driver/command/
trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java
trunk/common/src/main/org/jboss/portal/common/test/driver/response/
trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java
trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java
trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java
trunk/common/src/main/org/jboss/portal/common/test/info/
trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java
trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java
trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java
trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java
trunk/common/src/main/org/jboss/portal/common/test/junit/
trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java
trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistry.java
trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistryService.java
trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/ServerTestRunner.java
trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java
trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookupFailedException.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoGetCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoPostCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpResponse.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokeGetResponse.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokePostResponse.java
trunk/test/src/main/org/jboss/portal/test/framework/runner/
trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java
Removed:
trunk/cms/src/main/org/jboss/portal/test/cms/clustering/CMSTestSuite.java
trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileModSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jTestSuite.java
trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTest.java
trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java
trunk/server/src/main/org/jboss/portal/test/server/charset/CharsetTestSuite.java
trunk/server/src/main/org/jboss/portal/test/server/parameters/ParametersTestSuite.java
trunk/server/src/main/org/jboss/portal/test/server/servlet/ServletTestSuite.java
trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java
trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgentFactory.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestRunner.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestSuite.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/ClientCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoGetCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoPostCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/EndCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/RethrowCommand.java
trunk/test/src/main/org/jboss/portal/test/framework/container/result/AssertResult.java
trunk/test/src/main/org/jboss/portal/test/framework/container/result/EndTestResult.java
trunk/test/src/main/org/jboss/portal/test/framework/container/result/FailureResult.java
trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokeGetResult.java
trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokePostResult.java
trunk/test/src/main/org/jboss/portal/test/framework/container/result/Result.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunnerServlet.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestRunner.java
trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/
Modified:
trunk/common/build.xml
trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java
trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java
trunk/common/src/main/org/jboss/portal/common/util/Tools.java
trunk/portlet/build.xml
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Sequence.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistryBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java
trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml
trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml
trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
trunk/server/build.xml
trunk/server/src/main/org/jboss/portal/test/server/AbstractTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java
trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java
trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java
trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java
trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java
trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java
trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java
trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
trunk/test/build.xml
trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.java
trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLookup.java
trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookup.java
trunk/test/src/main/org/jboss/portal/test/framework/TestRuntimeContext.java
trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgent.java
trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgentMBean.java
trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgent.java
trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java
trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployment.java
trunk/test/src/main/org/jboss/portal/test/framework/server/Node.java
trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
trunk/tools/etc/buildfragments/modules.ent
trunk/tools/lib/explode.jar
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPProducerBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
initial refactor of the test framework
Deleted: trunk/cms/src/main/org/jboss/portal/test/cms/clustering/CMSTestSuite.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/clustering/CMSTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/clustering/CMSTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,46 +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.cms.clustering;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-import org.jboss.portal.test.framework.server.NodeId;
-
-/** @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a> */
-public class CMSTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-cms-cluster.war", new NodeId[]{NodeId.PORTS_01, NodeId.PORTS_02});
-
- //adding file create,update,delete operations in a cluster
- suite.addTest(new TestCase(NodeId.PORTS_01, "testFileUpdate"));
- suite.addTest(new TestCase(NodeId.PORTS_01, "testFileDelete"));
-
- //adding folder create,update,delete operations in a cluster
-
-
- return suite;
- }
-}
Added: trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileDeleteTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,274 @@
+/******************************************************************************
+ * 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.cms.clustering;
+
+import org.jboss.portal.test.server.AbstractTest;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.AbstractServerURL;
+import org.jboss.portal.cms.CMS;
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.impl.FileImpl;
+import org.jboss.portal.cms.impl.ContentImpl;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.model.Content;
+
+import java.util.Locale;
+import java.net.MalformedURLException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class FileDeleteTest extends AbstractTest
+{
+
+
+ public FileDeleteTest()
+ {
+ super("FileDelete", "/test");
+ }
+
+ /** . */
+ private String sFilePath = "/index.html";
+
+ /** . */
+ private CMS service;
+
+ public CMS getService()
+ {
+ return service;
+ }
+
+ public void setService(CMS service)
+ {
+// MBeanServer server = MBeanServerLocator.locateJBoss();
+// service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
+// ExtendedAssert.assertNotNull(service);
+ this.service = service;
+ }
+
+ public DriverResponse execute(ServerInvocation invocation)
+ {
+ try
+ {
+ if (HttpTestContext.isCurrentRequestCount(0) && NodeId.PORTS_01.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Performing SetUp on..." + NodeId.PORTS_01 + "(createTestFileDelete)");
+ System.out.println("-------------------------------------------------------");
+
+ try
+ {
+ Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
+ Object o = service.execute(getCommand);
+ if (o == null)
+ {
+ createFile(service);
+ }
+
+ //assert this test
+ o = service.execute(getCommand);
+ ExtendedAssert.assertNotNull(o);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return new FailureResponse(e.toString());
+ }
+
+ AbstractServerURL url = new AbstractServerURL();
+ url.setPortalRequestPath("/index.html");
+ String s = invocation.getResponse().encodeURL(url);
+ s = HttpTestContext.getCurrentContext().rewriteURLForNode(s, NodeId.PORTS_02);
+ return new InvokeGetResponse(s);
+ }
+ else if (HttpTestContext.isCurrentRequestCount(1) && NodeId.PORTS_02.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Performing SetUp on node..." + NodeId.PORTS_02 + "(createTestFileDelete)");
+ System.out.println("-------------------------------------------------------");
+
+ try
+ {
+ Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
+ Object o = service.execute(getCommand);
+
+ //assert this test
+ ExtendedAssert.assertNotNull(o);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return new FailureResponse(e.toString());
+ }
+
+ AbstractServerURL url = new AbstractServerURL();
+ url.setPortalRequestPath("/index.html");
+ String s = invocation.getResponse().encodeURL(url);
+ s = HttpTestContext.getCurrentContext().rewriteURLForNode(s, NodeId.PORTS_01);
+ return new InvokeGetResponse(s);
+ }
+ else if (HttpTestContext.isCurrentRequestCount(2) && NodeId.PORTS_01.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Performing FileDelete on..." + NodeId.PORTS_01 + "(createTestFileDelete)");
+ System.out.println("-------------------------------------------------------");
+
+
+ try
+ {
+ Command existsCommand = service.getCommandFactory().createItemExistsCommand(sFilePath);
+ Boolean exists = (Boolean)service.execute(existsCommand);
+ if (exists.booleanValue())
+ {
+ //delete the file
+ Command deleteCMD = service.getCommandFactory().createDeleteCommand(sFilePath);
+ service.execute(deleteCMD);
+
+ //assert and make sure the changes specified took effect
+ Command existsCMD = service.getCommandFactory().createItemExistsCommand(sFilePath);
+ Boolean existsCheck = (Boolean)service.execute(existsCMD);
+ ExtendedAssert.assertFalse(existsCheck.booleanValue());
+ }
+ else
+ {
+ System.out.println("The content was not successfully created");
+ ExtendedAssert.assertTrue("The content was not successfully created", exists.booleanValue());
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return new FailureResponse(e.toString());
+ }
+
+ AbstractServerURL url = new AbstractServerURL();
+ url.setPortalRequestPath("/index.html");
+ String s = invocation.getResponse().encodeURL(url);
+ s = HttpTestContext.getCurrentContext().rewriteURLForNode(s, NodeId.PORTS_02);
+ return new InvokeGetResponse(s);
+ }
+ else if (HttpTestContext.isCurrentRequestCount(3) && NodeId.PORTS_02.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Checking FileDelete on node..." + NodeId.PORTS_02 + "(createTestFileDelete)");
+ System.out.println("-------------------------------------------------------");
+
+ try
+ {
+ //delete the file
+ Command deleteCMD = service.getCommandFactory().createDeleteCommand(sFilePath);
+ service.execute(deleteCMD);
+
+ //assert and make sure the changes specified took effect
+ Command existsCMD = service.getCommandFactory().createItemExistsCommand(sFilePath);
+ Boolean existsCheck = (Boolean)service.execute(existsCMD);
+ ExtendedAssert.assertFalse("File delete on Node-1 not successfully propagated to Node-2", existsCheck.booleanValue());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return new FailureResponse(e.toString());
+ }
+
+ return new EndTestResponse();
+ }
+ else
+ {
+ return new ErrorResponse();
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+
+ /**
+ *
+ *
+ */
+ private void createFile(CMS service)
+ {
+ try
+ {
+ System.out.println("Creating content for...." + sFilePath);
+
+ //create this content first
+ // create file english
+ File file = new FileImpl();
+ file.setBasePath(sFilePath);
+
+ Content content = new ContentImpl();
+ content.setEncoding("UTF-8");
+ content.setTitle("English Title");
+ content.setDescription("English Description");
+ content.setBasePath(sFilePath + "/" + Locale.ENGLISH.getLanguage());
+ content.setBytes("1234567890".getBytes());
+ content.setMimeType("text/html");
+ file.setContent(Locale.ENGLISH, content);
+
+ // save english file
+ Command saveFileCMD = service.getCommandFactory().createFileSaveCommand(file);
+ service.execute(saveFileCMD);
+
+ //save english content
+ Command saveContentCMD = service.getCommandFactory().createContentSaveCommand(file);
+ service.execute(saveContentCMD);
+
+ // version the english content node
+ Command verCMD = service.getCommandFactory().createContentCreateNewVersionCommand(content, true);
+ service.execute(verCMD);
+
+ // create content spanish
+ Content contentSP = new ContentImpl();
+ contentSP.setEncoding("UTF-8");
+ contentSP.setTitle("Spanish Title");
+ contentSP.setDescription("Spanish Description");
+ contentSP.setBasePath(sFilePath + "/es");
+ contentSP.setBytes("0987654321".getBytes());
+ contentSP.setMimeType("text/html");
+ file.setContent(new Locale("es"), contentSP);
+
+ //save spanish content
+ Command saveSPContentCMD = service.getCommandFactory().createContentSaveCommand(file);
+ service.execute(saveSPContentCMD);
+
+ // version the spanish content node
+ Command verSPCMD = service.getCommandFactory().createContentCreateNewVersionCommand(contentSP, true);
+ service.execute(verSPCMD);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Deleted: trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileModSequenceBuilder.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileModSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileModSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,497 +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.cms.clustering;
-
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.cms.CMS;
-import org.jboss.portal.cms.Command;
-import org.jboss.portal.cms.impl.ContentImpl;
-import org.jboss.portal.cms.impl.FileImpl;
-import org.jboss.portal.cms.model.Content;
-import org.jboss.portal.cms.model.File;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
-import org.jboss.portal.test.framework.portlet.Sequence;
-import org.jboss.portal.test.framework.portlet.SequenceRegistry;
-import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.universal.UTP1;
-import org.jboss.portal.test.framework.server.NodeId;
-
-import javax.management.MBeanServer;
-import javax.portlet.Portlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.io.IOException;
-import java.util.Locale;
-
-
-/** @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a> */
-public class FileModSequenceBuilder extends SequenceRegistryBuilder
-{
- /**
- *
- */
- private String sFilePath = "/index.html";
-
- /**
- *
- *
- */
- public void createTestFileUpdate(SequenceRegistry registry)
- {
- Sequence seq = new Sequence();
- registry.addSequence("testFileUpdate", seq);
-
- seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Performing SetUp on..." + NodeId.PORTS_01 + "(createTestFileUpdate)");
- System.out.println("-------------------------------------------------------");
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
- Object o = service.execute(getCommand);
- if (o != null)
- {
- //this file exists delete it from the system before executing this testcase
- Command delete = service.getCommandFactory().createDeleteCommand(sFilePath);
- service.execute(delete);
- }
-
- createFile(service);
-
-
- o = service.execute(getCommand);
- //assert this test
- assertNotNull(o);
- System.out.println("-------------------------------------------------------");
- System.out.println("Content Description Before Update=" + ((File)o).getContent().getDescription());
- System.out.println("Live version Before Update=" + ((File)o).getContent().getVersionNumber());
- System.out.println("-------------------------------------------------------");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
-
- PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
- return new InvokeGetResult(url);
- }
- });
- seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Performing SetUp on node..." + NodeId.PORTS_02 + "(createTestFileUpdate)");
- System.out.println("-------------------------------------------------------");
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
- Object o = service.execute(getCommand);
-
- //assert this test
- assertNotNull(o);
- if (o != null)
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Content Description Before Update=" + ((File)o).getContent().getDescription());
- System.out.println("Content Description Before Update=" + ((File)o).getContent().getVersionNumber());
- System.out.println("-------------------------------------------------------");
- }
- else
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("File Not Found on this node " + sFilePath);
- System.out.println("-------------------------------------------------------");
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
- PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_01);
- return new InvokeGetResult(url);
- }
- });
- seq.addAction(2, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Performing FileUpdate on..." + NodeId.PORTS_01 + "(createTestFileUpdate)");
- System.out.println("-------------------------------------------------------");
-
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- Command existsCommand = service.getCommandFactory().createItemExistsCommand(sFilePath);
- Boolean exists = (Boolean)service.execute(existsCommand);
- if (exists.booleanValue())
- {
- //update the selected file
- Command getCMD = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
- File newfile = (File)service.execute(getCMD);
- Content content = newfile.getContent();
- content.setDescription("New English Description");
- newfile.setContent(content.getLocale(), content);
- //Command cmdUpdate = service.getCommandFactory().createFileUpdateCommand(newfile);
- Command cmdUpdate = service.getCommandFactory().createUpdateFileCommand(newfile, content, true);
- service.execute(cmdUpdate);
-
-
- newfile = (File)service.execute(getCMD);
-
- //assert and make sure the changes specified took effect
- assertEquals(newfile.getContent().getDescription(), "New English Description");
-
- System.out.println("-------------------------------------------");
- System.out.println("Content Description After Update =" + newfile.getContent().getDescription());
- System.out.println("Live Version After Update =" + newfile.getContent().getVersionNumber());
- System.out.println("-------------------------------------------");
- }
- else
- {
- System.out.println("The content was not successfully created");
- assertTrue("The content was not successfully created", exists.booleanValue());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
-
- PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
- return new InvokeGetResult(url);
- }
- });
- seq.addAction(3, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Checking FileUpdate on node..." + NodeId.PORTS_02 + "(createTestFileUpdate)");
- System.out.println("-------------------------------------------------------");
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- Command getCMD = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
- File file = (File)service.execute(getCMD);
-
- if (file != null)
- {
- System.out.println("-------------------------------------------");
- System.out.println("Content Description After Update =" + file.getContent().getDescription());
- System.out.println("Live Version After Update =" + file.getContent().getVersionNumber());
- System.out.println("-------------------------------------------");
- }
- else
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("File Not Found on this node " + sFilePath);
- System.out.println("-------------------------------------------------------");
- }
-
- assertEquals(file.getContent().getDescription(), "New English Description");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
- return new EndTestResult();
- }
- });
- }
-
- /**
- *
- *
- */
- public void createTestFileDelete(SequenceRegistry registry)
- {
- Sequence seq = new Sequence();
- registry.addSequence("testFileDelete", seq);
-
- seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Performing SetUp on..." + NodeId.PORTS_01 + "(createTestFileDelete)");
- System.out.println("-------------------------------------------------------");
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
- Object o = service.execute(getCommand);
- if (o == null)
- {
- createFile(service);
- }
-
- //assert this test
- o = service.execute(getCommand);
- assertNotNull(o);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
-
- PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
- return new InvokeGetResult(url);
- }
- });
- seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Performing SetUp on node..." + NodeId.PORTS_02 + "(createTestFileDelete)");
- System.out.println("-------------------------------------------------------");
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
- Object o = service.execute(getCommand);
-
- //assert this test
- assertNotNull(o);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
- PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_01);
- return new InvokeGetResult(url);
- }
- });
- seq.addAction(2, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Performing FileDelete on..." + NodeId.PORTS_01 + "(createTestFileDelete)");
- System.out.println("-------------------------------------------------------");
-
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- Command existsCommand = service.getCommandFactory().createItemExistsCommand(sFilePath);
- Boolean exists = (Boolean)service.execute(existsCommand);
- if (exists.booleanValue())
- {
- //delete the file
- Command deleteCMD = service.getCommandFactory().createDeleteCommand(sFilePath);
- service.execute(deleteCMD);
-
- //assert and make sure the changes specified took effect
- Command existsCMD = service.getCommandFactory().createItemExistsCommand(sFilePath);
- Boolean existsCheck = (Boolean)service.execute(existsCMD);
- assertFalse(existsCheck.booleanValue());
- }
- else
- {
- System.out.println("The content was not successfully created");
- assertTrue("The content was not successfully created", exists.booleanValue());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
-
- PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
- return new InvokeGetResult(url);
- }
- });
- seq.addAction(3, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
- {
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
- throws PortletException, PortletSecurityException, IOException
- {
- System.out.println("-------------------------------------------------------");
- System.out.println("Checking FileDelete on node..." + NodeId.PORTS_02 + "(createTestFileDelete)");
- System.out.println("-------------------------------------------------------");
-
- CMS service = null;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
- assertNotNull(service);
-
- //delete the file
- Command deleteCMD = service.getCommandFactory().createDeleteCommand(sFilePath);
- service.execute(deleteCMD);
-
- //assert and make sure the changes specified took effect
- Command existsCMD = service.getCommandFactory().createItemExistsCommand(sFilePath);
- Boolean existsCheck = (Boolean)service.execute(existsCMD);
- assertFalse("File delete on Node-1 not successfully propagated to Node-2", existsCheck.booleanValue());
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return new FailureResult(e.toString());
- }
-
- return new EndTestResult();
- }
- });
- }
-
- /**
- *
- *
- */
- private void createFile(CMS service)
- {
- try
- {
- System.out.println("Creating content for...." + sFilePath);
-
- //create this content first
- // create file english
- File file = new FileImpl();
- file.setBasePath(sFilePath);
-
- Content content = new ContentImpl();
- content.setEncoding("UTF-8");
- content.setTitle("English Title");
- content.setDescription("English Description");
- content.setBasePath(sFilePath + "/" + Locale.ENGLISH.getLanguage());
- content.setBytes("1234567890".getBytes());
- content.setMimeType("text/html");
- file.setContent(Locale.ENGLISH, content);
-
- // save english file
- Command saveFileCMD = service.getCommandFactory().createFileSaveCommand(file);
- service.execute(saveFileCMD);
-
- //save english content
- Command saveContentCMD = service.getCommandFactory().createContentSaveCommand(file);
- service.execute(saveContentCMD);
-
- // version the english content node
- Command verCMD = service.getCommandFactory().createContentCreateNewVersionCommand(content, true);
- service.execute(verCMD);
-
- // create content spanish
- Content contentSP = new ContentImpl();
- contentSP.setEncoding("UTF-8");
- contentSP.setTitle("Spanish Title");
- contentSP.setDescription("Spanish Description");
- contentSP.setBasePath(sFilePath + "/es");
- contentSP.setBytes("0987654321".getBytes());
- contentSP.setMimeType("text/html");
- file.setContent(new Locale("es"), contentSP);
-
- //save spanish content
- Command saveSPContentCMD = service.getCommandFactory().createContentSaveCommand(file);
- service.execute(saveSPContentCMD);
-
- // version the spanish content node
- Command verSPCMD = service.getCommandFactory().createContentCreateNewVersionCommand(contentSP, true);
- service.execute(verSPCMD);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-}
Added: trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileUpdateTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,321 @@
+/******************************************************************************
+ * 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.cms.clustering;
+
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.CMS;
+import org.jboss.portal.cms.impl.ContentImpl;
+import org.jboss.portal.cms.impl.FileImpl;
+import org.jboss.portal.cms.model.Content;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.test.server.AbstractTest;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.AbstractServerURL;
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.MBeanServerLocator;
+
+import javax.management.MBeanServer;
+import java.util.Locale;
+import java.net.MalformedURLException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class FileUpdateTest extends AbstractTest
+{
+
+
+ public FileUpdateTest()
+ {
+ super("", "");
+ }
+
+ /** . */
+ private String sFilePath = "/index.html";
+
+ /** . */
+ private CMS service;
+
+ public CMS getService()
+ {
+ return service;
+ }
+
+ public void setService(CMS service)
+ {
+// MBeanServer server = MBeanServerLocator.locateJBoss();
+// service = (CMS)MBeanProxyExt.create(CMS.class, "portal:service=CMS", server);
+// ExtendedAssert.assertNotNull(service);
+ this.service = service;
+ }
+
+ public DriverResponse execute(ServerInvocation invocation)
+ {
+ try
+ {
+ if (HttpTestContext.isCurrentRequestCount(0) && NodeId.PORTS_01.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Performing SetUp on..." + NodeId.PORTS_01 + "(createTestFileUpdate)");
+ System.out.println("-------------------------------------------------------");
+
+ try
+ {
+ Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
+ Object o = service.execute(getCommand);
+ if (o != null)
+ {
+ //this file exists delete it from the system before executing this testcase
+ Command delete = service.getCommandFactory().createDeleteCommand(sFilePath);
+ service.execute(delete);
+ }
+
+ createFile(service);
+
+
+ o = service.execute(getCommand);
+ //assert this test
+ ExtendedAssert.assertNotNull(o);
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Content Description Before Update=" + ((File)o).getContent().getDescription());
+ System.out.println("Live version Before Update=" + ((File)o).getContent().getVersionNumber());
+ System.out.println("-------------------------------------------------------");
+ }
+ catch (Exception e)
+ {
+ return new FailureResponse(e);
+ }
+
+ AbstractServerURL url = new AbstractServerURL();
+ url.setPortalRequestPath("/index.html");
+ String s = invocation.getResponse().encodeURL(url);
+ s = HttpTestContext.getCurrentContext().rewriteURLForNode(s, NodeId.PORTS_02);
+ return new InvokeGetResponse(s);
+ }
+ else if (HttpTestContext.isCurrentRequestCount(1) && NodeId.PORTS_02.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Performing SetUp on node..." + NodeId.PORTS_02 + "(createTestFileUpdate)");
+ System.out.println("-------------------------------------------------------");
+
+ try
+ {
+ Command getCommand = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
+ Object o = service.execute(getCommand);
+
+ //assert this test
+ ExtendedAssert.assertNotNull(o);
+ if (o != null)
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Content Description Before Update=" + ((File)o).getContent().getDescription());
+ System.out.println("Content Description Before Update=" + ((File)o).getContent().getVersionNumber());
+ System.out.println("-------------------------------------------------------");
+ }
+ else
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("File Not Found on this node " + sFilePath);
+ System.out.println("-------------------------------------------------------");
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return new FailureResponse(e.toString());
+ }
+
+ AbstractServerURL url = new AbstractServerURL();
+ url.setPortalRequestPath("/index.html");
+ String s = invocation.getResponse().encodeURL(url);
+ s = HttpTestContext.getCurrentContext().rewriteURLForNode(s, NodeId.PORTS_01);
+ return new InvokeGetResponse(s);
+ }
+ else if (HttpTestContext.isCurrentRequestCount(2) && NodeId.PORTS_01.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Performing FileUpdate on..." + NodeId.PORTS_01 + "(createTestFileUpdate)");
+ System.out.println("-------------------------------------------------------");
+
+
+ try
+ {
+ Command existsCommand = service.getCommandFactory().createItemExistsCommand(sFilePath);
+ Boolean exists = (Boolean)service.execute(existsCommand);
+ if (exists.booleanValue())
+ {
+ //update the selected file
+ Command getCMD = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
+ File newfile = (File)service.execute(getCMD);
+ Content content = newfile.getContent();
+ content.setDescription("New English Description");
+ newfile.setContent(content.getLocale(), content);
+ //Command cmdUpdate = service.getCommandFactory().createFileUpdateCommand(newfile);
+ Command cmdUpdate = service.getCommandFactory().createUpdateFileCommand(newfile, content, true);
+ service.execute(cmdUpdate);
+
+
+ newfile = (File)service.execute(getCMD);
+
+ //assert and make sure the changes specified took effect
+ ExtendedAssert.assertEquals(newfile.getContent().getDescription(), "New English Description");
+
+ System.out.println("-------------------------------------------");
+ System.out.println("Content Description After Update =" + newfile.getContent().getDescription());
+ System.out.println("Live Version After Update =" + newfile.getContent().getVersionNumber());
+ System.out.println("-------------------------------------------");
+ }
+ else
+ {
+ System.out.println("The content was not successfully created");
+ ExtendedAssert.assertTrue("The content was not successfully created", exists.booleanValue());
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return new FailureResponse(e.toString());
+ }
+
+
+ AbstractServerURL url = new AbstractServerURL();
+ url.setPortalRequestPath("/index.html");
+ String s = invocation.getResponse().encodeURL(url);
+ s = HttpTestContext.getCurrentContext().rewriteURLForNode(s, NodeId.PORTS_02);
+ return new InvokeGetResponse(s);
+ }
+ else if (HttpTestContext.isCurrentRequestCount(3) && NodeId.PORTS_02.equals(NodeId.locate()))
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("Checking FileUpdate on node..." + NodeId.PORTS_02 + "(createTestFileUpdate)");
+ System.out.println("-------------------------------------------------------");
+
+ try
+ {
+ Command getCMD = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
+ File file = (File)service.execute(getCMD);
+
+ if (file != null)
+ {
+ System.out.println("-------------------------------------------");
+ System.out.println("Content Description After Update =" + file.getContent().getDescription());
+ System.out.println("Live Version After Update =" + file.getContent().getVersionNumber());
+ System.out.println("-------------------------------------------");
+ }
+ else
+ {
+ System.out.println("-------------------------------------------------------");
+ System.out.println("File Not Found on this node " + sFilePath);
+ System.out.println("-------------------------------------------------------");
+ }
+
+ ExtendedAssert.assertEquals(file.getContent().getDescription(), "New English Description");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return new FailureResponse(e.toString());
+ }
+
+ return new EndTestResponse();
+ }
+ else
+ {
+ return new ErrorResponse();
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+
+ /**
+ *
+ *
+ */
+ private void createFile(CMS service)
+ {
+ try
+ {
+ System.out.println("Creating content for...." + sFilePath);
+
+ //create this content first
+ // create file english
+ File file = new FileImpl();
+ file.setBasePath(sFilePath);
+
+ Content content = new ContentImpl();
+ content.setEncoding("UTF-8");
+ content.setTitle("English Title");
+ content.setDescription("English Description");
+ content.setBasePath(sFilePath + "/" + Locale.ENGLISH.getLanguage());
+ content.setBytes("1234567890".getBytes());
+ content.setMimeType("text/html");
+ file.setContent(Locale.ENGLISH, content);
+
+ // save english file
+ Command saveFileCMD = service.getCommandFactory().createFileSaveCommand(file);
+ service.execute(saveFileCMD);
+
+ //save english content
+ Command saveContentCMD = service.getCommandFactory().createContentSaveCommand(file);
+ service.execute(saveContentCMD);
+
+ // version the english content node
+ Command verCMD = service.getCommandFactory().createContentCreateNewVersionCommand(content, true);
+ service.execute(verCMD);
+
+ // create content spanish
+ Content contentSP = new ContentImpl();
+ contentSP.setEncoding("UTF-8");
+ contentSP.setTitle("Spanish Title");
+ contentSP.setDescription("Spanish Description");
+ contentSP.setBasePath(sFilePath + "/es");
+ contentSP.setBytes("0987654321".getBytes());
+ contentSP.setMimeType("text/html");
+ file.setContent(new Locale("es"), contentSP);
+
+ //save spanish content
+ Command saveSPContentCMD = service.getCommandFactory().createContentSaveCommand(file);
+ service.execute(saveSPContentCMD);
+
+ // version the spanish content node
+ Command verSPCMD = service.getCommandFactory().createContentCreateNewVersionCommand(contentSP, true);
+ service.execute(verSPCMD);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Modified: trunk/common/build.xml
===================================================================
--- trunk/common/build.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/build.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -192,6 +192,12 @@
<execute-tests>
+<!--
+ <x-sysproperty>
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
+ </x-sysproperty>
+-->
<x-test>
<!--
<zest todir="." name="org.jboss.portal.common.junit.ConfigurableTestCase">
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,14 +23,12 @@
package org.jboss.portal.common.junit.ant;
import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
-import org.apache.tools.ant.types.Environment;
import org.jboss.portal.common.junit.ant.ConfigurableJUnitTask;
import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.ObjectOutputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.File;
import java.io.FileOutputStream;
@@ -69,7 +67,23 @@
for (int i = 0; i < nestedParameters.size(); i++)
{
TestParameter parameter = (TestParameter)nestedParameters.get(i);
- parameters.put(parameter.getName(), parameter.getValue());
+ String[] values = null;
+ if (parameter.value != null)
+ {
+ values = new String[]{parameter.value};
+ }
+ else if (parameter.nestedValues.size() > 0)
+ {
+ values = new String[parameter.nestedValues.size()];
+ for (int j = 0;j < values.length;j++)
+ {
+ values[j] = ((TestParameterValue)parameter.nestedValues.get(j)).text;
+ }
+ }
+ if (values != null)
+ {
+ parameters.put(parameter.name, values);
+ }
}
File tmp = new File(System.getProperty("java.io.tmpdir"), "junit.parameters");
tmp.deleteOnExit();
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,10 +24,12 @@
import java.util.Map;
import java.util.Iterator;
+import java.util.ArrayList;
import java.io.ObjectInputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -37,45 +39,50 @@
{
/** . */
- private String name;
+ protected String name;
/** . */
- private String value;
+ protected String value;
- public String getName()
- {
- return name;
- }
+ /** . */
+ protected ArrayList nestedValues = new ArrayList();
public void setName(String name)
{
this.name = name;
}
- public String getValue()
+ public void setValue(String value)
{
- return value;
+ this.value = value;
}
- public void setValue(String value)
+ public void addValue(TestParameterValue value)
{
- this.value = value;
+ nestedValues.add(value);
}
- public static Map readExternalParameters() throws Exception
+ public static Map readExternalParameters()
{
- File tmp = new File(System.getProperty("java.io.tmpdir"), "junit.parameters");
- if (tmp.exists() && tmp.isFile())
+ try
{
- FileInputStream fis = new FileInputStream(tmp);
- ObjectInputStream ois = new ObjectInputStream(fis);
- Map parameters = (Map)ois.readObject();
- ois.close();
- return parameters;
+ File tmp = new File(System.getProperty("java.io.tmpdir"), "junit.parameters");
+ if (tmp.exists() && tmp.isFile())
+ {
+ FileInputStream fis = new FileInputStream(tmp);
+ ObjectInputStream ois = new ObjectInputStream(fis);
+ Map parameters = (Map)ois.readObject();
+ ois.close();
+ return parameters;
+ }
+ else
+ {
+ return null;
+ }
}
- else
+ catch (Exception e)
{
- return null;
+ throw new Error(e);
}
}
}
Added: trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.common.junit.ant;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestParameterValue
+{
+
+ /** . */
+ protected String text;
+
+ public void addText(String text)
+ {
+ this.text = text;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameter.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameter.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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.common.test;
+
+/**
+ * A simple value.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MonoValuedTestParameter extends TestParameterValue
+{
+
+ /** . */
+ protected final Object value;
+
+ public MonoValuedTestParameter(Object value)
+ {
+ this.value = value;
+ }
+
+ public Object get()
+ {
+ return value;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameter.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameter.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.test;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * A multi valueed.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MultiValuedTestParameter extends TestParameterValue
+{
+
+ /** . */
+ protected final Collection value;
+
+ public MultiValuedTestParameter(Collection value)
+ {
+ if (value == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.value = value;
+ }
+
+ public Object get()
+ {
+ return value;
+ }
+
+ public Iterator iterator()
+ {
+ return new Iterator()
+ {
+ Iterator i = value.iterator();
+ public boolean hasNext()
+ {
+ return i.hasNext();
+ }
+ public Object next()
+ {
+ return new MonoValuedTestParameter(i.next());
+ }
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * 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.common.test;
+
+import java.io.Serializable;
+
+/**
+ * The value of a test parameter.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class TestParameterValue implements Serializable
+{
+ public abstract Object get();
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,148 @@
+/******************************************************************************
+ * 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.common.test;
+
+import org.jboss.portal.common.test.info.TestInfo;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Collection;
+import java.io.Serializable;
+
+/**
+ * The parametrization of a test.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestParametrization implements Serializable
+{
+
+ /** . */
+ private Map parameterValues;
+
+ public TestParametrization()
+ {
+ parameterValues = new HashMap();
+ }
+
+ private TestParametrization(Map parameterValues)
+ {
+ this.parameterValues = parameterValues;
+ }
+
+ public void setParameterValue(String parameterName, Object parameterValue)
+ {
+ if (parameterName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (parameterValue == null)
+ {
+ parameterValues.remove(parameterName);
+ }
+ else
+ {
+ parameterValues.put(parameterName, parameterValue);
+ }
+ }
+
+ public Object getParameterValue(String parameterName)
+ {
+ if (parameterName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return parameterValues.get(parameterName);
+ }
+
+ /**
+ * Build a collection of parametrization that satisfies the parameters exposed by the test
+ * meta information and the parameter provided by the map.
+ */
+ public static Collection createParametrizations(TestInfo info, Map parameterMap)
+ {
+ ArrayList c = new ArrayList();
+ c.add(new HashMap());
+
+ Set expectedParameters = new HashSet(info.getParameterNames());
+
+ //
+ for (Iterator i = parameterMap.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String parameterName = (String)entry.getKey();
+ TestParameterValue value = (TestParameterValue)entry.getValue();
+
+ //
+ if (expectedParameters.contains(parameterName))
+ {
+ expectedParameters.remove(parameterName);
+
+ //
+ if (value instanceof MultiValuedTestParameter)
+ {
+ MultiValuedTestParameter multiValue = (MultiValuedTestParameter)value;
+ ArrayList tmp = new ArrayList();
+ for (Iterator j = multiValue.iterator();j.hasNext();)
+ {
+ TestParameterValue o = (TestParameterValue)j.next();
+ ArrayList copy = new ArrayList(c.size());
+ for (Iterator k = c.iterator();k.hasNext();)
+ {
+ Map parametrization = (Map)k.next();
+ parametrization = new HashMap(parametrization);
+ parametrization.put(parameterName, o);
+ copy.add(parametrization);
+ }
+ tmp.addAll(copy);
+ }
+ c = tmp;
+ }
+ else
+ {
+ for (int j = 0; j < c.size(); j++)
+ {
+ Map parametrization = (Map)c.get(j);
+ parametrization.put(parameterName, value);
+ }
+ }
+ }
+ }
+
+ //
+ for (int i = 0;i < c.size();i++)
+ {
+ Map parametrization = (Map)c.get(i);
+ TestParametrization ctx = new TestParametrization(parametrization);
+ c.set(i, ctx);
+ }
+
+ //
+ return c;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.common.test.driver;
+
+import java.io.Serializable;
+
+/**
+ * The command in the test protocol.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DriverCommand implements Serializable
+{
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.common.test.driver;
+
+import java.io.Serializable;
+
+/**
+ * The response in the test protocol.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public abstract class DriverResponse implements Serializable
+{
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.common.test.driver;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ParameterNotBoundException extends TestDriverException
+{
+ public ParameterNotBoundException(String parameterName)
+ {
+ super("Parameter " + parameterName + " not bound");
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.common.test.driver;
+
+import org.jboss.portal.common.test.info.TestItemInfo;
+
+/**
+ * The contract that defines what a test is.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface TestDriver
+{
+ /**
+ * Returns the meta information exposed by the driver.
+ */
+ TestItemInfo getInfo();
+
+ /**
+ * Execute a command of the testing protocol.
+ */
+ DriverResponse invoke(DriverCommand command) throws TestDriverException;
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.test.driver;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestDriverException extends Exception
+{
+ public TestDriverException()
+ {
+ }
+
+ public TestDriverException(String message)
+ {
+ super(message);
+ }
+
+ public TestDriverException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public TestDriverException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.common.test.driver.command;
+
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.TestParametrization;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class StartTestCommand extends DriverCommand
+{
+
+ /** . */
+ private String testName;
+
+ /** . */
+ private TestParametrization parametrization;
+
+ public StartTestCommand(String testName, TestParametrization parametrization)
+ {
+ if (testName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (parametrization == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.testName = testName;
+ this.parametrization = parametrization;
+ }
+
+ public String getTestName()
+ {
+ return testName;
+ }
+
+ public TestParametrization getParametrization()
+ {
+ return parametrization;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.test.driver.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class EndTestResponse extends DriverResponse
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5213703287701969049L;
+
+ public EndTestResponse()
+ {
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.common.test.driver.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ErrorResponse extends DriverResponse
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -7343495299222478388L;
+
+ /** . */
+ private Throwable throwable;
+
+ public ErrorResponse()
+ {
+ this(new Exception());
+ }
+
+ public ErrorResponse(String msg)
+ {
+ this(new AssertionFailedError(msg));
+ }
+
+ public ErrorResponse(Throwable throwable)
+ {
+ if (throwable == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.throwable = throwable;
+ }
+
+ public Throwable getThrowable()
+ {
+ return throwable;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.common.test.driver.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class FailureResponse extends DriverResponse
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -7343495299222478388L;
+
+ /** . */
+ private Throwable throwable;
+
+ public FailureResponse()
+ {
+ this(new AssertionFailedError());
+ }
+
+ public FailureResponse(String msg)
+ {
+ this(new AssertionFailedError(msg));
+ }
+
+ public FailureResponse(Throwable throwable)
+ {
+ if (throwable == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.throwable = throwable;
+ }
+
+ public Throwable getThrowable()
+ {
+ return throwable;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,145 @@
+/******************************************************************************
+ * 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.common.test.info;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestContainerInfo extends TestItemInfo
+{
+
+ /** . */
+ private final Map children;
+
+ public TestContainerInfo(String name)
+ {
+ this(name, null);
+ }
+
+ public TestContainerInfo(String name, String description)
+ {
+ super(name, description);
+ this.children = new HashMap();
+ }
+
+ public TestContainerInfo(TestContainerInfo that)
+ {
+ super(that);
+ this.children = new HashMap(that.children.size());
+ for (Iterator i = that.children.values().iterator();i.hasNext();)
+ {
+ TestItemInfo child = (TestItemInfo)i.next();
+ TestItemInfo childClone = child.createClone();
+ addChild(childClone);
+ }
+ }
+
+ public TestItemInfo createClone()
+ {
+ return new TestContainerInfo(this);
+ }
+
+ protected void internalVisit(Visitor visitor)
+ {
+ visitor.enter(this);
+
+ //
+ for (Iterator i = children.values().iterator();i.hasNext();)
+ {
+ TestItemInfo child = (TestItemInfo)i.next();
+ child.internalVisit(visitor);
+ }
+
+ //
+ visitor.leave(this);
+ }
+
+ public synchronized void addChild(TestItemInfo item)
+ {
+ if (item == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ // Perform attachment
+ children.put(item.getName(), item);
+ }
+
+ public TestItemInfo getChild(String childName)
+ {
+ if (childName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return (TestItemInfo)children.get(childName);
+ }
+
+ public Set getChildNames()
+ {
+ return children.keySet();
+ }
+
+ public TestItemInfo findItem(String itemName)
+ {
+ if (itemName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (getName().equals(itemName))
+ {
+ return this;
+ }
+ for (Iterator i = children.values().iterator();i.hasNext();)
+ {
+ TestItemInfo child = (TestItemInfo)i.next();
+ TestItemInfo item = child.findItem(itemName);
+ if (item != null)
+ {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer("TestContainerInfo[" + getName()).append(",");
+ for (Iterator i = children.values().iterator();i.hasNext();)
+ {
+ TestItemInfo child = (TestItemInfo)i.next();
+ buffer.append(child);
+ if (i.hasNext())
+ {
+ buffer.append(',');
+ }
+ }
+ buffer.append("]");
+ return buffer.toString();
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,110 @@
+/******************************************************************************
+ * 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.common.test.info;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.Iterator;
+
+/**
+ * Meta information that describe a test.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInfo extends TestItemInfo
+{
+
+ /** The parameters that the test requires. */
+ private final Map parameters;
+
+ public TestInfo(TestInfo that)
+ {
+ super(that);
+ this.parameters = new HashMap(that.parameters);
+ }
+
+ public TestInfo(String name)
+ {
+ this(name, null);
+ }
+
+ public TestInfo(String name, String description)
+ {
+ super(name, description);
+ this.parameters = new HashMap();
+ }
+
+ public TestItemInfo createClone()
+ {
+ return new TestInfo(this);
+ }
+
+
+ public void addParameter(TestParameterInfo parameter)
+ {
+ if (parameter == null)
+ {
+ throw new IllegalArgumentException("No null accepted");
+ }
+ if (parameters.containsKey(parameter.getName()))
+ {
+ throw new IllegalArgumentException("Duplicate parameter " + parameter.getName());
+ }
+ parameters.put(parameter.getName(), parameter);
+ }
+
+ public Set getParameterNames()
+ {
+ return parameters.keySet();
+ }
+
+ public TestParameterInfo getParameter(String parameterName)
+ {
+ if (parameterName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return (TestParameterInfo)parameters.get(parameterName);
+ }
+
+ public TestItemInfo findItem(String itemName)
+ {
+ if (itemName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return getName().equals(itemName) ? this : null;
+ }
+
+ protected void internalVisit(Visitor visitor)
+ {
+ visitor.visit(this);
+ }
+
+ public String toString()
+ {
+ return "TestInfo[" + getName() + "]";
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,120 @@
+/******************************************************************************
+ * 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.common.test.info;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class TestItemInfo implements Serializable
+{
+
+ /** The test name. */
+ private final String name;
+
+ /** The optional test description. */
+ private final String description;
+
+ public TestItemInfo(TestItemInfo that)
+ {
+ if (that == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.name = that.name;
+ this.description = that.description;
+ }
+
+ public TestItemInfo(String name)
+ {
+ this(name, null);
+ }
+
+ public TestItemInfo(String name, String description)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.name = name;
+ this.description = description;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public abstract TestItemInfo findItem(String itemId);
+
+ public abstract TestItemInfo createClone();
+
+ protected abstract void internalVisit(Visitor visitor);
+
+ public void visit(Visitor visitor)
+ {
+ if (visitor == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ internalVisit(visitor);
+ }
+
+ public interface Visitor
+ {
+ /**
+ *
+ */
+ void enter(TestContainerInfo testContainerInfo);
+
+ /**
+ *
+ */
+ void leave(TestContainerInfo testContainerInfo);
+
+ /**
+ *
+ */
+ void visit(TestInfo testInfo);
+ }
+
+ public static class AbstractVisitor implements Visitor
+ {
+ public void enter(TestContainerInfo testContainerInfo)
+ {
+ }
+ public void leave(TestContainerInfo testContainerInfo)
+ {
+ }
+ public void visit(TestInfo testInfo)
+ {
+ }
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.common.test.info;
+
+import java.io.Serializable;
+
+/**
+ * Meta information of a test parameter.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestParameterInfo implements Serializable
+{
+
+ /** The parameter name. */
+ private final String name;
+
+ /** The optional parameter description. */
+ private final String description;
+
+ public TestParameterInfo(String name)
+ {
+ this(name, null);
+ }
+
+ public TestParameterInfo(String name, String description)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.name = name;
+ this.description = description;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,155 @@
+/******************************************************************************
+ * 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.common.test.junit;
+
+import junit.framework.TestResult;
+import junit.framework.TestCase;
+import junit.framework.AssertionFailedError;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.MonoValuedTestParameter;
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.junit.ant.TestParameter;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.HashMap;
+
+/**
+ * An runner that adapts the <code>junit.framework.Test</code> interface to the
+ * <code>TestDriver</code> protocol.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitAdapter implements junit.framework.Test
+{
+
+ /** . */
+ private TestDriver driver;
+
+ /** . */
+ private Map parameterMap;
+
+ public JUnitAdapter(TestDriver test, Map parameterMap) throws Exception
+ {
+ this.driver = test;
+ this.parameterMap = parameterMap;
+ }
+
+ public JUnitAdapter(TestDriver test) throws Exception
+ {
+ this(test, Collections.EMPTY_MAP);
+ }
+
+ public int countTestCases()
+ {
+ return 1;
+ }
+
+ public void run(TestResult result)
+ {
+ try
+ {
+ TestItemInfo info = driver.getInfo();
+ run(info, result);
+ }
+ catch (final Exception e)
+ {
+ TestCase tc = new TestCase()
+ {
+ public void runBare() throws Throwable
+ {
+ throw e;
+ }
+ };
+ tc.run(result);
+ }
+ }
+
+ private void run(final TestItemInfo info, final TestResult result)
+ {
+ TestItemInfo.Visitor visitor = new TestItemInfo.AbstractVisitor()
+ {
+ public void visit(final TestInfo testInfo)
+ {
+ Collection contexts = TestParametrization.createParametrizations(testInfo, parameterMap);
+ for (Iterator i = contexts.iterator();i.hasNext();)
+ {
+ final TestParametrization parametrization = (TestParametrization)i.next();
+ TestCase tc = new TestCase(testInfo.getName())
+ {
+ public void runBare() throws Throwable
+ {
+ StartTestCommand st = new StartTestCommand(testInfo.getName(), parametrization);
+ DriverResponse resp = driver.invoke(st);
+ if (resp instanceof FailureResponse)
+ {
+ FailureResponse fr = (FailureResponse)resp;
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(fr.getThrowable());
+ throw afe;
+ }
+ else if (resp instanceof ErrorResponse)
+ {
+ ErrorResponse er = (ErrorResponse)resp;
+ throw er.getThrowable();
+ }
+ }
+ };
+ tc.run(result);
+ }
+ }
+ };
+ info.visit(visitor);
+ }
+
+ public static Map getParameterMap() throws Exception
+ {
+ Map parameterMap = TestParameter.readExternalParameters();
+ if (parameterMap == null)
+ {
+ parameterMap = Collections.EMPTY_MAP;
+ }
+ else
+ {
+ Map tmp = new HashMap();
+ for (Iterator i = parameterMap.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String parameterName = (String)entry.getKey();
+ String parameterValue = (String)entry.getValue();
+ tmp.put(parameterName, new MonoValuedTestParameter(parameterValue));
+ }
+ parameterMap = tmp;
+ }
+ return parameterMap;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,289 @@
+/******************************************************************************
+ * 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.common.test.junit;
+
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.common.test.info.TestParameterInfo;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestContainerInfo;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.TestParameterValue;
+import org.jboss.portal.common.test.driver.ParameterNotBoundException;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestSuite;
+
+/**
+ * Test an object based on junit infrastructure + some conventions.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJOJUnitTest implements TestDriver
+{
+
+ /** . */
+ private Class testClass;
+
+ /** . */
+ private TestContainerInfo containerInfo;
+
+ /** . */
+ private Map testMap;
+
+ /** . */
+ private Map setterMap;
+
+ /** . */
+ private Object test;
+
+ public POJOJUnitTest(Object test)
+ {
+ if (test == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.test = test;
+ this.testClass = test.getClass();
+ this.setterMap = new HashMap();
+ this.testMap = new HashMap();
+
+ //
+ buildInfo();
+ }
+
+ public POJOJUnitTest(Class testClass)
+ {
+ if (testClass == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.test = null;
+ this.testClass = testClass;
+ this.setterMap = new HashMap();
+ this.testMap = new HashMap();
+
+ //
+ buildInfo();
+ }
+
+ public TestItemInfo getInfo()
+ {
+ return containerInfo;
+ }
+
+ public DriverResponse invoke(DriverCommand command) throws TestDriverException
+ {
+ StartTestCommand start = (StartTestCommand)command;
+
+ try
+ {
+ // Reuse instance already provided if it exists otherwise instantiate it from class
+ Object test = this.test;
+ if (test == null)
+ {
+ test = testClass.newInstance();
+ }
+
+ // Get corresponding test info
+ TestInfo testInfo = (TestInfo)containerInfo.getChild(start.getTestName());
+
+ // Contextualize
+ TestParametrization parametrization = start.getParametrization();
+ for (Iterator i = testInfo.getParameterNames().iterator();i.hasNext();)
+ {
+ String parameterName = (String)i.next();
+ TestParameterValue value = (TestParameterValue)parametrization.getParameterValue(parameterName);
+ if (value == null)
+ {
+ throw new ParameterNotBoundException(parameterName);
+ }
+
+ // Bind parameter
+ Method setter = (Method)setterMap.get(parameterName);
+ if (setter != null)
+ {
+ setter.invoke(test, new Object[]{value.get()});
+ }
+ }
+
+ // Invoke setUp() if it exists
+ try
+ {
+ Method setUpMethod = testClass.getMethod("setUp", new Class[0]);
+ if (isInvokable(setUpMethod))
+ {
+ setUpMethod.invoke(test, new Object[0]);
+ }
+ }
+ catch (NoSuchMethodException ignore)
+ {
+ }
+
+ // Invoke test joinpoint
+ Method method = (Method)testMap.get(start.getTestName());
+ method.invoke(test, new Object[0]);
+ return new EndTestResponse();
+ }
+ catch (InstantiationException e)
+ {
+ return new ErrorResponse(e);
+ }
+ catch (IllegalAccessException e)
+ {
+ return new ErrorResponse(e);
+ }
+ catch (InvocationTargetException e)
+ {
+ Throwable cause = e.getCause();
+
+ //
+ if (cause instanceof AssertionFailedError)
+ {
+ return new FailureResponse(cause);
+ }
+ else
+ {
+ return new ErrorResponse(cause);
+ }
+ }
+ finally
+ {
+ // Invoke tearDown() if it exists
+ try
+ {
+ Method tearDown = testClass.getMethod("tearDown", new Class[0]);
+ if (isInvokable(tearDown))
+ {
+ tearDown.invoke(test, new Object[0]);
+ }
+ }
+ catch (NoSuchMethodException ignore)
+ {
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private void buildInfo()
+ {
+ TestContainerInfo containerInfo = new TestContainerInfo(testClass.getName());
+
+ //
+ try
+ {
+ Method[] methods = testClass.getMethods();
+ for (int j = 0; j < methods.length; j++)
+ {
+ Method method = methods[j];
+
+ //
+ if (isInvokable(method))
+ {
+ String methodName = method.getName();
+ if (methodName.startsWith("test") &&
+ method.getParameterTypes().length == 0)
+ {
+ TestInfo childInfo = new TestInfo(method.getName());
+ containerInfo.addChild(childInfo);
+ testMap.put(method.getName(), method);
+ }
+ else if (methodName.startsWith("set") &&
+ methodName.endsWith("Parameter") &&
+ method.getParameterTypes().length == 1 &&
+ String.class.equals(method.getParameterTypes()[0]))
+ {
+ String parameterName = methodName.substring(3, methodName.length() - 9);
+ setterMap.put(parameterName, method);
+ }
+ }
+ }
+
+ // Set all parameters on children
+ for (Iterator i = setterMap.keySet().iterator();i.hasNext();)
+ {
+ String parameterName = (String)i.next();
+ for (Iterator j = testMap.keySet().iterator();j.hasNext();)
+ {
+ String childName = (String)j.next();
+ TestInfo childInfo = (TestInfo)containerInfo.getChild(childName);
+ childInfo.addParameter(new TestParameterInfo(parameterName));
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException();
+ iae.initCause(e);
+ throw iae;
+ }
+
+ //
+ this.containerInfo = containerInfo;
+ }
+
+ /**
+ * Return true if the method is invokable.
+ */
+ private boolean isInvokable(Method m)
+ {
+ int modifiers = m.getModifiers();
+ return Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers);
+ }
+
+ public static TestSuite createTestSuite(Class testClass, Map parameterMap) throws Exception
+ {
+ TestSuite suite = new TestSuite();
+ POJOJUnitTest test = new POJOJUnitTest(testClass);
+ JUnitAdapter adapter = new JUnitAdapter(test, parameterMap);
+ suite.addTest(adapter);
+ return suite;
+ }
+
+ public static TestSuite createTestSuite(Class testClass) throws Exception
+ {
+ TestSuite suite = new TestSuite();
+ POJOJUnitTest test = new POJOJUnitTest(testClass);
+ JUnitAdapter adapter = new JUnitAdapter(test);
+ suite.addTest(adapter);
+ return suite;
+ }
+}
Modified: trunk/common/src/main/org/jboss/portal/common/util/Tools.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/Tools.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/common/src/main/org/jboss/portal/common/util/Tools.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -43,6 +43,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.URL;
import java.net.URLClassLoader;
@@ -688,6 +689,21 @@
return name;
}
+ public static String getPackageOf(Class clazz)
+ {
+ String name = clazz.getName();
+ int index = name.lastIndexOf('.');
+ if (index != -1)
+ {
+ name = name.substring(0, index);
+ }
+ else
+ {
+ name = "";
+ }
+ return name;
+ }
+
public static String buildClassLoaderInfo(ClassLoader loader)
{
if (loader == null)
@@ -867,4 +883,20 @@
return null;
}
}
+
+ public static Object[] appendTo(Object[] array, Object o)
+ {
+ if (array == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ Class componentType = array.getClass().getComponentType();
+ if (o != null && componentType.isAssignableFrom(o.getClass()))
+ {
+ throw new ClassCastException("Object with class " + o.getClass().getName() + " cannot be casted to class " + componentType.getComponentType().getName());
+ }
+ Object[] copy = (Object[])Array.newInstance(componentType, array.length + 1);
+ copy[array.length] = o;
+ return copy;
+ }
}
\ No newline at end of file
Modified: trunk/portlet/build.xml
===================================================================
--- trunk/portlet/build.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/build.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -190,20 +190,15 @@
<jar jarfile="${build.lib}/portal-portlet-lib.jar">
<fileset dir="${build.classes}">
<exclude name="org/jboss/portal/test/**"/>
- <exclude name="org/jboss/portal/tck/**"/>
+ <exclude name="org/jboss/portal/portlet/tck/**"/>
</fileset>
</jar>
<!-- Portlet test lib jar -->
<jar jarfile="${build.lib}/portal-portlet-test-lib.jar">
- <fileset dir="${build.classes}" includes="org/jboss/portal/portlet/test/**"/>
+ <fileset dir="${build.classes}" includes="org/jboss/portal/test/framework/portlet/**"/>
</jar>
- <!-- Portlet test framework lib jar...this is used by the cms clustering testcases -->
- <jar jarfile="${build.lib}/portal-portlet-testframework-lib.jar">
- <fileset dir="${build.classes}" includes="org/jboss/portal/test/framework/portlet/**"/>
- </jar>
-
<!-- Portlet tck lib jar -->
<jar jarfile="${build.lib}/portal-portlet-tck-lib.jar">
<fileset dir="${build.classes}" includes="org/jboss/portal/portlet/tck/**"/>
@@ -285,16 +280,6 @@
<!-- create artifacts for running the portlet tests (except TCK) target output should have already been executed -->
<target name="package-tests" depends="init">
- <!-- Portlet test lib jar -->
- <jar jarfile="${build.lib}/portal-portlet-test-lib.jar">
- <fileset dir="${build.classes}" includes="org/jboss/portal/portlet/test/**"/>
- </jar>
-
- <!-- Portlet tck lib jar -->
- <jar jarfile="${build.lib}/portal-portlet-tck-lib.jar">
- <fileset dir="${build.classes}" includes="org/jboss/portal/portlet/tck/**"/>
- </jar>
-
<!-- TCK sar -->
<copy todir="${build.resources}/tck-sar">
<fileset dir="${jboss.portal-common.root}/lib" includes="portal-common-lib.jar"/>
@@ -320,14 +305,16 @@
</jar>
<copy todir="${build.resources}/test-sar">
<fileset dir="${jboss.portal-common.root}/lib" includes="portal-common-lib.jar"/>
+ <fileset dir="${jboss.portal-test.lib}" includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib" includes="portal-jems-lib.jar"/>
<fileset dir="${jboss.portal-server.root}/lib" includes="portal-server-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib" includes="portal-server-test-lib.jar"/>
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib" includes="portlet-api-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib" includes="portal-api-lib.jar"/>
- <fileset dir="${jboss.portal-test.lib}" includes="portal-test-lib.jar"/>
<fileset dir="${junit.junit.lib}" includes="junit.jar"/>
- <fileset dir="${build.lib}" includes="portal-portlet-lib.jar,test.war"/>
+ <fileset dir="${build.lib}" includes="portal-portlet-lib.jar"/>
+ <fileset dir="${build.lib}" includes="test.war"/>
</copy>
<jar jarfile="${build.lib}/test.sar">
<fileset dir="${build.resources}/test-sar"/>
@@ -336,9 +323,12 @@
<fileset dir="${build.resources}/test/info/test-info-war"/>
</jar>
<jar jarfile="${build.lib}/test-info.sar">
+ <fileset dir="${junit.junit.lib}" includes="junit.jar"/>
+ <fileset dir="${jboss.portal-test.root}/lib" includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib" includes="portal-common-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib" includes="portal-jems-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib" includes="portal-server-lib.jar,portal-server-test-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib" includes="portal-server-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib" includes="portal-server-test-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib" includes="portlet-api-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib" includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
@@ -455,74 +445,53 @@
<x-sysproperty>
<sysproperty key="test.root" value="${build.lib}"/>
<sysproperty key="test.uri" value="/test/redirect/"/>
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+-->
</x-sysproperty>
<x-test>
+
<!--Spec TCK Assertions tests-->
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.dispatcher.DispatcherTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portletconfig.PortletConfigTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portletrequests.PortletRequestTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portletmode.PortletModeTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portletresponses.PortletResponsesTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.preferences.PreferencesTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portletsession.PortletSessionTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portletinterface.PortletInterfaceTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portleturl.PortletURLTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.windowstates.WindowStatesTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.tck.portletcontext.PortletContextTestSuite"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.DispatcherTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletConfigTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletContextTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletInterfaceTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletModeTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletRequestsTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletResponsesTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletSessionTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletURLTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PreferencesTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.WindowStatesTestCase"/>
+
<!--API Tests-->
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portletconfig.PortletConfigAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portletmode.PortletModeAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.windowstate.WindowStateAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portletsessionutil.PortletSessionUtilAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portalcontext.PortalContextAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portletcontext.PortletContextAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portleturl.PortletURLAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portletpreferences.PortletPreferencesAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.portletsession.PortletSessionAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.actionrequest.ActionRequestAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.renderrequest.RenderRequestAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.actionresponse.ActionResponseAPITestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.api.renderresponse.RenderResponseAPITestSuite"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.ActionRequestTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.ActionResponseTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortalContextTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortletConfigTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortletContextTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortletModeTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortletPreferencesTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortletSessionTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortletSessionUtilTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortletURLTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.RenderRequestTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.RenderResponseTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.WindowStateTestCase"/>
+
<!--Ext Tests-->
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.ext.preferences.PreferencesTestSuite"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.session.SessionTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.ext.portletresponses.PortletResponsesTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.ext.portletmode.PortletModeTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.ext.portletconfig.PortletConfigTestSuite"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherTestSuite"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.DispatcherTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PortletConfigTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PortletModeTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PortletRequestsTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PortletResponsesTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PreferencesTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.SessionTestCase"/>
+
<!--Misc Tests-->
- <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.misc.log4j.Log4jTestSuite"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.misc.Log4jTestCase"/>
+
</x-test>
<x-classpath>
<path refid="oswego.concurrent.classpath"/>
@@ -542,7 +511,7 @@
<target name="test-info" depends="init">
<execute-tests>
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.portlet.info.InfoTestSuite"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.info.InfoTestCase"/>
</x-test>
<x-sysproperty>
<sysproperty key="test.root" value="${build.lib}"/>
@@ -568,14 +537,10 @@
<execute-tests>
<x-test>
<test todir="${test.reports}" name="org.jboss.portal.test.portlet.deployment.UnmarshallerTestCase"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.state.LocalStoreProducerStatefulPortletInvokerTestCase"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.state.RemoteStoreProducerStatefulPortletInvokerTestCase"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.state.LocalStoreConsumerStatefulPortletInvokerTestCase"/>
- <test todir="${test.reports}"
- name="org.jboss.portal.test.portlet.state.RemoteStoreConsumerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.state.LocalStoreProducerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.state.RemoteStoreProducerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.state.LocalStoreConsumerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.state.RemoteStoreConsumerStatefulPortletInvokerTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.portlet.state.StateConverterV0TestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.portlet.PortletRequestDecoderTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.portlet.ParametersTestCase"/>
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -50,10 +50,16 @@
/** The namespace. */
protected String namespace;
+ /** Not really used but we need it to memorize what the client set optionally. */
+ protected int bufferSize;
+
public RenderResponseImpl(RenderInvocation invocation, PortletRequestImpl preq)
{
super(invocation, preq);
this.result = new FragmentResponse();
+
+ // 0 means no buffering - we say no buffering
+ this.bufferSize = 0;
}
public PortletInvocationResponse getResult()
@@ -146,15 +152,17 @@
return invocation.getUserContext().getLocale();
}
- public void setBufferSize(int i)
+ public void setBufferSize(int bufferSize)
{
- // Ignore it, it's just a wish
+ if (bufferSize >- 0)
+ {
+ this.bufferSize = bufferSize;
+ }
}
public int getBufferSize()
{
- // 0 means no buffering - we say no buffering
- return 0;
+ return bufferSize;
}
public void flushBuffer() throws IOException
@@ -170,7 +178,7 @@
public void reset()
{
// Clear the buffer
- result.resetBuffer();
+ resetBuffer();
// And properties
invocation.getContext().getAttributeResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE).getKeys().clear();
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -27,6 +27,7 @@
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.io.Writer;
/**
* Data produced.
@@ -45,10 +46,10 @@
private String header;
/** The output as a bytes if any. */
- private ByteArrayOutputStream bytes;
+ private ClosableOutputStream bytes;
/** The output as chars if any. */
- private StringWriter chars;
+ private ClosableWriter chars;
/** The writer that will produce the chars output if any. */
private PrintWriter writer;
@@ -114,7 +115,7 @@
{
throw new IllegalStateException("Bytes not used");
}
- return bytes;
+ return (ByteArrayOutputStream)bytes.out;
}
/**
@@ -129,7 +130,7 @@
{
throw new IllegalStateException("Chars not used");
}
- return chars;
+ return (StringWriter)chars.writer;
}
/**
@@ -185,7 +186,7 @@
}
if (chars == null)
{
- chars = new StringWriter();
+ chars = new ClosableWriter(new StringWriter());
writer = new PrintWriter(chars);
}
return writer;
@@ -207,7 +208,7 @@
}
if (bytes == null)
{
- bytes = new ByteArrayOutputStream();
+ bytes = new ClosableOutputStream(new ByteArrayOutputStream());
}
return bytes;
}
@@ -216,12 +217,21 @@
{
if (bytes != null)
{
- bytes.reset();
+ if (bytes.closed)
+ {
+ throw new IllegalStateException("Cannot reset a closed stream");
+ }
+ ((ByteArrayOutputStream)bytes.out).reset();
}
else if (chars != null)
{
- chars.flush();
- chars.getBuffer().setLength(0);
+ if (chars.closed)
+ {
+ throw new IllegalStateException("Cannot reset a closed writer");
+ }
+ StringWriter sw = (StringWriter)chars.writer;
+ sw.flush();
+ sw.getBuffer().setLength(0);
}
}
@@ -234,4 +244,144 @@
{
this.expirationSecs = expirationSecs;
}
+
+ private class ClosableOutputStream extends OutputStream
+ {
+
+ /** . */
+ boolean closed = false;
+
+ /** . */
+ final OutputStream out;
+
+ public ClosableOutputStream(OutputStream out)
+ {
+ this.out = out;
+ }
+
+
+ public void write(byte b[]) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed stream");
+ }
+
+ //
+ out.write(b);
+ }
+
+ public void write(byte b[], int off, int len) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed stream");
+ }
+
+ //
+ out.write(b);
+ }
+
+ public void write(int b) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed stream");
+ }
+
+ //
+ out.write(b);
+ }
+
+ public void flush() throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot flush a closed stream");
+ }
+
+ //
+ out.flush();
+ }
+
+ public void close() throws IOException
+ {
+ super.close();
+
+ //
+ closed = true;
+ }
+ }
+
+ /**
+ * Adds behavior to a writer that complies with JSR-168 notion of writer.
+ */
+ private class ClosableWriter extends Writer
+ {
+
+ /** . */
+ boolean closed = false;
+
+ /** . */
+ final Writer writer;
+
+ public ClosableWriter(Writer writer)
+ {
+ this.writer = writer;
+ }
+
+ public void write(int c) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed writer");
+ }
+
+ //
+ writer.write(c);
+ }
+
+
+ public void write(char cbuf[], int off, int len) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed writer");
+ }
+
+ //
+ writer.write(cbuf, off, len);
+ }
+
+
+ public void write(String str) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed writer");
+ }
+
+ //
+ writer.write(str);
+ }
+
+ public void flush() throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot flush closed writer");
+ }
+
+ //
+ writer.flush();
+ }
+
+ public void close() throws IOException
+ {
+ writer.close();
+
+ //
+ closed = true;
+ }
+ }
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -72,7 +72,7 @@
import org.jboss.portal.server.impl.MapAttributeResolver;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.server.util.HTTPStreamInfo;
-import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -123,7 +123,7 @@
public void handle(ServerInvocation invocation) throws ServerException
{
//
- if (TestCaseContext.isCurrentRequestCount(0))
+ if (HttpTestContext.isCurrentRequestCount(0))
{
invocation.getServerContext().getClientRequest().getSession().invalidate();
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.framework.portlet;
/**
- * Defines a binding point for component id and it's method
+ * Defines a binding point for component id and its method.
*
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision$
@@ -31,23 +31,25 @@
public class Joinpoint
{
- /** Id of component like "portlet A", "Servlet B". */
- private String id;
-
- /** method in component like "render" and etc. */
- private int point;
-
- /** The node id. */
- private String nodeId;
-
+ /** . */
public static int PORTLET_RENDER = 0;
+ /** . */
public static int PORTLET_ACTION = 1;
+ /** . */
//public static int PORTLET_INIT = 1;
+ /** . */
public static int SERVLET_SERVICE = 2;
+
+ /** Id of component like "portlet A", "Servlet B". */
+ private final String id;
+
+ /** method in component like "render" and etc. */
+ private final int point;
+
public Joinpoint(String id, int point)
{
if (id == null)
@@ -67,29 +69,11 @@
return id;
}
- public void setId(String id)
- {
- if (id == null)
- {
- throw new IllegalArgumentException("Component id value cannot be 'null'");
- }
- this.id = id;
- }
-
public int getPoint()
{
return point;
}
- public void setPoint(int point)
- {
- if (point < 0)
- {
- throw new IllegalArgumentException("Binding point has wrong value");
- }
- this.point = point;
- }
-
public int hashCode()
{
return id.hashCode() * point;
@@ -101,27 +85,13 @@
{
throw new IllegalArgumentException("Cannot compare with different object class");
}
-
-
Joinpoint j = (Joinpoint)obj;
-
- //System.out.println("%%%%%%%%%%Comparing: " + j.toString() + " to " + this.toString());
-
- if (id.equals(j.id) && point == j.point)
- {
- return true;
- }
- else
- {
- return false;
- }
+ return id.equals(j.id) && point == j.point;
}
public String toString()
{
return id + "_" + point;
}
-
-
}
Added: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.framework.portlet;
+
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.server.HttpTestDriverRegistry;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestContainerInfo;
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletTestDriver extends AbstractJBossService implements TestDriver
+{
+
+ /** . */
+ private HttpTestDriverRegistry testDriverRegistry;
+
+ public HttpTestDriverRegistry getTestDriverRegistry()
+ {
+ return testDriverRegistry;
+ }
+
+ public void setTestDriverRegistry(HttpTestDriverRegistry testDriverRegistry)
+ {
+ this.testDriverRegistry = testDriverRegistry;
+ }
+
+ protected void startService() throws Exception
+ {
+ testDriverRegistry.register(this);
+ }
+
+ protected void stopService() throws Exception
+ {
+ testDriverRegistry.unregister(this);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ TestContainerInfo container = new TestContainerInfo("Portlet");
+ SequenceRegistry registry = SequenceRegistryBuilder.getRegistry();
+ for (Iterator i = registry.getTestNames().iterator(); i.hasNext();)
+ {
+ String testName = (String)i.next();
+ TestInfo test = new TestInfo(testName);
+ container.addChild(test);
+ }
+ return container;
+ }
+
+ public DriverResponse invoke(DriverCommand command) throws TestDriverException
+ {
+ StartTestCommand start = (StartTestCommand)command;
+ String testName = start.getTestName();
+ TestInfo info = (TestInfo)getInfo().findItem(testName);
+ return new InvokeGetResponse("/test/" + info.getName());
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Sequence.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Sequence.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Sequence.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.portlet.actions.TestAction;
+import org.jboss.portal.test.framework.portlet.TestAction;
import org.jboss.portal.test.framework.server.NodeId;
import java.util.HashMap;
@@ -41,13 +40,9 @@
/** . */
private Map actionMap;
- /** . */
- private AssertResult assertResult;
-
public Sequence()
{
actionMap = new HashMap();
- assertResult = new AssertResult();
}
public void addAction(int requestCount, Joinpoint joinpoint, TestAction action)
@@ -55,11 +50,6 @@
addAction(requestCount, NodeId.DEFAULT, joinpoint, action);
}
- /**
- * @param requestCount
- * @param joinpoint
- * @param action
- */
public void addAction(int requestCount, NodeId nodeId, Joinpoint joinpoint, TestAction action)
{
if (action == null)
@@ -91,8 +81,13 @@
private static class Key
{
+ /** . */
private final int requestCount;
+
+ /** . */
private final NodeId nodeId;
+
+ /** . */
private final Joinpoint joinpoint;
public Key(int requestCount, NodeId nodeId, Joinpoint joinpoint)
@@ -120,24 +115,12 @@
{
return true;
}
- if (o == null || getClass() != o.getClass())
+ if (o instanceof Key)
{
- return false;
+ Key that = (Key)o;
+ return this.requestCount == that.requestCount && this.joinpoint.equals(that.joinpoint) && this.nodeId.equals(that.nodeId);
}
- final Key key = (Key)o;
- if (requestCount != key.requestCount)
- {
- return false;
- }
- if (!joinpoint.equals(key.joinpoint))
- {
- return false;
- }
- if (!nodeId.equals(key.nodeId))
- {
- return false;
- }
- return true;
+ return false;
}
public int hashCode()
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,6 +25,8 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.Collections;
+import java.util.Set;
/**
* Registry of action sequences. Every sequence is binded with test id
@@ -35,13 +37,12 @@
public class SequenceRegistry
{
- public static String SEQUENCE_REGISTRY = "jboss.portal.testframework.SEQUENCE_REGISTRY_BINDING";
-
+ /** . */
private Map registry = null;
public SequenceRegistry()
{
- registry = new HashMap();
+ registry = Collections.synchronizedMap(new HashMap());
}
public Map getRegistry()
@@ -65,9 +66,7 @@
{
throw new IllegalArgumentException("Sequence can't be null");
}
-
-
- getRegistry().put(testId, sequence);
+ registry.put(testId, sequence);
}
public Sequence getSequence(String testId)
@@ -76,6 +75,11 @@
{
throw new IllegalArgumentException("Test ID can't be null");
}
- return (Sequence)getRegistry().get(testId);
+ return (Sequence)registry.get(testId);
}
+
+ public Set getTestNames()
+ {
+ return registry.keySet();
+ }
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistryBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistryBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistryBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,6 +23,16 @@
package org.jboss.portal.test.framework.portlet;
import org.apache.log4j.Logger;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestContainerInfo;
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.test.server.HttpTestDriverRegistryService;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
@@ -30,8 +40,9 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
-import java.util.LinkedList;
import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
import java.util.regex.Pattern;
/**
@@ -41,15 +52,15 @@
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision$
*/
-public abstract class SequenceRegistryBuilder implements ServletContextListener
+public abstract class SequenceRegistryBuilder implements ServletContextListener, TestDriver
{
-
+ /** . */
private static SequenceRegistry registry = null;
private final Logger log = Logger.getLogger(getClass());
- //defines pattern for method names like createXXX
+ // Defines pattern for method names like createXXX
public static String METHOD_PATTERN = "create.*";
public static SequenceRegistry getRegistry()
@@ -74,8 +85,8 @@
log.info("RegistryBuilder invoked with instance of: '" + this.getClass().getName() + "' class");
setRegistry(new SequenceRegistry());
- //we invoke all createXXX methods to fill seqenceRegistry
- List methods = findMethods(SequenceRegistryBuilder.METHOD_PATTERN);
+ // We invoke all createXXX methods to fill seqenceRegistry
+ List methods = introspectMethods(SequenceRegistryBuilder.METHOD_PATTERN);
for (int i = 0; i < methods.size(); i++)
{
Method m = (Method)methods.get(i);
@@ -96,49 +107,58 @@
}
}
- //saveRegistry(getRegistry(), sce.getServletContext());
+ //
+ HttpTestDriverRegistryService.registerTestDriver(this);
}
public void contextDestroyed(ServletContextEvent servletContextEvent)
{
- //do Nothing
+ HttpTestDriverRegistryService.unregisterTestDriver(this);
}
+
+ public TestItemInfo getInfo()
+ {
+ TestContainerInfo container = new TestContainerInfo("Portlet");
+ SequenceRegistry registry = SequenceRegistryBuilder.getRegistry();
+ for (Iterator i = registry.getTestNames().iterator(); i.hasNext();)
+ {
+ String testName = (String)i.next();
+ TestInfo test = new TestInfo(testName);
+ container.addChild(test);
+ }
+ return container;
+ }
+
+ public DriverResponse invoke(DriverCommand command) throws TestDriverException
+ {
+ StartTestCommand start = (StartTestCommand)command;
+ String testName = start.getTestName();
+ TestInfo info = (TestInfo)getInfo().findItem(testName);
+ return new InvokeGetResponse("/test/" + info.getName());
+ }
+
/**
* Returning List of Method objects matching given name pattern
*
* @param namePattern
* @return List of Method objects
*/
- private List findMethods(String namePattern)
+ private List introspectMethods(String namePattern)
{
- List methods = new LinkedList();
-
List allMethods = Arrays.asList(getClass().getMethods());
-
+ List methods = new ArrayList(allMethods.size());
for (int i = 0; i < allMethods.size(); i++)
{
Method m = (Method)allMethods.get(i);
if (Pattern.matches(namePattern, m.getName()) &&
- m.getParameterTypes().length == 1 &&
- ((Class)m.getParameterTypes()[0]).equals(SequenceRegistry.class) &&
- Modifier.isPublic(m.getModifiers()))
+ m.getParameterTypes().length == 1 &&
+ m.getParameterTypes()[0].equals(SequenceRegistry.class) &&
+ Modifier.isPublic(m.getModifiers()))
{
methods.add(m);
}
}
return methods;
}
-
- /**
- * injects SequenceRegistry into ServletContext
- * overriding this enables class testing
- * @param registry
- * @param context
- */
- /*protected void saveRegistry(SequenceRegistry registry, ServletContext context)
- {
- context.setAttribute(SequenceRegistry.SEQUENCE_REGISTRY, registry);
- }*/
-
}
Copied: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java (from rev 5499, trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java 2006-10-24 20:04:54 UTC (rev 5499)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.portlet;
+
+import junit.framework.AssertionFailedError;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision$
+ */
+public abstract class TestAction extends ExtendedAssert
+{
+
+ protected DriverResponse decode(Throwable t)
+ {
+ for (Throwable u = t; u != null; u = u.getCause())
+ {
+ if (u instanceof AssertionFailedError)
+ {
+ AssertionFailedError afe = (AssertionFailedError)u;
+ return new FailureResponse(afe);
+ }
+ }
+ return new ErrorResponse(t);
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -28,17 +28,16 @@
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision$
*/
-public interface TestContants
+public class TestContants
{
- /** String from PortletContext.getServerInfo() */
- String SERVER_INVO = "JBossPortal/1.0";
+ /** String from <code>PortletContext.getServerInfo()</code/>. */
+ public static final String SERVER_INVO = "JBossPortal/1.0";
- /** int for PortletContext.getMinorVersion(); */
- int MINOR_VERSION = 0;
+ /** int for <code>PortletContext.getMinorVersion()</code/>. */
+ public static final int MINOR_VERSION = 0;
- /** int for PortletContext.getMajorVersion(); */
- int MAJOR_VERSION = 1;
+ /** int for <code>PortletContext.getMajorVersion()</code/>. */
+ public static final int MAJOR_VERSION = 1;
-
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,15 +22,18 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.actions;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.portlet.TestAction;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.Portlet;
import javax.portlet.PortletException;
-import javax.portlet.PortletSecurityException;
import java.io.IOException;
+import junit.framework.AssertionFailedError;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision$
@@ -38,19 +41,19 @@
public abstract class PortletActionTestAction extends TestAction
{
- public Result execute(Portlet servlet, ActionRequest request, ActionResponse response)
+ public DriverResponse execute(Portlet portlet, ActionRequest request, ActionResponse response) throws PortletException, IOException
{
try
{
- run(servlet, request, response);
+ run(portlet, request, response);
return null;
}
- catch (Throwable t)
+ catch (AssertionFailedError t)
{
- return decode(t);
+ return new FailureResponse(t);
}
}
- protected abstract void run(Portlet portlet, ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException;
+ protected abstract void run(Portlet portlet, ActionRequest request, ActionResponse response) throws PortletException, IOException;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,7 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.actions;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.portlet.TestAction;
import javax.portlet.Portlet;
import javax.portlet.PortletException;
@@ -31,6 +33,8 @@
import javax.portlet.RenderResponse;
import java.io.IOException;
+import junit.framework.AssertionFailedError;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision$
@@ -38,17 +42,17 @@
public abstract class PortletRenderTestAction extends TestAction
{
- public Result execute(Portlet servlet, RenderRequest request, RenderResponse response)
+ public DriverResponse execute(Portlet servlet, RenderRequest request, RenderResponse response) throws PortletException, IOException
{
try
{
return run(servlet, request, response);
}
- catch (Throwable t)
+ catch (AssertionFailedError t)
{
- return decode(t);
+ return new FailureResponse(t);
}
}
- protected abstract Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException;
+ protected abstract DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletException, IOException;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.actions;
-import junit.framework.AssertionFailedError;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.TestAction;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
@@ -38,24 +37,17 @@
*/
public abstract class ServletServiceTestAction extends TestAction
{
- protected abstract Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
+ protected abstract DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
try
{
return run(servlet, request, response);
}
- catch (AssertionFailedError afe)
+ catch (Throwable t)
{
- //AssertResult.log.error("Failure during test", afe);
- return new AssertResult(afe);
+ return decode(t);
}
- catch (Throwable e)
- {
- //AssertResult.log.error("Error during test", e);
- return new AssertResult(e);
- }
}
-
}
Deleted: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.framework.portlet.actions;
-
-import junit.framework.AssertionFailedError;
-import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision$
- */
-public abstract class TestAction extends ExtendedAssert
-{
-
- protected Result decode(Throwable t)
- {
- for (Throwable u = t; u != null; u = u.getCause())
- {
- if (u instanceof AssertionFailedError)
- {
- AssertionFailedError afe = (AssertionFailedError)u;
- return new AssertResult(afe);
- }
- }
- return new AssertResult(t);
- }
-}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.basictests;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -47,21 +47,16 @@
*/
public class BasicTestSequenceBuilder extends SequenceRegistryBuilder
{
- /* private Joinpoint portletARender = new Joinpoint("PortletA", Joinpoint.PORTLET_RENDER);
-private Joinpoint portletAAction = new Joinpoint("PortletA", Joinpoint.PORTLET_ACTION);
-private Joinpoint portletBRender = new Joinpoint("PortletB", Joinpoint.PORTLET_RENDER);
-private Joinpoint portletBAction = new Joinpoint("PortletB", Joinpoint.PORTLET_ACTION);*/
-
public void createOnePortletTestCase(SequenceRegistry registry)
{
Sequence seq = new Sequence();
registry.addSequence("OnePortlet", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -72,9 +67,9 @@
registry.addSequence("FailurePortlet", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new FailureResult();
+ return new FailureResponse();
}
});
}
@@ -85,7 +80,7 @@
registry.addSequence("FailAssertPortlet", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
fail();
return null;
@@ -99,10 +94,10 @@
registry.addSequence("FailAssertInActionPortlet", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -117,9 +112,9 @@
//this shouldn't be reached
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -130,18 +125,18 @@
registry.addSequence("TwoPortlet", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -152,17 +147,17 @@
registry.addSequence("TwoResultPortlet", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.framework.portlet.basictests;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -34,16 +32,17 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-basic.war");
-
-
- suite.addTest(new TestCase("OnePortlet"));
- suite.addTest(new TestCase("FailurePortlet"));
- suite.addTest(new TestCase("FailAssertPortlet"));
- suite.addTest(new TestCase("FailAssertInActionPortlet"));
- suite.addTest(new TestCase("TwoPortlet"));
- suite.addTest(new TestCase("TwoResultPortlet"));
-
- return suite;
+// TestSuite suite = new TestSuite("test-basic.war");
+//
+//
+// suite.addTest(new TestCase("OnePortlet"));
+// suite.addTest(new TestCase("FailurePortlet"));
+// suite.addTest(new TestCase("FailAssertPortlet"));
+// suite.addTest(new TestCase("FailAssertInActionPortlet"));
+// suite.addTest(new TestCase("TwoPortlet"));
+// suite.addTest(new TestCase("TwoResultPortlet"));
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,12 +23,12 @@
package org.jboss.portal.test.framework.portlet.basictests.classes;
import junit.framework.TestCase;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Joinpoint;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.actions.TestAction;
+import org.jboss.portal.test.framework.portlet.TestAction;
import javax.portlet.Portlet;
import javax.portlet.RenderRequest;
@@ -46,9 +46,9 @@
Joinpoint joinpoint = new Joinpoint("PortletA", Joinpoint.PORTLET_RENDER);
TestAction action = new PortletRenderTestAction()
{
- public Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ public DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult("http://www.jboss.com");
+ return new InvokeGetResponse("http://www.jboss.com");
}
};
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,7 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.components;
-import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.util.Tools;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -41,6 +42,7 @@
*/
public abstract class AbstractTestGenericPortlet extends GenericPortlet
{
+
/** The test id. */
private final String testCaseId;
@@ -53,18 +55,12 @@
/** Get the test id from the class name. It can be overriden. */
protected String createCaseTestId(Class clazz)
{
- String s = clazz.getName();
- int index = s.lastIndexOf('.');
- if (index != -1)
- {
- s = s.substring(index + 1);
- }
- return s;
+ return Tools.getShortNameOf(clazz);
}
public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentCaseTestId(testCaseId))
{
doProcessAction(req, resp);
}
@@ -72,11 +68,11 @@
final public void render(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentCaseTestId(testCaseId))
{
- doRenderInit(request, response);
+ preRender(request, response);
super.render(request, response);
- doRenderFinal(request, response);
+ postRender(request, response);
}
}
@@ -95,7 +91,7 @@
* @throws PortletSecurityException
* @throws IOException
*/
- protected void doRenderInit(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ protected void preRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
throw new PortletException();
}
@@ -109,7 +105,7 @@
* @throws PortletSecurityException
* @throws IOException
*/
- protected void doRenderFinal(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ protected void postRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.components;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -36,6 +39,8 @@
import javax.portlet.RenderResponse;
import java.io.IOException;
+import junit.framework.AssertionFailedError;
+
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -99,7 +104,7 @@
public final void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentCaseTestId(testCaseId))
{
doProcessAction(req, resp);
}
@@ -107,7 +112,7 @@
public final void render(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentCaseTestId(testCaseId))
+ if (HttpTestContext.isCurrentCaseTestId(testCaseId))
{
doRender(req, resp);
}
@@ -139,8 +144,27 @@
return s;
}
- public static void marshall(Result result)
+ public DriverResponse bilto(Runnable runnable, DriverResponse abc)
{
- TestCaseContext.setCurrentResult(result);
+ try
+ {
+ runnable.run();
+
+ //
+ return new EndTestResponse();
+ }
+ catch (AssertionFailedError e)
+ {
+ return new FailureResponse(e);
+ }
+ catch (Exception e)
+ {
+ return new ErrorResponse(e);
+ }
}
+
+ public static void marshall(DriverResponse response)
+ {
+ HttpTestContext.setCurrentResult(response);
+ }
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,16 +23,16 @@
package org.jboss.portal.test.framework.portlet.components;
import org.apache.log4j.Logger;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Joinpoint;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.actions.TestAction;
+import org.jboss.portal.test.framework.portlet.TestAction;
import org.jboss.portal.test.framework.server.NodeId;
import javax.portlet.ActionRequest;
@@ -135,7 +135,7 @@
*/
public final void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ HttpTestContext ctx = HttpTestContext.getCurrentContext();
//
log.debug("Component '" + getComponentId() + "' processAction() method invoked for '"
@@ -154,21 +154,21 @@
//
if (action == null)
{
- ctx.setResult(new FailureResult("No action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint));
+ ctx.setResult(new FailureResponse("No action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint));
}
else if (action instanceof PortletActionTestAction == false)
{
- ctx.setResult(new FailureResult("Action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint + " is not an instance of " + PortletActionTestAction.class.getName() + " but is " + action.getClass().getName()));
+ ctx.setResult(new FailureResponse("Action for " + ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint + " is not an instance of " + PortletActionTestAction.class.getName() + " but is " + action.getClass().getName()));
}
else
{
log.debug("Found action for jointpoint " + actionJoinpoint + " : " + action);
//
- Result result = ((PortletActionTestAction)action).execute(this, req, resp);
+ DriverResponse response = ((PortletActionTestAction)action).execute(this, req, resp);
//
- ctx.setResult(result);
+ ctx.setResult(response);
}
}
}
@@ -185,7 +185,7 @@
*/
public final void render(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ HttpTestContext ctx = HttpTestContext.getCurrentContext();
//
log.debug("Component '" + getComponentId() + "' render() method invoked for '"
@@ -212,7 +212,7 @@
log.debug("Found action for jointpoint " + renderJoinpoint + " : " + action);
// Get the result
- Result sr = ((PortletRenderTestAction)action).execute(this, req, resp);
+ DriverResponse sr = ((PortletRenderTestAction)action).execute(this, req, resp);
// If we have one result it is meant to be returned to the client
if (sr != null)
@@ -264,7 +264,7 @@
log.error("No SequenceRegistry object found in current context");
throw new PortletException("No SequenceRegistry object found in context");
}
- return registry.getSequence(TestCaseContext.getCurrentTestCaseId());
+ return registry.getSequence(HttpTestContext.getCurrentTestCaseId());
}
protected String getComponentId()
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,14 +23,14 @@
package org.jboss.portal.test.framework.portlet.components;
import org.apache.log4j.Logger;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Joinpoint;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
-import org.jboss.portal.test.framework.portlet.actions.TestAction;
+import org.jboss.portal.test.framework.portlet.TestAction;
import org.jboss.portal.test.framework.server.NodeId;
import javax.servlet.ServletException;
@@ -97,7 +97,7 @@
*/
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ HttpTestContext ctx = HttpTestContext.getCurrentContext();
//
log.info("Component '" + getComponentId() + "' service() method invoked for '"
@@ -117,10 +117,10 @@
if (action != null && action instanceof ServletServiceTestAction)
{
log.info("Found Action for this jointpoint");
- Result result = ((ServletServiceTestAction)action).execute(this, request, response);
- if (result != null)
+ DriverResponse dr = ((ServletServiceTestAction)action).execute(this, request, response);
+ if (dr != null)
{
- ctx.setResult(result);
+ ctx.setResult(dr);
}
}
@@ -166,7 +166,7 @@
log.info("No SequenceRegistry object found in current context");
throw new ServletException("No SequenceRegistry object found in context");
}
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ HttpTestContext ctx = HttpTestContext.getCurrentContext();
return registry.getSequence(ctx.getTestCaseId());
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.test.portlet.ha.session;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -54,25 +54,25 @@
registry.addSequence("ABC", seq);
seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
{
assertNull(request.getPortletSession(false));
PortletSession session = request.getPortletSession();
assertNotNull(session);
session.setAttribute("immutable", "abcdef");
PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
- return new InvokeGetResult(url);
+ String url = HttpTestContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
+ return new InvokeGetResponse(url);
}
});
seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
assertNotNull(session);
assertEquals("abcdef", session.getAttribute("immutable"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -83,7 +83,7 @@
registry.addSequence("ABC", seq);
seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
assertNull(request.getPortletSession(false));
PortletSession session = request.getPortletSession();
@@ -92,18 +92,18 @@
session.setAttribute("mutable", value);
value.setString("fedcba");
PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
- return new InvokeGetResult(url);
+ String url = HttpTestContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
+ return new InvokeGetResponse(url);
}
});
seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
assertNotNull(session);
assertEquals(new MutableValue("fedcba"), session.getAttribute("mutable"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -114,7 +114,7 @@
registry.addSequence("ABC", seq);
seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
assertNull(request.getPortletSession(false));
PortletSession session = request.getPortletSession();
@@ -123,12 +123,12 @@
session.setAttribute("mutable", value);
PortletURL portletURL = response.createRenderURL();
String url = portletURL.toString();
- return new InvokeGetResult(url);
+ return new InvokeGetResponse(url);
}
});
seq.addAction(1, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
PortletSession session = request.getPortletSession();
Object o = session.getAttribute("mutable");
@@ -137,18 +137,18 @@
MutableValue value = (MutableValue)o;
value.setString("fedcba");
PortletURL portletURL = response.createRenderURL();
- String url = TestCaseContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
- return new InvokeGetResult(url);
+ String url = HttpTestContext.getCurrentContext().rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
+ return new InvokeGetResponse(url);
}
});
seq.addAction(2, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
assertNotNull(session);
assertEquals(new MutableValue("abcdef"), session.getAttribute("mutable"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Deleted: trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,42 +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.ha.session;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-import org.jboss.portal.test.framework.server.NodeId;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class SessionTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-ha-session.war", new NodeId[]{NodeId.PORTS_01, NodeId.PORTS_02});
- suite.addTest(new TestCase(NodeId.PORTS_01, "ABC"));
- return suite;
- }
-}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -27,8 +27,9 @@
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
/**
@@ -38,6 +39,11 @@
public class CacheInfoTest extends AbstractTest
{
+ public CacheInfoTest()
+ {
+ super("CacheInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -50,25 +56,13 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
-
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- PortletContainer container = registry.getPortletContainer("/test-info.CachePortlet");
- PortletInfo info = container.getInfo();
- CacheInfo cacheInfo = info.getCache();
-
- assertEquals(65, cacheInfo.getExpirationSecs());
-
- //TODO:implement getReferenceType();
-
- }
- });
-
- return result;
+ PortletContainer container = registry.getPortletContainer("/test-info.CachePortlet");
+ PortletInfo info = container.getInfo();
+ CacheInfo cacheInfo = info.getCache();
+ ExtendedAssert.assertEquals(65, cacheInfo.getExpirationSecs());
+ //TODO:implement getReferenceType();
+ return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -32,8 +32,9 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import java.util.HashSet;
@@ -48,6 +49,12 @@
public class CapabilitiesInfoTest extends AbstractTest
{
+
+ public CapabilitiesInfoTest()
+ {
+ super("CapabilitiesInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -60,123 +67,112 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
+ PortletContainer container = registry.getPortletContainer("/test-info.CapabilitiesPortlet");
+ PortletInfo info = container.getInfo();
+ CapabilitiesInfo capInfo = info.getCapabilities();
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
+ //TODO: finish locales asserts
+ // locales should at least contain Locale.ENGLISH
+ Set allLocales = capInfo.getAllLocales();
+ ExtendedAssert.assertNotNull(allLocales);
+ ExtendedAssert.assertTrue(allLocales.contains(Locale.ENGLISH));
+
+ //check mime types
+ Set types = capInfo.getMimeTypes();
+ String[] mt = new String[types.size()];
+ int count = 0;
+ for (Iterator i = types.iterator(); i.hasNext();)
{
- public void run() throws Exception
- {
- PortletContainer container = registry.getPortletContainer("/test-info.CapabilitiesPortlet");
- PortletInfo info = container.getInfo();
- CapabilitiesInfo capInfo = info.getCapabilities();
+ Object o = i.next();
+ mt[count++] = (String)o;
+ }
+ ExtendedAssert.assertEquals(new String[]{"text/vnd.wap.wml", "text/html"}, mt);
- //TODO: finish locales asserts
- // locales should at least contain Locale.ENGLISH
- Set allLocales = capInfo.getAllLocales();
- assertNotNull(allLocales);
- assertTrue(allLocales.contains(Locale.ENGLISH));
+ //check all modes
+ Set modeInfos = capInfo.getAllModes();
+ Set modes = extractModes(modeInfos);
- //check mime types
- Set types = capInfo.getMimeTypes();
- String[] mt = new String[types.size()];
- int count = 0;
- for (Iterator i = types.iterator(); i.hasNext();)
- {
- Object o = i.next();
- mt[count++] = (String)o;
- }
- assertEquals(new String[]{"text/vnd.wap.wml", "text/html"}, mt);
+ ExtendedAssert.assertTrue(modes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(modes.contains(Mode.HELP));
+ ExtendedAssert.assertTrue(modes.contains(Mode.EDIT));
- //check all modes
- Set modeInfos = capInfo.getAllModes();
- Set modes = extractModes(modeInfos);
+ //check text/html modes
+ modeInfos = capInfo.getModes("text/html");
+ modes = extractModes(modeInfos);
+ ExtendedAssert.assertEquals(2, modes.size());
+ ExtendedAssert.assertTrue(modes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(modes.contains(Mode.HELP));
- assertTrue(modes.contains(Mode.VIEW));
- assertTrue(modes.contains(Mode.HELP));
- assertTrue(modes.contains(Mode.EDIT));
+ //check text/vnd.wap.wml modes
+ modeInfos = capInfo.getModes("text/vnd.wap.wml");
+ modes = extractModes(modeInfos);
+ ExtendedAssert.assertEquals(2, modes.size());
+ ExtendedAssert.assertTrue(modes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(modes.contains(Mode.EDIT));
- //check text/html modes
- modeInfos = capInfo.getModes("text/html");
- modes = extractModes(modeInfos);
- assertEquals(2, modes.size());
- assertTrue(modes.contains(Mode.VIEW));
- assertTrue(modes.contains(Mode.HELP));
+ //check undeclared
+ modeInfos = capInfo.getModes("text/undeclared");
+ modes = extractModes(modeInfos);
+ ExtendedAssert.assertEquals(0, modes.size());
- //check text/vnd.wap.wml modes
- modeInfos = capInfo.getModes("text/vnd.wap.wml");
- modes = extractModes(modeInfos);
- assertEquals(2, modes.size());
- assertTrue(modes.contains(Mode.VIEW));
- assertTrue(modes.contains(Mode.EDIT));
+ //check all window states
+ Set stateInfos = capInfo.getAllWindowStates();
+ Set states = extractWindowStates(stateInfos);
+ ExtendedAssert.assertEquals(3, states.size());
+ ExtendedAssert.assertTrue(states.contains(WindowState.NORMAL));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MINIMIZED));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MAXIMIZED));
- //check undeclared
- modeInfos = capInfo.getModes("text/undeclared");
- modes = extractModes(modeInfos);
- assertEquals(0, modes.size());
+ //check for text/html
+ stateInfos = capInfo.getWindowStates("text/html");
+ states = extractWindowStates(stateInfos);
+ ExtendedAssert.assertEquals(3, states.size());
+ ExtendedAssert.assertTrue(states.contains(WindowState.NORMAL));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MINIMIZED));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MAXIMIZED));
- //check all window states
- Set stateInfos = capInfo.getAllWindowStates();
- Set states = extractWindowStates(stateInfos);
- assertEquals(3, states.size());
- assertTrue(states.contains(WindowState.NORMAL));
- assertTrue(states.contains(WindowState.MINIMIZED));
- assertTrue(states.contains(WindowState.MAXIMIZED));
+ //simple check for text/vnd.wap.wml
+ //TODO:is this really expected behaviour? shouldn't it return no states as this is unsupported by portal one?
+ states = capInfo.getWindowStates("text/vnd.wap.wml");
+ ExtendedAssert.assertEquals(3, states.size());
- //check for text/html
- stateInfos = capInfo.getWindowStates("text/html");
- states = extractWindowStates(stateInfos);
- assertEquals(3, states.size());
- assertTrue(states.contains(WindowState.NORMAL));
- assertTrue(states.contains(WindowState.MINIMIZED));
- assertTrue(states.contains(WindowState.MAXIMIZED));
+ //check undeclared
+ states = capInfo.getWindowStates("undeclared/mime");
+ ExtendedAssert.assertEquals(0, states.size());
- //simple check for text/vnd.wap.wml
- //TODO:is this really expected behaviour? shouldn't it return no states as this is unsupported by portal one?
- states = capInfo.getWindowStates("text/vnd.wap.wml");
- assertEquals(3, states.size());
+ //fail();
- //check undeclared
- states = capInfo.getWindowStates("undeclared/mime");
- assertEquals(0, states.size());
+ //throw new UnsupportedOperationException("CapabilitiesInfoTest: Finish implementation!");
+ return new EndTestResponse();
+ }
- //fail();
+ public Set extractWindowStates(Set infos)
+ {
+ Set states = new HashSet();
- //throw new UnsupportedOperationException("CapabilitiesInfoTest: Finish implementation!");
- }
-
- public Set extractWindowStates(Set infos) throws Exception
- {
- Set states = new HashSet();
-
- for (Iterator i = infos.iterator(); i.hasNext();)
- {
- WindowStateInfo info = (WindowStateInfo)i.next();
- WindowState state = info.getWindowState();
- assertEquals(state.toString(), (info.getWindowStateName()));
- states.add(state);
- }
- return states;
- }
-
- public Set extractModes(Set infos) throws Exception
- {
- Set modes = new HashSet();
-
- for (Iterator i = infos.iterator(); i.hasNext();)
- {
- ModeInfo info = (ModeInfo)i.next();
- Mode mode = info.getMode();
- assertEquals(mode.toString(), (info.getModeName()));
- modes.add(mode);
- }
- return modes;
- }
- });
-
- return result;
+ for (Iterator i = infos.iterator(); i.hasNext();)
+ {
+ WindowStateInfo info = (WindowStateInfo)i.next();
+ WindowState state = info.getWindowState();
+ ExtendedAssert.assertEquals(state.toString(), (info.getWindowStateName()));
+ states.add(state);
+ }
+ return states;
}
+ public Set extractModes(Set infos)
+ {
+ Set modes = new HashSet();
+ for (Iterator i = infos.iterator(); i.hasNext();)
+ {
+ ModeInfo info = (ModeInfo)i.next();
+ Mode mode = info.getMode();
+ ExtendedAssert.assertEquals(mode.toString(), (info.getModeName()));
+ modes.add(mode);
+ }
+ return modes;
+ }
}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InfoTestCase extends ServerTestRunner
+{
+ public InfoTestCase()
+ {
+ super("test-info.sar");
+ }
+}
Deleted: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,51 +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.info;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class InfoTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-info.sar");
- suite.addTest(new TestCase("MetaInfoTest"));
-
- //Not implemented compleatly yet
- suite.addTest(new TestCase("CapabilitiesInfoTest"));
- suite.addTest(new TestCase("PreferenceInfoTest"));
- suite.addTest(new TestCase("CacheInfoTest"));
- suite.addTest(new TestCase("ModeInfoTest"));
- suite.addTest(new TestCase("PortletInfoTest"));
- suite.addTest(new TestCase("SessionInfoTest"));
- suite.addTest(new TestCase("SecurityInfoTest"));
-
- return suite;
- }
-}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -28,8 +28,9 @@
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import java.util.Locale;
@@ -41,6 +42,12 @@
public class MetaInfoTest extends AbstractTest
{
+
+ public MetaInfoTest()
+ {
+ super("MetaInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -53,35 +60,27 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
+ PortletContainer container = registry.getPortletContainer("/test-info.NoBundlePortlet");
+ PortletInfo info = container.getInfo();
+ MetaInfo metaInfo = info.getMeta();
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- PortletContainer container = registry.getPortletContainer("/test-info.NoBundlePortlet");
- PortletInfo info = container.getInfo();
- MetaInfo metaInfo = info.getMeta();
+ //
+ LocalizedString title = metaInfo.getMetaValue(MetaInfo.TITLE);
+ String titleEn = title.getString(Locale.ENGLISH, false);
+ ExtendedAssert.assertEquals("title", titleEn);
- //
- LocalizedString title = metaInfo.getMetaValue(MetaInfo.TITLE);
- String titleEn = title.getString(Locale.ENGLISH, false);
- assertEquals("title", titleEn);
+ //
+ LocalizedString shortTitle = metaInfo.getMetaValue(MetaInfo.SHORT_TITLE);
+ String shortTitleEn = shortTitle.getString(Locale.ENGLISH, false);
+ ExtendedAssert.assertEquals("short-title", shortTitleEn);
- //
- LocalizedString shortTitle = metaInfo.getMetaValue(MetaInfo.SHORT_TITLE);
- String shortTitleEn = shortTitle.getString(Locale.ENGLISH, false);
- assertEquals("short-title", shortTitleEn);
+ //
+ LocalizedString keywords = metaInfo.getMetaValue(MetaInfo.KEYWORDS);
+ String keywordsEn = keywords.getString(Locale.ENGLISH, false);
+ ExtendedAssert.assertEquals("keywords", keywordsEn);
- //
- LocalizedString keywords = metaInfo.getMetaValue(MetaInfo.KEYWORDS);
- String keywordsEn = keywords.getString(Locale.ENGLISH, false);
- assertEquals("keywords", keywordsEn);
- }
- });
-
- return result;
+ return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -28,8 +28,9 @@
import org.jboss.portal.portlet.info.CapabilitiesInfo;
import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import java.util.HashSet;
@@ -43,6 +44,12 @@
public class ModeInfoTest extends AbstractTest
{
+
+ public ModeInfoTest()
+ {
+ super("ModeInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -55,61 +62,51 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
+ PortletContainer container1 = registry.getPortletContainer("/test-info.ModePortlet1");
+ PortletContainer container2 = registry.getPortletContainer("/test-info.ModePortlet2");
+ CapabilitiesInfo capaInfo = container1.getInfo().getCapabilities();
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- PortletContainer container1 = registry.getPortletContainer("/test-info.ModePortlet1");
- PortletContainer container2 = registry.getPortletContainer("/test-info.ModePortlet2");
- CapabilitiesInfo capaInfo = container1.getInfo().getCapabilities();
+ //Portlet 1 with VIEW, EDIT, HELP
+ Set modeInfos = capaInfo.getModes("text/html");
- //Portlet 1 with VIEW, EDIT, HELP
- Set modeInfos = capaInfo.getModes("text/html");
+ //shoule be 3 modes
+ ExtendedAssert.assertEquals(3, modeInfos.size());
- //shoule be 3 modes
- assertEquals(3, modeInfos.size());
+ Set portletModes = new HashSet();
+ for (Iterator i = modeInfos.iterator(); i.hasNext();)
+ {
+ ModeInfo mode = (ModeInfo)i.next();
+ portletModes.add(mode.getMode());
+ ExtendedAssert.assertEquals(mode.getModeName(), mode.getMode().toString());
+ }
- Set portletModes = new HashSet();
- for (Iterator i = modeInfos.iterator(); i.hasNext();)
- {
- ModeInfo mode = (ModeInfo)i.next();
- portletModes.add(mode.getMode());
- assertEquals(mode.getModeName(), mode.getMode().toString());
- }
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.HELP));
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.EDIT));
- assertTrue(portletModes.contains(Mode.VIEW));
- assertTrue(portletModes.contains(Mode.HELP));
- assertTrue(portletModes.contains(Mode.EDIT));
+ //Portlet 2 with only VIEW
+ capaInfo = container2.getInfo().getCapabilities();
+ modeInfos = capaInfo.getModes("text/html");
- //Portlet 2 with only VIEW
- capaInfo = container2.getInfo().getCapabilities();
- modeInfos = capaInfo.getModes("text/html");
+ //shoule be 1 mode
+ ExtendedAssert.assertEquals(1, modeInfos.size());
- //shoule be 1 mode
- assertEquals(1, modeInfos.size());
+ portletModes = new HashSet();
+ for (Iterator i = modeInfos.iterator(); i.hasNext();)
+ {
+ ModeInfo mode = (ModeInfo)i.next();
+ portletModes.add(mode.getMode());
+ ExtendedAssert.assertEquals(mode.getModeName(), mode.getMode().toString());
+ }
- portletModes = new HashSet();
- for (Iterator i = modeInfos.iterator(); i.hasNext();)
- {
- ModeInfo mode = (ModeInfo)i.next();
- portletModes.add(mode.getMode());
- assertEquals(mode.getModeName(), mode.getMode().toString());
- }
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(!portletModes.contains(Mode.HELP));
+ ExtendedAssert.assertTrue(!portletModes.contains(Mode.EDIT));
- assertTrue(portletModes.contains(Mode.VIEW));
- assertTrue(!portletModes.contains(Mode.HELP));
- assertTrue(!portletModes.contains(Mode.EDIT));
-
-
- }
- });
-
- return result;
+ return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -26,8 +26,9 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
/**
@@ -37,6 +38,12 @@
public class PortletInfoTest extends AbstractTest
{
+
+ public PortletInfoTest()
+ {
+ super("PortletInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -49,40 +56,29 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
+ //This asserts only .isRemotable() as rest is checked in other tests
+ PortletContainer container = (PortletContainer)registry.getPortletContainer("/test-info.RemotablePortlet1");
+ PortletInfo info = container.getInfo();
+ ExtendedAssert.assertEquals(Boolean.TRUE, info.isRemotable());
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- //This asserts only .isRemotable() as rest is checked in other tests
+ //just simple test if we get other infos...
+ ExtendedAssert.assertNotNull(info.getCache());
+ ExtendedAssert.assertNotNull(info.getCapabilities());
+ ExtendedAssert.assertNotNull(info.getMeta());
+ ExtendedAssert.assertNotNull(info.getPreferences());
+ ExtendedAssert.assertNotNull(info.getSecurity());
+ ExtendedAssert.assertNotNull(info.getSession());
- PortletContainer container = (PortletContainer)registry.getPortletContainer("/test-info.RemotablePortlet1");
- PortletInfo info = container.getInfo();
- assertEquals(Boolean.TRUE, info.isRemotable());
+ container = (PortletContainer)registry.getPortletContainer("/test-info.RemotablePortlet2");
+ info = container.getInfo();
+ ExtendedAssert.assertEquals(Boolean.FALSE, info.isRemotable());
- //just simple test if we get other infos...
- assertNotNull(info.getCache());
- assertNotNull(info.getCapabilities());
- assertNotNull(info.getMeta());
- assertNotNull(info.getPreferences());
- assertNotNull(info.getSecurity());
- assertNotNull(info.getSession());
+ container = (PortletContainer)registry.getPortletContainer("/test-info.RemotablePortlet3");
+ info = container.getInfo();
+ ExtendedAssert.assertEquals(Boolean.TRUE, info.isRemotable());
- container = (PortletContainer)registry.getPortletContainer("/test-info.RemotablePortlet2");
- info = container.getInfo();
- assertEquals(Boolean.FALSE, info.isRemotable());
-
- container = (PortletContainer)registry.getPortletContainer("/test-info.RemotablePortlet3");
- info = container.getInfo();
- assertEquals(Boolean.TRUE, info.isRemotable());
-
-
- }
- });
-
- return result;
+ return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -28,8 +28,9 @@
import org.jboss.portal.portlet.info.PreferenceInfo;
import org.jboss.portal.portlet.info.PreferencesInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import java.util.Locale;
@@ -42,6 +43,12 @@
public class PreferenceInfoTest extends AbstractTest
{
+
+ public PreferenceInfoTest()
+ {
+ super("PreferenceInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -54,64 +61,57 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- PortletContainer container = registry.getPortletContainer("/test-info.PreferenceInfoPortlet");
+ PortletContainer container = registry.getPortletContainer("/test-info.PreferenceInfoPortlet");
- //
- PortletInfo info = container.getInfo();
- PreferencesInfo prefsInfo = info.getPreferences();
+ //
+ PortletInfo info = container.getInfo();
+ PreferencesInfo prefsInfo = info.getPreferences();
- //
- PreferenceInfo prefInfo = prefsInfo.getPreference("localized_pref");
- assertEquals("localized_pref", prefInfo.getKey());
- assertEquals("english localized description", prefInfo.getDescription().getString(Locale.ENGLISH, false));
- assertEquals("polish localized description", prefInfo.getDescription().getString(new Locale("pl"), false));
- assertEquals("english_localized_name", prefInfo.getDisplayName().getString(Locale.ENGLISH, false));
- assertEquals("polish_localized_name", prefInfo.getDisplayName().getString(new Locale("pl"), false));
+ //
+ PreferenceInfo prefInfo = prefsInfo.getPreference("localized_pref");
+ ExtendedAssert.assertEquals("localized_pref", prefInfo.getKey());
+ ExtendedAssert.assertEquals("english localized description", prefInfo.getDescription().getString(Locale.ENGLISH, false));
+ ExtendedAssert.assertEquals("polish localized description", prefInfo.getDescription().getString(new Locale("pl"), false));
+ ExtendedAssert.assertEquals("english_localized_name", prefInfo.getDisplayName().getString(Locale.ENGLISH, false));
+ ExtendedAssert.assertEquals("polish_localized_name", prefInfo.getDisplayName().getString(new Locale("pl"), false));
- //
- Set keys = prefsInfo.getKeys();
- assertTrue(keys.contains("localized_pref"));
- assertTrue(keys.contains("single_pref"));
- assertTrue(keys.contains("multi_pref"));
- assertTrue(keys.contains("single_pref_bis"));
- assertTrue(keys.contains("multi_pref_bis"));
+ //
+ Set keys = prefsInfo.getKeys();
+ ExtendedAssert.assertTrue(keys.contains("localized_pref"));
+ ExtendedAssert.assertTrue(keys.contains("single_pref"));
+ ExtendedAssert.assertTrue(keys.contains("multi_pref"));
+ ExtendedAssert.assertTrue(keys.contains("single_pref_bis"));
+ ExtendedAssert.assertTrue(keys.contains("multi_pref_bis"));
- //
- prefInfo = prefsInfo.getPreference("single_pref");
- assertEquals("single_pref", prefInfo.getKey());
- String[] values = prefInfo.getDefaultValue().asStringArray();
- assertEquals(new String[]{"single_pref_value"}, values);
- assertTrue(!prefInfo.isReadOnly().booleanValue());
+ //
+ prefInfo = prefsInfo.getPreference("single_pref");
+ ExtendedAssert.assertEquals("single_pref", prefInfo.getKey());
+ String[] values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"single_pref_value"}, values);
+ ExtendedAssert.assertTrue(!prefInfo.isReadOnly().booleanValue());
- //
- prefInfo = prefsInfo.getPreference("multi_pref");
- assertEquals("multi_pref", prefInfo.getKey());
- values = prefInfo.getDefaultValue().asStringArray();
- assertEquals(new String[]{"multi_pref_value_1", "multi_pref_value_2"}, values);
- assertTrue(!prefInfo.isReadOnly().booleanValue());
+ //
+ prefInfo = prefsInfo.getPreference("multi_pref");
+ ExtendedAssert.assertEquals("multi_pref", prefInfo.getKey());
+ values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"multi_pref_value_1", "multi_pref_value_2"}, values);
+ ExtendedAssert.assertTrue(!prefInfo.isReadOnly().booleanValue());
- //
- prefInfo = prefsInfo.getPreference("single_pref_bis");
- assertEquals("single_pref_bis", prefInfo.getKey());
- values = prefInfo.getDefaultValue().asStringArray();
- assertEquals(new String[]{"single_pref_value"}, values);
- assertTrue(prefInfo.isReadOnly().booleanValue());
+ //
+ prefInfo = prefsInfo.getPreference("single_pref_bis");
+ ExtendedAssert.assertEquals("single_pref_bis", prefInfo.getKey());
+ values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"single_pref_value"}, values);
+ ExtendedAssert.assertTrue(prefInfo.isReadOnly().booleanValue());
- //
- prefInfo = prefsInfo.getPreference("multi_pref_bis");
- assertEquals("multi_pref_bis", prefInfo.getKey());
- values = prefInfo.getDefaultValue().asStringArray();
- assertEquals(new String[]{"multi_pref_value_1", "multi_pref_value_2"}, values);
- assertTrue(prefInfo.isReadOnly().booleanValue());
- }
- });
- return result;
+ //
+ prefInfo = prefsInfo.getPreference("multi_pref_bis");
+ ExtendedAssert.assertEquals("multi_pref_bis", prefInfo.getKey());
+ values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"multi_pref_value_1", "multi_pref_value_2"}, values);
+ ExtendedAssert.assertTrue(prefInfo.isReadOnly().booleanValue());
+ return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -28,8 +28,9 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
/**
@@ -39,6 +40,12 @@
public class SecurityInfoTest extends AbstractTest
{
+
+ public SecurityInfoTest()
+ {
+ super("SecurityInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -51,48 +58,38 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
+ //This asserts only .isRemotable() as rest is checked in other tests
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- //This asserts only .isRemotable() as rest is checked in other tests
+ PortletContainer container = registry.getPortletContainer("/test-info.SecuredPortlet1");
+ PortletInfo info = container.getInfo();
+ SecurityInfo secInfo = info.getSecurity();
- PortletContainer container = registry.getPortletContainer("/test-info.SecuredPortlet1");
- PortletInfo info = container.getInfo();
- SecurityInfo secInfo = info.getSecurity();
+ secInfo = info.getSecurity();
+ ExtendedAssert.assertEquals(2, secInfo.getTransportGuarantees().size());
+ ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
+ //ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+ ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
- secInfo = info.getSecurity();
- assertEquals(2, secInfo.getTransportGuarantees().size());
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
- //assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+ container = registry.getPortletContainer("/test-info.SecuredPortlet2");
+ info = container.getInfo();
- container = registry.getPortletContainer("/test-info.SecuredPortlet2");
- info = container.getInfo();
+ secInfo = info.getSecurity();
+ ExtendedAssert.assertEquals(3, secInfo.getTransportGuarantees().size());
+ ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+ ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
+ ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
- secInfo = info.getSecurity();
- assertEquals(3, secInfo.getTransportGuarantees().size());
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+ container = registry.getPortletContainer("/test-info.SecuredPortlet3");
+ info = container.getInfo();
+ secInfo = info.getSecurity();
+ ExtendedAssert.assertEquals(2, secInfo.getTransportGuarantees().size());
+ ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+ ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
- container = registry.getPortletContainer("/test-info.SecuredPortlet3");
- info = container.getInfo();
- secInfo = info.getSecurity();
- assertEquals(2, secInfo.getTransportGuarantees().size());
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
- assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
-
-
- }
- });
-
- return result;
+ return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -27,8 +27,9 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SessionInfo;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
/**
@@ -38,6 +39,12 @@
public class SessionInfoTest extends AbstractTest
{
+
+ public SessionInfoTest()
+ {
+ super("SessionInfoTest", "/test");
+ }
+
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
@@ -50,31 +57,23 @@
this.registry = registry;
}
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
+ PortletContainer container = registry.getPortletContainer("/test-info.DistributedPortlet1");
+ PortletInfo info = container.getInfo();
+ SessionInfo sessionInfo = info.getSession();
+ ExtendedAssert.assertNotNull(sessionInfo);
+ Boolean distributed = sessionInfo.getDistributed();
+ ExtendedAssert.assertEquals(Boolean.TRUE, distributed);
- AssertResult result = new AssertResult();
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- PortletContainer container = registry.getPortletContainer("/test-info.DistributedPortlet1");
- PortletInfo info = container.getInfo();
- SessionInfo sessionInfo = info.getSession();
- assertNotNull(sessionInfo);
- Boolean distributed = sessionInfo.getDistributed();
- assertEquals(Boolean.TRUE, distributed);
+ container = registry.getPortletContainer("/test-info.DistributedPortlet2");
+ info = container.getInfo();
+ sessionInfo = info.getSession();
+ ExtendedAssert.assertNotNull(sessionInfo);
+ distributed = sessionInfo.getDistributed();
+ ExtendedAssert.assertEquals(Boolean.FALSE, distributed);
- container = registry.getPortletContainer("/test-info.DistributedPortlet2");
- info = container.getInfo();
- sessionInfo = info.getSession();
- assertNotNull(sessionInfo);
- distributed = sessionInfo.getDistributed();
- assertEquals(Boolean.FALSE, distributed);
- }
- });
-
- return result;
+ return new EndTestResponse();
}
}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ActionRequestTestCase extends ServerTestRunner
+{
+ public ActionRequestTestCase()
+ {
+ super("test-jsr168-api-actionrequest.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ActionResponseTestCase extends ServerTestRunner
+{
+ public ActionResponseTestCase()
+ {
+ super("test-jsr168-api-actionresponse.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortalContextTestCase extends ServerTestRunner
+{
+ public PortalContextTestCase()
+ {
+ super("test-jsr168-api-portalcontext.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletConfigTestCase extends ServerTestRunner
+{
+ public PortletConfigTestCase()
+ {
+ super("test-jsr168-api-portletconfig.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletContextTestCase extends ServerTestRunner
+{
+ public PortletContextTestCase()
+ {
+ super("test-jsr168-api-portletcontext.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletModeTestCase extends ServerTestRunner
+{
+ public PortletModeTestCase()
+ {
+ super("test-jsr168-api-portletmode.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletPreferencesTestCase extends ServerTestRunner
+{
+ public PortletPreferencesTestCase()
+ {
+ super("test-jsr168-api-portletpreferences.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletSessionTestCase extends ServerTestRunner
+{
+ public PortletSessionTestCase()
+ {
+ super("test-jsr168-api-portletsession.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletSessionUtilTestCase extends ServerTestRunner
+{
+ public PortletSessionUtilTestCase()
+ {
+ super("test-jsr168-api-portletsessionutil.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletURLTestCase extends ServerTestRunner
+{
+ public PortletURLTestCase()
+ {
+ super("test-jsr168-api-portleturl.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RenderRequestTestCase extends ServerTestRunner
+{
+ public RenderRequestTestCase()
+ {
+ super("test-jsr168-api-renderrequest.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RenderResponseTestCase extends ServerTestRunner
+{
+ public RenderResponseTestCase()
+ {
+ super("test-jsr168-api-renderresponse.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowStateTestCase extends ServerTestRunner
+{
+ public WindowStateTestCase()
+ {
+ super("test-jsr168-api-windowstate.war");
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.actionrequest;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,52 +33,53 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.actionrequest;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -58,7 +58,7 @@
registry.addSequence("Constants", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("javax.portlet.userinfo", ActionRequest.USER_INFO);
@@ -66,7 +66,7 @@
assertEquals("FORM", ActionRequest.FORM_AUTH);
assertEquals("CLIENT_CERT", ActionRequest.CLIENT_CERT_AUTH);
assertEquals("DIGEST", ActionRequest.DIGEST_AUTH);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -78,9 +78,9 @@
registry.addSequence("Property", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -110,10 +110,10 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -126,9 +126,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -168,9 +168,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -183,9 +183,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -215,9 +215,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.actionresponse;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,39 +33,40 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.actionresponse;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -55,9 +55,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -187,9 +187,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -206,9 +206,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -238,9 +238,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -253,9 +253,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -276,9 +276,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portalcontext;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,29 +33,30 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portalcontext;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -52,7 +52,7 @@
registry.addSequence("SupportedPortletModes", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
Enumeration modesEnum = request.getPortalContext().getSupportedPortletModes();
@@ -69,7 +69,7 @@
assertTrue(modes.contains(PortletMode.EDIT));
assertTrue(modes.contains(PortletMode.HELP));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -81,7 +81,7 @@
registry.addSequence("SupportedWindowStates", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
Enumeration statesEnum = request.getPortalContext().getSupportedWindowStates();
@@ -99,7 +99,7 @@
assertTrue(states.contains(WindowState.MINIMIZED));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -111,14 +111,14 @@
registry.addSequence("PortalInfo", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
String info = request.getPortalContext().getPortalInfo();
assertTrue(info.length() > 0);
assertTrue(info.startsWith("JBoss Portal"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -130,7 +130,7 @@
registry.addSequence("Property", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert Exception is thrown
try
@@ -143,7 +143,7 @@
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portletconfig;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,34 +33,35 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portletconfig;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -56,13 +56,13 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
PortletConfig config = aport.getPortletConfig();
assertNotNull(config);
assertEquals("TestUniversalPortletA", config.getPortletName());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -74,7 +74,7 @@
registry.addSequence("PortletContext", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
PortletConfig config = aport.getPortletConfig();
@@ -85,7 +85,7 @@
assertNotNull(context);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -97,7 +97,7 @@
registry.addSequence("InitParameter", seq);
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
PortletConfig config = aport.getPortletConfig();
@@ -122,7 +122,7 @@
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -136,7 +136,7 @@
//this portlet has no init params defined
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
PortletConfig config = aport.getPortletConfig();
@@ -155,7 +155,7 @@
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
PortletConfig config = aport.getPortletConfig();
@@ -177,7 +177,7 @@
assertTrue(names.contains("InitParamA"));
assertTrue(names.contains("InitParamB"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portletcontext;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,63 +33,64 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portletcontext;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -52,11 +52,11 @@
registry.addSequence("ServerInfo", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
assertEquals(TestContants.SERVER_INVO, aport.getPortletContext().getServerInfo());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -68,7 +68,7 @@
registry.addSequence("Dispatcher", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
@@ -76,7 +76,7 @@
//assertNull(aport.getPortletContext().getRequestDispatcher("/notExistingDispatcher.jsp"));
assertNull(aport.getPortletContext().getNamedDispatcher("NotExistingDispatcher"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -88,13 +88,13 @@
registry.addSequence("Version", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
assertEquals(TestContants.MINOR_VERSION, aport.getPortletContext().getMinorVersion());
assertEquals(TestContants.MAJOR_VERSION, aport.getPortletContext().getMajorVersion());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -106,12 +106,12 @@
registry.addSequence("MimeType", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
assertEquals("text/plain", aport.getPortletContext().getMimeType("/simple_resource.txt"));
assertNull(aport.getPortletContext().getMimeType("/notExistingResource"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -123,7 +123,7 @@
registry.addSequence("ResourcePaths", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
@@ -133,7 +133,7 @@
assertTrue(paths.contains("/WEB-INF/"));
assertTrue(paths.contains("/simple_resource.txt"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -145,7 +145,7 @@
registry.addSequence("Resource", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
@@ -172,7 +172,7 @@
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -184,7 +184,7 @@
registry.addSequence("Attribute", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
@@ -220,7 +220,7 @@
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -232,7 +232,7 @@
registry.addSequence("InitParameter", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
@@ -249,7 +249,7 @@
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -261,13 +261,13 @@
registry.addSequence("PortletContextName", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
assertEquals("PortletContext WebApp", aport.getPortletContext().getPortletContextName());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portletmode;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,30 +33,31 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portletmode;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -49,13 +49,13 @@
registry.addSequence("Modes", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("view", "" + PortletMode.VIEW);
assertEquals("edit", "" + PortletMode.EDIT);
assertEquals("help", "" + PortletMode.HELP);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -67,7 +67,7 @@
registry.addSequence("Constructor", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("testmode", "" + new PortletMode("testmode"));
assertEquals("testmode", "" + new PortletMode("TESTMODE"));
@@ -75,7 +75,7 @@
assertEquals("", "" + new PortletMode(""));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -87,7 +87,7 @@
registry.addSequence("Equals", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletMode pm1 = new PortletMode("TestMode");
PortletMode pm2 = new PortletMode("TestMode");
@@ -99,7 +99,7 @@
assertTrue(!pm1.equals(pm3));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -111,7 +111,7 @@
registry.addSequence("HashCode", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletMode pm1 = new PortletMode("TestMode");
PortletMode pm2 = new PortletMode("TestMode");
@@ -128,7 +128,7 @@
assertEquals("othermode".hashCode(), pm3.hashCode());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portletpreferences;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,28 +33,29 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portletpreferences;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -58,7 +58,7 @@
registry.addSequence("ReadOnly", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
@@ -70,7 +70,7 @@
{
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -86,9 +86,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -186,9 +186,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -200,7 +200,7 @@
registry.addSequence("ResetNullKeyThrowsNPE", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws ReadOnlyException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws ReadOnlyException
{
try
{
@@ -211,7 +211,7 @@
{
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -225,7 +225,7 @@
registry.addSequence("ZeroLengthArrayValue", seq);
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletPreferences prefs = request.getPreferences();
@@ -236,7 +236,7 @@
//
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
@@ -264,7 +264,7 @@
});
seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletPreferences prefs = request.getPreferences();
@@ -273,7 +273,7 @@
assertEquals(new String[0], prefs.getValues("dynamic", new String[]{"other"}));
//
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portletsession;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,49 +33,50 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portletsession;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -49,11 +49,11 @@
registry.addSequence("Constants", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals(0x01, PortletSession.APPLICATION_SCOPE);
assertEquals(0x02, PortletSession.PORTLET_SCOPE);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -65,7 +65,7 @@
registry.addSequence("GetAttribute", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
@@ -110,7 +110,7 @@
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -122,7 +122,7 @@
registry.addSequence("AttributeNames", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
@@ -152,7 +152,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -164,7 +164,7 @@
registry.addSequence("CreationTime", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
@@ -182,7 +182,7 @@
catch (IllegalStateException expected)
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -194,7 +194,7 @@
registry.addSequence("Invalidate", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
@@ -210,7 +210,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -222,7 +222,7 @@
registry.addSequence("New", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
@@ -240,7 +240,7 @@
catch (IllegalStateException expected)
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -252,7 +252,7 @@
registry.addSequence("RemoveAttribute", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
@@ -300,7 +300,7 @@
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -312,7 +312,7 @@
registry.addSequence("SetAttribute", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
@@ -359,7 +359,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portletsessionutil;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,19 +33,20 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portletsessionutil;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -48,7 +48,7 @@
registry.addSequence("DecodeAttributeName", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("name", PortletSessionUtil.decodeAttributeName("name"));
@@ -63,7 +63,7 @@
assertEquals("javax.portlet.strange.id?name", PortletSessionUtil.decodeAttributeName("javax.portlet.strange.id?name"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -74,7 +74,7 @@
registry.addSequence("DecodeScope", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals(PortletSession.APPLICATION_SCOPE, PortletSessionUtil.decodeScope("simpleName"));
assertEquals(PortletSession.APPLICATION_SCOPE, PortletSessionUtil.decodeScope("javax.portlet.name"));
@@ -85,7 +85,7 @@
assertEquals(PortletSession.PORTLET_SCOPE, PortletSessionUtil.decodeScope("javax.portlet.p.id?name"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.portleturl;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,33 +33,34 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.portleturl;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -51,7 +51,7 @@
registry.addSequence("Parameter", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createRenderURL();
@@ -173,7 +173,7 @@
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.renderrequest;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,41 +33,42 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.renderrequest;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -54,7 +54,7 @@
registry.addSequence("Constants", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("javax.portlet.userinfo", RenderRequest.USER_INFO);
@@ -62,7 +62,7 @@
assertEquals("FORM", RenderRequest.FORM_AUTH);
assertEquals("CLIENT_CERT", RenderRequest.CLIENT_CERT_AUTH);
assertEquals("DIGEST", RenderRequest.DIGEST_AUTH);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -74,7 +74,7 @@
registry.addSequence("Property", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
@@ -95,7 +95,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -107,7 +107,7 @@
registry.addSequence("Attribute", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
@@ -136,7 +136,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -148,7 +148,7 @@
registry.addSequence("Parameter", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
@@ -168,7 +168,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.renderresponse;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,43 +33,44 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.renderresponse;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -48,10 +48,10 @@
registry.addSequence("Constants", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("portlet.expiration-cache", RenderResponse.EXPIRATION_CACHE);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -63,7 +63,7 @@
registry.addSequence("ContentType", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
@@ -74,7 +74,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -91,7 +91,7 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
@@ -110,7 +110,7 @@
catch (IllegalArgumentException expected)
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -123,7 +123,7 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
@@ -134,7 +134,7 @@
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.api.windowstate;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,30 +33,31 @@
public static Test 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;
+// 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;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api.windowstate;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -49,13 +49,13 @@
registry.addSequence("States", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("minimized", "" + WindowState.MINIMIZED);
assertEquals("maximized", "" + WindowState.MAXIMIZED);
assertEquals("normal", "" + WindowState.NORMAL);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -67,7 +67,7 @@
registry.addSequence("Constructor", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("teststate", "" + new WindowState("teststate"));
assertEquals("teststate", "" + new WindowState("TESTSTATE"));
@@ -75,7 +75,7 @@
assertEquals("", "" + new WindowState(""));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -87,7 +87,7 @@
registry.addSequence("Equals", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
WindowState ws1 = new WindowState("TestState");
WindowState ws2 = new WindowState("teststate");
@@ -99,7 +99,7 @@
assertTrue(!ws1.equals(ws3));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -111,7 +111,7 @@
registry.addSequence("HashCode", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
WindowState ws1 = new WindowState("TestState");
WindowState ws2 = new WindowState("teststate");
@@ -128,7 +128,7 @@
assertEquals("otherstate".hashCode(), ws3.hashCode());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ext;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DispatcherTestCase extends ServerTestRunner
+{
+ public DispatcherTestCase()
+ {
+ super("test-jsr168-ext-dispatcher.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ext;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletConfigTestCase extends ServerTestRunner
+{
+ public PortletConfigTestCase()
+ {
+ super("test-jsr168-ext-portletconfig.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ext;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletModeTestCase extends ServerTestRunner
+{
+ public PortletModeTestCase()
+ {
+ super("test-jsr168-ext-portletmode.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ext;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletRequestsTestCase extends ServerTestRunner
+{
+ public PortletRequestsTestCase()
+ {
+ super("test-jsr168-ext-portletrequests.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ext;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletResponsesTestCase extends ServerTestRunner
+{
+ public PortletResponsesTestCase()
+ {
+ super("test-jsr168-ext-portletresponses.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ext;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PreferencesTestCase extends ServerTestRunner
+{
+ public PreferencesTestCase()
+ {
+ super("test-jsr168-ext-preferences.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.ext;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SessionTestCase extends ServerTestRunner
+{
+ public SessionTestCase()
+ {
+ super("test-jsr168-ext-session.war");
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,9 +23,9 @@
package org.jboss.portal.test.portlet.jsr168.ext.dispatcher;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -64,7 +64,7 @@
registry.addSequence("GetRequestURI", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
response.setContentType("text/html");
@@ -76,10 +76,10 @@
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
assertEquals(org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherSequenceBuilder.SERVLET_A_URI, request.getRequestURI());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -91,7 +91,7 @@
registry.addSequence("RequestHeaderAccess", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
// Test the value is not there yet
Set propertyNames = Tools.toSet(request.getPropertyNames());
@@ -100,7 +100,7 @@
assertFalse(request.getProperties("myheader").hasMoreElements());
// Invoke render with header
- InvokeGetResult render = new InvokeGetResult(response.createRenderURL().toString());
+ InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
render.setHeader("myheader", "render-value");
return render;
}
@@ -108,7 +108,7 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
response.setContentType("text/html");
@@ -119,7 +119,7 @@
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response)
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response)
{
// Test the header is here
Set headerNames = Tools.toSet(request.getHeaderNames());
@@ -129,7 +129,7 @@
assertTrue(values.hasMoreElements());
assertEquals("render-value", values.nextElement());
assertFalse(values.hasMoreElements());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.ext.dispatcher;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -35,9 +33,10 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-ext-dispatcher.war");
- suite.addTest(new TestCase("GetRequestURI"));
- suite.addTest(new TestCase("RequestHeaderAccess"));
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-ext-dispatcher.war");
+// suite.addTest(new TestCase("GetRequestURI"));
+// suite.addTest(new TestCase("RequestHeaderAccess"));
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext.portletconfig;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -54,13 +54,13 @@
seq.addAction(0, GetResourceBundleDuringInitPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
ResourceBundle bundle = GetResourceBundleDuringInitPortlet.bundle;
assertNotNull(bundle);
assertEquals("bar", bundle.getObject("foo"));
assertEquals(Locale.ENGLISH, bundle.getLocale());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -73,7 +73,7 @@
seq.addAction(0, ResourceBundleCascadePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
@@ -124,7 +124,7 @@
assertThrowsMissingResourceException(bundle_fr);
assertThrowsMissingResourceException(bundle_fr_FR);
assertThrowsMissingResourceException(bundle_fr_FR_aa);
- return new EndTestResult();
+ return new EndTestResponse();
}
private void assertThrowsMissingResourceException(ResourceBundle bundle)
@@ -148,7 +148,7 @@
seq.addAction(0, ResourceBundlePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
ResourceBundle bundle = cfg.getResourceBundle(Locale.ENGLISH);
@@ -159,7 +159,7 @@
//
String title = bundle.getString("javax.portlet.title");
assertEquals("the title", title);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.ext.portletconfig;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -36,11 +34,12 @@
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-ext-portletconfig.war");
- suite.addTest(new TestCase("GetResourceBundleDuringInit"));
- suite.addTest(new TestCase("ResourceBundleCascade"));
- suite.addTest(new TestCase("ResourceBundle"));
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-ext-portletconfig.war");
+// suite.addTest(new TestCase("GetResourceBundleDuringInit"));
+// suite.addTest(new TestCase("ResourceBundleCascade"));
+// suite.addTest(new TestCase("ResourceBundle"));
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext.portletmode;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -54,11 +54,11 @@
registry.addSequence("TestActionWithPortletMode", seq);
seq.addAction(0, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
{
PortletURL url = response.createActionURL();
url.setPortletMode(PortletMode.EDIT);
- InvokeGetResult result = new InvokeGetResult(url.toString());
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
return result;
}
});
@@ -73,9 +73,9 @@
seq.addAction(1, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -86,10 +86,10 @@
registry.addSequence("TestDuringAction", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- InvokeGetResult result = new InvokeGetResult(url.toString());
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
return result;
}
});
@@ -105,9 +105,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
@@ -119,7 +119,7 @@
registry.addSequence("TestDuringRender", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
{
// Test null returns false
assertFalse(request.isPortletModeAllowed(null));
@@ -139,7 +139,7 @@
// Test we can set null portlet mode
url2.setPortletMode(null);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Deleted: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,46 +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.ext.portletmode;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
- * @version $Revision$
- */
-public class PortletModeTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-jsr168-ext-portletmode.war");
-
- suite.addTest(new TestCase("TestActionWithPortletMode"));
- suite.addTest(new TestCase("TestDuringAction"));
- suite.addTest(new TestCase("TestDuringRender"));
-
- return suite;
- }
-}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.ext.portletrequests;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -34,16 +32,17 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-ext-portletrequests.war");
- suite.addTest(new TestCase("ActionRequestUseForm"));
- suite.addTest(new TestCase("ActionRequestUseInputStream"));
- suite.addTest(new TestCase("ActionRequestUseReader"));
- suite.addTest(new TestCase("RequestAttribute"));
- suite.addTest(new TestCase("RequestAttributeScoping"));
- suite.addTest(new TestCase("RequestParameter"));
- suite.addTest(new TestCase("RequestHeaderAccess"));
-
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-ext-portletrequests.war");
+// suite.addTest(new TestCase("ActionRequestUseForm"));
+// suite.addTest(new TestCase("ActionRequestUseInputStream"));
+// suite.addTest(new TestCase("ActionRequestUseReader"));
+// suite.addTest(new TestCase("RequestAttribute"));
+// suite.addTest(new TestCase("RequestAttributeScoping"));
+// suite.addTest(new TestCase("RequestParameter"));
+// suite.addTest(new TestCase("RequestHeaderAccess"));
+//
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,10 +23,10 @@
package org.jboss.portal.test.portlet.jsr168.ext.portletrequests;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -71,20 +71,20 @@
registry.addSequence("ActionRequestUseForm", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- InvokePostResult iur = new InvokePostResult();
+ InvokePostResponse iur = new InvokePostResponse();
PortletURL url = response.createActionURL();
url.setParameter("g_foo1", "g_bar1_1");
url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
url.setParameter("g_foo3", new String[]{"g_bar3_1"});
iur.setURL(url.toString());
- InvokePostResult.FormBody body = new InvokePostResult.FormBody();
+ InvokePostResponse.FormBody body = new InvokePostResponse.FormBody();
body.addParameter("g_foo3", new String[]{"g_bar3_2"});
body.addParameter("g_foo4", new String[]{"g_bar4_1"});
body.addParameter("g_foo5", new String[]{"g_bar5_1", "g_bar5_2"});
iur.setBody(body);
- iur.setContentType(InvokePostResult.APPLICATION_X_WWW_FORM_URLENCODED);
+ iur.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
return iur;
}
});
@@ -98,7 +98,7 @@
assertEquals(new String[]{"g_bar3_1", "g_bar3_2"}, request.getParameterValues("g_foo3"));
assertEquals(new String[]{"g_bar4_1"}, request.getParameterValues("g_foo4"));
assertEquals(new String[]{"g_bar5_1", "g_bar5_2"}, request.getParameterValues("g_foo5"));
- assertEquals(InvokePostResult.APPLICATION_X_WWW_FORM_URLENCODED, request.getContentType());
+ assertEquals(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED, request.getContentType());
try
{
@@ -124,9 +124,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -142,17 +142,17 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- InvokePostResult iur = new InvokePostResult();
+ InvokePostResponse iur = new InvokePostResponse();
PortletURL url = response.createActionURL();
url.setParameter("g_foo1", "g_bar1_1");
url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
iur.setURL(url.toString());
- InvokePostResult.RawBody body = new InvokePostResult.RawBody();
+ InvokePostResponse.RawBody body = new InvokePostResponse.RawBody();
body.setBytes(byteContent);
iur.setBody(body);
- iur.setContentType(InvokePostResult.MULTIPART_FORM_DATA);
+ iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
return iur;
}
});
@@ -165,7 +165,7 @@
assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
- assertEquals(InvokePostResult.MULTIPART_FORM_DATA, request.getContentType());
+ assertEquals(InvokePostResponse.MULTIPART_FORM_DATA, request.getContentType());
assertEquals(byteContent.length, request.getContentLength());
InputStream in = null;
try
@@ -203,9 +203,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -220,17 +220,17 @@
registry.addSequence("ActionRequestUseReader", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- InvokePostResult iur = new InvokePostResult();
+ InvokePostResponse iur = new InvokePostResponse();
PortletURL url = response.createActionURL();
url.setParameter("g_foo1", "g_bar1_1");
url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
iur.setURL(url.toString());
- InvokePostResult.RawBody body = new InvokePostResult.RawBody();
+ InvokePostResponse.RawBody body = new InvokePostResponse.RawBody();
body.setBytes(byteContent);
iur.setBody(body);
- iur.setContentType(InvokePostResult.MULTIPART_FORM_DATA);
+ iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
return iur;
}
});
@@ -241,7 +241,7 @@
{
assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
- assertEquals(InvokePostResult.MULTIPART_FORM_DATA, request.getContentType());
+ assertEquals(InvokePostResponse.MULTIPART_FORM_DATA, request.getContentType());
assertEquals(byteContent.length, request.getContentLength());
Reader in = null;
try
@@ -279,9 +279,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -296,7 +296,7 @@
registry.addSequence("RequestAttribute", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
// Take a snapshot of the attribute names
Set snapshot = Tools.toSet(request.getAttributeNames());
@@ -316,7 +316,7 @@
expectedNames.remove("javax.portlet.config");
expectedNames.add("bar");
assertEquals(expectedNames, Tools.toSet(request.getAttributeNames()));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -331,11 +331,11 @@
registry.addSequence("RequestAttributeScoping", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertNull(request.getAttribute("foo"));
request.setAttribute("foo", "foo");
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -346,12 +346,12 @@
registry.addSequence("RequestParameter", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
url.setParameter("foo1", "bar1");
url.setParameter("foo2", new String[]{"bar2_1", "bar2_2"});
- InvokeGetResult iur = new InvokeGetResult(url.toString());
+ InvokeGetResponse iur = new InvokeGetResponse(url.toString());
return iur;
}
});
@@ -386,9 +386,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -401,7 +401,7 @@
registry.addSequence("RequestHeaderAccess", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
// Test the value is not there yet
Set propertyNames = Tools.toSet(request.getPropertyNames());
@@ -410,7 +410,7 @@
assertFalse(request.getProperties("myheader").hasMoreElements());
// Invoke render with header
- InvokeGetResult render = new InvokeGetResult(response.createRenderURL().toString());
+ InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
render.setHeader("myheader", "render-value");
return render;
}
@@ -418,7 +418,7 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
// Test the header is here
Set propertyNames = Tools.toSet(request.getPropertyNames());
@@ -430,7 +430,7 @@
assertFalse(values.hasMoreElements());
// Invoke action with header
- InvokeGetResult action = new InvokeGetResult(response.createActionURL().toString());
+ InvokeGetResponse action = new InvokeGetResponse(response.createActionURL().toString());
action.setHeader("myheader", "action-value");
return action;
}
@@ -453,9 +453,9 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext.portletresponses;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -46,7 +46,7 @@
registry.addSequence("ContentType", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
String responseContentType = request.getResponseContentType();
response.setContentType(responseContentType);
@@ -55,7 +55,7 @@
// Test that character encoding is ignored as specified by the spec in PLT.12.3.1
response.setContentType(responseContentType + "; charset=UTF-8");
assertEquals(responseContentType, response.getContentType());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.ext.portletresponses;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -35,11 +33,12 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-ext-portletresponses.war");
- suite.addTest(new TestCase("ContentType"));
-
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-ext-portletresponses.war");
+// suite.addTest(new TestCase("ContentType"));
+//
+//
+// return suite;
+ return null;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext.preferences;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -65,7 +65,7 @@
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
// Get prefs
PortletPreferences prefs = request.getPreferences();
@@ -73,7 +73,7 @@
//assert that isReadOnly returns correct values
assertEquals(true, prefs.isReadOnly("static_single_pref"));
assertEquals(false, prefs.isReadOnly("static_multi_pref"));
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -92,9 +92,9 @@
seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -105,10 +105,10 @@
registry.addSequence("StoreMustPersistAllChanges", seq);
seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -138,9 +138,9 @@
seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -161,9 +161,9 @@
seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -175,9 +175,9 @@
seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -229,9 +229,9 @@
seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.ext.preferences;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
@@ -35,18 +33,19 @@
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-ext-preferences.war");
-
- /**
- * Tests if .isReadOnly() returns correct values during action and render phases
- */
- suite.addTest(new TestCase("IsReadOnly"));
-
-
- suite.addTest(new TestCase("StoreMustPersistAllChanges"));
- suite.addTest(new TestCase("Map"));
-
- //
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-ext-preferences.war");
+//
+// /**
+// * Tests if .isReadOnly() returns correct values during action and render phases
+// */
+// suite.addTest(new TestCase("IsReadOnly"));
+//
+//
+// suite.addTest(new TestCase("StoreMustPersistAllChanges"));
+// suite.addTest(new TestCase("Map"));
+//
+// //
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext.session;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -67,11 +67,11 @@
registry.addSequence("SessionDoesNotExistBeforeItIsRequested", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession(false);
assertNull(session);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -87,12 +87,12 @@
registry.addSequence("ObtainNonNullSessionUsingCreateEqualsFalse", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
assertNotNull(session);
session.setAttribute("foo_1", "bar_1");
- InvokeGetResult igr = new InvokeGetResult(response.createActionURL().toString());
+ InvokeGetResponse igr = new InvokeGetResponse(response.createActionURL().toString());
return igr;
}
});
@@ -108,13 +108,13 @@
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession(false);
assertNotNull(session);
assertEquals("bar_1", session.getAttribute("foo_1"));
assertEquals("bar_2", session.getAttribute("foo_2"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -132,12 +132,12 @@
registry.addSequence("CrossContextSessionAttribute", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletSession session = request.getPortletSession();
session.setAttribute("key", "value", PortletSession.APPLICATION_SCOPE);
String path = request.getContextPath();
- InvokeGetResult igr = new InvokeGetResult(path + "/universalServletA");
+ InvokeGetResponse igr = new InvokeGetResponse(path + "/universalServletA");
return igr;
}
});
@@ -149,11 +149,11 @@
*/
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
HttpSession session = request.getSession();
assertEquals("value", session.getAttribute("key"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.ext.session;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -34,10 +32,11 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-ext-session.war");
- suite.addTest(new TestCase("ObtainNonNullSessionUsingCreateEqualsFalse"));
- suite.addTest(new TestCase("SessionDoesNotExistBeforeItIsRequested"));
- suite.addTest(new TestCase("CrossContextSessionAttribute"));
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-ext-session.war");
+// suite.addTest(new TestCase("ObtainNonNullSessionUsingCreateEqualsFalse"));
+// suite.addTest(new TestCase("SessionDoesNotExistBeforeItIsRequested"));
+// suite.addTest(new TestCase("CrossContextSessionAttribute"));
+// return suite;
+ return null;
}
}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.misc;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class Log4jTestCase extends ServerTestRunner
+{
+ public Log4jTestCase()
+ {
+ super("test-jsr168-misc-log4j.war");
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,8 @@
package org.jboss.portal.test.portlet.jsr168.misc.log4j;
import org.apache.log4j.Logger;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -46,12 +46,12 @@
registry.addSequence("TestLog4j", seq);
seq.addAction(0, LoggingPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
Logger logger = ((LoggingPortlet)portlet).getLogger();
assertNotNull(logger);
assertTrue("Logger is an instance of " + logger.getClass().getName() + " instead of ", logger instanceof CustomLogger);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Deleted: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,42 +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.misc.log4j;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
- * @version $Revision: 2972 $
- */
-public class Log4jTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-jsr168-misc-log4j.war");
- suite.addTest(new TestCase("TestLog4j"));
- return suite;
- }
-}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DispatcherTestCase extends ServerTestRunner
+{
+ public DispatcherTestCase()
+ {
+ super("test-jsr168-dispatcher.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletConfigTestCase extends ServerTestRunner
+{
+ public PortletConfigTestCase()
+ {
+ super("test-jsr168-portletconfig.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletContextTestCase extends ServerTestRunner
+{
+ public PortletContextTestCase()
+ {
+ super("test-jsr168-portletcontext.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletInterfaceTestCase extends ServerTestRunner
+{
+ public PortletInterfaceTestCase()
+ {
+ super("test-jsr168-portletinterface.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletModeTestCase extends ServerTestRunner
+{
+ public PortletModeTestCase()
+ {
+ super("test-jsr168-portletmode.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletRequestsTestCase extends ServerTestRunner
+{
+ public PortletRequestsTestCase()
+ {
+ super("test-jsr168-portletrequests.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletResponsesTestCase extends ServerTestRunner
+{
+ public PortletResponsesTestCase()
+ {
+ super("test-jsr168-portletresponses.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletSessionTestCase extends ServerTestRunner
+{
+ public PortletSessionTestCase()
+ {
+ super("test-jsr168-portletsession.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletURLTestCase extends ServerTestRunner
+{
+ public PortletURLTestCase()
+ {
+ super("test-jsr168-portleturl.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PreferencesTestCase extends ServerTestRunner
+{
+ public PreferencesTestCase()
+ {
+ super("test-jsr168-preferences.war");
+ }
+}
Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.tck;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowStatesTestCase extends ServerTestRunner
+{
+ public WindowStatesTestCase()
+ {
+ super("test-jsr168-windowstates.war");
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.dispatcher;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -76,7 +76,7 @@
registry.addSequence("ObtainingDispatcher", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
UTP1 p = (UTP1)portlet;
//correct
@@ -114,7 +114,7 @@
//correct
dispatcher = p.getPortletContext().getRequestDispatcher("/universalServletA");
assertNotNull(dispatcher);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -130,9 +130,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -148,7 +148,7 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
String path = "/universalServletA";
path += "?key1=k1value1&key2=k2value1";
@@ -160,13 +160,13 @@
//assert that params from query string doesn't last longer then in include call
assertEquals("differentValue", request.getParameter("key1"));
assertNull(request.getParameter("key2"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
assertEquals("k1value1", request.getParameter("key1"));
assertEquals("k2value1", request.getParameter("key2"));
@@ -190,7 +190,7 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
assertNotNull(dispatcher);
@@ -204,13 +204,13 @@
{
UTP1.local.set(null);
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
StringBuffer buffer = request.getRequestURL();
UTP1.local.set(buffer == null ? Boolean.TRUE : Boolean.FALSE);
@@ -231,7 +231,7 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
assertNotNull(dispatcher);
@@ -241,13 +241,13 @@
//assert that servlet handle this as GET
assertEquals(Boolean.TRUE, (Boolean)UTP1.local.get());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
if (request.getMethod().equals("GET"))
{
@@ -271,7 +271,7 @@
registry.addSequence("IncludedRequestParameters", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
assertNotNull(dispatcher);
@@ -344,13 +344,13 @@
assertTrue(!namesList.contains("javax.servlet.include.servlet_path"));
assertTrue(!namesList.contains("javax.servlet.include.path_info"));
assertTrue(!namesList.contains("javax.servlet.include.query_string"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
UTP1.local1.set(request.getAttribute("javax.servlet.include.request_uri"));
UTP1.local2.set(request.getAttribute("javax.servlet.include.context_path"));
@@ -373,7 +373,7 @@
registry.addSequence("IncludedRequestAttributes", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
assertNotNull(dispatcher);
@@ -387,7 +387,7 @@
//assert that servlet has access to correct objects via attributes
assertAttributes((AbstractUniversalTestPortlet)portlet, request, response);
- return new EndTestResult();
+ return new EndTestResponse();
}
@@ -415,7 +415,7 @@
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
UTP1.local1.set(request.getAttribute("javax.portlet.config"));
UTP1.local2.set(request.getAttribute("javax.portlet.request"));
@@ -450,7 +450,7 @@
registry.addSequence("RequestObject", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
//we dispatch to servlet and assertions will be done there
String queryString = "?key1=k1value1&key2=k2value1";
@@ -464,7 +464,7 @@
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//we get this object to assert some of it's method compare wieth http request methods
RenderRequest portletRequest = (RenderRequest)request.getAttribute("javax.portlet.request");
@@ -564,7 +564,7 @@
//SPEC:137
assertEquals("GET", request.getMethod());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -581,7 +581,7 @@
registry.addSequence("ResponseObject", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
//we dispatch to servlet and assertions will be done there
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
@@ -594,7 +594,7 @@
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//we get this object to assert some of it's method compare wieth http request methods
RenderResponse portletResponse = (RenderResponse)request.getAttribute("javax.portlet.response");
@@ -610,7 +610,7 @@
//SPEC:141
assertEquals(portletResponse.getLocale(), response.getLocale());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -629,7 +629,7 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
@@ -644,18 +644,18 @@
//expected
}
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//SPEC:142 - RuntimeException
throw new RuntimeException();
@@ -664,7 +664,7 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
assertNotNull(dispatcher);
@@ -678,18 +678,18 @@
//expected
}
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//SPEC:142 - checked exception of type IOException
throw new IOException();
@@ -698,7 +698,7 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
@@ -716,18 +716,18 @@
fail();
}
}
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(2, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//SPEC:143 - ServletException
throw new ServletException();
@@ -736,7 +736,7 @@
seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
/*PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
assertNotNull(dispatcher);
@@ -750,18 +750,18 @@
//expected
}*/
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(3, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//SPEC:143 - 'other' exception
throw new Error();
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.dispatcher;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -35,97 +33,98 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-dispatcher.war");
-
- /**
- * SPEC:121 Testable=true Section=PLT.16.1
- * SPEC:122 Testable=true Section=PLT.16.1
- * - ObtainingDispatcherPortlet
- * - ObtainingDispatcherServlet
- */
- suite.addTest(new TestCase("ObtainingDispatcher"));
-
- /**
- * SPEC:123 Testable= true Section=PLT.16.1.1
- * - QueryStringInRequestDispatcherPortlet
- * - QueryStringInRequestDispatcherServlet
- */
- suite.addTest(new TestCase("QueryStringInRequestDispatcher"));
-
- /**
- * SPEC:124 Testable=true Section=PLT.16.2
- * SPEC:125 Testable=true Section=PLT.16.2
- * - DispatchedRequestPortlet
- * - DispatchedRequestServlet
- */
- suite.addTest(new TestCase("DispatchedRequest"));
-
- /**
- * SPEC:126 Testable=true Section=PLT.16.3
- * - GETMethodPortlet
- * - GETMethodServlet
- */
- suite.addTest(new TestCase("GETMethod"));
-
- /**
- * SPEC:127 Testable=true Section=PLT.16.3.1
- * - IncludedRequestParametersPortlet
- * - IncludedRequestParametersDispatchedServlet
- * - IncludedRequestParametersNamedDispatchedServlet
- */
- suite.addTest(new TestCase("IncludedRequestParameters"));
-
- /**
- * SPEC:128 Testable=true Section=PLT.16.3.2
- * - IncludedRequestAttributesPortlet
- * - IncludedRequestAttributesDispatchedServlet
- */
- suite.addTest(new TestCase("IncludedRequestAttributes"));
-
- /**
- * SPEC:129 Testable=true Section=PLT.16.3.3
- * SPEC:130 Testable=true Section=PLT.16.3.3
- * SPEC:131 Testable=true Section=PLT.16.3.3
- * SPEC:132 Testable=true Section=PLT.16.3.3
- * SPEC:133 Testable=true Section=PLT.16.3.3
- * SPEC:134 Testable=true Section=PLT.16.3.3
- * SPEC:137 Testable=true Section=PLT.16.3.3
- * - RequestObjectPortlet
- * - RequestObjectServlet
- */
- suite.addTest(new TestCase("RequestObject"));
-
- /**
- * SPEC:135 Testable=true Section=PLT.16.3.3
- * SPEC:136 Testable=true Section=PLT.16.3.3
- * POSTPONED
- */
-
- /**
- * SPEC:138 Testable=true Section= PLT.16.3.3
- * SPEC:141 Testable=true Section= PLT.16.3.3
- */
- suite.addTest(new TestCase("ResponseObject"));
-
- /**
- * SPEC:139 Testable=true Section= PLT.16.3.3
- * NOT DONE YET
- */
-
- /**
- * SPEC:140 Testable=false(impl) Section= PLT.16.3.3
- * Testable=false(impl)!
- */
-
- /**
- * SPEC:142 Testable=true Section=PLT.16.3.4
- * SPEC:143 Testable=true Section=PLT.16.3.4
- * - ErrorHandlingPortlet
- * - ErrorHandlingServlet
- * - SampleException
- */
- suite.addTest(new TestCase("ErrorHandling"));
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-dispatcher.war");
+//
+// /**
+// * SPEC:121 Testable=true Section=PLT.16.1
+// * SPEC:122 Testable=true Section=PLT.16.1
+// * - ObtainingDispatcherPortlet
+// * - ObtainingDispatcherServlet
+// */
+// suite.addTest(new TestCase("ObtainingDispatcher"));
+//
+// /**
+// * SPEC:123 Testable= true Section=PLT.16.1.1
+// * - QueryStringInRequestDispatcherPortlet
+// * - QueryStringInRequestDispatcherServlet
+// */
+// suite.addTest(new TestCase("QueryStringInRequestDispatcher"));
+//
+// /**
+// * SPEC:124 Testable=true Section=PLT.16.2
+// * SPEC:125 Testable=true Section=PLT.16.2
+// * - DispatchedRequestPortlet
+// * - DispatchedRequestServlet
+// */
+// suite.addTest(new TestCase("DispatchedRequest"));
+//
+// /**
+// * SPEC:126 Testable=true Section=PLT.16.3
+// * - GETMethodPortlet
+// * - GETMethodServlet
+// */
+// suite.addTest(new TestCase("GETMethod"));
+//
+// /**
+// * SPEC:127 Testable=true Section=PLT.16.3.1
+// * - IncludedRequestParametersPortlet
+// * - IncludedRequestParametersDispatchedServlet
+// * - IncludedRequestParametersNamedDispatchedServlet
+// */
+// suite.addTest(new TestCase("IncludedRequestParameters"));
+//
+// /**
+// * SPEC:128 Testable=true Section=PLT.16.3.2
+// * - IncludedRequestAttributesPortlet
+// * - IncludedRequestAttributesDispatchedServlet
+// */
+// suite.addTest(new TestCase("IncludedRequestAttributes"));
+//
+// /**
+// * SPEC:129 Testable=true Section=PLT.16.3.3
+// * SPEC:130 Testable=true Section=PLT.16.3.3
+// * SPEC:131 Testable=true Section=PLT.16.3.3
+// * SPEC:132 Testable=true Section=PLT.16.3.3
+// * SPEC:133 Testable=true Section=PLT.16.3.3
+// * SPEC:134 Testable=true Section=PLT.16.3.3
+// * SPEC:137 Testable=true Section=PLT.16.3.3
+// * - RequestObjectPortlet
+// * - RequestObjectServlet
+// */
+// suite.addTest(new TestCase("RequestObject"));
+//
+// /**
+// * SPEC:135 Testable=true Section=PLT.16.3.3
+// * SPEC:136 Testable=true Section=PLT.16.3.3
+// * POSTPONED
+// */
+//
+// /**
+// * SPEC:138 Testable=true Section= PLT.16.3.3
+// * SPEC:141 Testable=true Section= PLT.16.3.3
+// */
+// suite.addTest(new TestCase("ResponseObject"));
+//
+// /**
+// * SPEC:139 Testable=true Section= PLT.16.3.3
+// * NOT DONE YET
+// */
+//
+// /**
+// * SPEC:140 Testable=false(impl) Section= PLT.16.3.3
+// * Testable=false(impl)!
+// */
+//
+// /**
+// * SPEC:142 Testable=true Section=PLT.16.3.4
+// * SPEC:143 Testable=true Section=PLT.16.3.4
+// * - ErrorHandlingPortlet
+// * - ErrorHandlingServlet
+// * - SampleException
+// */
+// suite.addTest(new TestCase("ErrorHandling"));
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletconfig;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -53,7 +53,7 @@
seq.addAction(0, InlineValuesNotInResourceBundlePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
@@ -67,7 +67,7 @@
assertEquals("title", bundle_en.getString("javax.portlet.title"));
assertEquals("short-title", bundle_en.getString("javax.portlet.short-title"));
assertEquals("keywords", bundle_en.getString("javax.portlet.keywords"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -79,7 +79,7 @@
seq.addAction(0, InlineValuesWithNoResourceBundleDefinedPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
@@ -99,7 +99,7 @@
assertEquals("title", bundle_en.getString("javax.portlet.title"));
assertEquals("short-title", bundle_en.getString("javax.portlet.short-title"));
assertEquals("keywords", bundle_en.getString("javax.portlet.keywords"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portletconfig;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -36,19 +34,20 @@
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portletconfig.war");
-
- /**
- * SPEC:24 Testable= true Section=PLT.6.2
- * - InlineValuesNotInResourcesBundlePortlet
- */
- suite.addTest(new TestCase("InlineValuesNotInResourceBundle"));
-
- /**
- * SPEC:24 Testable= true Section=PLT.6.2
- * - InlineValuesWithNoResourceBundleDefinedPortlet
- */
- suite.addTest(new TestCase("InlineValuesWithNoResourceBundleDefined"));
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portletconfig.war");
+//
+// /**
+// * SPEC:24 Testable= true Section=PLT.6.2
+// * - InlineValuesNotInResourcesBundlePortlet
+// */
+// suite.addTest(new TestCase("InlineValuesNotInResourceBundle"));
+//
+// /**
+// * SPEC:24 Testable= true Section=PLT.6.2
+// * - InlineValuesWithNoResourceBundleDefinedPortlet
+// */
+// suite.addTest(new TestCase("InlineValuesWithNoResourceBundleDefined"));
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletcontext;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -70,7 +70,7 @@
registry.addSequence("InitializationParameters", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
Enumeration enumeration = aport.getPortletContext().getInitParameterNames();
@@ -85,18 +85,18 @@
assertEquals(Boolean.TRUE, o);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
Enumeration portletEnumeration = (Enumeration)serv.getServletContext().getAttribute("initParams");
@@ -119,7 +119,7 @@
registry.addSequence("ContextAttributes", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
aport.getPortletContext().setAttribute("sharedObject", "sharedObjectValue");
@@ -137,13 +137,13 @@
assertTrue(aport.getPortletContext().getAttribute("sharedObject2").equals("sharedObjectValue2"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
UTP1.local.set(serv.getServletContext().getAttribute("sharedObject").equals("sharedObjectValue") ? Boolean.TRUE : Boolean.FALSE);
@@ -151,7 +151,7 @@
return null;
}
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
@@ -168,7 +168,7 @@
registry.addSequence("AccessSameSetOfResources", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
//we get resource and pass it to servlet
@@ -193,13 +193,13 @@
assertEquals(Boolean.TRUE, o);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
URL portletUrl = (URL)serv.getServletContext().getAttribute("resource");
@@ -222,7 +222,7 @@
return null;
}
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
@@ -240,7 +240,7 @@
registry.addSequence("TempDir", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
File tempDir = (File)aport.getPortletContext().getAttribute("javax.servlet.context.tempdir");
@@ -256,13 +256,13 @@
assertEquals(Boolean.TRUE, o);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
String path = (String)serv.getServletContext().getAttribute("tempDirPath");
@@ -274,7 +274,7 @@
return null;
}
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
return null;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portletcontext;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -36,33 +34,34 @@
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portletcontext.war");
-
- /**
- * SPEC:43 Testable=true Section=PLT.10.3
- */
- suite.addTest(new TestCase("InitializationParameters"));
-
- /**
- * SPEC:44 Testable=true Section=PLT.10.3
- */
- suite.addTest(new TestCase("ContextAttributes"));
-
- /**
- * SPEC:45 Testable=true Section=PLT.10.3
- */
- suite.addTest(new TestCase("AccessSameSetOfResources"));
-
- /**
- * SPEC:46 Testable=true Section=PLT.10.3
- */
- suite.addTest(new TestCase("TempDir"));
-
- /**
- * SPEC:47 Testable=true Section=PLT.10.3(servlet spec)
- * NOT DONE - POSTPONED
- */
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portletcontext.war");
+//
+// /**
+// * SPEC:43 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("InitializationParameters"));
+//
+// /**
+// * SPEC:44 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("ContextAttributes"));
+//
+// /**
+// * SPEC:45 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("AccessSameSetOfResources"));
+//
+// /**
+// * SPEC:46 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("TempDir"));
+//
+// /**
+// * SPEC:47 Testable=true Section=PLT.10.3(servlet spec)
+// * NOT DONE - POSTPONED
+// */
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -70,10 +70,10 @@
registry.addSequence("InitializeBeforeHandle", seq);
seq.addAction(0, InitializeBeforeHandlePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertTrue(InitializeBeforeHandlePortlet.init);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -94,7 +94,7 @@
//PortletExceptionDuringInitPortlet
seq.addAction(0, PortletExceptionDuringInitPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletExceptionDuringInitPortlet.rendered = true;
return null;
@@ -104,7 +104,7 @@
//RuntimeExceptionDuringInitPortlet
seq.addAction(0, RuntimeExceptionDuringInitPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
RuntimeExceptionDuringInitPortlet.rendered = true;
return null;
@@ -114,7 +114,7 @@
//UnavailableExceptionDuringInitPortlet
seq.addAction(0, UnavailableExceptionDuringInitPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
UnavailableExceptionDuringInitPortlet.rendered = true;
return null;
@@ -124,23 +124,23 @@
//ControllerPortlet
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//portlets shouldn't render itself
assertEquals(false, PortletExceptionDuringInitPortlet.rendered);
@@ -151,7 +151,7 @@
assertEquals(false, PortletExceptionDuringInitPortlet.destroyed);
assertEquals(false, UnavailableExceptionDuringInitPortlet.destroyed);
assertEquals(false, RuntimeExceptionDuringInitPortlet.destroyed);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
@@ -169,9 +169,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -185,10 +185,10 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals(Boolean.TRUE, (Boolean)UTP1.local.get());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -206,15 +206,15 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//pass action url
UTP2.holder = response.createActionURL().toString();
@@ -224,11 +224,11 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//get portlet b action url and invoke
assertNotNull(UTP2.holder);
- return new InvokeGetResult((String)UTP2.holder);
+ return new InvokeGetResponse((String)UTP2.holder);
}
});
@@ -243,7 +243,7 @@
seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert that render is after Portlet B action
assertEquals(Boolean.TRUE, (Boolean)UTP2.local.get());
@@ -253,20 +253,20 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert that render is after Portlet B action
assertEquals(Boolean.TRUE, (Boolean)UTP2.local.get());
//and reinvoke itself
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -283,23 +283,23 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//mark that Portlet B was invoked after portlet A render url
UTP2.holder = Boolean.TRUE;
@@ -309,11 +309,11 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert Portlet B was invoked
assertEquals(Boolean.TRUE, (Object)UTP2.holder);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -329,9 +329,9 @@
registry.addSequence("SendRedirectDuringAction", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -346,21 +346,43 @@
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//We shouldn't be here
- return new FailureResult("Render wasn't expected to be invoked");
+ return new FailureResponse("Render wasn't expected to be invoked");
}
});
}
+ public void createMinimizedStateDontRenderPortlet(SequenceRegistry registry)
+ {
+ registry.addSequence("MinimizedStateDontRenderPortlet", new Sequence());
+ }
+ /**
+ * SPEC:17 Testable=true Section=PLT.5.2.4.4
+ * SPEC:18 Testable=false Section=PLT.5.2.4.4
+ * SPEC:19 Testable=true Section=PLT.5.2.4.4
+ * This case is based on:
+ * - ExceptionsDuringRequestHandlingControllerPortlet
+ * - PortletExceptionDuringRequestHandlingPortlet
+ * - RuntimeExceptionDuringRequestHandlingPortlet
+ * - UnavailableExceptionDuringProcessActionPortlet
+ * - UnavailableExceptionDuringRenderPortlet
+ *
+ * This test is disabled. Specification doesn't defined strictly portal behaviour when
+ * one of the portlets throws PortletException. Currently in JBoss Portal if one portlet
+ * throws an PortletException than the rest of portlet of the page is not rendered - code 500
+ * is returned. Tests are based on different behaviour where rest of portlets are rendered.
+ */
+ /////suite.addTest(new PortletTestCase("ExceptionsDuringRequestHandlingPortlet"));
+
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -34,81 +32,81 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portletinterface.war");
-
- //SPEC:4 Testable=true Section=PLT.5.2.2
- suite.addTest(new TestCase("InitializeBeforeHandle"));
-
- /**
- * SPEC:5 Testable=true Section=PLT.5.2.2.1
- * SPEC:6 Testable=true Section=PLT.5.2.2.1
- * SPEC:8 Testable=true Section=PLT.5.2.2.1
- * This case is based on:
- * - PortletExceptionDuringInitPortlet
- * - RuntimeExceptionDuringInitPortlet
- * - UnavailableExceptionDuringInitPortlet
- */
- suite.addTest(new TestCase("ExceptionsOnInit"));
-
- /**
- * SPEC:7 Testable=true Section=PLT.5.2.2.1
- * POSTPONED
- */
-
- /**
- * SPEC:9 Testable=true Section=PLT 5.2.4
- */
- suite.addTest(new TestCase("InvokeActionFirst"));
-
- /**
- * SPEC:10 Testable=true Section=PLT 5.2.4
- */
- suite.addTest(new TestCase("InvokeRenderAfterActionURL"));
-
- /**
- * SPEC:11 Testable=true Section=PLT 5.2.4
- */
- suite.addTest(new TestCase("InvokeRenderAfterRenderURL"));
-
- /**
- * SPEC:12 Testable= true Section=PLT.5.2.4.1
- */
- suite.addTest(new TestCase("SendRedirectDuringAction"));
-
- /**
- * SPEC:13 Testable= true Section=PLT.5.2.4.2.1
- * SPEC:14 Testable= true Section=PLT.5.2.4.2.1
- * SPEC:15 Testable= true Section=PLT.5.2.4.2.1
- * -----> Tested in SPEC:36
- * - portletmode/spec/RequestDispatchingDependingOnModePortlet (SPEC:36)
- */
-
- /**
- * SPEC:16 Testable=true Section=PLT 5.2.4.2.1
- * - MinimizedStateDontRenderPortlet
- */
- suite.addTest(new TestCase("MinimizedStateDontRenderPortlet"));
-
- /**
- * SPEC:17 Testable=true Section=PLT.5.2.4.4
- * SPEC:18 Testable=false Section=PLT.5.2.4.4
- * SPEC:19 Testable=true Section=PLT.5.2.4.4
- * This case is based on:
- * - ExceptionsDuringRequestHandlingControllerPortlet
- * - PortletExceptionDuringRequestHandlingPortlet
- * - RuntimeExceptionDuringRequestHandlingPortlet
- * - UnavailableExceptionDuringProcessActionPortlet
- * - UnavailableExceptionDuringRenderPortlet
- *
- * This test is disabled. Specification doesn't defined strictly portal behaviour when
- * one of the portlets throws PortletException. Currently in JBoss Portal if one portlet
- * throws an PortletException than the rest of portlet of the page is not rendered - code 500
- * is returned. Tests are based on different behaviour where rest of portlets are rendered.
- */
- /////suite.addTest(new PortletTestCase("ExceptionsDuringRequestHandlingPortlet"));
-
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portletinterface.war");
+//
+// //SPEC:4 Testable=true Section=PLT.5.2.2
+// suite.addTest(new TestCase("InitializeBeforeHandle"));
+//
+// /**
+// * SPEC:5 Testable=true Section=PLT.5.2.2.1
+// * SPEC:6 Testable=true Section=PLT.5.2.2.1
+// * SPEC:8 Testable=true Section=PLT.5.2.2.1
+// * This case is based on:
+// * - PortletExceptionDuringInitPortlet
+// * - RuntimeExceptionDuringInitPortlet
+// * - UnavailableExceptionDuringInitPortlet
+// */
+// suite.addTest(new TestCase("ExceptionsOnInit"));
+//
+// /**
+// * SPEC:7 Testable=true Section=PLT.5.2.2.1
+// * POSTPONED
+// */
+//
+// /**
+// * SPEC:9 Testable=true Section=PLT 5.2.4
+// */
+// suite.addTest(new TestCase("InvokeActionFirst"));
+//
+// /**
+// * SPEC:10 Testable=true Section=PLT 5.2.4
+// */
+// suite.addTest(new TestCase("InvokeRenderAfterActionURL"));
+//
+// /**
+// * SPEC:11 Testable=true Section=PLT 5.2.4
+// */
+// suite.addTest(new TestCase("InvokeRenderAfterRenderURL"));
+//
+// /**
+// * SPEC:12 Testable= true Section=PLT.5.2.4.1
+// */
+// suite.addTest(new TestCase("SendRedirectDuringAction"));
+//
+// /**
+// * SPEC:13 Testable= true Section=PLT.5.2.4.2.1
+// * SPEC:14 Testable= true Section=PLT.5.2.4.2.1
+// * SPEC:15 Testable= true Section=PLT.5.2.4.2.1
+// * -----> Tested in SPEC:36
+// * - portletmode/spec/RequestDispatchingDependingOnModePortlet (SPEC:36)
+// */
+//
+// /**
+// * SPEC:16 Testable=true Section=PLT 5.2.4.2.1
+// * - MinimizedStateDontRenderPortlet
+// */
+// suite.addTest(new TestCase("MinimizedStateDontRenderPortlet"));
+//
+// /**
+// * SPEC:17 Testable=true Section=PLT.5.2.4.4
+// * SPEC:18 Testable=false Section=PLT.5.2.4.4
+// * SPEC:19 Testable=true Section=PLT.5.2.4.4
+// * This case is based on:
+// * - ExceptionsDuringRequestHandlingControllerPortlet
+// * - PortletExceptionDuringRequestHandlingPortlet
+// * - RuntimeExceptionDuringRequestHandlingPortlet
+// * - UnavailableExceptionDuringProcessActionPortlet
+// * - UnavailableExceptionDuringRenderPortlet
+// *
+// * This test is disabled. Specification doesn't defined strictly portal behaviour when
+// * one of the portlets throws PortletException. Currently in JBoss Portal if one portlet
+// * throws an PortletException than the rest of portlet of the page is not rendered - code 500
+// * is returned. Tests are based on different behaviour where rest of portlets are rendered.
+// */
+// /////suite.addTest(new PortletTestCase("ExceptionsDuringRequestHandlingPortlet"));
+//
+//
+// return suite;
+ return null;
}
-
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.PortletException;
@@ -59,57 +61,55 @@
protected void doRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.getCurrentRequestCount() == 0)
+ if (HttpTestContext.getCurrentRequestCount() == 0)
{
//Just repaint
PortletURL url = resp.createRenderURL();
- InvokeGetResult result = new InvokeGetResult(url.toString());
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
marshall(result);
}
- if (TestCaseContext.getCurrentRequestCount() == 1)
+ if (HttpTestContext.getCurrentRequestCount() == 1)
{
//Invoke PortletExceptionDuringRequestHandlingPortlet action
- InvokeGetResult result = new InvokeGetResult(PortletExceptionDuringRequestHandlingPortlet.actionURL);
+ InvokeGetResponse result = new InvokeGetResponse(PortletExceptionDuringRequestHandlingPortlet.actionURL);
marshall(result);
}
- if (TestCaseContext.getCurrentRequestCount() == 2)
+ if (HttpTestContext.getCurrentRequestCount() == 2)
{
//Invoke RuntimeExceptionDuringRequestHandlingPortlet action
- InvokeGetResult result = new InvokeGetResult(RuntimeExceptionDuringRequestHandlingPortlet.actionURL);
+ InvokeGetResponse result = new InvokeGetResponse(RuntimeExceptionDuringRequestHandlingPortlet.actionURL);
marshall(result);
}
- if (TestCaseContext.getCurrentRequestCount() == 3)
+ if (HttpTestContext.getCurrentRequestCount() == 3)
{
//Invoke UnavailableExceptionDuringProcessActionPortlet action
- InvokeGetResult result = new InvokeGetResult(UnavailableExceptionDuringProcessActionPortlet.actionURL);
+ InvokeGetResponse result = new InvokeGetResponse(UnavailableExceptionDuringProcessActionPortlet.actionURL);
marshall(result);
}
- if (TestCaseContext.getCurrentRequestCount() == 4)
+ if (HttpTestContext.getCurrentRequestCount() == 4)
{
//Just repaint
PortletURL url = resp.createRenderURL();
- InvokeGetResult result = new InvokeGetResult(url.toString());
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
marshall(result);
}
- else if (TestCaseContext.isCurrentRequestCount(5))
+ else if (HttpTestContext.isCurrentRequestCount(5))
{
- AssertResult ares = new AssertResult();
- ares.execute(new AssertResult.Test()
+ DriverResponse dr = bilto(new Runnable()
{
- public void run() throws Exception
+ public void run()
{
//portlets that shouldn't render itself after Exception in Action Phase
- assertEquals(false, PortletExceptionDuringRequestHandlingPortlet.rendered);
- assertEquals(false, RuntimeExceptionDuringRequestHandlingPortlet.rendered);
- assertEquals(false, UnavailableExceptionDuringProcessActionPortlet.rendered);
+ ExtendedAssert.assertEquals(false, PortletExceptionDuringRequestHandlingPortlet.rendered);
+ ExtendedAssert.assertEquals(false, RuntimeExceptionDuringRequestHandlingPortlet.rendered);
+ ExtendedAssert.assertEquals(false, UnavailableExceptionDuringProcessActionPortlet.rendered);
//and should be destroyed because of UnavailableException was throwed
- assertEquals(true, UnavailableExceptionDuringProcessActionPortlet.destroyed);
- assertEquals(true, UnavailableExceptionDuringRenderPortlet.destroyed);
+ ExtendedAssert.assertEquals(true, UnavailableExceptionDuringProcessActionPortlet.destroyed);
+ ExtendedAssert.assertEquals(true, UnavailableExceptionDuringRenderPortlet.destroyed);
}
- });
- marshall(ares);
-
+ }, new EndTestResponse());
+ marshall(dr);
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,10 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
import org.jboss.portal.test.framework.portlet.components.AbstractTestGenericPortlet;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
@@ -47,112 +48,90 @@
public class MinimizedStateDontRenderPortlet extends AbstractTestGenericPortlet
{
- private AssertResult ares;
+ private DriverResponse ares;
protected void doView(final RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(1))
+ if (HttpTestContext.isCurrentRequestCount(1))
{
- ares = new AssertResult();
- ares.execute(new AssertResult.Test()
- {
- public void run()
- {
- //shouldn't be here
- fail();
- }
- });
+ //shouldn't be here
+ ares = new FailureResponse();
}
}
protected void doEdit(final RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(2))
+ if (HttpTestContext.isCurrentRequestCount(2))
{
- ares = new AssertResult();
- ares.execute(new AssertResult.Test()
- {
- public void run()
- {
- //shouldn't be here
- fail();
- }
- });
+ //shouldn't be here
+ ares = new FailureResponse();
}
}
protected void doHelp(final RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(3))
+ if (HttpTestContext.isCurrentRequestCount(3))
{
- ares = new AssertResult();
- ares.execute(new AssertResult.Test()
- {
- public void run()
- {
- //shouldn't be here
- fail();
- }
- });
+ //shouldn't be here
+ ares = new FailureResponse();
}
}
-
- protected void doRenderInit(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ protected void preRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
if (ares == null)
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ if (HttpTestContext.isCurrentRequestCount(0))
{
PortletURL url = resp.createRenderURL();
//invoking VIEW mode
url.setPortletMode(PortletMode.VIEW);
url.setWindowState(WindowState.MINIMIZED);
- InvokeGetResult result = new InvokeGetResult(url.toString());
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
AbstractTestPortlet.marshall(result);
//set not null ares - becouse doRenderInit is invoked for every render request
- ares = new AssertResult();
+ ares = new EndTestResponse();
}
else
{
- AbstractTestPortlet.marshall(new FailureResult("The assert result was expected to be not null"));
+ AbstractTestPortlet.marshall(new FailureResponse("The assert result was expected to be not null"));
}
}
else
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ if (HttpTestContext.isCurrentRequestCount(0))
{
- AbstractTestPortlet.marshall(new FailureResult("The assert result was expected to be not null"));
+ AbstractTestPortlet.marshall(new FailureResponse("The assert result was expected to be not null"));
}
}
}
- protected void doRenderFinal(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ protected void postRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (ares.isFailed() || TestCaseContext.isCurrentRequestCount(3))
+ if (ares instanceof FailureResponse || HttpTestContext.isCurrentRequestCount(3))
{
AbstractTestPortlet.marshall(ares);
}
else
{
- if (TestCaseContext.isCurrentRequestCount(1))
+ if (HttpTestContext.isCurrentRequestCount(1))
{
PortletURL url = resp.createRenderURL();
//invoking EDIT mode
url.setPortletMode(PortletMode.EDIT);
url.setWindowState(WindowState.MINIMIZED);
- InvokeGetResult result = new InvokeGetResult(url.toString());
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
AbstractTestPortlet.marshall(result);
}
- else if (TestCaseContext.isCurrentRequestCount(2))
+ else if (HttpTestContext.isCurrentRequestCount(2))
{
PortletURL url = resp.createRenderURL();
//invoking HELP mode
url.setPortletMode(PortletMode.HELP);
url.setWindowState(WindowState.MINIMIZED);
- InvokeGetResult result = new InvokeGetResult(url.toString());
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
AbstractTestPortlet.marshall(result);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.ActionRequest;
@@ -59,7 +59,7 @@
protected void doProcessAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(2))
+ if (HttpTestContext.isCurrentRequestCount(2))
{
throw new PortletException();
}
@@ -67,12 +67,12 @@
protected void doRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ if (HttpTestContext.isCurrentRequestCount(0))
{
PortletURL url = resp.createActionURL();
actionURL = url.toString();
}
- else if (TestCaseContext.isCurrentRequestCount(2))
+ else if (HttpTestContext.isCurrentRequestCount(2))
{
PortletExceptionDuringRequestHandlingPortlet.rendered = true;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.ActionRequest;
@@ -61,7 +61,7 @@
protected void doProcessAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(3))
+ if (HttpTestContext.isCurrentRequestCount(3))
{
//throw new RuntimeException();
}
@@ -69,12 +69,12 @@
protected void doRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ if (HttpTestContext.isCurrentRequestCount(0))
{
PortletURL url = resp.createActionURL();
actionURL = url.toString();
}
- if (TestCaseContext.isCurrentRequestCount(3))
+ if (HttpTestContext.isCurrentRequestCount(3))
{
RuntimeExceptionDuringRequestHandlingPortlet.rendered = true;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.ActionRequest;
@@ -58,7 +58,7 @@
protected void doProcessAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(4))
+ if (HttpTestContext.isCurrentRequestCount(4))
{
//throw new UnavailableException("UnavailableException thrown during action phase for testing purposes");
}
@@ -66,12 +66,12 @@
protected void doRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ if (HttpTestContext.isCurrentRequestCount(0))
{
PortletURL url = resp.createActionURL();
actionURL = url.toString();
}
- if (TestCaseContext.isCurrentRequestCount(4))
+ if (HttpTestContext.isCurrentRequestCount(4))
{
UnavailableExceptionDuringProcessActionPortlet.rendered = true;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.PortletException;
@@ -55,7 +55,7 @@
protected void doRender(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ if (HttpTestContext.isCurrentRequestCount(0))
{
throw new UnavailableException("UnavailableException thrown during render phase for testing purposes");
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletmode;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -52,11 +52,10 @@
public void createNotInvokeModeDeclaredForNotSupportedMarkupCase(SequenceRegistry registry)
{
Sequence seq = new Sequence();
- registry.addSequence("NotInvokeModeDeclaredForNotSupportedMarkup", seq);
seq.addAction(0, NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
{
NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.url = response.createRenderURL();
NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.url.setPortletMode(PortletMode.EDIT);
@@ -66,28 +65,28 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//just repost so other portlet can create url in first render
PortletURL url = response.createRenderURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//invoke render url from different portlet to be able to call specific mode for it
//it has Mode set to EDIT
- return new InvokeGetResult(NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.url.toString());
+ return new InvokeGetResponse(NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.url.toString());
}
});
seq.addAction(2, NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws PortletModeException
{
if (request.getPortletMode().equals(PortletMode.EDIT))
{
@@ -100,23 +99,27 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//check that other portlet wasn't invoked
assertNull(UTP1.holder);
- return new EndTestResult();
+ return new EndTestResponse();
}
});
+// registry.addSequence("NotInvokeModeDeclaredForNotSupportedMarkup", seq);
+ }
+ public void createRequestDispatchingDependingOnModePortlet(SequenceRegistry registry)
+ {
+ registry.addSequence("RequestDispatchingDependingOnModePortlet", new Sequence());
}
-
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portletmode;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -35,26 +33,27 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portletmode.war");
-
- /**
- * SPEC:36 Testable=true Section=PLT.8.5
- * - RequestDispatchingDependingOnModePortlet
- */
- suite.addTest(new TestCase("RequestDispatchingDependingOnModePortlet"));
-
- /**
- * SPEC:37 Testable=true Section=PLT.8.6
- * Tested in SPEC:36 - RequestDispatchingDependingOnModePortlet as VIEW mode isn't specified in descriptor
- */
-
- /**
- * SPEC:38 Testable=true Section=PLT.8.6
- * - NotInvokeModeDeclaredForNotSupportedMarkupPortlet
- * - NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet
- */
- //suite.addTest(new TestCase("NotInvokeModeDeclaredForNotSupportedMarkup"));
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portletmode.war");
+//
+// /**
+// * SPEC:36 Testable=true Section=PLT.8.5
+// * - RequestDispatchingDependingOnModePortlet
+// */
+// suite.addTest(new TestCase("RequestDispatchingDependingOnModePortlet"));
+//
+// /**
+// * SPEC:37 Testable=true Section=PLT.8.6
+// * Tested in SPEC:36 - RequestDispatchingDependingOnModePortlet as VIEW mode isn't specified in descriptor
+// */
+//
+// /**
+// * SPEC:38 Testable=true Section=PLT.8.6
+// * - NotInvokeModeDeclaredForNotSupportedMarkupPortlet
+// * - NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet
+// */
+// //suite.addTest(new TestCase("NotInvokeModeDeclaredForNotSupportedMarkup"));
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,19 +22,18 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletmode.spec;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
import org.jboss.portal.test.framework.portlet.components.AbstractTestGenericPortlet;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
import javax.portlet.PortletException;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletURL;
import java.io.IOException;
/**
@@ -47,154 +46,75 @@
public class RequestDispatchingDependingOnModePortlet extends AbstractTestGenericPortlet
{
- private AssertResult ares;
- private boolean viewInvocation = false;
- private boolean editInvocation = false;
- private boolean helpInvocation = false;
+ /** . */
+ private String methodCall;
-
- protected void doView(final RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ protected void doView(final RenderRequest request, RenderResponse response) throws PortletException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(1))
+ if (HttpTestContext.isCurrentRequestCount(1))
{
- ares = new AssertResult();
- ares.execute(new AssertResult.Test()
- {
- public void run()
- {
- //assert that correct method was called
- assertEquals(request.getPortletMode(), PortletMode.VIEW);
-
- //assert that test goes well
- assertEquals(viewInvocation, false);
- assertEquals(editInvocation, false);
- assertEquals(helpInvocation, false);
- }
- });
- viewInvocation = true;
+ methodCall = "doView";
}
}
- protected void doEdit(final RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ protected void doEdit(final RenderRequest request, RenderResponse response) throws PortletException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(2))
+ if (HttpTestContext.isCurrentRequestCount(2))
{
- ares = new AssertResult();
- ares.execute(new AssertResult.Test()
- {
- public void run()
- {
- //assert that correct method was called
- assertEquals(request.getPortletMode(), PortletMode.EDIT);
-
- //assert that test goes well
- assertEquals(viewInvocation, true);
- assertEquals(editInvocation, false);
- assertEquals(helpInvocation, false);
- }
- });
- editInvocation = true;
+ methodCall = "doEdit";
}
}
- protected void doHelp(final RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ protected void doHelp(final RenderRequest request, RenderResponse response) throws PortletException, IOException
{
- if (TestCaseContext.isCurrentRequestCount(3))
+ if (HttpTestContext.isCurrentRequestCount(3))
{
- ares = new AssertResult();
- ares.execute(new AssertResult.Test()
- {
- public void run()
- {
- //assert that correct method was called
- assertEquals(request.getPortletMode(), PortletMode.HELP);
-
- //assert that test goes well
- assertEquals(viewInvocation, true);
- assertEquals(editInvocation, true);
- assertEquals(helpInvocation, false);
- }
- });
- helpInvocation = true;
+ methodCall = "doHelp";
}
}
-
- protected void doRenderInit(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ protected void preRender(RenderRequest req, RenderResponse resp) throws PortletException, IOException
{
+ methodCall = null;
+ }
- if (ares == null)
+ protected void postRender(RenderRequest req, RenderResponse resp) throws PortletException, IOException
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
- if (TestCaseContext.isCurrentRequestCount(0))
- {
- PortletURL url = resp.createRenderURL();
- //invoking VIEW mode
- url.setPortletMode(PortletMode.VIEW);
- InvokeGetResult result = new InvokeGetResult(url.toString());
- AbstractTestPortlet.marshall(result);
-
- //set not null ares - becouse doRenderInit is invoked for every render request
- ares = new AssertResult();
- }
- else
- {
- AbstractTestPortlet.marshall(new FailureResult("The assert result was expected to be not null"));
- }
+ // Invoking VIEW mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.VIEW);
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
+ AbstractTestPortlet.marshall(result);
}
- else
+ else if (HttpTestContext.isCurrentRequestCount(1))
{
- if (TestCaseContext.isCurrentRequestCount(0))
- {
- AbstractTestPortlet.marshall(new FailureResult("The assert result was expected to be not null"));
- }
- }
- }
+ ExtendedAssert.assertEquals("doView", methodCall);
- protected void doRenderFinal(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
- {
- if (ares.isFailed())
- {
- AbstractTestPortlet.marshall(ares);
+ // Invoking EDIT mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.EDIT);
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
+ AbstractTestPortlet.marshall(result);
}
- else
+ else if (HttpTestContext.isCurrentRequestCount(2))
{
- if (TestCaseContext.isCurrentRequestCount(1))
- {
- PortletURL url = resp.createRenderURL();
- //invoking EDIT mode
- url.setPortletMode(PortletMode.EDIT);
- InvokeGetResult result = new InvokeGetResult(url.toString());
- AbstractTestPortlet.marshall(result);
- }
- else if (TestCaseContext.isCurrentRequestCount(2))
- {
- PortletURL url = resp.createRenderURL();
- //invoking HELP mode
- url.setPortletMode(PortletMode.HELP);
- InvokeGetResult result = new InvokeGetResult(url.toString());
- AbstractTestPortlet.marshall(result);
- }
- else if (TestCaseContext.isCurrentRequestCount(3))
- {
- ares = new AssertResult();
- ares.execute(new AssertResult.Test()
- {
- public void run()
- {
- //assert that test went well
- assertEquals(viewInvocation, true);
- assertEquals(editInvocation, true);
- assertEquals(helpInvocation, true);
- }
- });
- helpInvocation = true;
+ ExtendedAssert.assertEquals("doEdit", methodCall);
- AbstractTestPortlet.marshall(ares);
- }
+ // Invoking HELP mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.HELP);
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
+ AbstractTestPortlet.marshall(result);
}
+ else if (HttpTestContext.isCurrentRequestCount(3))
+ {
+ ExtendedAssert.assertEquals("doHelp", methodCall);
-
+ //
+ AbstractTestPortlet.marshall(new EndTestResponse());
+ }
}
-
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portletrequests;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -34,76 +32,77 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portletrequests.war");
-
- /**
- * SPEC:48 Testable=true Section=PLT.11.1.1
- * SPEC:49 Testable=true Section=PLT.11.1.1
- * NOT TESTABLE - POSTPONED
- */
- /**
- * SPEC:50 Testable= true Section=PLT.11.1.1
- */
- suite.addTest(new TestCase("ActionToRequestParametersNotPropagated"));
-
- /**
- * SPEC:52 Testable=true Section=PLT.11.1.1
- */
- suite.addTest(new TestCase("ActionToRenderParameters"));
-
- /**
- * SPEC:51 Testable=true Section=PLT.11.1.1
- * SPEC:54 Testable=true Section=PLT.11.1.1
- */
- suite.addTest(new TestCase("ParametersDuringRenderNotTargeted"));
-
- /**
- * SPEC:53 Testable= true Section=PLT.11.1.1
- * NOT TESTABLE - Postponed
- */
-
- /**
- * SPEC:55 Testable=true Section=PLT.11.1.1
- * SPEC:56 Testable=true Section=PLT.11.1.1
- */
- suite.addTest(new TestCase("ParameterAccessMethodst"));
-
- /**
- * SPEC:57 Testable=false Section=PLT.11.1.2
- * Testable=fale
- */
-
- /**
- * SPEC:58 Testable= true Section=PLT.11.1.5
- * SPEC:59 Testable=true Section=PLT.11.1.5
- */
- suite.addTest(new TestCase("ContextPath"));
-
- /**
- * SPEC:60 Testable=true Section=PLT.11.1.7
- */
- suite.addTest(new TestCase("AuthType"));
-
- /**
- * SPEC:61 Testable=true Section=PLT.11.1.7
- */
- suite.addTest(new TestCase("ContentType"));
-
- /**
- * SPEC:62 Testable=true Section=PLT.11.1.7
- * NOT TESTABLE NOW AS PORTAL DOESN'T SUPPORT ADDITIONAL CONTENT TYPES
- */
-
- /**
- * SPEC:63 Testable=true Section=PLT.11.2.1
- */
- suite.addTest(new TestCase("ObtainingInputStreamAndReader"));
-
- /**
- * SPEC:64 Testable=true Section=PLT.11.2.1
- * NOT TESTABLE - Postponed
- */
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portletrequests.war");
+//
+// /**
+// * SPEC:48 Testable=true Section=PLT.11.1.1
+// * SPEC:49 Testable=true Section=PLT.11.1.1
+// * NOT TESTABLE - POSTPONED
+// */
+// /**
+// * SPEC:50 Testable= true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ActionToRequestParametersNotPropagated"));
+//
+// /**
+// * SPEC:52 Testable=true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ActionToRenderParameters"));
+//
+// /**
+// * SPEC:51 Testable=true Section=PLT.11.1.1
+// * SPEC:54 Testable=true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ParametersDuringRenderNotTargeted"));
+//
+// /**
+// * SPEC:53 Testable= true Section=PLT.11.1.1
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:55 Testable=true Section=PLT.11.1.1
+// * SPEC:56 Testable=true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ParameterAccessMethodst"));
+//
+// /**
+// * SPEC:57 Testable=false Section=PLT.11.1.2
+// * Testable=fale
+// */
+//
+// /**
+// * SPEC:58 Testable= true Section=PLT.11.1.5
+// * SPEC:59 Testable=true Section=PLT.11.1.5
+// */
+// suite.addTest(new TestCase("ContextPath"));
+//
+// /**
+// * SPEC:60 Testable=true Section=PLT.11.1.7
+// */
+// suite.addTest(new TestCase("AuthType"));
+//
+// /**
+// * SPEC:61 Testable=true Section=PLT.11.1.7
+// */
+// suite.addTest(new TestCase("ContentType"));
+//
+// /**
+// * SPEC:62 Testable=true Section=PLT.11.1.7
+// * NOT TESTABLE NOW AS PORTAL DOESN'T SUPPORT ADDITIONAL CONTENT TYPES
+// */
+//
+// /**
+// * SPEC:63 Testable=true Section=PLT.11.2.1
+// */
+// suite.addTest(new TestCase("ObtainingInputStreamAndReader"));
+//
+// /**
+// * SPEC:64 Testable=true Section=PLT.11.2.1
+// * NOT TESTABLE - Postponed
+// */
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletrequests;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -61,12 +61,12 @@
registry.addSequence("ActionToRequestParametersNotPropagated", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
url.setParameter("key1", "k1value1");
url.setParameter("key2", new String[]{"k2value1", "k2value2", "k2value3"});
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -82,12 +82,12 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert that parameters weren't propagated from Action phase
assertNull(request.getParameter("key1"));
assertNull(request.getParameter("key2"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -103,10 +103,10 @@
registry.addSequence("ActionToRenderParameters", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -122,12 +122,12 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert that we received parameters from action phase
assertEquals("k1value1", request.getParameter("key1"));
assertEquals(new String[]{"k2value1", "k2value2", "k2value3"}, request.getParameterValues("key2"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -144,7 +144,7 @@
registry.addSequence("ParametersDuringRenderNotTargeted", seq);
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
UTP2.holder = response.createRenderURL();
return null;
@@ -153,7 +153,7 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//just repost so other portlet can create url in first render
PortletURL url = response.createRenderURL();
@@ -161,25 +161,25 @@
//we are setting params to ourselves to test if they will last while request to another porltet
url.setParameter("portlet1key1", "p1k1value1");
url.setParameter("portlet1key2", new String[]{"p1k2value1", "p1k2value2", "p1k2value3"});
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//invoke render url from different portlet to be able to pass some params to it
PortletURL url = (PortletURL)UTP2.holder;
url.setParameter("portlet2key1", "p2k1value1");
url.setParameter("portlet2key2", new String[]{"p2k2value1", "p2k2value2", "p2k2value3"});
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals("p2k1value1", request.getParameter("portlet2key1"));
assertEquals(new String[]{"p2k2value1", "p2k2value2", "p2k2value3"}, request.getParameterValues("portlet2key2"));
@@ -189,7 +189,7 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//we test if we have params set during requestCount==0, becouse our portlet
//wasn't targeted in current render request
@@ -203,18 +203,18 @@
//and just repost so other portlet render invokation can be finished
PortletURL url = response.createRenderURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//second portlet asserted if it received correct parameters during render request
//we simply end test
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -232,13 +232,13 @@
registry.addSequence("ParameterAccessMethodst", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
//set some parameters for testing
url.setParameter("key1", "k1value1");
url.setParameter("key2", new String[]{"k2value1", "k2value2", "k2value3"});
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -258,9 +258,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -279,10 +279,10 @@
registry.addSequence("ContextPath", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -304,7 +304,7 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//and we test the same for RenderRequest
@@ -316,7 +316,7 @@
assertTrue(path.subSequence(0, 1).equals("/"));
assertTrue(!path.subSequence(path.length() - 1, path.length()).equals("/"));
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -331,10 +331,10 @@
registry.addSequence("AuthType", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -349,11 +349,11 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//in current testsuite there is no user authentication
assertNull(request.getAuthType());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -371,10 +371,10 @@
registry.addSequence("ContentType", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -391,9 +391,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
@@ -411,10 +411,10 @@
registry.addSequence("ObtainingInputStreamAndReader", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -438,10 +438,10 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -465,9 +465,9 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletresponses;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -73,10 +73,10 @@
registry.addSequence("SendRedirectWithRelativeURL", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -98,9 +98,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -116,10 +116,10 @@
registry.addSequence("SendRedirectAfterChangeStateMethods", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -142,10 +142,10 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -168,10 +168,10 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -194,10 +194,10 @@
seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -222,9 +222,9 @@
seq.addAction(4, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -240,10 +240,10 @@
registry.addSequence("NotAllowedMode", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -265,9 +265,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -283,10 +283,10 @@
registry.addSequence("NotSupportedWindowState", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -308,9 +308,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -327,10 +327,10 @@
registry.addSequence("StateChangesAfterRedirectionSend", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -364,17 +364,17 @@
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new FailureResult("Render wasn't expected to be called");
+ return new FailureResponse("Render wasn't expected to be called");
}
});
}
@@ -392,10 +392,10 @@
registry.addSequence("RenderParameters", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -412,23 +412,23 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//we should receive overwrite values
assertEquals("k1value1", request.getParameter("key1"));
assertEquals(new String[]{"k2value1", "k2value2", "k2value3"}, request.getParameterValues("key2"));
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//we shouldn't receive anything as no parameters were set during action phase
assertNull(request.getParameter("key1"));
assertNull(request.getParameter("key2"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -445,10 +445,10 @@
registry.addSequence("ParametersSetAfterSendRedirect", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -484,17 +484,17 @@
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new FailureResult("Render wasn't expected");
+ return new FailureResponse("Render wasn't expected");
}
});
}
@@ -511,7 +511,7 @@
registry.addSequence("SetNotSupportedContentType", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
@@ -522,7 +522,7 @@
{
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -537,7 +537,7 @@
registry.addSequence("SetContentTypeBeforeOutputStreamOrWriter", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
try
{
@@ -548,13 +548,13 @@
{
//expected as no content type was set
}
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
try
{
@@ -565,7 +565,7 @@
{
//expected as no content type was set
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -580,7 +580,7 @@
registry.addSequence("GetContentType", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
@@ -596,7 +596,7 @@
{
//expected as no content type was set
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -612,7 +612,7 @@
registry.addSequence("OutputStreamOrWriter", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
response.setContentType("text/html");
response.getWriter();
@@ -625,13 +625,13 @@
{
//expected
}
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
//we need this to be able to marshal the result
response.setContentType("text/html");
@@ -654,7 +654,7 @@
// Writer writer = new OutputStreamWriter(os);
// ServerResultMarshaller.marshall(, writer, TestCaseContext.getCurrentTestCaseId());
// writer.close();
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -673,7 +673,7 @@
registry.addSequence("NamespaceEncoding", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
String namespace = response.getNamespace();
@@ -686,7 +686,7 @@
assertEquals(namespace, response.getNamespace());
assertEquals(namespace, response.getNamespace());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -724,10 +724,10 @@
registry.addSequence("IllegalStateExceptionAfterSendRedirect", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -743,19 +743,19 @@
seq.addAction(1, UTS2.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
- return new FailureResult("Redirection shouldn't be made");
+ return new FailureResponse("Redirection shouldn't be made");
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//if redirect wasn't called we should be here. Alternatively we should use other portlet
//with same test id to render the response.
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -773,17 +773,19 @@
registry.addSequence("BufferSize", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- //no buffering is defined
+ // No buffering is defined
assertEquals(0, response.getBufferSize());
- //we define buffer size
+ // We define buffer size
response.setBufferSize(1000000);
- //and assert that buffer size is at least what we set
+ // And assert that buffer size is at least what we set
assertTrue(response.getBufferSize() >= 1000000);
- return new EndTestResult();
+
+ //
+ return new EndTestResponse();
}
});
}
@@ -798,17 +800,17 @@
registry.addSequence("BufferReset", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//here we should test if after resetBuffer() response properties were cleared
//but it's rather hard to do this now as there is no getProperty() method.
- return new InvokeGetResult(response.createRenderURL().toString());
+ return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException
{
response.setContentType("text/html");
PrintWriter writer = response.getWriter();
@@ -823,7 +825,7 @@
{
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portletresponses;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -35,109 +33,110 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portletresponses.war");
-
- /**
- * SPEC:65 Testable=true Section=PLT.12.2.1
- */
- suite.addTest(new TestCase("SendRedirectWithRelativeURL"));
-
- /**
- * SPEC:66 Testable=true Section=PLT.12.2.1
- */
- suite.addTest(new TestCase("SendRedirectAfterChangeStateMethods"));
-
- /**
- * SPEC:67 Testable=true Section=PLT.12.2.2
- */
- suite.addTest(new TestCase("NotAllowedMode"));
-
- /**
- * SPEC:68 Testable=true Section=PLT.12.2.2
- */
- suite.addTest(new TestCase("NotSupportedWindowState"));
-
- /**
- * SPEC:69 Testable= true Section=PLT.12.2.2
- * SPEC:70 Testable= true Section=PLT.12.2.2
- */
- suite.addTest(new TestCase("StateChangesAfterRedirectionSend"));
-
- /**
- * SPEC:71 Testable=true Section=PLT.12.2.2
- *
- * This is dissabled as after propagating IllegalStateException to PortletContainer
- * '500' code is returned which doesn't allow us to end test properly
- */
- //suite.addTest(new PortletTestCase("IllegalStateExceptionAfterSendRedirect"));
-
- /**
- * SPEC:72 Testable= true Section=PLT.12.2.3
- * SPEC:73 Testable= true Section=PLT.12.2.3
- */
- suite.addTest(new TestCase("RenderParameters"));
-
- /**
- * SPEC:74 Testable= true Section=PLT.12.2.3
- * SPEC:75 Testable= true Section=PLT.12.2.3
- *
- * SPEC:75 done only partially - see SPEC:71 comment for the reason
- */
- suite.addTest(new TestCase("ParametersSetAfterSendRedirect"));
-
- /**
- * SPEC:76 Testable=true Section=PLT.12.3.1
- */
- suite.addTest(new TestCase("SetNotSupportedContentType"));
-
- /**
- * SPEC:77 Testable= true Section=PLT.12.3.1
- */
- suite.addTest(new TestCase("SetContentTypeBeforeOutputStreamOrWriter"));
-
- /**
- * SPEC:78 Testable= true Section=PLT.12.3.1
- */
- suite.addTest(new TestCase("GetContentType"));
-
- /**
- * SPEC:79 Testable= true Section=PLT.12.3.2
- */
- suite.addTest(new TestCase("OutputStreamOrWriter"));
-
- /**
- * SPEC:80 Testable=true Section=PLT.12.3.3
- * SPEC:81 Testable=true Section=PLT.12.3.3
- *
- * This is commented as no buffering is implemented yet
- */
- //suite.addTest(new TestCase("BufferSize"));
-
- /**
- * SPEC:82 Testable=true Section=PLT.12.3.3
- * NOT TESTABLE - Postponed
- */
-
- /**
- * SPEC:83 Testable=true Section=PLT.12.3.3
- *
- * This is commented as no buffering is implemented yet
- */
- //suite.addTest(new TestCase("BufferReset"));
-
- /**
- * SPEC:84 Testable=true Section=PLT.12.3.3
- * SPEC:85 Testable=true Section=PLT.12.3.3
- * NOT TESTABLE - Postponed
- */
-
- /**
- * SPEC:86 Testable= true Section=PLT.12.3.4
- * SPEC:87 Testable= true Section=PLT.12.3.4
- * SPEC:88 Testable= true Section=PLT.12.3.4
- */
- suite.addTest(new TestCase("NamespaceEncoding"));
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portletresponses.war");
+//
+// /**
+// * SPEC:65 Testable=true Section=PLT.12.2.1
+// */
+// suite.addTest(new TestCase("SendRedirectWithRelativeURL"));
+//
+// /**
+// * SPEC:66 Testable=true Section=PLT.12.2.1
+// */
+// suite.addTest(new TestCase("SendRedirectAfterChangeStateMethods"));
+//
+// /**
+// * SPEC:67 Testable=true Section=PLT.12.2.2
+// */
+// suite.addTest(new TestCase("NotAllowedMode"));
+//
+// /**
+// * SPEC:68 Testable=true Section=PLT.12.2.2
+// */
+// suite.addTest(new TestCase("NotSupportedWindowState"));
+//
+// /**
+// * SPEC:69 Testable= true Section=PLT.12.2.2
+// * SPEC:70 Testable= true Section=PLT.12.2.2
+// */
+// suite.addTest(new TestCase("StateChangesAfterRedirectionSend"));
+//
+// /**
+// * SPEC:71 Testable=true Section=PLT.12.2.2
+// *
+// * This is dissabled as after propagating IllegalStateException to PortletContainer
+// * '500' code is returned which doesn't allow us to end test properly
+// */
+// //suite.addTest(new PortletTestCase("IllegalStateExceptionAfterSendRedirect"));
+//
+// /**
+// * SPEC:72 Testable= true Section=PLT.12.2.3
+// * SPEC:73 Testable= true Section=PLT.12.2.3
+// */
+// suite.addTest(new TestCase("RenderParameters"));
+//
+// /**
+// * SPEC:74 Testable= true Section=PLT.12.2.3
+// * SPEC:75 Testable= true Section=PLT.12.2.3
+// *
+// * SPEC:75 done only partially - see SPEC:71 comment for the reason
+// */
+// suite.addTest(new TestCase("ParametersSetAfterSendRedirect"));
+//
+// /**
+// * SPEC:76 Testable=true Section=PLT.12.3.1
+// */
+// suite.addTest(new TestCase("SetNotSupportedContentType"));
+//
+// /**
+// * SPEC:77 Testable= true Section=PLT.12.3.1
+// */
+// suite.addTest(new TestCase("SetContentTypeBeforeOutputStreamOrWriter"));
+//
+// /**
+// * SPEC:78 Testable= true Section=PLT.12.3.1
+// */
+// suite.addTest(new TestCase("GetContentType"));
+//
+// /**
+// * SPEC:79 Testable= true Section=PLT.12.3.2
+// */
+// suite.addTest(new TestCase("OutputStreamOrWriter"));
+//
+// /**
+// * SPEC:80 Testable=true Section=PLT.12.3.3
+// * SPEC:81 Testable=true Section=PLT.12.3.3
+// *
+// * This is commented as no buffering is implemented yet
+// */
+// //suite.addTest(new TestCase("BufferSize"));
+//
+// /**
+// * SPEC:82 Testable=true Section=PLT.12.3.3
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:83 Testable=true Section=PLT.12.3.3
+// *
+// * This is commented as no buffering is implemented yet
+// */
+// //suite.addTest(new TestCase("BufferReset"));
+//
+// /**
+// * SPEC:84 Testable=true Section=PLT.12.3.3
+// * SPEC:85 Testable=true Section=PLT.12.3.3
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:86 Testable= true Section=PLT.12.3.4
+// * SPEC:87 Testable= true Section=PLT.12.3.4
+// * SPEC:88 Testable= true Section=PLT.12.3.4
+// */
+// suite.addTest(new TestCase("NamespaceEncoding"));
+// return suite;
+ return null;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletsession;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -74,19 +74,19 @@
registry.addSequence("SessionCreate", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//we ensure that session is ceated
UTP1.holder = request.getPortletSession();
assertNotNull(UTP1.holder);
PortletURL url = response.createRenderURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
UTP2.holder = request.getPortletSession();
return null;
@@ -95,11 +95,11 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert that during same request it was the same object
assertTrue(((PortletSession)UTP1.holder).getId().equals(((PortletSession)UTP2.holder).getId()));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -126,12 +126,12 @@
registry.addSequence("SessionAttributes", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
request.getPortletSession(true).setAttribute("key1", "k1value1", PortletSession.APPLICATION_SCOPE);
request.getPortletSession().setAttribute("key2", "k2value1", PortletSession.PORTLET_SCOPE);
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -146,7 +146,7 @@
seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert that we have access to APLICATION_SCOPE and not to PORTLET_SCOPE attributes
assertEquals("k1value1", request.getPortletSession().getAttribute("key1", PortletSession.APPLICATION_SCOPE));
@@ -157,28 +157,28 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//in this request count we do an assert in SessionAttributesHelperPortlet
//so just repaint to let it finish
PortletURL url = response.createRenderURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//invoke servlet
String path = request.getContextPath();
- return new InvokeGetResult(path + "/universalServletA");
+ return new InvokeGetResponse(path + "/universalServletA");
}
});
seq.addAction(3, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//assert that we have access to APLICATION_SCOPE and not to PORTLET_SCOPE attributes
assertEquals("k1value1", request.getSession().getAttribute("key1"));
@@ -206,7 +206,7 @@
//then we must assert it is namespaced correctly
assertTrue(Pattern.matches("javax.portlet.p.[^\\?]*\\?key2", name));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -224,20 +224,20 @@
registry.addSequence("HttpSessionRelations", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
UTP1.holder = response.createRenderURL().toString();
request.getPortletSession().setAttribute("key1", "k1value1", PortletSession.APPLICATION_SCOPE);
String path = request.getContextPath();
- return new InvokeGetResult(path + "/universalServletA");
+ return new InvokeGetResponse(path + "/universalServletA");
}
});
seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
{
- protected Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//assert that we can access attributest stored in PortletSession
assertEquals("k1value1", request.getSession().getAttribute("key1"));
@@ -246,18 +246,18 @@
request.getSession().setAttribute("key2", "k2value1");
//invoke portlet
- return new InvokeGetResult((String)UTP1.holder);
+ return new InvokeGetResponse((String)UTP1.holder);
}
});
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//assert that we can access attributest stored in HttpSession
assertEquals("k2value1", request.getPortletSession().getAttribute("key2", PortletSession.APPLICATION_SCOPE));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -272,7 +272,7 @@
registry.addSequence("HttpSessionInvalidatesPortletSession", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
PortletSession session = request.getPortletSession();
assertNotNull(session);
@@ -302,7 +302,7 @@
assertNull(session.getAttribute("doesnotexist"));
//
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -317,7 +317,7 @@
registry.addSequence("PortletSessionInvalidatesHttpSession", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, PortletException
{
try
{
@@ -349,7 +349,7 @@
}
//
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portletsession;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -34,49 +32,50 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portletsession.war");
-
- /**
- * SPEC:106 Testable=true Section=PLT.15.1
- * SPEC:107 Testable=true Section=PLT.15.1
- */
- suite.addTest(new TestCase("SessionCreate"));
-
- /**
- * SPEC:108 Testable=true Section=PLT.15.2
- * SPEC:109 Testable=true Section=PLT.15.2
- * NOT TESTABLE - Postponed
- */
-
- /**
- * SPEC:110 Testable=true Section=PLT.15.3
- * SPEC:111 Testable=true Section=PLT.15.3
- * SPEC:112 Testable=true Section=PLT.15.3
- * SPEC:117 Testable=true Section=PLT.15.4.1
- * SPEC:118 Testable=true Section=PLT.15.4.1
- * SPEC:119 Testable=true Section=PLT.15.4.1
- */
- suite.addTest(new TestCase("SessionAttributes"));
-
- /**
- * SPEC:113 Testable=true Section=PLT.15.4
- * SPEC:114 Testable=true Section=PLT.15.4
- */
- suite.addTest(new TestCase("HttpSessionRelations"));
-
- /**
- * SPEC:115 Testable=true Section=PLT.15.4
- * SPEC:116 Testable=true Section=PLT.15.4
- */
-// suite.addTest(new TestCase("SessionInvalidation"));
- suite.addTest(new TestCase("HttpSessionInvalidatesPortletSession"));
- suite.addTest(new TestCase("PortletSessionInvalidatesHttpSession"));
-
- /**
- * SPEC:120 Testable=true Section=PLT.15.8
- * NOT TESTABLE - Postponed
- */
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portletsession.war");
+//
+// /**
+// * SPEC:106 Testable=true Section=PLT.15.1
+// * SPEC:107 Testable=true Section=PLT.15.1
+// */
+// suite.addTest(new TestCase("SessionCreate"));
+//
+// /**
+// * SPEC:108 Testable=true Section=PLT.15.2
+// * SPEC:109 Testable=true Section=PLT.15.2
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:110 Testable=true Section=PLT.15.3
+// * SPEC:111 Testable=true Section=PLT.15.3
+// * SPEC:112 Testable=true Section=PLT.15.3
+// * SPEC:117 Testable=true Section=PLT.15.4.1
+// * SPEC:118 Testable=true Section=PLT.15.4.1
+// * SPEC:119 Testable=true Section=PLT.15.4.1
+// */
+// suite.addTest(new TestCase("SessionAttributes"));
+//
+// /**
+// * SPEC:113 Testable=true Section=PLT.15.4
+// * SPEC:114 Testable=true Section=PLT.15.4
+// */
+// suite.addTest(new TestCase("HttpSessionRelations"));
+//
+// /**
+// * SPEC:115 Testable=true Section=PLT.15.4
+// * SPEC:116 Testable=true Section=PLT.15.4
+// */
+//// suite.addTest(new TestCase("SessionInvalidation"));
+// suite.addTest(new TestCase("HttpSessionInvalidatesPortletSession"));
+// suite.addTest(new TestCase("PortletSessionInvalidatesHttpSession"));
+//
+// /**
+// * SPEC:120 Testable=true Section=PLT.15.8
+// * NOT TESTABLE - Postponed
+// */
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.portleturl;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -34,48 +32,49 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-portleturl.war");
-
- /**
- * SPEC:26 Testable= true Section=PLT.7.1
- */
- suite.addTest(new TestCase("RenderURLNotInvokeAction"));
-
- /**
- * SPEC:27 Testable= true Section=PLT.7.1
- * SPEC:28 Testable= true Section=PLT.7.1
- * SPEC:29 Testable= true Section=PLT.7.1
- */
- suite.addTest(new TestCase("PortletURLParameters"));
-
- /**
- * SPEC:30 Testable= true Section=PLT.7.1
- * SPEC:31 Testable= true Section=PLT.7.1
- * NOTTESTABLE - POSTPONED
- */
-
- /**
- * SPEC:32 Testable= true Section=PLT.7.1.1
- */
- suite.addTest(new TestCase("PortletURLWithNotSupportedMode"));
-
- /**
- * SPEC:33 Testable= true Section=PLT.7.1.1
- *
- * TESTED IN SPEC:36 - portletmode/RequestDispatchingDependingOnModePortlet
- */
-
- /**
- * SPEC:34 Testable= true Section=PLT.7.1.1
- */
- suite.addTest(new TestCase("PortletURLWithNotSupportedState"));
-
- /**
- * SPEC:35 Testable= true Section=PLT.7.1.2
- */
- suite.addTest(new TestCase("SecurityLevel"));
-
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-portleturl.war");
+//
+// /**
+// * SPEC:26 Testable= true Section=PLT.7.1
+// */
+// suite.addTest(new TestCase("RenderURLNotInvokeAction"));
+//
+// /**
+// * SPEC:27 Testable= true Section=PLT.7.1
+// * SPEC:28 Testable= true Section=PLT.7.1
+// * SPEC:29 Testable= true Section=PLT.7.1
+// */
+// suite.addTest(new TestCase("PortletURLParameters"));
+//
+// /**
+// * SPEC:30 Testable= true Section=PLT.7.1
+// * SPEC:31 Testable= true Section=PLT.7.1
+// * NOTTESTABLE - POSTPONED
+// */
+//
+// /**
+// * SPEC:32 Testable= true Section=PLT.7.1.1
+// */
+// suite.addTest(new TestCase("PortletURLWithNotSupportedMode"));
+//
+// /**
+// * SPEC:33 Testable= true Section=PLT.7.1.1
+// *
+// * TESTED IN SPEC:36 - portletmode/RequestDispatchingDependingOnModePortlet
+// */
+//
+// /**
+// * SPEC:34 Testable= true Section=PLT.7.1.1
+// */
+// suite.addTest(new TestCase("PortletURLWithNotSupportedState"));
+//
+// /**
+// * SPEC:35 Testable= true Section=PLT.7.1.2
+// */
+// suite.addTest(new TestCase("SecurityLevel"));
+//
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portleturl;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -61,10 +61,10 @@
registry.addSequence("RenderURLNotInvokeAction", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createRenderURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -79,10 +79,10 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertNull(UTP1.local.get());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -102,7 +102,7 @@
registry.addSequence("PortletURLParameters", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
@@ -113,7 +113,7 @@
url.setParameter("key2", new String[]{"k2value1", "k2value2", "k2value3"});
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -128,7 +128,7 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createActionURL();
@@ -142,7 +142,7 @@
map.put("key4", new String[]{"k4value1", "k4value2", "k4value3"});
url.setParameters(map);
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -162,7 +162,7 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createRenderURL();
@@ -174,13 +174,13 @@
url.setParameters(map);
url.setParameter("key7", new String[]{"k7value1", "k7value2"});
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//what was in previous request
assertNull(request.getParameter("key1"));
@@ -192,7 +192,7 @@
assertEquals("k5value1", request.getParameter("key5"));
assertEquals(new String[]{"k6value1", "k6value2", "k6value3"}, request.getParameterValues("key6"));
assertEquals(new String[]{"k7value1", "k7value2"}, request.getParameterValues("key7"));
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -208,7 +208,7 @@
registry.addSequence("PortletURLWithNotSupportedMode", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createRenderURL();
try
@@ -221,7 +221,7 @@
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -237,7 +237,7 @@
registry.addSequence("PortletURLWithNotSupportedState", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
PortletURL url = response.createRenderURL();
try
@@ -249,7 +249,7 @@
{
//expected
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -265,11 +265,11 @@
registry.addSequence("SecurityLevel", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
UTP1.holder = new Boolean(request.isSecure());
PortletURL url = response.createActionURL();
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
@@ -283,10 +283,10 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals(((Boolean)UTP1.holder).booleanValue(), request.isSecure());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.preferences;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -71,9 +71,9 @@
seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -108,9 +108,9 @@
seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -129,9 +129,9 @@
seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -148,9 +148,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -181,9 +181,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -201,9 +201,9 @@
seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -230,9 +230,9 @@
seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -262,9 +262,9 @@
seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -282,9 +282,9 @@
seq.addAction(3, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -300,9 +300,9 @@
seq.addAction(0, UTP5.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -381,9 +381,9 @@
seq.addAction(1, UTP5.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -399,9 +399,9 @@
seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -434,9 +434,9 @@
seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -457,9 +457,9 @@
seq.addAction(2, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -474,7 +474,7 @@
registry.addSequence("StoreCalledDuringRenderThrowsIllegalArgumentException", seq);
seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, ValidatorException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws IOException, ValidatorException
{
// Get prefs
PortletPreferences prefs = request.getPreferences();
@@ -488,7 +488,7 @@
catch (IllegalStateException e)
{
}
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -505,9 +505,9 @@
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -542,9 +542,9 @@
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -563,9 +563,9 @@
seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -582,9 +582,9 @@
seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -618,9 +618,9 @@
seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -654,9 +654,9 @@
seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -675,9 +675,9 @@
seq.addAction(3, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -692,10 +692,10 @@
registry.addSequence("CreateASingleInstanceOfValidator", seq);
seq.addAction(0, UTP6.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
assertEquals(1, CreateASingleInstanceOfValidatorValidator.getCreatedCount());
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -714,9 +714,9 @@
seq.addAction(0, UTP8.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -754,9 +754,9 @@
seq.addAction(1, UTP8.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -775,9 +775,9 @@
seq.addAction(2, UTP8.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
@@ -794,9 +794,9 @@
seq.addAction(0, UTP7.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -832,9 +832,9 @@
seq.addAction(1, UTP7.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new InvokeGetResult(response.createActionURL().toString());
+ return new InvokeGetResponse(response.createActionURL().toString());
}
});
@@ -854,9 +854,9 @@
seq.addAction(2, UTP7.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.preferences;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -35,88 +33,89 @@
{
public static Test suite()
{
- TestSuite suite = new TestSuite("test-jsr168-preferences.war");
-
- /**
- * SPEC:90 Testable= true Section=PLT.14.1
- */
- suite.addTest(new TestCase("PreferencesCanBeSetToNull"));
-
- /**
- * SPEC:91 Testable= true Section=PLT.14.1
- */
- suite.addTest(new TestCase("PreferencesMapModificationDoesNotModifyPreferencesValues"));
-
- /**
- * SPEC:92 Testable=true Section=PLT.14.1
- */
- suite.addTest(new TestCase("ResetPreferenceHavingNoDefaultValueDeletesIt"));
-
- /**
- * SPEC:93 Testable=true Section=PLT.14.1
- */
- suite.addTest(new TestCase("ReadOnlyPreferenceCannotBeModified"));
-
- /**
- * SPEC:94 Testable=true Section=PLT.14.1
- * Tested in every over case in this chapter... DONE
- */
-
- /**
- * SPEC:95 Testable=true Section=PLT.14.1
- * NOT TESTED - Postponed
- */
-
- /**
- * SPEC:96 Testable=true Section=PLT.14.1
- */
- suite.addTest(new TestCase("ChangesMadeButNotStoredAreDiscarded"));
-
- /**
- * SPEC:97 Testable= true Section=PLT.14.1
- */
- suite.addTest(new TestCase("StoreCalledDuringRenderThrowsIllegalArgumentException"));
-
- /**
- * SPEC:98 Testable=true Section=PLT.14.1
- * NOT TESTED - Postponed
- */
-
- /**
- * SPEC:99 Testable=true Section=PLT.14.3
- */
- suite.addTest(new TestCase("CanModifyNonReadOnlyPreference"));
-
- /**
- * SPEC:100 Testable=true Section=PLT.14.3
- */
- suite.addTest(new TestCase("DynamicPreferenceTreatedLikeModifiablePreference"));
-
- /**
- * SPEC:101 Testable=false Section=PLT.14.4
- * - CreateASingleInstanceOfValidatorValidator
- */
- suite.addTest(new TestCase("CreateASingleInstanceOfValidator"));
-
- /**
- * SPEC:102 Testable=false Section=PLT.14.4
- * Testable=fales
- */
-
- /**
- * SPEC:103 Testable=true Section=PLT.14.4
- * SPEC:105 Testable=true Section=PLT.14.4
- * - ValidationStoresValidator
- */
- suite.addTest(new TestCase("ValidationStores"));
-
- /**
- * SPEC:104 Testable=true Section=PLT.14.4
- * - InvalidationCancelsStoreValidator
- */
- suite.addTest(new TestCase("InvalidationCancelsStore"));
-
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-preferences.war");
+//
+// /**
+// * SPEC:90 Testable= true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("PreferencesCanBeSetToNull"));
+//
+// /**
+// * SPEC:91 Testable= true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("PreferencesMapModificationDoesNotModifyPreferencesValues"));
+//
+// /**
+// * SPEC:92 Testable=true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("ResetPreferenceHavingNoDefaultValueDeletesIt"));
+//
+// /**
+// * SPEC:93 Testable=true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("ReadOnlyPreferenceCannotBeModified"));
+//
+// /**
+// * SPEC:94 Testable=true Section=PLT.14.1
+// * Tested in every over case in this chapter... DONE
+// */
+//
+// /**
+// * SPEC:95 Testable=true Section=PLT.14.1
+// * NOT TESTED - Postponed
+// */
+//
+// /**
+// * SPEC:96 Testable=true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("ChangesMadeButNotStoredAreDiscarded"));
+//
+// /**
+// * SPEC:97 Testable= true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("StoreCalledDuringRenderThrowsIllegalArgumentException"));
+//
+// /**
+// * SPEC:98 Testable=true Section=PLT.14.1
+// * NOT TESTED - Postponed
+// */
+//
+// /**
+// * SPEC:99 Testable=true Section=PLT.14.3
+// */
+// suite.addTest(new TestCase("CanModifyNonReadOnlyPreference"));
+//
+// /**
+// * SPEC:100 Testable=true Section=PLT.14.3
+// */
+// suite.addTest(new TestCase("DynamicPreferenceTreatedLikeModifiablePreference"));
+//
+// /**
+// * SPEC:101 Testable=false Section=PLT.14.4
+// * - CreateASingleInstanceOfValidatorValidator
+// */
+// suite.addTest(new TestCase("CreateASingleInstanceOfValidator"));
+//
+// /**
+// * SPEC:102 Testable=false Section=PLT.14.4
+// * Testable=fales
+// */
+//
+// /**
+// * SPEC:103 Testable=true Section=PLT.14.4
+// * SPEC:105 Testable=true Section=PLT.14.4
+// * - ValidationStoresValidator
+// */
+// suite.addTest(new TestCase("ValidationStores"));
+//
+// /**
+// * SPEC:104 Testable=true Section=PLT.14.4
+// * - InvalidationCancelsStoreValidator
+// */
+// suite.addTest(new TestCase("InvalidationCancelsStore"));
+//
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.windowstates;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.test.framework.portlet.Sequence;
import org.jboss.portal.test.framework.portlet.SequenceRegistry;
import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
@@ -57,28 +57,28 @@
registry.addSequence("CustomStateNotMappedNotInvoked", seq);
seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response) throws WindowStateException
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response) throws WindowStateException
{
PortletURL url = response.createRenderURL();
url.setWindowState(new WindowState("UNMAPPED_STATE"));
- return new InvokeGetResult(url.toString());
+ return new InvokeGetResponse(url.toString());
}
});
seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
//if portlet was invoked we will have failure
- return new FailureResult("Render wasn't expected");
+ return new FailureResponse("Render wasn't expected");
}
});
seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
{
- protected Result run(Portlet portlet, RenderRequest request, RenderResponse response)
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response)
{
- return new EndTestResult();
+ return new EndTestResponse();
}
});
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,7 +23,6 @@
package org.jboss.portal.test.portlet.jsr168.tck.windowstates;
import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestSuite;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -34,17 +33,17 @@
{
public static Test suite()
{
-
- TestSuite suite = new TestSuite("test-jsr168-windowstates.war");
-
- /**
- * SPEC:40 Testable=true Section=PLT.9.4
- *
- * Disabled as feature is not supported by portal yet
- */
- //suite.addTest(new TestCase("CustomStateNotMappedNotInvokedPortlet"));
-
-
- return suite;
+// TestSuite suite = new TestSuite("test-jsr168-windowstates.war");
+//
+// /**
+// * SPEC:40 Testable=true Section=PLT.9.4
+// *
+// * Disabled as feature is not supported by portal yet
+// */
+// //suite.addTest(new TestCase("CustomStateNotMappedNotInvokedPortlet"));
+//
+//
+// return suite;
+ return null;
}
}
Modified: trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,6 +23,26 @@
<server>
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.server.HttpTestDriverRegistryService"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ </mbean>
+
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -84,11 +104,12 @@
<!-- -->
<mbean
- code="org.jboss.portal.test.server.RequestControllerTestImpl"
+ code="org.jboss.portal.test.server.TestRequestController"
name="portal:controller=Request"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<!-- -->
@@ -98,8 +119,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
@@ -108,8 +129,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
@@ -118,8 +139,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
@@ -128,8 +149,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
@@ -138,8 +159,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
@@ -148,8 +169,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
@@ -158,8 +179,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
@@ -168,7 +189,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
<depends optional-attribute-name="Registry" proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
</server>
\ No newline at end of file
Modified: trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,6 +24,26 @@
<server>
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.server.HttpTestDriverRegistryService"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ </mbean>
+
<!-- Server stack -->
<mbean
code="org.jboss.portal.portlet.test.UserInterceptor"
Modified: trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,6 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<jboss-web>
+ <context-root>/test</context-root>
<security-domain>java:/jaas/other</security-domain>
<replication-config>
<replication-trigger>SET</replication-trigger>
Modified: trunk/server/build.xml
===================================================================
--- trunk/server/build.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/build.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -189,13 +189,13 @@
</jar>
<jar jarfile="${build.lib}/test-parameters.sar">
-
+ <fileset dir="${junit.junit.lib}" includes="junit.jar"/>
+ <fileset dir="${jboss.portal-test.root}/lib" includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib" includes="portal-common-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib" includes="portal-jems-lib.jar"/>
<fileset dir="${build.lib}" includes="test-agent.war"/>
<fileset dir="${build.lib}" includes="portal-server-lib.jar"/>
<fileset dir="${build.lib}" includes="portal-server-test-lib.jar"/>
-
<fileset dir="${build.resources}/test/test-parameters-sar"/>
</jar>
@@ -209,13 +209,13 @@
<fileset dir="${build.resources}/test/test-servlet-defaultservletmapping-war"/>
</jar>
<jar jarfile="${build.lib}/test-servlet.sar">
-
+ <fileset dir="${junit.junit.lib}" includes="junit.jar"/>
+ <fileset dir="${jboss.portal-test.root}/lib" includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib" includes="portal-common-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib" includes="portal-jems-lib.jar"/>
<fileset dir="${build.lib}" includes="test-agent.war"/>
<fileset dir="${build.lib}" includes="portal-server-lib.jar"/>
<fileset dir="${build.lib}" includes="portal-server-test-lib.jar"/>
-
<fileset dir="${build.resources}/test/test-servlet-sar"/>
<fileset dir="${build.lib}" includes="test-servlet-rootpathmapping.war"/>
<fileset dir="${build.lib}" includes="test-servlet-pathmapping.war"/>
@@ -223,13 +223,13 @@
</jar>
<jar jarfile="${build.lib}/test-charset.sar">
-
+ <fileset dir="${junit.junit.lib}" includes="junit.jar"/>
+ <fileset dir="${jboss.portal-test.root}/lib" includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib" includes="portal-common-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib" includes="portal-jems-lib.jar"/>
<fileset dir="${build.lib}" includes="test-agent.war"/>
<fileset dir="${build.lib}" includes="portal-server-lib.jar"/>
<fileset dir="${build.lib}" includes="portal-server-test-lib.jar"/>
-
<fileset dir="${build.resources}/test/test-charset-sar"/>
</jar>
</target>
@@ -285,12 +285,16 @@
<x-sysproperty>
<sysproperty key="test.root" value="${build.lib}"/>
<sysproperty key="test.uri" value="/test/redirect/"/>
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+-->
</x-sysproperty>
<x-test>
<!-- Server side tests -->
- <test todir="${test.reports}" name="org.jboss.portal.test.server.parameters.ParametersTestSuite"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.server.servlet.ServletTestSuite"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.server.charset.CharsetTestSuite"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.server.CharsetTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.server.ParametersTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.server.ServletTestCase"/>
</x-test>
<x-classpath>
<path refid="jboss.serialization.classpath"/>
Modified: trunk/server/src/main/org/jboss/portal/test/server/AbstractTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/AbstractTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/AbstractTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,45 +24,73 @@
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public abstract class AbstractTest extends AbstractJBossService
+public abstract class AbstractTest extends AbstractJBossService implements TestDriver
{
/** The test id. */
private final String testCaseId;
+ /** The test path. */
+ private final String path;
+
/** The controller. */
- private RequestControllerTest controller;
+ private HttpTestDriverRegistry testDriverRegistry;
- public AbstractTest()
+ public DriverResponse invoke(DriverCommand cmd) throws TestDriverException
{
- testCaseId = createCaseTestId(getClass());
+ if (cmd instanceof StartTestCommand)
+ {
+ StartTestCommand stc = (StartTestCommand)cmd;
+ return new InvokeGetResponse(path);
+ }
+ else
+ {
+ throw new TestDriverException("Unrecognized command " + cmd);
+ }
}
- public AbstractTest(String testCaseId)
+ public TestItemInfo getInfo()
{
+ return new TestInfo(testCaseId);
+ }
+
+ public AbstractTest(String testCaseId, String path)
+ {
if (testCaseId == null)
{
throw new IllegalArgumentException("No null test case id accepted");
}
+ if (path == null)
+ {
+ throw new IllegalArgumentException("No null test path accepted");
+ }
//
this.testCaseId = testCaseId;
+ this.path = path;
}
- public RequestControllerTest getController()
+ public HttpTestDriverRegistry getTestDriverRegistry()
{
- return controller;
+ return testDriverRegistry;
}
- public void setController(RequestControllerTest controller)
+ public void setTestDriverRegistry(HttpTestDriverRegistry testDriverRegistry)
{
- this.controller = controller;
+ this.testDriverRegistry = testDriverRegistry;
}
public String getTestCaseId()
@@ -70,20 +98,25 @@
return testCaseId;
}
+ public String getPath()
+ {
+ return path;
+ }
+
public void createService()
{
- controller.add(this);
+ testDriverRegistry.register(this);
}
public void destroyService()
{
- controller.remove(this);
+ testDriverRegistry.unregister(this);
}
/**
*
*/
- public abstract Result execute(ServerInvocation invocation);
+ public abstract DriverResponse execute(ServerInvocation invocation);
/** Get the test id from the class name. It can be overriden. */
protected String createCaseTestId(Class clazz)
Added: trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.server;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CharsetTestCase extends ServerTestRunner
+{
+ public CharsetTestCase()
+ {
+ super("test-charset.sar");
+ }
+}
Copied: trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistry.java (from rev 5499, trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTest.java)
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTest.java 2006-10-24 20:04:54 UTC (rev 5499)
+++ trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistry.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.server;
+
+import org.jboss.portal.server.RequestController;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface HttpTestDriverRegistry extends HttpTestDriverServer
+{
+ void register(TestDriver test);
+
+ void unregister(TestDriver test);
+
+ TestDriver getDriver(String testName);
+}
Property changes on: trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistry.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistryService.java (from rev 5499, trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java)
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java 2006-10-24 20:04:54 UTC (rev 5499)
+++ trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistryService.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,163 @@
+/******************************************************************************
+ * 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.server;
+
+import org.jboss.portal.test.framework.driver.http.AbstractHttpTestDriverServerService;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestContainerInfo;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class HttpTestDriverRegistryService extends AbstractHttpTestDriverServerService implements HttpTestDriverRegistry
+{
+
+ /** . */
+ private static Map _entries;
+
+ /** . */
+ private static TestContainerInfo _container;
+
+ public HttpTestDriverRegistryService()
+ {
+ _entries = new HashMap();
+ _container = new TestContainerInfo("Main");
+ }
+
+ public synchronized static void registerTestDriver(TestDriver test)
+ {
+ if (test == null)
+ {
+ throw new IllegalArgumentException("Cannot add null test");
+ }
+ TestItemInfo itemInfo = test.getInfo();
+ String entryKey = itemInfo.getName();
+ if (_entries.containsKey(entryKey))
+ {
+ throw new IllegalArgumentException("Cannot have two tests with the same id " + entryKey);
+ }
+
+ //
+ _container.addChild(itemInfo.createClone());
+ _entries.put(entryKey, test);
+ }
+
+ public static synchronized void unregisterTestDriver(TestDriver test)
+ {
+ if (test == null)
+ {
+ throw new IllegalArgumentException("Cannot add null test");
+ }
+ String entryKey = test.getInfo().getName();
+ if (!_entries.containsKey(entryKey))
+ {
+ throw new IllegalArgumentException("Cannot remove test that was not added previously " + entryKey);
+ }
+
+ //
+ TestContainerInfo container = new TestContainerInfo("Main");
+ for (Iterator i = _container.getChildNames().iterator();i.hasNext();)
+ {
+ String itemName = (String)i.next();
+ TestItemInfo item = _container.getChild(itemName);
+ if (item.getName().equals(entryKey) == false)
+ {
+ HttpTestDriverRegistryService._container.addChild(item.createClone());
+ }
+ }
+
+ //
+ _entries.remove(entryKey);
+ _container = container;
+ }
+
+ public synchronized void register(TestDriver test)
+ {
+ registerTestDriver(test);
+ }
+
+ public synchronized void unregister(TestDriver test)
+ {
+ unregisterTestDriver(test);
+ }
+
+ public TestDriver getDriver(String testName)
+ {
+ for (Iterator i = _entries.keySet().iterator();i.hasNext();)
+ {
+ String testDriverName = (String)i.next();
+ TestItemInfo testDriverItem = _container.getChild(testDriverName);
+ if (testDriverItem.findItem(testName) != null)
+ {
+ TestDriver testDriver = (TestDriver)_entries.get(testDriverName);
+ return testDriver;
+ }
+ }
+ return null;
+ }
+
+ public DriverResponse invoke(DriverCommand cmd) throws TestDriverException
+ {
+ if (cmd instanceof StartTestCommand)
+ {
+ StartTestCommand stc = (StartTestCommand)cmd;
+ String testName = stc.getTestName();
+
+ //
+ TestItemInfo item = _container.findItem(testName);
+ if (item == null)
+ {
+ throw new TestDriverException("Test not found " + testName);
+ }
+
+ // Get associated test driver
+ TestDriver driver = getDriver(testName);
+ return driver.invoke(cmd);
+ }
+ else
+ {
+ throw new TestDriverException("Unrecognized command " + cmd);
+ }
+ }
+
+ public TestItemInfo getInfo()
+ {
+ TestContainerInfo info = new TestContainerInfo("Main");
+ for (Iterator i = _entries.values().iterator();i.hasNext();)
+ {
+ TestDriver driver = (TestDriver)i.next();
+ info.addChild(driver.getInfo());
+ }
+ return info;
+ }
+}
Property changes on: trunk/server/src/main/org/jboss/portal/test/server/HttpTestDriverRegistryService.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.server;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ParametersTestCase extends ServerTestRunner
+{
+ public ParametersTestCase()
+ {
+ super("test-parameters.sar");
+ }
+}
Deleted: trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,36 +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.server;
-
-import org.jboss.portal.server.RequestController;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface RequestControllerTest extends RequestController
-{
- void add(AbstractTest test);
-
- void remove(AbstractTest test);
-}
Deleted: trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.server;
-
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.server.ServerException;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.Result;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class RequestControllerTestImpl extends AbstractJBossService implements RequestControllerTest
-{
-
- private Map tests;
-
- public RequestControllerTestImpl()
- {
- tests = new HashMap();
- }
-
- public void handle(ServerInvocation invocation) throws ServerException
- {
- String testCaseId = TestCaseContext.getCurrentTestCaseId();
- AbstractTest test = (AbstractTest)tests.get(testCaseId);
- Result result = test.execute(invocation);
- TestCaseContext.setCurrentResult(result);
- }
-
- public void add(AbstractTest test)
- {
- if (test == null)
- {
- throw new IllegalArgumentException("Cannot add null test");
- }
- if (tests.containsKey(test.getTestCaseId()))
- {
- throw new IllegalArgumentException("Cannot have two tests with the same id " + test.getTestCaseId());
- }
- tests.put(test.getTestCaseId(), test);
- }
-
- public void remove(AbstractTest test)
- {
- if (test == null)
- {
- throw new IllegalArgumentException("Cannot add null test");
- }
- if (!tests.containsKey(test.getTestCaseId()))
- {
- throw new IllegalArgumentException("Cannot remove test that was not added previously " + test.getTestCaseId());
- }
- tests.remove(test.getTestCaseId());
- }
-
-}
Added: trunk/server/src/main/org/jboss/portal/test/server/ServerTestRunner.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ServerTestRunner.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/ServerTestRunner.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.server;
+
+import org.jboss.portal.test.framework.runner.BaseRunner;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.common.junit.ant.TestParameter;
+import junit.framework.TestSuite;
+import junit.framework.AssertionFailedError;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServerTestRunner extends BaseRunner
+{
+
+ public ServerTestRunner()
+ {
+ Map abc = TestParameter.readExternalParameters();
+ archiveName = ((String[])abc.get("archive"))[0];
+ }
+
+ public ServerTestRunner(String archiveName)
+ {
+ this.archiveName = archiveName;
+ }
+
+ /** . */
+ private String archiveName;
+
+ public void startRunner() throws Exception
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ getDeployer().deploy(f.toURL(), getNodeManager().getNode(NodeId.DEFAULT));
+ }
+
+ public void stopRunner()
+ {
+ try
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ getDeployer().undeploy(f.toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void testDummy()
+ {
+ throw new AssertionFailedError("Test dummy should not be called, it's a place holder so that running it from ant does not fail");
+ }
+}
Added: trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.server;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServletTestCase extends ServerTestRunner
+{
+ public ServletTestCase()
+ {
+ super("test-servlet.sar");
+ }
+}
Added: trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.server;
+
+import org.jboss.portal.server.RequestController;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.ServerException;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestRequestController extends AbstractJBossService implements RequestController
+{
+
+ /** . */
+ private HttpTestDriverRegistry registry;
+
+ public HttpTestDriverRegistry getTestDriverRegistry()
+ {
+ return registry;
+ }
+
+ public void setTestDriverRegistry(HttpTestDriverRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public void handle(ServerInvocation invocation) throws ServerException
+ {
+ String testName = HttpTestContext.getCurrentTestCaseId();
+ AbstractTest test = (AbstractTest)registry.getDriver(testName);
+ try
+ {
+ DriverResponse response = test.execute(invocation);
+ HttpTestContext.setCurrentResult(response);
+ }
+ catch (AssertionFailedError e)
+ {
+ HttpTestContext.setCurrentResult(new FailureResponse(e));
+ }
+ catch (Exception e)
+ {
+ HttpTestContext.setCurrentResult(new ErrorResponse(e));
+ }
+ }
+}
Deleted: trunk/server/src/main/org/jboss/portal/test/server/charset/CharsetTestSuite.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/CharsetTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/CharsetTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,46 +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.server.charset;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class CharsetTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-charset.sar");
- suite.addTest(new TestCase("GetTest"));
- suite.addTest(new TestCase("PostTest"));
- suite.addTest(new TestCase("PostXWWWFormURLEncodedNoCharsetTest"));
- suite.addTest(new TestCase("PostXWWWFormURLEncodedUTF8Test"));
- suite.addTest(new TestCase("PostMultipartFormDataNoCharsetTest"));
- suite.addTest(new TestCase("PostMultipartFormDataUTF8Test"));
- return suite;
- }
-}
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,10 +25,11 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import javax.servlet.http.HttpServletRequest;
@@ -39,29 +40,28 @@
*/
public class GetTest extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+ public GetTest()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("GetTest", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
String s = invocation.getResponse().encodeURL(url);
- return new InvokeGetResult(s);
+ return new InvokeGetResponse(s);
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- HttpServletRequest req = context.getClientRequest();
- assertNull(context.getMediaType());
- assertNull(req.getCharacterEncoding());
- }
- });
- return assertResult;
+ ServerInvocationContext context = invocation.getServerContext();
+ HttpServletRequest req = context.getClientRequest();
+ ExtendedAssert.assertNull(context.getMediaType());
+ ExtendedAssert.assertNull(req.getCharacterEncoding());
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -26,10 +26,11 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import javax.servlet.http.HttpServletRequest;
@@ -40,33 +41,32 @@
*/
public class PostMultipartFormDataNoCharsetTest extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+ public PostMultipartFormDataNoCharsetTest()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("PostMultipartFormDataNoCharsetTest", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
String s = invocation.getResponse().encodeURL(url);
- InvokePostResult post = new InvokePostResult();
+ InvokePostResponse post = new InvokePostResponse();
post.setURL(s);
post.setContentType(PortalConstants.MULTIPART_FORM_DATA);
- post.setBody(new InvokePostResult.FormBody());
+ post.setBody(new InvokePostResponse.FormBody());
return post;
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- HttpServletRequest req = context.getClientRequest();
- assertEquals(PortalConstants.MULTIPART_FORM_DATA, context.getMediaType());
- assertNull(req.getCharacterEncoding());
- }
- });
- return assertResult;
+ ServerInvocationContext context = invocation.getServerContext();
+ HttpServletRequest req = context.getClientRequest();
+ ExtendedAssert.assertEquals(PortalConstants.MULTIPART_FORM_DATA, context.getMediaType());
+ ExtendedAssert.assertNull(req.getCharacterEncoding());
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -26,10 +26,11 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import javax.servlet.http.HttpServletRequest;
@@ -40,33 +41,32 @@
*/
public class PostMultipartFormDataUTF8Test extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+ public PostMultipartFormDataUTF8Test()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("PostMultipartFormDataUTF8Test", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
String s = invocation.getResponse().encodeURL(url);
- InvokePostResult post = new InvokePostResult();
+ InvokePostResponse post = new InvokePostResponse();
post.setURL(s);
post.setContentType(PortalConstants.MULTIPART_FORM_DATA);
- post.setBody(new InvokePostResult.FormBody());
+ post.setBody(new InvokePostResponse.FormBody());
return post;
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- HttpServletRequest req = context.getClientRequest();
- assertEquals(PortalConstants.MULTIPART_FORM_DATA, context.getMediaType());
- // assertEquals(PortalConstants.UTF_8.name(), req.getCharacterEncoding());
- }
- });
- return assertResult;
+ ServerInvocationContext context = invocation.getServerContext();
+ HttpServletRequest req = context.getClientRequest();
+ ExtendedAssert.assertEquals(PortalConstants.MULTIPART_FORM_DATA, context.getMediaType());
+ // ExtendedAssert.assertEquals(PortalConstants.UTF_8.name(), req.getCharacterEncoding());
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,10 +25,11 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
import org.jboss.portal.test.server.AbstractTest;
import javax.servlet.http.HttpServletRequest;
@@ -39,32 +40,31 @@
*/
public class PostTest extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+ public PostTest()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("PostTest", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
String s = invocation.getResponse().encodeURL(url);
- InvokePostResult post = new InvokePostResult();
+ InvokePostResponse post = new InvokePostResponse();
post.setURL(s);
- post.setBody(new InvokePostResult.FormBody());
+ post.setBody(new InvokePostResponse.FormBody());
return post;
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- HttpServletRequest req = context.getClientRequest();
- assertNull(context.getMediaType());
- assertNull(req.getCharacterEncoding());
- }
- });
- return assertResult;
+ ServerInvocationContext context = invocation.getServerContext();
+ HttpServletRequest req = context.getClientRequest();
+ ExtendedAssert.assertNull(context.getMediaType());
+ ExtendedAssert.assertNull(req.getCharacterEncoding());
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -26,10 +26,11 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import javax.servlet.http.HttpServletRequest;
@@ -40,33 +41,33 @@
*/
public class PostXWWWFormURLEncodedNoCharsetTest extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+
+ public PostXWWWFormURLEncodedNoCharsetTest()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("PostXWWWFormURLEncodedNoCharsetTest", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
String s = invocation.getResponse().encodeURL(url);
- InvokePostResult post = new InvokePostResult();
+ InvokePostResponse post = new InvokePostResponse();
post.setURL(s);
post.setContentType(PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED);
- post.setBody(new InvokePostResult.FormBody());
+ post.setBody(new InvokePostResponse.FormBody());
return post;
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- HttpServletRequest req = context.getClientRequest();
- assertEquals(PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED, context.getMediaType());
- assertEquals(PortalConstants.UTF_8.name(), req.getCharacterEncoding());
- }
- });
- return assertResult;
+ ServerInvocationContext context = invocation.getServerContext();
+ HttpServletRequest req = context.getClientRequest();
+ ExtendedAssert.assertEquals(PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED, context.getMediaType());
+ ExtendedAssert.assertEquals(PortalConstants.UTF_8.name(), req.getCharacterEncoding());
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -26,10 +26,11 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import javax.servlet.http.HttpServletRequest;
@@ -40,33 +41,32 @@
*/
public class PostXWWWFormURLEncodedUTF8Test extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+ public PostXWWWFormURLEncodedUTF8Test()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("PostXWWWFormURLEncodedUTF8Test", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
String s = invocation.getResponse().encodeURL(url);
- InvokePostResult post = new InvokePostResult();
+ InvokePostResponse post = new InvokePostResponse();
post.setURL(s);
post.setContentType(PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED + "; charset=" + PortalConstants.UTF_8.name());
- post.setBody(new InvokePostResult.FormBody());
+ post.setBody(new InvokePostResponse.FormBody());
return post;
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- HttpServletRequest req = context.getClientRequest();
- assertEquals(PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED, context.getMediaType());
- assertEquals(PortalConstants.UTF_8.name(), req.getCharacterEncoding());
- }
- });
- return assertResult;
+ ServerInvocationContext context = invocation.getServerContext();
+ HttpServletRequest req = context.getClientRequest();
+ ExtendedAssert.assertEquals(PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED, context.getMediaType());
+ ExtendedAssert.assertEquals(PortalConstants.UTF_8.name(), req.getCharacterEncoding());
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,10 +25,11 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import java.util.Map;
@@ -40,9 +41,14 @@
public class GetTest extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+ public GetTest()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("GetTest", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
@@ -50,39 +56,32 @@
url.setParameterValues("c", new String[]{"d", "e"});
url.setParameterValues("encoding", new String[]{Utils.RANGE_0_255});
String s = invocation.getResponse().encodeURL(url);
- return new InvokeGetResult(s);
+ return new InvokeGetResponse(s);
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- Map queryParameterMap = context.getQueryParameterMap();
- Map bodyParameterMap = context.getBodyParameterMap();
+ ServerInvocationContext context = invocation.getServerContext();
+ Map queryParameterMap = context.getQueryParameterMap();
+ Map bodyParameterMap = context.getBodyParameterMap();
- //
- assertNotNull(queryParameterMap);
- assertNull(bodyParameterMap);
+ //
+ ExtendedAssert.assertNotNull(queryParameterMap);
+ ExtendedAssert.assertNull(bodyParameterMap);
- String[] a = (String[])queryParameterMap.get("a");
- assertNotNull(a);
- assertEquals(new String[]{"b"}, a);
+ String[] a = (String[])queryParameterMap.get("a");
+ ExtendedAssert.assertNotNull(a);
+ ExtendedAssert.assertEquals(new String[]{"b"}, a);
- //
- String[] c = (String[])queryParameterMap.get("c");
- assertNotNull(c);
- assertEquals(new String[]{"d", "e"}, c);
+ //
+ String[] c = (String[])queryParameterMap.get("c");
+ ExtendedAssert.assertNotNull(c);
+ ExtendedAssert.assertEquals(new String[]{"d", "e"}, c);
- //
- String[] f = (String[])queryParameterMap.get("encoding");
- assertNotNull(f);
- assertEquals(new String[]{Utils.RANGE_0_255}, f);
- }
- });
- return assertResult;
+ //
+ String[] f = (String[])queryParameterMap.get("encoding");
+ ExtendedAssert.assertNotNull(f);
+ ExtendedAssert.assertEquals(new String[]{Utils.RANGE_0_255}, f);
+ return new EndTestResponse();
}
}
}
Deleted: trunk/server/src/main/org/jboss/portal/test/server/parameters/ParametersTestSuite.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/parameters/ParametersTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/ParametersTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,43 +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.server.parameters;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ParametersTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-parameters.sar");
- suite.addTest(new TestCase("GetTest"));
- suite.addTest(new TestCase("PostApplicationXWWWFormURLEncodedTest"));
- suite.addTest(new TestCase("PostMultipartFormDataTest"));
- return suite;
- }
-}
Modified: trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,10 +25,11 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import java.util.Map;
@@ -39,13 +40,20 @@
*/
public class PostApplicationXWWWFormURLEncodedTest extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+
+ public PostApplicationXWWWFormURLEncodedTest()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("PostApplicationXWWWFormURLEncodedTest", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
- InvokePostResult.FormBody body = new InvokePostResult.FormBody();
+ InvokePostResponse.FormBody body = new InvokePostResponse.FormBody();
//
url.setParameterValue("a", "b");
@@ -67,89 +75,82 @@
//
String s = invocation.getResponse().encodeURL(url);
- InvokePostResult result = new InvokePostResult();
+ InvokePostResponse result = new InvokePostResponse();
result.setURL(s);
- result.setContentType(InvokePostResult.APPLICATION_X_WWW_FORM_URLENCODED + "; charset=UTF-8");
+ result.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED + "; charset=UTF-8");
result.setBody(body);
return result;
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- Map queryParameterMap = context.getQueryParameterMap();
- Map bodyParameterMap = context.getBodyParameterMap();
+ ServerInvocationContext context = invocation.getServerContext();
+ Map queryParameterMap = context.getQueryParameterMap();
+ Map bodyParameterMap = context.getBodyParameterMap();
- //
- assertNotNull(queryParameterMap);
- assertNotNull(bodyParameterMap);
+ //
+ ExtendedAssert.assertNotNull(queryParameterMap);
+ ExtendedAssert.assertNotNull(bodyParameterMap);
- //
- String[] qa = (String[])queryParameterMap.get("a");
- String[] ba = (String[])bodyParameterMap.get("a");
- assertNotNull(qa);
- assertNull(ba);
- assertEquals(new String[]{"b"}, qa);
+ //
+ String[] qa = (String[])queryParameterMap.get("a");
+ String[] ba = (String[])bodyParameterMap.get("a");
+ ExtendedAssert.assertNotNull(qa);
+ ExtendedAssert.assertNull(ba);
+ ExtendedAssert.assertEquals(new String[]{"b"}, qa);
- //
- String[] qc = (String[])queryParameterMap.get("c");
- String[] bc = (String[])bodyParameterMap.get("c");
- assertNotNull(qc);
- assertNull(bc);
- assertEquals(new String[]{"d", "e"}, qc);
+ //
+ String[] qc = (String[])queryParameterMap.get("c");
+ String[] bc = (String[])bodyParameterMap.get("c");
+ ExtendedAssert.assertNotNull(qc);
+ ExtendedAssert.assertNull(bc);
+ ExtendedAssert.assertEquals(new String[]{"d", "e"}, qc);
- //
- String[] qf = (String[])queryParameterMap.get("f");
- String[] bf = (String[])bodyParameterMap.get("f");
- assertNotNull(qf);
- assertNotNull(bf);
- assertEquals(new String[]{"g"}, qf);
- assertEquals(new String[]{"_g"}, bf);
+ //
+ String[] qf = (String[])queryParameterMap.get("f");
+ String[] bf = (String[])bodyParameterMap.get("f");
+ ExtendedAssert.assertNotNull(qf);
+ ExtendedAssert.assertNotNull(bf);
+ ExtendedAssert.assertEquals(new String[]{"g"}, qf);
+ ExtendedAssert.assertEquals(new String[]{"_g"}, bf);
- //
- String[] qh = (String[])queryParameterMap.get("h");
- String[] bh = (String[])bodyParameterMap.get("h");
- assertNotNull(qh);
- assertNotNull(bh);
- assertEquals(new String[]{"i", "j"}, qh);
- assertEquals(new String[]{"_i", "_j"}, bh);
+ //
+ String[] qh = (String[])queryParameterMap.get("h");
+ String[] bh = (String[])bodyParameterMap.get("h");
+ ExtendedAssert.assertNotNull(qh);
+ ExtendedAssert.assertNotNull(bh);
+ ExtendedAssert.assertEquals(new String[]{"i", "j"}, qh);
+ ExtendedAssert.assertEquals(new String[]{"_i", "_j"}, bh);
- //
- String[] qencoding1 = (String[])queryParameterMap.get("encoding_1");
- String[] bencoding1 = (String[])bodyParameterMap.get("encoding_1");
- assertNotNull(qencoding1);
- assertNotNull(bencoding1);
- assertEquals(new String[]{Utils.RANGE_0_255}, qencoding1);
- assertEquals(new String[]{Utils.RANGE_0_255}, bencoding1);
+ //
+ String[] qencoding1 = (String[])queryParameterMap.get("encoding_1");
+ String[] bencoding1 = (String[])bodyParameterMap.get("encoding_1");
+ ExtendedAssert.assertNotNull(qencoding1);
+ ExtendedAssert.assertNotNull(bencoding1);
+ ExtendedAssert.assertEquals(new String[]{Utils.RANGE_0_255}, qencoding1);
+ ExtendedAssert.assertEquals(new String[]{Utils.RANGE_0_255}, bencoding1);
- //
- String[] qencoding2 = (String[])queryParameterMap.get("encoding_2");
- String[] bencoding2 = (String[])bodyParameterMap.get("encoding_2");
- assertNotNull(qencoding2);
- assertNotNull(bencoding2);
- assertEquals(new String[]{Utils.RANGE_256_512}, qencoding2);
- assertEquals(new String[]{Utils.RANGE_256_512}, bencoding2);
+ //
+ String[] qencoding2 = (String[])queryParameterMap.get("encoding_2");
+ String[] bencoding2 = (String[])bodyParameterMap.get("encoding_2");
+ ExtendedAssert.assertNotNull(qencoding2);
+ ExtendedAssert.assertNotNull(bencoding2);
+ ExtendedAssert.assertEquals(new String[]{Utils.RANGE_256_512}, qencoding2);
+ ExtendedAssert.assertEquals(new String[]{Utils.RANGE_256_512}, bencoding2);
- //
- String[] qk = (String[])queryParameterMap.get("k");
- String[] bk = (String[])bodyParameterMap.get("k");
- assertNull(qk);
- assertNotNull(bk);
- assertEquals(new String[]{"l"}, bk);
+ //
+ String[] qk = (String[])queryParameterMap.get("k");
+ String[] bk = (String[])bodyParameterMap.get("k");
+ ExtendedAssert.assertNull(qk);
+ ExtendedAssert.assertNotNull(bk);
+ ExtendedAssert.assertEquals(new String[]{"l"}, bk);
- //
- String[] qm = (String[])queryParameterMap.get("m");
- String[] bm = (String[])bodyParameterMap.get("m");
- assertNull(qm);
- assertNotNull(bm);
- assertEquals(new String[]{"n", "o"}, bm);
- }
- });
- return assertResult;
+ //
+ String[] qm = (String[])queryParameterMap.get("m");
+ String[] bm = (String[])bodyParameterMap.get("m");
+ ExtendedAssert.assertNull(qm);
+ ExtendedAssert.assertNotNull(bm);
+ ExtendedAssert.assertEquals(new String[]{"n", "o"}, bm);
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,10 +25,11 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.InvokePostResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
import java.util.Map;
@@ -39,13 +40,19 @@
*/
public class PostMultipartFormDataTest extends AbstractTest
{
- public Result execute(final ServerInvocation invocation)
+
+ public PostMultipartFormDataTest()
{
- if (TestCaseContext.isCurrentRequestCount(0))
+ super("PostMultipartFormDataTest", "/test");
+ }
+
+ public DriverResponse execute(final ServerInvocation invocation)
+ {
+ if (HttpTestContext.isCurrentRequestCount(0))
{
AbstractServerURL url = new AbstractServerURL();
url.setPortalRequestPath("/index.html");
- InvokePostResult.FormBody body = new InvokePostResult.FormBody();
+ InvokePostResponse.FormBody body = new InvokePostResponse.FormBody();
//
url.setParameterValue("a", "b");
@@ -58,38 +65,31 @@
body.addParameter("h", new String[]{"_i", "_j"});
String s = invocation.getResponse().encodeURL(url);
- InvokePostResult result = new InvokePostResult();
+ InvokePostResponse result = new InvokePostResponse();
result.setURL(s);
- result.setContentType(InvokePostResult.MULTIPART_FORM_DATA);
+ result.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
result.setBody(body);
return result;
}
else
{
- AssertResult assertResult = new AssertResult();
- assertResult.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- ServerInvocationContext context = invocation.getServerContext();
- Map queryParameterMap = context.getQueryParameterMap();
- Map bodyParameterMap = context.getBodyParameterMap();
+ ServerInvocationContext context = invocation.getServerContext();
+ Map queryParameterMap = context.getQueryParameterMap();
+ Map bodyParameterMap = context.getBodyParameterMap();
- //
- assertNotNull(queryParameterMap);
- assertNull(bodyParameterMap);
+ //
+ ExtendedAssert.assertNotNull(queryParameterMap);
+ ExtendedAssert.assertNull(bodyParameterMap);
- String[] a = (String[])queryParameterMap.get("a");
- assertNotNull(a);
- assertEquals(new String[]{"b"}, a);
+ String[] a = (String[])queryParameterMap.get("a");
+ ExtendedAssert.assertNotNull(a);
+ ExtendedAssert.assertEquals(new String[]{"b"}, a);
- //
- String[] c = (String[])queryParameterMap.get("c");
- assertNotNull(c);
- assertEquals(new String[]{"d", "e"}, c);
- }
- });
- return assertResult;
+ //
+ String[] c = (String[])queryParameterMap.get("c");
+ ExtendedAssert.assertNotNull(c);
+ ExtendedAssert.assertEquals(new String[]{"d", "e"}, c);
+ return new EndTestResponse();
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,12 +24,12 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
/**
@@ -39,62 +39,31 @@
public class DefaultServletMappingTest extends AbstractTest
{
- private AssertResult result = new AssertResult();
+ public DefaultServletMappingTest()
+ {
+ super("DefaultServletMappingTest", "/test-servlet-defaultservletmapping");
+ }
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
- ServerRequest req = invocation.getRequest();
final ServerInvocationContext ctx = invocation.getServerContext();
- switch (TestCaseContext.getCurrentRequestCount())
+ switch (HttpTestContext.getCurrentRequestCount())
{
case 0:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-defaultservletmapping", ctx.getPortalContextPath());
- // Here we test with "/" because on the exact context path tomcat will perform a redirect to the
- // the same context appending a trailing / to it
- assertEquals("/", ctx.getPortalRequestPath());
- }
- });
- if (result.isFailed())
- {
- return result;
- }
- else
- {
- return new InvokeGetResult("/test-servlet-defaultservletmapping/");
- }
+ ExtendedAssert.assertEquals("/test-servlet-defaultservletmapping", ctx.getPortalContextPath());
+ // Here we test with "/" because on the exact context path tomcat will perform a redirect to the
+ // the same context appending a trailing / to it
+ ExtendedAssert.assertEquals("/", ctx.getPortalRequestPath());
+ return new InvokeGetResponse("/test-servlet-defaultservletmapping/");
case 1:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-defaultservletmapping", ctx.getPortalContextPath());
- assertEquals("/", ctx.getPortalRequestPath());
- }
- });
- if (result.isFailed())
- {
- return result;
- }
- else
- {
- return new InvokeGetResult("/test-servlet-defaultservletmapping/a");
- }
+ ExtendedAssert.assertEquals("/test-servlet-defaultservletmapping", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("/", ctx.getPortalRequestPath());
+ return new InvokeGetResponse("/test-servlet-defaultservletmapping/a");
case 2:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-defaultservletmapping", ctx.getPortalContextPath());
- assertEquals("/a", ctx.getPortalRequestPath());
- }
- });
- return result;
- default:
- return new FailureResult("");
+ ExtendedAssert.assertEquals("/test-servlet-defaultservletmapping", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("/a", ctx.getPortalRequestPath());
+ return new EndTestResponse();
}
+ return new ErrorResponse();
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,12 +24,12 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
/**
@@ -39,60 +39,29 @@
public class PathMappingTest extends AbstractTest
{
- private AssertResult result = new AssertResult();
+ public PathMappingTest()
+ {
+ super("PathMappingTest", "/test-servlet-pathmapping/abc");
+ }
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
- ServerRequest req = invocation.getRequest();
final ServerInvocationContext ctx = invocation.getServerContext();
- switch (TestCaseContext.getCurrentRequestCount())
+ switch (HttpTestContext.getCurrentRequestCount())
{
case 0:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-pathmapping/abc", ctx.getPortalContextPath());
- assertEquals("", ctx.getPortalRequestPath());
- }
- });
- if (result.isFailed())
- {
- return result;
- }
- else
- {
- return new InvokeGetResult("/test-servlet-pathmapping/abc/");
- }
+ ExtendedAssert.assertEquals("/test-servlet-pathmapping/abc", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("", ctx.getPortalRequestPath());
+ return new InvokeGetResponse("/test-servlet-pathmapping/abc/");
case 1:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-pathmapping/abc", ctx.getPortalContextPath());
- assertEquals("/", ctx.getPortalRequestPath());
- }
- });
- if (result.isFailed())
- {
- return result;
- }
- else
- {
- return new InvokeGetResult("/test-servlet-pathmapping/abc/a");
- }
+ ExtendedAssert.assertEquals("/test-servlet-pathmapping/abc", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("/", ctx.getPortalRequestPath());
+ return new InvokeGetResponse("/test-servlet-pathmapping/abc/a");
case 2:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-pathmapping/abc", ctx.getPortalContextPath());
- assertEquals("/a", ctx.getPortalRequestPath());
- }
- });
- return result;
- default:
- return new FailureResult("");
+ ExtendedAssert.assertEquals("/test-servlet-pathmapping/abc", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("/a", ctx.getPortalRequestPath());
+ return new EndTestResponse();
}
+ return new ErrorResponse();
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,11 +25,12 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.FailureResult;
-import org.jboss.portal.test.framework.container.result.InvokeGetResult;
-import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.server.AbstractTest;
/**
@@ -39,60 +40,30 @@
public class RootPathMappingTest extends AbstractTest
{
- private AssertResult result = new AssertResult();
+ public RootPathMappingTest()
+ {
+ super("RootPathMappingTest", "/test-servlet-rootpathmapping");
+ }
- public Result execute(ServerInvocation invocation)
+ public DriverResponse execute(ServerInvocation invocation)
{
ServerRequest req = invocation.getRequest();
final ServerInvocationContext ctx = invocation.getServerContext();
- switch (TestCaseContext.getCurrentRequestCount())
+ switch (HttpTestContext.getCurrentRequestCount())
{
case 0:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-rootpathmapping", ctx.getPortalContextPath());
- assertEquals("", ctx.getPortalRequestPath());
- }
- });
- if (result.isFailed())
- {
- return result;
- }
- else
- {
- return new InvokeGetResult("/test-servlet-rootpathmapping/");
- }
+ ExtendedAssert.assertEquals("/test-servlet-rootpathmapping", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("", ctx.getPortalRequestPath());
+ return new InvokeGetResponse("/test-servlet-rootpathmapping/");
case 1:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-rootpathmapping", ctx.getPortalContextPath());
- assertEquals("/", ctx.getPortalRequestPath());
- }
- });
- if (result.isFailed())
- {
- return result;
- }
- else
- {
- return new InvokeGetResult("/test-servlet-rootpathmapping/a");
- }
+ ExtendedAssert.assertEquals("/test-servlet-rootpathmapping", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("/", ctx.getPortalRequestPath());
+ return new InvokeGetResponse("/test-servlet-rootpathmapping/a");
case 2:
- result.execute(new AssertResult.Test()
- {
- public void run() throws Exception
- {
- assertEquals("/test-servlet-rootpathmapping", ctx.getPortalContextPath());
- assertEquals("/a", ctx.getPortalRequestPath());
- }
- });
- return result;
- default:
- return new FailureResult("");
+ ExtendedAssert.assertEquals("/test-servlet-rootpathmapping", ctx.getPortalContextPath());
+ ExtendedAssert.assertEquals("/a", ctx.getPortalRequestPath());
+ return new EndTestResponse();
}
+ return new ErrorResponse();
}
}
Deleted: trunk/server/src/main/org/jboss/portal/test/server/servlet/ServletTestSuite.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/servlet/ServletTestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/main/org/jboss/portal/test/server/servlet/ServletTestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,43 +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.server.servlet;
-
-import junit.framework.Test;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.framework.container.client.TestSuite;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ServletTestSuite
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("test-servlet.sar");
- suite.addTest(new TestCase("RootPathMappingTest", "/test-servlet-rootpathmapping"));
- suite.addTest(new TestCase("PathMappingTest", "/test-servlet-pathmapping/abc"));
- suite.addTest(new TestCase("DefaultServletMappingTest", "/test-servlet-defaultservletmapping"));
- return suite;
- }
-}
Modified: trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -33,7 +33,6 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
-
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
Modified: trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,6 +23,26 @@
<server>
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.server.HttpTestDriverRegistryService"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ </mbean>
+
<!-- Server configuration service -->
<mbean
code="org.jboss.portal.server.config.ServerConfigService"
@@ -55,13 +75,14 @@
</depends-list>
</mbean>
- <!-- -->
+ <!-- Controller -->
<mbean
- code="org.jboss.portal.test.server.RequestControllerTestImpl"
+ code="org.jboss.portal.test.server.TestRequestController"
name="portal:controller=Request"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<!-- -->
@@ -71,7 +92,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.charset.PostTest"
@@ -79,7 +100,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.charset.PostXWWWFormURLEncodedNoCharsetTest"
@@ -87,7 +108,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.charset.PostXWWWFormURLEncodedUTF8Test"
@@ -95,7 +116,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.charset.PostMultipartFormDataNoCharsetTest"
@@ -103,7 +124,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.charset.PostMultipartFormDataUTF8Test"
@@ -111,6 +132,6 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
</server>
\ No newline at end of file
Modified: trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,6 +23,26 @@
<server>
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.server.HttpTestDriverRegistryService"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ </mbean>
+
<!-- Server configuration service -->
<mbean
code="org.jboss.portal.server.config.ServerConfigService"
@@ -54,13 +74,14 @@
</depends-list>
</mbean>
- <!-- -->
+ <!-- Controller -->
<mbean
- code="org.jboss.portal.test.server.RequestControllerTestImpl"
+ code="org.jboss.portal.test.server.TestRequestController"
name="portal:controller=Request"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<!-- -->
@@ -70,7 +91,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.parameters.PostApplicationXWWWFormURLEncodedTest"
@@ -78,7 +99,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.parameters.PostMultipartFormDataTest"
@@ -86,6 +107,6 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
</server>
\ No newline at end of file
Modified: trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,6 +23,26 @@
<server>
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.server.HttpTestDriverRegistryService"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ </mbean>
+
<!-- Server configuration service -->
<mbean
code="org.jboss.portal.server.config.ServerConfigService"
@@ -33,7 +53,6 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
-
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -44,7 +63,6 @@
<depends optional-attribute-name="Config" proxy-type="attribute">portal:service=ServerConfig</depends>
</mbean>
-
<!-- Server stack -->
<mbean
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
@@ -56,13 +74,14 @@
</depends-list>
</mbean>
- <!-- -->
+ <!-- Controller -->
<mbean
- code="org.jboss.portal.test.server.RequestControllerTestImpl"
+ code="org.jboss.portal.test.server.TestRequestController"
name="portal:controller=Request"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<!-- -->
@@ -72,7 +91,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.servlet.PathMappingTest"
@@ -80,7 +99,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
<mbean
code="org.jboss.portal.test.server.servlet.DefaultServletMappingTest"
@@ -88,6 +107,6 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Controller" proxy-type="attribute">portal:controller=Request</depends>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
</server>
\ No newline at end of file
Modified: trunk/test/build.xml
===================================================================
--- trunk/test/build.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/build.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -159,19 +159,28 @@
<!-- -->
<jar jarfile="${build.lib}/portal-test-lib.jar" manifest="${build.etc}/portal-test-lib-jar.mf">
- <fileset dir="${build.classes}"/>
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/portal/test/framework/agent/**"/>
+ </fileset>
<fileset dir="${build.resources}/portal-test-jar"/>
</jar>
<!-- -->
+ <jar jarfile="${build.lib}/portal-test-agent-lib.jar" manifest="${build.etc}/portal-test-lib-jar.mf">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/portal/test/framework/agent/**"/>
+ </fileset>
+ </jar>
+
+ <!-- -->
<jar jarfile="${build.lib}/portal-test.sar">
<!--<fileset dir="${jboss.portal-common.root}/lib" includes="portal-common-lib.jar"/>-->
<fileset dir="${build.resources}/portal-test-sar"/>
- <fileset dir="${junit.junit.lib}" includes="junit.jar"/>
- <fileset dir="${build.lib}" includes="portal-test-lib.jar"/>
+ <!--<fileset dir="${junit.junit.lib}" includes="junit.jar"/>-->
+ <fileset dir="${build.lib}" includes="portal-test-agent-lib.jar"/>
<!--<fileset dir="${sun.opends.lib}" includes="OpenDS.jar"/>-->
- <fileset dir="${sleepycat.sleepycat.lib}" includes="je.jar"/>
- <fileset dir="${sun.jaf.lib}" includes="activation.jar"/>
+ <!--<fileset dir="${sleepycat.sleepycat.lib}" includes="je.jar"/>-->
+ <!--<fileset dir="${sun.jaf.lib}" includes="activation.jar"/>-->
</jar>
</target>
Modified: trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -37,50 +37,29 @@
{
/** . */
- private MBeanServerFactory serverFactory;
-
- /** . */
private String name;
/** . */
private String proxyClassName;
- public JBossServiceLookup(final Node node, String name, String proxyClassName)
+ public JBossServiceLookup(String name, String proxyClassName)
{
- this.serverFactory = new MBeanServerFactory()
- {
- public MBeanServer getServer()
- {
- return node.getServer();
- }
- };
this.name = name;
this.proxyClassName = proxyClassName;
}
- public JBossServiceLookup(final MBeanServer server, String name, String proxyClassName)
+ public Object getService(Node node) throws ServiceLookupFailedException
{
- this.serverFactory = new MBeanServerFactory()
+ try
{
- public MBeanServer getServer()
- {
- return server;
- }
- };
- this.name = name;
- this.proxyClassName = proxyClassName;
+ Class proxyClass = Thread.currentThread().getContextClassLoader().loadClass(proxyClassName);
+ ObjectName name = new ObjectName(this.name);
+ MBeanServer server = node.getServer();
+ return MBeanProxy.get(proxyClass, name, server);
+ }
+ catch (Exception e)
+ {
+ throw new ServiceLookupFailedException(e);
+ }
}
-
- public Object getService() throws Exception
- {
- Class proxyClass = Thread.currentThread().getContextClassLoader().loadClass(proxyClassName);
- ObjectName name = new ObjectName(this.name);
- MBeanServer server = serverFactory.getServer();
- return MBeanProxy.get(proxyClass, name, server);
- }
-
- private interface MBeanServerFactory
- {
- MBeanServer getServer();
- }
}
Modified: trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLookup.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLookup.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/JNDIServiceLookup.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,9 +23,10 @@
package org.jboss.portal.test.framework;
+import org.jboss.portal.test.framework.server.Node;
+
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import java.util.Properties;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -34,48 +35,37 @@
public class JNDIServiceLookup extends ServiceLookup
{
- /**
- *
- */
- private Properties env;
-
- /**
- *
- */
+ /** . */
private String jndiName;
- public String getJNDIName()
- {
- return jndiName;
- }
+// public String getJNDIName()
+// {
+// return jndiName;
+// }
+//
+// public void setJNDIName(String jndiName)
+// {
+// this.jndiName = jndiName;
+// }
- public void setJNDIName(String jndiName)
+
+ public JNDIServiceLookup(String jndiName)
{
this.jndiName = jndiName;
}
- public Properties getEnv()
+ public Object getService(Node node)
{
- return env;
- }
-
- public void setEnv(Properties env)
- {
- this.env = env;
- }
-
- public JNDIServiceLookup()
- {
- }
-
- public Object getService() throws Exception
- {
InitialContext ctx = null;
try
{
- ctx = new InitialContext(env);
+ ctx = node.getInitialContext();
return ctx.lookup(jndiName);
}
+ catch (NamingException e)
+ {
+ throw new ServiceLookupFailedException(e);
+ }
finally
{
if (ctx != null)
Modified: trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookup.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookup.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookup.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,11 +23,20 @@
package org.jboss.portal.test.framework;
+import org.jboss.portal.test.framework.server.Node;
+
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
public abstract class ServiceLookup
{
- public abstract Object getService() throws Exception;
+ /**
+ * Perform a service lookup for a given node.
+ *
+ * @param node the target node
+ * @return the service proxy
+ * @throws ServiceLookupFailedException if the lookup fails
+ */
+ public abstract Object getService(Node node) throws ServiceLookupFailedException;
}
Added: trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookupFailedException.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookupFailedException.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/ServiceLookupFailedException.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServiceLookupFailedException extends RuntimeException
+{
+ public ServiceLookupFailedException()
+ {
+ }
+
+ public ServiceLookupFailedException(String message)
+ {
+ super(message);
+ }
+
+ public ServiceLookupFailedException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ServiceLookupFailedException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,286 +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.framework;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.portal.test.framework.agent.TestAgent;
-import org.jboss.portal.test.framework.container.result.Result;
-import org.jboss.portal.test.framework.server.NodeId;
-
-import java.io.File;
-import java.io.Serializable;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * The test context seen from the server side.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class TestCaseContext implements Serializable
-{
-
- /** The current context. */
- private static TestCaseContext currentContext;
-
- /**
- * Return the current test case context.
- *
- * @return the current test context
- * @throws IllegalStateException if there is no current context
- */
- public static TestCaseContext getCurrentContext() throws IllegalStateException
- {
- if (currentContext == null)
- {
- throw new IllegalStateException("No existing context");
- }
- return currentContext;
- }
-
- /**
- * Return the current test case context or null if none exist.
- *
- * @return the current test context
- */
- public static TestCaseContext peekCurrentContext()
- {
- return currentContext;
- }
-
- /**
- * Set the current context.
- *
- * @param newContext the test case context
- */
- public static void setCurrentContext(TestCaseContext newContext)
- {
- currentContext = newContext;
- }
-
- /** The test id. */
- private final String testCaseId;
-
- /** The test count. */
- private int requestCount;
-
- /** The test result. */
- private Result result;
-
- /** The path where archive we want to deploy are. */
- private String archivePath;
-
- /** The test agent, normally only valid in the server side for now. */
- private TestAgent testAgent;
-
- /** Copy constructor. */
- public TestCaseContext(TestCaseContext that)
- {
- this.testCaseId = that.testCaseId;
- this.requestCount = that.requestCount;
- this.archivePath = that.archivePath;
- this.result = that.result;
- }
-
- public TestCaseContext(String testCaseId, int requestCount, String archivePath)
- {
- this.testCaseId = testCaseId;
- this.requestCount = requestCount;
- this.archivePath = archivePath;
- }
-
- /** Should not be exposed, but for now, well. */
- public TestAgent getTestAgent()
- {
- return testAgent;
- }
-
- /** Should not be exposed, but for now, well. */
- public void setTestAgent(TestAgent testAgent)
- {
- this.testAgent = testAgent;
- }
-
- /**
- * Return the test id.
- *
- * @return the test id
- */
- public String getTestCaseId()
- {
- return testCaseId;
- }
-
- /**
- * Return the test count.
- *
- * @return the test count
- */
- public int getRequestCount()
- {
- return requestCount;
- }
-
- /**
- * Return the result.
- *
- * @return the result of the test
- */
- public Result getResult()
- {
- return result;
- }
-
- public void setResult(Result result)
- {
- if (this.result != null)
- {
- throw new IllegalStateException("A result is already provided");
- }
- else
- {
- this.result = result;
- }
- }
-
- /**
- * @param url the url to rewrite
- * @param nodeId the node id
- * @return the rewritten url
- * @throws MalformedURLException
- * @throws IllegalArgumentException if the url is null or the node id not recognized
- */
- public String rewriteURLForNode(String url, NodeId nodeId) throws MalformedURLException
- {
- if (url == null)
- {
- throw new IllegalArgumentException("No null URL accepted");
- }
- int port;
- if (NodeId.DEFAULT.equals(nodeId))
- {
- port = 8080;
- }
- else if (NodeId.PORTS_01.equals(nodeId))
- {
- port = 8180;
- }
- else if (NodeId.PORTS_02.equals(nodeId))
- {
- port = 8280;
- }
- else
- {
- throw new IllegalArgumentException("Unknown node");
- }
- URL tmp;
- if (url.startsWith("http://"))
- {
- tmp = new URL(url);
- tmp = new URL(tmp.getProtocol(), tmp.getHost(), port, tmp.getFile());
- }
- else
- {
- tmp = new URL("http", "localhost", port, url);
- }
- return tmp.toString();
- }
-
- public void deploy(String archiveId) throws MalformedURLException, IllegalStateException, DeploymentException
- {
- if (testAgent == null)
- {
- throw new IllegalStateException("No test agent to perform deploy");
- }
-
- //
- File root = new File(archivePath);
- File f = new File(root, archiveId);
- URL url = f.toURL();
- testAgent.deploy(url);
- }
-
- public void undeploy(String archiveId) throws MalformedURLException, IllegalStateException, DeploymentException
- {
- if (testAgent == null)
- {
- throw new IllegalStateException("No test agent to perform deploy");
- }
-
- //
- File root = new File(archivePath);
- File f = new File(root, archiveId);
- URL url = f.toURL();
- testAgent.undeploy(url);
- }
-
- public static boolean isCurrentCaseTestId(String id) throws IllegalStateException
- {
- if (id == null)
- {
- throw new IllegalArgumentException();
- }
- return id.equals(getCurrentContext().testCaseId);
- }
-
- public static String getCurrentTestCaseId() throws IllegalStateException
- {
- return getCurrentContext().testCaseId;
- }
-
- public static boolean isCurrentRequestCount(int count) throws IllegalStateException
- {
- return getCurrentContext().requestCount == count;
- }
-
- public static int getCurrentRequestCount() throws IllegalStateException
- {
- return getCurrentContext().requestCount;
- }
-
- public static Result getCurrentResult() throws IllegalStateException
- {
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
- if (ctx != null)
- {
- return ctx.result;
- }
- else
- {
- return null;
- }
- }
-
- public static void setCurrentResult(Result currentResult) throws IllegalStateException
- {
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
- ctx.setResult(currentResult);
- }
-
- public String toString()
- {
- return "TestCaseContext[" + testCaseId + "," + requestCount + "]";
- }
-}
Modified: trunk/test/src/main/org/jboss/portal/test/framework/TestRuntimeContext.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/TestRuntimeContext.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/TestRuntimeContext.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -142,7 +142,7 @@
}
catch (Throwable throwable)
{
- log.error("Got a throwable", throwable);
+// log.error("Got a throwable", throwable);
if (throwable instanceof Error)
{
throw(Error)throwable;
Modified: trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgent.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgent.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgent.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -20,25 +20,17 @@
* 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.framework.agent;
import org.jboss.deployment.DeploymentException;
import org.jboss.deployment.MainDeployerMBean;
import org.jboss.invocation.Invocation;
-import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.system.ServiceMBeanSupport;
import java.lang.reflect.Method;
import java.net.URL;
/**
- * This is a hack for testing. We log the deployment exception in the MainDeployerProxy that keeps exception in a thread
- * local and rethrow them once deployment is finished. We are forced to do that because the deployment mechanism we have
- * is based on JMX notifications isolate the two deployment layers (JBoss AS and JBoss Portal).
- * <p/>
- * Having deployment interception will solve the problem.
- *
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
@@ -71,26 +63,6 @@
this.mainDeployer = mainDeployer;
}
- public void setContext(TestCaseContext context)
- {
- context.setTestAgent(this);
-
- //
- TestCaseContext.setCurrentContext(context);
- }
-
- public TestCaseContext getContext()
- {
- TestCaseContext ctx = TestCaseContext.peekCurrentContext();
-
- // We clone it because we don't want the agent to be potentially marshalled
- ctx = new TestCaseContext(ctx);
- ctx.setTestAgent(null);
-
- //
- return ctx;
- }
-
public void deploy(URL url) throws DeploymentException
{
perform(url, true);
@@ -137,12 +109,13 @@
private DeploymentException e;
}
- /** Perform proxy call to ourself. */
+ /**
+ * Perform proxy call to ourself.
+ */
public Object invoke(Invocation invocation) throws Exception
{
Method method = invocation.getMethod();
Object[] args = invocation.getArguments();
-// log.debug("invoke invoked: method=" + method + " args=" + args);
return method.invoke(this, args);
}
}
Modified: trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgentMBean.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgentMBean.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgentMBean.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,7 +24,6 @@
import org.jboss.deployment.MainDeployerMBean;
import org.jboss.invocation.Invocation;
-import org.jboss.mx.util.ObjectNameFactory;
import org.jboss.system.ServiceMBean;
import javax.management.ObjectName;
@@ -35,8 +34,6 @@
*/
public interface JBossTestAgentMBean extends TestAgent, ServiceMBean
{
- ObjectName OBJECT_NAME = ObjectNameFactory.create("portal.test:service=Agent");
-
MainDeployerMBean getMainDeployer();
void setMainDeployer(MainDeployerMBean mainDeployer);
Modified: trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgent.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgent.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgent.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,7 +23,6 @@
package org.jboss.portal.test.framework.agent;
import org.jboss.deployment.DeploymentException;
-import org.jboss.portal.test.framework.TestCaseContext;
import java.net.URL;
@@ -42,14 +41,4 @@
*
*/
void undeploy(URL url) throws DeploymentException;
-
- /**
- *
- */
- void setContext(TestCaseContext context);
-
- /**
- *
- */
- TestCaseContext getContext();
}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgentFactory.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgentFactory.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgentFactory.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,65 +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.framework.agent;
-
-import org.jboss.portal.test.framework.server.Node;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestAgentFactory
-{
-
- public TestAgent getTestAgent(Node node)
- {
- try
- {
- MBeanServer server = node.getServer();
- return (TestAgent)server.getAttribute(new ObjectName("portal.test:service=Invoker,name=Agent"), "Proxy");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public void create()
- {
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop()
- {
- }
-
- public void destroy()
- {
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,376 +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.framework.container.client;
-
-import junit.framework.AssertionFailedError;
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HostConfiguration;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.SimpleHttpConnectionManager;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.params.HttpMethodParams;
-import org.apache.log4j.Logger;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.agent.TestAgent;
-import org.jboss.portal.test.framework.container.client.command.ClientCommand;
-import org.jboss.portal.test.framework.container.client.command.DoGetCommand;
-import org.jboss.portal.test.framework.container.client.command.DoPostCommand;
-import org.jboss.portal.test.framework.container.client.command.EndCommand;
-import org.jboss.portal.test.framework.container.client.command.RethrowCommand;
-import org.jboss.portal.test.framework.container.result.Result;
-import org.jboss.portal.test.framework.server.Node;
-import org.jboss.portal.test.framework.server.NodeId;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Base class for portlet test case.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
- * @version $Revision$
- */
-public class TestCase extends junit.framework.TestCase
-{
-
- /** . */
- private final Logger log = Logger.getLogger(getClass());
-
- /** The test case id. */
- protected String testCaseId;
-
- /** The runner we belong to. */
- protected TestRunner runner;
-
- /** The initial uri. */
- protected String uri;
-
- /** . */
- private NodeId initialNodeId;
-
- /** . */
- private int requestCount;
-
- /** . */
- private HttpClient client;
-
- /** . */
- private Node currentNode;
-
- public TestCase(String testCaseId)
- {
- this(testCaseId, "/test/");
- }
-
- public TestCase(NodeId initialNodeId, String testCaseId)
- {
- this(initialNodeId, testCaseId, "/test/");
- }
-
- public TestCase(String testCaseId, String uri)
- {
- this(NodeId.DEFAULT, testCaseId, uri);
- }
-
- public TestCase(NodeId initialNodeId, String testCaseId, String uri)
- {
- if (initialNodeId == null)
- {
- throw new IllegalArgumentException("No null initial node id");
- }
- if (testCaseId == null)
- {
- throw new IllegalArgumentException("Test case id must not be null");
- }
- if (uri == null)
- {
- throw new IllegalArgumentException("URI must not be null");
- }
-
- //
- this.initialNodeId = initialNodeId;
- this.uri = uri;
- this.testCaseId = testCaseId;
- this.requestCount = 0;
- this.client = new HttpClient(new SimpleHttpConnectionManager());
-
- // Configure client
- client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, null);
- Credentials defaultcreds = new UsernamePasswordCredentials("test", "test");
- client.getState().setCredentials(AuthScope.ANY, defaultcreds);
- }
-
- public void setRunner(TestRunner runner)
- {
- this.runner = runner;
- }
-
- /** Override with the test case id. */
- public final String getName()
- {
- return testCaseId;
- }
-
- /** Perform the test run. */
- protected final void runTest() throws Throwable
- {
- log.info("# Starting '" + testCaseId + "' test");
- currentNode = runner.getNodeManager().getNode(initialNodeId);
- if (currentNode == null)
- {
- throw new IllegalStateException("No such node " + initialNodeId);
- }
- ClientCommand cmd = new DoGetCommand(uri);
- run(cmd);
- }
-
- protected final void run(ClientCommand cmd) throws Throwable
- {
- while (true)
- {
- if (cmd instanceof EndCommand)
- {
- log.info("# Ending '" + testCaseId + "' test");
- break;
- }
- else if (cmd instanceof RethrowCommand)
- {
- log.info("# Ending test: '" + testCaseId + "' by rethrowing exception from test case'");
- throw((RethrowCommand)cmd).getThrowable();
- }
- else if (cmd instanceof DoPostCommand)
- {
- DoPostCommand dpc = (DoPostCommand)cmd;
- PostMethod post = null;
- try
- {
- post = new PostMethod(dpc.getURL());
- post.setFollowRedirects(false);
- DoPostCommand.Body body = dpc.getBody();
- if (dpc.getContentType() != null)
- {
- post.addRequestHeader("Content-Type", dpc.getContentType());
- }
- if (body instanceof DoPostCommand.RawBody)
- {
- DoPostCommand.RawBody rb = (DoPostCommand.RawBody)body;
- ByteArrayRequestEntity entity = new ByteArrayRequestEntity(rb.getBytes());
- post.setRequestEntity(entity);
- }
- else if (body instanceof DoPostCommand.FormBody)
- {
- DoPostCommand.FormBody fb = (DoPostCommand.FormBody)body;
- Collection tmp = new ArrayList();
- for (Iterator i = fb.getParameters().entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String name = (String)entry.getKey();
- String[] values = (String[])entry.getValue();
- for (int j = 0; j < values.length; j++)
- {
- String value = values[j];
- NameValuePair nvp = new NameValuePair(name, value);
- tmp.add(nvp);
- }
- }
- NameValuePair[] nvps = (NameValuePair[])tmp.toArray(new NameValuePair[tmp.size()]);
- post.setRequestBody(nvps);
- }
- executeMethod(post);
- cmd = evaluateHttpMethodResponse(post);
- }
- finally
- {
- if (post != null)
- {
- post.releaseConnection();
- }
- }
- }
- else if (cmd instanceof DoGetCommand)
- {
- DoGetCommand dgc = (DoGetCommand)cmd;
- GetMethod get = null;
- try
- {
- get = new GetMethod(dgc.getURL());
- Map headers = dgc.getHeaders();
- for (Iterator i = headers.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String headerName = (String)entry.getKey();
- String headerValue = (String)entry.getValue();
- get.setRequestHeader(headerName, headerValue);
- }
- get.setFollowRedirects(false);
- executeMethod(get);
- cmd = evaluateHttpMethodResponse(get);
- }
- finally
- {
- if (get != null)
- {
- get.releaseConnection();
- }
- }
- }
- else
- {
- throw new IllegalStateException("Unknown command");
- }
- }
- }
-
- private ClientCommand evaluateHttpMethodResponse(HttpMethod hm) throws Exception
- {
- TestAgent agent = runner.getTestAgent(currentNode);
- TestCaseContext ctx = agent.getContext();
- Result result = ctx.getResult();
- int status = hm.getStatusCode();
- switch (status)
- {
- case 500:
- log.info("# Received '500' code");
- throw new AssertionFailedError("500");
- case 200:
- if (result == null)
- {
- throw new AssertionFailedError("No result for test " + testCaseId + " in the response");
- }
- else
- {
- log.info("# Received '200' code");
- requestCount++;
- return result.createCommand();
- }
- // Send redirect
- case 302:
- // If any result has been setup during the action it overrides the 302 code
- if (result != null)
- {
- log.info("# Received Result object which overrides the 302");
- return result.createCommand();
- }
- // Otherwise satisfy the 302 code
- Header locationHeader = hm.getResponseHeader("location");
- if (locationHeader != null)
- {
- String redirectLocation = locationHeader.getValue();
- log.info("# Received '302' code --> " + redirectLocation);
- return new DoGetCommand(redirectLocation);
- }
- else
- {
- // The response is invalid
- throw new AssertionFailedError("302 Code with corrupted data");
- }
- default:
- throw new AssertionFailedError("Unexpected status code : " + status);
- }
- }
-
- public int executeMethod(HttpMethod method) throws Exception
- {
- int port = method.getURI().getPort();
- if (port != -1)
- {
- currentNode = getNode(port);
- if (currentNode == null)
- {
- throw new IllegalArgumentException("Wrong port " + method.getURI().getPort());
- }
- }
- else
- {
- port = getPort(currentNode);
- }
-
- //
- String host = method.getURI().getHost();
- if (host == null)
- {
- host = "localhost";
- }
-
- //
- HostConfiguration cfg = new HostConfiguration();
- cfg.setHost(host, port);
- TestCaseContext ctx = new TestCaseContext(testCaseId, requestCount, runner.getArchivePath());
-
- log.info("# Updating test case context of : " + currentNode + " : " + ctx);
- TestAgent agent = runner.getTestAgent(currentNode);
- agent.setContext(ctx);
-
- //
- log.info("# Invoking test case over http " + cfg + " " + method.getURI());
-
- return client.executeMethod(cfg, method);
- }
-
- private Node getNode(int port)
- {
- NodeId nodeId = null;
- switch (port)
- {
- case 8080:
- nodeId = NodeId.DEFAULT;
- break;
- case 8180:
- nodeId = NodeId.PORTS_01;
- break;
- case 8280:
- nodeId = NodeId.PORTS_02;
- break;
- }
- return runner.getNodeManager().getNode(nodeId);
- }
-
- public int getPort(Node node)
- {
- NodeId nodeId = node.getId();
- if (NodeId.DEFAULT.equals(nodeId))
- {
- return 8080;
- }
- if (NodeId.PORTS_01.equals(nodeId))
- {
- return 8180;
- }
- if (NodeId.PORTS_02.equals(nodeId))
- {
- return 8280;
- }
- return -1;
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestRunner.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestRunner.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestRunner.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,200 +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.framework.container.client;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.SimpleLayout;
-import org.jboss.portal.test.framework.TestRuntimeContext;
-import org.jboss.portal.test.framework.agent.TestAgent;
-import org.jboss.portal.test.framework.agent.TestAgentFactory;
-import org.jboss.portal.test.framework.deployment.Deployer;
-import org.jboss.portal.test.framework.server.Node;
-import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.test.framework.server.NodeManager;
-
-import java.io.File;
-import java.net.URL;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
- */
-public class TestRunner extends TestSuite
-{
-
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.INFO);
- }
-
- /** . */
- protected TestRuntimeContext runtimeContext;
-
- /** . */
- protected URL url;
-
- /** The injected deployer. */
- protected Deployer deployer;
-
- /** The injected node manager. */
- protected NodeManager nodeManager;
-
- /** The node id list used for this test suite. */
- protected NodeId[] nodeIds;
-
- /** The test agent factory. */
- protected TestAgentFactory testAgentFactory;
-
- public TestRunner(String beansDescriptorLocation)
- {
- this(beansDescriptorLocation, new NodeId[]{NodeId.DEFAULT});
- }
-
- public TestRunner(String beansDescriptorLocation, NodeId[] nodeIds)
- {
- this.runtimeContext = new TestRuntimeContext(beansDescriptorLocation);
- this.nodeIds = (NodeId[])nodeIds.clone();
- }
-
- public TestAgentFactory getTestAgentFactory()
- {
- return testAgentFactory;
- }
-
- public void setTestAgentFactory(TestAgentFactory testAgentFactory)
- {
- this.testAgentFactory = testAgentFactory;
- }
-
- public NodeManager getNodeManager()
- {
- return nodeManager;
- }
-
- public void setNodeManager(NodeManager nodeManager)
- {
- this.nodeManager = nodeManager;
- }
-
- public Deployer getDeployer()
- {
- return deployer;
- }
-
- public void setDeployer(Deployer deployer)
- {
- this.deployer = deployer;
- }
-
- /**
- * Returns a path where the deployable archives are.
- *
- * @return the path to the archive that are deployable
- */
- public String getArchivePath()
- {
- File root = new File(System.getProperty("test.root"));
- return root.getAbsolutePath();
- }
-
- public void addTest(Test test)
- {
- if (test instanceof org.jboss.portal.test.framework.container.client.TestCase)
- {
- ((org.jboss.portal.test.framework.container.client.TestCase)test).setRunner(this);
- }
- super.addTest(test);
- }
-
- public void run(TestResult testResult)
- {
- try
- {
- runtimeContext.addBean("TestBean", this);
- runtimeContext.start();
-
- // Perform deploy
- deploy();
-
- // Run all tests
- super.run(testResult);
-
- //
- undeploy();
- }
- catch (final Exception e)
- {
- e.printStackTrace();
- junit.framework.TestCase tc = new TestCase()
- {
- protected void runTest() throws Throwable
- {
- if (e.getCause() != null)
- {
- fail("Was not able to execute test runner");
- }
- }
- };
- runTest(tc, testResult);
- }
- finally
- {
- runtimeContext.stop();
- }
- }
-
- /**
- * Returns the test agent for a specified node.
- *
- * @param node the target node
- * @return the specified node
- * @throws Exception
- */
- public TestAgent getTestAgent(Node node) throws Exception
- {
- return testAgentFactory.getTestAgent(node);
- }
-
- /**
- * Subclass to perform deployment.
- *
- * @throws Exception
- */
- public void deploy() throws Exception
- {
- }
-
- /** Subclass to perform undeployment. */
- public void undeploy()
- {
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestSuite.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestSuite.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestSuite.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,112 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.test.framework.container.client;
-
-import org.jboss.portal.test.framework.server.Node;
-import org.jboss.portal.test.framework.server.NodeId;
-
-import java.io.File;
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class TestSuite extends TestRunner
-{
-
- /** The test suite id. */
- protected String testSuiteId;
-
- public TestSuite(String testSuiteId)
- {
- super("org/jboss/portal/test/framework/container/jboss-beans.xml");
-
- //
- if (testSuiteId == null)
- {
- throw new IllegalArgumentException("Was expecting a test suite id");
- }
-
- //
- this.testSuiteId = testSuiteId;
- }
-
- public TestSuite(String testSuiteId, NodeId[] nodeIds)
- {
- this(testSuiteId, "org/jboss/portal/test/framework/container/jboss-beans.xml", nodeIds);
- }
-
- public TestSuite(String testSuiteId, String beansDescriptorLocation, NodeId[] nodeIds)
- {
- super(beansDescriptorLocation, nodeIds);
-
- //
- if (testSuiteId == null)
- {
- throw new IllegalArgumentException("Was expecting a test suite id");
- }
-
- //
- this.testSuiteId = testSuiteId;
- }
-
- public void deploy() throws Exception
- {
- String archivePath = getArchivePath();
- File root = new File(archivePath);
- File f = new File(root, testSuiteId);
- if (!f.exists())
- {
- throw new Exception("No such file to deploy " + f.getAbsolutePath());
- }
- if (!f.isFile())
- {
- throw new Exception("File is not a plain file " + f.getAbsolutePath());
- }
- url = f.toURL();
-
- //
- ArrayList nodes = new ArrayList();
-
- //
- for (int i = 0; i < nodeIds.length; i++)
- {
- NodeId nodeId = nodeIds[i];
- Node node = nodeManager.getNode(nodeId);
- nodes.add(node);
- }
-
- //
- deployer.deploy(url, nodes);
- }
-
- public void undeploy()
- {
- if (url != null)
- {
- deployer.undeploy(url);
- }
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/ClientCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/ClientCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/ClientCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,34 +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.framework.container.client.command;
-
-/**
- * A command executed on the client based on a result from a portlet invocation.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ClientCommand
-{
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoGetCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoGetCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoGetCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,72 +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.framework.container.client.command;
-
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * Perform a get.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class DoGetCommand extends ClientCommand
-{
-
- /** . */
- private String url;
-
- /** . */
- private Map headers;
-
- public DoGetCommand(String url)
- {
- this(url, Collections.EMPTY_MAP);
- }
-
- public DoGetCommand(String url, Map headers)
- {
- if (url == null)
- {
- throw new IllegalArgumentException();
- }
- if (headers == null)
- {
- throw new IllegalArgumentException();
- }
- this.url = url;
- this.headers = headers;
- }
-
- public String getURL()
- {
- return url;
- }
-
- public Map getHeaders()
- {
- return headers;
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoPostCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoPostCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/DoPostCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,113 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.test.framework.container.client.command;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class DoPostCommand extends ClientCommand
-{
-
- private String url;
-
- private String contentType;
-
- private Body body;
-
- public DoPostCommand(String url, String contentType, Body body)
- {
- if (url == null)
- {
- throw new IllegalArgumentException();
- }
- if (body == null)
- {
- throw new IllegalArgumentException();
- }
- this.url = url;
- this.contentType = contentType;
- this.body = body;
- }
-
- public String getURL()
- {
- return url;
- }
-
- public String getContentType()
- {
- return contentType;
- }
-
- public Body getBody()
- {
- return body;
- }
-
- public abstract static class Body
- {
- }
-
- public static class FormBody extends Body
- {
- private Map parameters;
-
- public FormBody(Map parameters)
- {
- if (parameters == null)
- {
- throw new IllegalArgumentException();
- }
- this.parameters = parameters;
- }
-
- public Map getParameters()
- {
- return parameters;
- }
- }
-
- public static class RawBody extends Body
- {
- private final byte[] bytes;
-
- public RawBody(byte[] bytes)
- {
- if (bytes == null)
- {
- throw new IllegalArgumentException();
- }
- this.bytes = bytes;
- }
-
- public byte[] getBytes()
- {
- return bytes;
- }
- }
-
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/EndCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/EndCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/EndCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,34 +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.framework.container.client.command;
-
-/**
- * Terminate a test.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class EndCommand extends ClientCommand
-{
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/RethrowCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/RethrowCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/command/RethrowCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,44 +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.framework.container.client.command;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class RethrowCommand extends ClientCommand
-{
-
- private Throwable throwable;
-
- public RethrowCommand(Throwable throwable)
- {
- this.throwable = throwable;
- }
-
- public Throwable getThrowable()
- {
- return throwable;
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/result/AssertResult.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/result/AssertResult.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/result/AssertResult.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,135 +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.framework.container.result;
-
-import junit.framework.AssertionFailedError;
-import org.apache.log4j.Logger;
-import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.container.client.command.ClientCommand;
-import org.jboss.portal.test.framework.container.client.command.EndCommand;
-import org.jboss.portal.test.framework.container.client.command.RethrowCommand;
-
-/**
- * A set of assertions as result.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class AssertResult extends Result
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 1877502248444615242L;
-
- /** . */
- private static Logger log = Logger.getLogger(AssertResult.class);
-
- /** The throwable that failed this assertion. */
- private Throwable throwable;
-
- public AssertResult()
- {
- }
-
- public AssertResult(Throwable t)
- {
- throwable = t;
- }
-
- public static AssertResult run(Test test) throws IllegalArgumentException, IllegalStateException
- {
- AssertResult assertResult = new AssertResult();
- assertResult.execute(test);
- return assertResult;
- }
-
- /**
- * Run the test, record the error or failure if any and increment the count.
- *
- * @param test the test to execute
- * @throws IllegalArgumentException if test is null
- * @throws IllegalStateException if the test is already failed
- */
- public void execute(Test test) throws IllegalArgumentException, IllegalStateException
- {
- if (isFailed())
- {
- throw new IllegalStateException();
- }
- if (test == null)
- {
- throw new IllegalArgumentException("Test must not be null");
- }
- if (throwable == null)
- {
- try
- {
- test.run();
- }
- catch (AssertionFailedError afe)
- {
- AssertResult.log.error("Failure during test", afe);
- throwable = afe;
- }
- catch (Throwable e)
- {
- AssertResult.log.error("Error during test", e);
- throwable = e;
- }
- }
- else
- {
- // Do not execute test as we already have a failure
- }
- }
-
- public static abstract class Test extends ExtendedAssert
- {
- public abstract void run() throws Exception;
- }
-
- /** Return the recorded throwable or null if nothing has been recorded. */
- public Throwable getThrowable()
- {
- return throwable;
- }
-
- /** Return true if throwable is null. */
- public boolean isFailed()
- {
- return throwable != null;
- }
-
- public ClientCommand createCommand()
- {
- if (throwable != null)
- {
- return new RethrowCommand(throwable);
- }
- else
- {
- return new EndCommand();
- }
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/result/EndTestResult.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/result/EndTestResult.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/result/EndTestResult.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,47 +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.framework.container.result;
-
-import org.jboss.portal.test.framework.container.client.command.ClientCommand;
-import org.jboss.portal.test.framework.container.client.command.EndCommand;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class EndTestResult extends Result
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 5213703287701969049L;
-
- public EndTestResult()
- {
- }
-
- public ClientCommand createCommand()
- {
- return new EndCommand();
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/result/FailureResult.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/result/FailureResult.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/result/FailureResult.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,70 +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.framework.container.result;
-
-import junit.framework.AssertionFailedError;
-import org.jboss.portal.test.framework.container.client.command.ClientCommand;
-import org.jboss.portal.test.framework.container.client.command.RethrowCommand;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class FailureResult extends Result
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -7343495299222478388L;
- private AssertionFailedError afe;
-
- public FailureResult()
- {
- }
-
- public FailureResult(String message)
- {
- if (message == null)
- {
- throw new IllegalArgumentException("Message must not be null");
- }
- try
- {
- throw new AssertionFailedError(message);
- }
- catch (AssertionFailedError afe)
- {
- this.afe = afe;
- }
- }
-
- public AssertionFailedError getAfe()
- {
- return afe;
- }
-
- public ClientCommand createCommand()
- {
- return new RethrowCommand(afe);
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokeGetResult.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokeGetResult.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokeGetResult.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,87 +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.framework.container.result;
-
-import org.jboss.portal.test.framework.container.client.command.ClientCommand;
-import org.jboss.portal.test.framework.container.client.command.DoGetCommand;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
- * @version $Revision$
- */
-public class InvokeGetResult extends Result
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 5968471624915140976L;
-
- /** . */
- private String url;
-
- /** . */
- private Map headers;
-
- public InvokeGetResult(String url)
- {
- if (url == null)
- {
- throw new IllegalArgumentException("Cannot invoke against a null URL");
- }
- this.url = url;
- this.headers = new HashMap();
- }
-
- public String getURL()
- {
- return url;
- }
-
- public void setHeader(String headerName, String headerValue)
- {
- if (headerName == null)
- {
- throw new IllegalArgumentException("No null header name accepted");
- }
- if (headerValue == null)
- {
- throw new IllegalArgumentException("No null header value accepted");
- }
- headers.put(headerName, headerValue);
- }
-
- public ClientCommand createCommand()
- {
- DoGetCommand dgc = new DoGetCommand(url, headers);
- return dgc;
- }
-
- public String toString()
- {
- return "InvokeRenderURL[" + url + "]";
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokePostResult.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokePostResult.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/result/InvokePostResult.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,192 +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.framework.container.result;
-
-import org.jboss.portal.test.framework.container.client.command.ClientCommand;
-import org.jboss.portal.test.framework.container.client.command.DoPostCommand;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * The portlet wants to invoke a post.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class InvokePostResult extends Result
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 2635507530899509020L;
-
- /** . */
- public static final String APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded";
-
- /** . */
- public static final String MULTIPART_FORM_DATA = "multipart/form-data";
-
- /** The post url. */
- private String url;
-
- /** The content type. */
- private String contentType;
-
- /** The post body. */
- private Body body;
-
- public String getURL()
- {
- return url;
- }
-
- public void setURL(String url)
- {
- this.url = url;
- }
-
- public Body getBody()
- {
- return body;
- }
-
- public void setBody(Body body)
- {
- this.body = body;
- }
-
- public String getContentType()
- {
- return contentType;
- }
-
- public void setContentType(String contentType)
- {
- this.contentType = contentType;
- }
-
- public ClientCommand createCommand()
- {
- if (url == null)
- {
- throw new IllegalStateException("No url");
- }
- if (body == null)
- {
- throw new IllegalStateException("No body");
- }
- DoPostCommand.Body dpcb = body.getBody();
- return new DoPostCommand(url, contentType, dpcb);
- }
-
- public abstract static class Body implements Serializable
- {
- public abstract DoPostCommand.Body getBody() throws IllegalStateException;
- }
-
- public static class RawBody extends Body
- {
-
- private byte[] bytes;
-
- public byte[] getBytes()
- {
- return bytes;
- }
-
- public void setBytes(byte[] bytes)
- {
- this.bytes = bytes;
- }
-
- public DoPostCommand.Body getBody()
- {
- if (bytes == null)
- {
- throw new IllegalStateException("No bytes");
- }
- DoPostCommand.RawBody dpcb = new DoPostCommand.RawBody(bytes);
- return dpcb;
- }
- }
-
- public static class FormBody extends Body
- {
-
- private Map parameters = new HashMap();
-
- public void addParameter(String name, String[] values)
- {
- if (name == null)
- {
- throw new IllegalStateException();
- }
- if (values == null)
- {
- throw new IllegalStateException();
- }
- for (int i = 0; i < values.length; i++)
- {
- String value = values[i];
- if (value == null)
- {
- throw new IllegalStateException();
- }
- }
- parameters.put(name, values.clone());
- }
-
- public void removeParameter(String name)
- {
- if (name == null)
- {
- throw new IllegalStateException();
- }
- parameters.remove(name);
- }
-
- public Set getParameterNames()
- {
- return Collections.unmodifiableSet(parameters.keySet());
- }
-
- public String[] getParameterValue(String name)
- {
- if (name == null)
- {
- throw new IllegalStateException();
- }
- String[] values = (String[])parameters.get(name);
- return (String[])values.clone();
- }
-
- public DoPostCommand.Body getBody()
- {
- return new DoPostCommand.FormBody(parameters);
- }
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/result/Result.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/result/Result.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/result/Result.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.framework.container.result;
-
-import org.jboss.portal.test.framework.container.client.command.ClientCommand;
-
-import java.io.Serializable;
-
-/**
- * The result of a render phase from the portlet perspective.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public abstract class Result implements Serializable
-{
-
- protected Result()
- {
- }
-
- /**
- * Return the command to execute on the client side.
- *
- * @throws IllegalStateException if the state does not allow the construction of the command
- */
- public abstract ClientCommand createCommand() throws IllegalStateException;
-}
Modified: trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -23,8 +23,8 @@
package org.jboss.portal.test.framework.deployment;
-import org.jboss.portal.test.framework.agent.TestAgentFactory;
import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.ServiceLookup;
import java.net.MalformedURLException;
import java.net.URL;
@@ -48,16 +48,16 @@
private Map deployments;
/** . */
- private TestAgentFactory testAgentFactory;
+ private ServiceLookup testAgentLookup;
- public TestAgentFactory getTestAgentFactory()
+ public ServiceLookup getTestAgentLookup()
{
- return testAgentFactory;
+ return testAgentLookup;
}
- public void setTestAgentFactory(TestAgentFactory testAgentFactory)
+ public void setTestAgentLookup(ServiceLookup testAgentLookup)
{
- this.testAgentFactory = testAgentFactory;
+ this.testAgentLookup = testAgentLookup;
}
public void create()
@@ -99,7 +99,7 @@
public void deploy(URL url, Collection nodes) throws Exception
{
Deployment deployment = new Deployment(nodes, url);
- deployment.deploy(testAgentFactory);
+ deployment.deploy(testAgentLookup);
deployments.put(url, deployment);
}
@@ -108,7 +108,7 @@
Deployment deployment = (Deployment)deployments.remove(url);
if (deployment != null)
{
- deployment.undeploy(testAgentFactory);
+ deployment.undeploy(testAgentLookup);
}
}
Modified: trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployment.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployment.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployment.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -27,8 +27,8 @@
import org.apache.log4j.Logger;
import org.jboss.deployment.DeploymentException;
import org.jboss.portal.test.framework.agent.TestAgent;
-import org.jboss.portal.test.framework.agent.TestAgentFactory;
import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.ServiceLookup;
import java.io.IOException;
import java.net.URL;
@@ -79,7 +79,7 @@
* @throws IllegalArgumentException if the application name does not give a valid deployment
* @throws java.io.IOException
*/
- void deploy(TestAgentFactory testAgentFactory) throws DeploymentException, IllegalArgumentException, IllegalStateException, IOException
+ void deploy(ServiceLookup testAgentLookup) throws DeploymentException, IllegalArgumentException, IllegalStateException, IOException
{
if (deployed)
{
@@ -92,7 +92,7 @@
for (Iterator i = nodes.iterator(); i.hasNext();)
{
Node node = (Node)i.next();
- TestAgent agent = testAgentFactory.getTestAgent(node);
+ TestAgent agent = (TestAgent)testAgentLookup.getService(node);
agent.deploy(url);
}
}
@@ -115,7 +115,7 @@
}
/** Undeploy a portlet application. This method blocks until the undeployment is finished. */
- void undeploy(TestAgentFactory testAgentFactory)
+ void undeploy(ServiceLookup testAgentLookup)
{
URL url = this.url;
this.url = null;
@@ -126,7 +126,7 @@
try
{
Node node = (Node)i.next();
- TestAgent agent = testAgentFactory.getTestAgent(node);
+ TestAgent agent = (TestAgent)testAgentLookup.getService(node);
agent.undeploy(url);
}
catch (Exception e)
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.framework.driver.http;
+
+import org.jboss.portal.test.framework.agent.TestAgent;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.invocation.Invocation;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractHttpTestDriverServerService extends ServiceMBeanSupport implements HttpTestDriverServer
+{
+
+ /** . */
+ private TestAgent agent;
+
+ public TestAgent getAgent()
+ {
+ return agent;
+ }
+
+ public void setAgent(TestAgent agent)
+ {
+ this.agent = agent;
+ }
+
+ public void updateContext(HttpTestContext ctx)
+ {
+ ctx.setTestAgent(agent);
+
+ //
+ HttpTestContext.setCurrentContext(ctx);
+ }
+
+ public HttpTestContext retrieveContext()
+ {
+ HttpTestContext ctx = HttpTestContext.peekCurrentContext();
+
+ // We clone it because we don't want the agent to be potentially marshalled
+ ctx = new HttpTestContext(ctx);
+ ctx.setTestAgent(null);
+
+ //
+ return ctx;
+ }
+
+ /**
+ * Perform proxy call to ourself.
+ */
+ public Object invoke(Invocation invocation) throws Exception
+ {
+ Method method = invocation.getMethod();
+ Object[] args = invocation.getArguments();
+ return method.invoke(this, args);
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,291 @@
+/******************************************************************************
+ * 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.framework.driver.http;
+
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.framework.agent.TestAgent;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.deployment.DeploymentException;
+
+import java.io.Serializable;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * The test context seen from the server side.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5498 $
+ */
+public class HttpTestContext implements Serializable
+{
+
+ /** The current context. */
+ private static HttpTestContext currentContext;
+
+ /**
+ * Return the current test case context.
+ *
+ * @return the current test context
+ * @throws IllegalStateException if there is no current context
+ */
+ public static HttpTestContext getCurrentContext() throws IllegalStateException
+ {
+ if (currentContext == null)
+ {
+ throw new IllegalStateException("No existing context");
+ }
+ return currentContext;
+ }
+
+ /**
+ * Return the current test case context or null if none exist.
+ *
+ * @return the current test context
+ */
+ public static HttpTestContext peekCurrentContext()
+ {
+ return currentContext;
+ }
+
+ /**
+ * Set the current context.
+ *
+ * @param newContext the test case context
+ */
+ public static void setCurrentContext(HttpTestContext newContext)
+ {
+ currentContext = newContext;
+ }
+
+ /** The test id. */
+ private final String testCaseId;
+
+ /** The test count. */
+ private int requestCount;
+
+ /** The test result. */
+ private DriverResponse result;
+
+ /** The path where archive we want to deploy are. */
+ private String archivePath;
+
+ /** The test agent, normally only valid in the server side for now. */
+ private TestAgent testAgent;
+
+ /**
+ * Copy constructor.
+ */
+ public HttpTestContext(HttpTestContext that)
+ {
+ this.testCaseId = that.testCaseId;
+ this.requestCount = that.requestCount;
+ this.archivePath = that.archivePath;
+ this.result = that.result;
+ }
+
+ public HttpTestContext(String testCaseId, int requestCount, String archivePath)
+ {
+ this.testCaseId = testCaseId;
+ this.requestCount = requestCount;
+ this.archivePath = archivePath;
+ }
+
+ /**
+ * Should not be exposed, but for now, well.
+ */
+ public TestAgent getTestAgent()
+ {
+ return testAgent;
+ }
+
+ /**
+ * Should not be exposed, but for now, well.
+ */
+ public void setTestAgent(TestAgent testAgent)
+ {
+ this.testAgent = testAgent;
+ }
+
+ /**
+ * Return the test id.
+ *
+ * @return the test id
+ */
+ public String getTestCaseId()
+ {
+ return testCaseId;
+ }
+
+ /**
+ * Return the test count.
+ *
+ * @return the test count
+ */
+ public int getRequestCount()
+ {
+ return requestCount;
+ }
+
+ /**
+ * Return the result.
+ *
+ * @return the result of the test
+ */
+ public DriverResponse getResult()
+ {
+ return result;
+ }
+
+ public void setResult(DriverResponse result)
+ {
+ if (this.result != null)
+ {
+ throw new IllegalStateException("A result is already provided");
+ }
+ else
+ {
+ this.result = result;
+ }
+ }
+
+ /**
+ * @param url the url to rewrite
+ * @param nodeId the node id
+ * @return the rewritten url
+ * @throws MalformedURLException
+ * @throws IllegalArgumentException if the url is null or the node id not recognized
+ */
+ public String rewriteURLForNode(String url, NodeId nodeId) throws MalformedURLException
+ {
+ if (url == null)
+ {
+ throw new IllegalArgumentException("No null URL accepted");
+ }
+ int port;
+ if (NodeId.DEFAULT.equals(nodeId))
+ {
+ port = 8080;
+ }
+ else if (NodeId.PORTS_01.equals(nodeId))
+ {
+ port = 8180;
+ }
+ else if (NodeId.PORTS_02.equals(nodeId))
+ {
+ port = 8280;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown node");
+ }
+ URL tmp;
+ if (url.startsWith("http://"))
+ {
+ tmp = new URL(url);
+ tmp = new URL(tmp.getProtocol(), tmp.getHost(), port, tmp.getFile());
+ }
+ else
+ {
+ tmp = new URL("http", "localhost", port, url);
+ }
+ return tmp.toString();
+ }
+
+ public void deploy(String archiveId) throws MalformedURLException, IllegalStateException, DeploymentException
+ {
+ if (testAgent == null)
+ {
+ throw new IllegalStateException("No test agent to perform deploy");
+ }
+
+ //
+ File root = new File(archivePath);
+ File f = new File(root, archiveId);
+ URL url = f.toURL();
+ testAgent.deploy(url);
+ }
+
+ public void undeploy(String archiveId) throws MalformedURLException, IllegalStateException, DeploymentException
+ {
+ if (testAgent == null)
+ {
+ throw new IllegalStateException("No test agent to perform deploy");
+ }
+
+ //
+ File root = new File(archivePath);
+ File f = new File(root, archiveId);
+ URL url = f.toURL();
+ testAgent.undeploy(url);
+ }
+
+ public static boolean isCurrentCaseTestId(String id) throws IllegalStateException
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return id.equals(getCurrentContext().testCaseId);
+ }
+
+ public static String getCurrentTestCaseId() throws IllegalStateException
+ {
+ return getCurrentContext().testCaseId;
+ }
+
+ public static boolean isCurrentRequestCount(int count) throws IllegalStateException
+ {
+ return getCurrentContext().requestCount == count;
+ }
+
+ public static int getCurrentRequestCount() throws IllegalStateException
+ {
+ return getCurrentContext().requestCount;
+ }
+
+ public static DriverResponse getCurrentResult() throws IllegalStateException
+ {
+ HttpTestContext ctx = getCurrentContext();
+ if (ctx != null)
+ {
+ return ctx.result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static void setCurrentResult(DriverResponse currentResult) throws IllegalStateException
+ {
+ HttpTestContext ctx = getCurrentContext();
+ ctx.setResult(currentResult);
+ }
+
+ public String toString()
+ {
+ return "TestCaseContext[" + testCaseId + "," + requestCount + "]";
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,444 @@
+/******************************************************************************
+ * 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.framework.driver.http;
+
+import org.jboss.portal.test.framework.driver.http.command.HttpCommand;
+import org.jboss.portal.test.framework.driver.http.command.DoPostCommand;
+import org.jboss.portal.test.framework.driver.http.command.DoGetCommand;
+import org.jboss.portal.test.framework.driver.http.response.HttpResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.response.FailureResponse;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.framework.server.NodeManager;
+import org.jboss.portal.test.framework.ServiceLookup;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.SimpleHttpConnectionManager;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+import org.apache.log4j.Logger;
+
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HttpTestDriverClient implements TestDriver
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(getClass());
+
+ // Config
+
+ /** . */
+ private NodeId initialNodeId;
+
+ /** . */
+ private String archivePath;
+
+ // Services
+
+ /** . */
+ private ServiceLookup serverLookup;
+
+ /** . */
+ private NodeManager nodeManager;
+
+ public NodeId getInitialNodeId()
+ {
+ return initialNodeId;
+ }
+
+ public void setInitialNodeId(NodeId initialNodeId)
+ {
+ this.initialNodeId = initialNodeId;
+ }
+
+ public String getArchivePath()
+ {
+ return archivePath;
+ }
+
+ public void setArchivePath(String archivePath)
+ {
+ this.archivePath = archivePath;
+ }
+
+ public NodeManager getNodeManager()
+ {
+ return nodeManager;
+ }
+
+ public void setNodeManager(NodeManager nodeManager)
+ {
+ this.nodeManager = nodeManager;
+ }
+
+ public ServiceLookup getServerLookup()
+ {
+ return serverLookup;
+ }
+
+ public void setServerLookup(ServiceLookup serverLookup)
+ {
+ this.serverLookup = serverLookup;
+ }
+
+ private HttpTestDriverServer getServer()
+ {
+ Node node = nodeManager.getNode(initialNodeId);
+ return (HttpTestDriverServer)serverLookup.getService(node);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ HttpTestDriverServer server = getServer();
+ return server.getInfo();
+ }
+
+ public DriverResponse invoke(DriverCommand cmd) throws TestDriverException
+ {
+ try
+ {
+ if (cmd instanceof StartTestCommand)
+ {
+ StartTestCommand st = (StartTestCommand)cmd;
+ Node node = nodeManager.getNode(initialNodeId);
+
+ // Setup context
+ HttpTestContext ctx = new HttpTestContext(st.getTestName(), -1, archivePath);
+ getServer().updateContext(ctx);
+
+ //
+ DriverResponse resp = getServer().invoke(cmd);
+ if (resp instanceof HttpResponse)
+ {
+ HttpResponse httpResp = (HttpResponse)resp;
+ HttpConversation conversation = new HttpConversation(st.getTestName(), node);
+ return conversation.handleHttpResponse(httpResp);
+ }
+ return resp;
+ }
+ else
+ {
+ return new ErrorResponse(new UnsupportedOperationException());
+ }
+ }
+ catch (Exception e)
+ {
+ throw new TestDriverException(e);
+ }
+ }
+
+ private class HttpConversation
+ {
+
+ /** The test name. */
+ final String testName;
+
+ /** . */
+ HttpClient client;
+
+ /** The node to invoke. */
+ Node node;
+
+ /** The request count for that session. */
+ int requestCount;
+
+ public HttpConversation(String testName, Node node)
+ {
+ this.testName = testName;
+ this.node = node;
+
+ //
+ client = new HttpClient(new SimpleHttpConnectionManager());
+ client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, null);
+ client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("test", "test"));
+ }
+
+ private DriverResponse handleHttpResponse(HttpResponse httpResp) throws Exception
+ {
+ HttpCommand httpCmd = createHttpCommand(httpResp);
+ DriverResponse resp = invokeHttp(httpCmd);
+ if (resp instanceof HttpResponse)
+ {
+ return handleHttpResponse((HttpResponse)resp);
+ }
+ else
+ {
+ return resp;
+ }
+ }
+
+ /**
+ * Create an http command from an http response.
+ */
+ private HttpCommand createHttpCommand(HttpResponse httpResp) throws Exception
+ {
+ if (httpResp instanceof InvokeGetResponse)
+ {
+ InvokeGetResponse igr = (InvokeGetResponse)httpResp;
+ return new DoGetCommand(igr.getURL(), igr.getHeaders());
+ }
+ else
+ {
+ InvokePostResponse ipr = (InvokePostResponse)httpResp;
+ DoPostCommand.Body dpcb = ipr.getBody().getBody();
+ return new DoPostCommand(ipr.getURL(), ipr.getContentType(), dpcb);
+ }
+ }
+
+ /**
+ *
+ */
+ private DriverResponse invokeHttp(HttpCommand cmd) throws Exception
+ {
+ HttpMethod hm = null;
+ if (cmd instanceof DoPostCommand)
+ {
+ DoPostCommand doPostCmd = (DoPostCommand)cmd;
+ PostMethod post = null;
+ try
+ {
+ post = new PostMethod(doPostCmd.getURL());
+ post.setFollowRedirects(false);
+ DoPostCommand.Body body = doPostCmd.getBody();
+ if (doPostCmd.getContentType() != null)
+ {
+ post.addRequestHeader("Content-Type", doPostCmd.getContentType());
+ }
+ if (body instanceof DoPostCommand.RawBody)
+ {
+ DoPostCommand.RawBody rb = (DoPostCommand.RawBody)body;
+ ByteArrayRequestEntity entity = new ByteArrayRequestEntity(rb.getBytes());
+ post.setRequestEntity(entity);
+ }
+ else if (body instanceof DoPostCommand.FormBody)
+ {
+ DoPostCommand.FormBody fb = (DoPostCommand.FormBody)body;
+ Collection tmp = new ArrayList();
+ for (Iterator i = fb.getParameters().entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ String[] values = (String[])entry.getValue();
+ for (int j = 0; j < values.length; j++)
+ {
+ String value = values[j];
+ NameValuePair nvp = new NameValuePair(name, value);
+ tmp.add(nvp);
+ }
+ }
+ NameValuePair[] nvps = (NameValuePair[])tmp.toArray(new NameValuePair[tmp.size()]);
+ post.setRequestBody(nvps);
+ }
+ executeMethod(post);
+ hm = post;
+ }
+ finally
+ {
+ if (post != null)
+ {
+ post.releaseConnection();
+ }
+ }
+ }
+ else if (cmd instanceof DoGetCommand)
+ {
+ DoGetCommand doGetCmd = (DoGetCommand)cmd;
+ GetMethod get = null;
+ try
+ {
+ get = new GetMethod(doGetCmd.getURL());
+ Map headers = doGetCmd.getHeaders();
+ for (Iterator i = headers.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String headerName = (String)entry.getKey();
+ String headerValue = (String)entry.getValue();
+ get.setRequestHeader(headerName, headerValue);
+ }
+ get.setFollowRedirects(false);
+ executeMethod(get);
+ hm = get;
+ }
+ finally
+ {
+ if (get != null)
+ {
+ get.releaseConnection();
+ }
+ }
+ }
+
+ //
+ HttpTestDriverServer agent = getServer();
+ HttpTestContext ctx = agent.retrieveContext();
+ DriverResponse response = ctx.getResult();
+ int status = hm.getStatusCode();
+ switch (status)
+ {
+ case 200:
+ if (response == null)
+ {
+ throw new AssertionFailedError("No result for test " + testName + " in the response");
+ }
+ else
+ {
+ log.info("# Received '200' code");
+ requestCount++;
+ return response;
+ }
+ // Send redirect
+ case 302:
+ // If any result has been setup during the action it overrides the 302 code
+ if (response != null)
+ {
+ log.info("# Received Result object which overrides the 302");
+ requestCount++;
+ return response;
+ }
+
+ // Otherwise satisfy the 302 code
+ Header locationHeader = hm.getResponseHeader("location");
+ if (locationHeader != null)
+ {
+ String redirectLocation = locationHeader.getValue();
+ log.info("# Received '302' code --> " + redirectLocation);
+ cmd = new DoGetCommand(redirectLocation);
+ return invokeHttp(cmd);
+ }
+ else
+ {
+ // The response is invalid
+ throw new AssertionFailedError("302 Code with corrupted data");
+ }
+ case 500:
+ log.info("# Received '500' code");
+ return new FailureResponse("Received '500' code at " + hm.getURI());
+ case 404:
+ log.info("# Received '404' code");
+ return new FailureResponse("Received '404' code at " + hm.getURI());
+ default:
+ return new ErrorResponse("Unexpected http code " + status + " at " + hm.getURI());
+ }
+ }
+
+ public int executeMethod(HttpMethod method) throws Exception
+ {
+ int port = method.getURI().getPort();
+ if (port != -1)
+ {
+ node = getNode(port);
+ if (node == null)
+ {
+ throw new IllegalArgumentException("Wrong port " + method.getURI().getPort());
+ }
+ }
+ else
+ {
+ port = getPort(node);
+ }
+
+ //
+ String host = method.getURI().getHost();
+ if (host == null)
+ {
+ host = "localhost";
+ }
+
+ //
+ HostConfiguration cfg = new HostConfiguration();
+ cfg.setHost(host, port);
+ HttpTestContext ctx = new HttpTestContext(testName, requestCount, archivePath);
+
+ log.info("# Updating test case context of : " + node + " : " + ctx);
+ HttpTestDriverServer agent = getServer();
+ agent.updateContext(ctx);
+
+ //
+ log.info("# Invoking test case over http " + cfg + " " + method.getURI());
+
+ return client.executeMethod(cfg, method);
+ }
+
+ private Node getNode(int port)
+ {
+ NodeId nodeId = null;
+ switch (port)
+ {
+ case 8080:
+ nodeId = NodeId.DEFAULT;
+ break;
+ case 8180:
+ nodeId = NodeId.PORTS_01;
+ break;
+ case 8280:
+ nodeId = NodeId.PORTS_02;
+ break;
+ }
+ return nodeManager.getNode(nodeId);
+ }
+
+ public int getPort(Node node)
+ {
+ NodeId nodeId = node.getId();
+ if (NodeId.DEFAULT.equals(nodeId))
+ {
+ return 8080;
+ }
+ if (NodeId.PORTS_01.equals(nodeId))
+ {
+ return 8180;
+ }
+ if (NodeId.PORTS_02.equals(nodeId))
+ {
+ return 8280;
+ }
+ return -1;
+ }
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.framework.driver.http;
+
+import org.jboss.portal.common.test.driver.TestDriver;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface HttpTestDriverServer extends TestDriver
+{
+ /**
+ *
+ */
+ void updateContext(HttpTestContext ctx);
+
+ /**
+ *
+ */
+ HttpTestContext retrieveContext();
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoGetCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoGetCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoGetCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.framework.driver.http.command;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * Perform a get.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DoGetCommand extends HttpCommand
+{
+
+ /** . */
+ private String url;
+
+ /** . */
+ private Map headers;
+
+ public DoGetCommand(String url)
+ {
+ this(url, Collections.EMPTY_MAP);
+ }
+
+ public DoGetCommand(String url, Map headers)
+ {
+ if (url == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (headers == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.url = url;
+ this.headers = headers;
+ }
+
+ public String getURL()
+ {
+ return url;
+ }
+
+ public Map getHeaders()
+ {
+ return headers;
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoPostCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoPostCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/DoPostCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.http.command;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DoPostCommand extends HttpCommand
+{
+
+ private String url;
+
+ private String contentType;
+
+ private Body body;
+
+ public DoPostCommand(String url, String contentType, Body body)
+ {
+ if (url == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (body == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.url = url;
+ this.contentType = contentType;
+ this.body = body;
+ }
+
+ public String getURL()
+ {
+ return url;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public Body getBody()
+ {
+ return body;
+ }
+
+ public abstract static class Body
+ {
+ }
+
+ public static class FormBody extends Body
+ {
+ private Map parameters;
+
+ public FormBody(Map parameters)
+ {
+ if (parameters == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.parameters = parameters;
+ }
+
+ public Map getParameters()
+ {
+ return parameters;
+ }
+ }
+
+ public static class RawBody extends Body
+ {
+ private final byte[] bytes;
+
+ public RawBody(byte[] bytes)
+ {
+ if (bytes == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.bytes = bytes;
+ }
+
+ public byte[] getBytes()
+ {
+ return bytes;
+ }
+ }
+
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpCommand.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpCommand.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/command/HttpCommand.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.framework.driver.http.command;
+
+import org.jboss.portal.common.test.driver.DriverCommand;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HttpCommand extends DriverCommand
+{
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpResponse.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/HttpResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.framework.driver.http.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class HttpResponse extends DriverResponse
+{
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokeGetResponse.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokeGetResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokeGetResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * 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.framework.driver.http.response;
+
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class InvokeGetResponse extends HttpResponse
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5968471624915140976L;
+
+ /** . */
+ private String url;
+
+ /** . */
+ private Map headers;
+
+ public InvokeGetResponse(String url)
+ {
+ if (url == null)
+ {
+ throw new IllegalArgumentException("Cannot invoke against a null URL");
+ }
+ this.url = url;
+ this.headers = new HashMap();
+ }
+
+ public String getURL()
+ {
+ return url;
+ }
+
+ public void setHeader(String headerName, String headerValue)
+ {
+ if (headerName == null)
+ {
+ throw new IllegalArgumentException("No null header name accepted");
+ }
+ if (headerValue == null)
+ {
+ throw new IllegalArgumentException("No null header value accepted");
+ }
+ headers.put(headerName, headerValue);
+ }
+
+
+ public Map getHeaders()
+ {
+ return headers;
+ }
+
+ public String toString()
+ {
+ return "InvokeRenderURL[" + url + "]";
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokePostResponse.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokePostResponse.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/driver/http/response/InvokePostResponse.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.framework.driver.http.response;
+
+import org.jboss.portal.test.framework.driver.http.command.DoPostCommand;
+import org.jboss.portal.common.test.driver.DriverResponse;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * The portlet wants to invoke a post.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class InvokePostResponse extends HttpResponse
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 2635507530899509020L;
+
+ /** . */
+ public static final String APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded";
+
+ /** . */
+ public static final String MULTIPART_FORM_DATA = "multipart/form-data";
+
+ /** The post url. */
+ private String url;
+
+ /** The content type. */
+ private String contentType;
+
+ /** The post body. */
+ private Body body;
+
+ public String getURL()
+ {
+ return url;
+ }
+
+ public void setURL(String url)
+ {
+ this.url = url;
+ }
+
+ public Body getBody()
+ {
+ return body;
+ }
+
+ public void setBody(Body body)
+ {
+ this.body = body;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+// public RunnerCommand createCommand()
+// {
+// if (url == null)
+// {
+// throw new IllegalStateException("No url");
+// }
+// if (body == null)
+// {
+// throw new IllegalStateException("No body");
+// }
+// DoPostCommand.Body dpcb = body.getBody();
+// return new DoPostCommand(url, contentType, dpcb);
+// }
+
+ public abstract static class Body implements Serializable
+ {
+ public abstract DoPostCommand.Body getBody() throws IllegalStateException;
+ }
+
+ public static class RawBody extends Body
+ {
+
+ private byte[] bytes;
+
+ public byte[] getBytes()
+ {
+ return bytes;
+ }
+
+ public void setBytes(byte[] bytes)
+ {
+ this.bytes = bytes;
+ }
+
+ public DoPostCommand.Body getBody()
+ {
+ if (bytes == null)
+ {
+ throw new IllegalStateException("No bytes");
+ }
+ DoPostCommand.RawBody dpcb = new DoPostCommand.RawBody(bytes);
+ return dpcb;
+ }
+ }
+
+ public static class FormBody extends Body
+ {
+
+ private Map parameters = new HashMap();
+
+ public void addParameter(String name, String[] values)
+ {
+ if (name == null)
+ {
+ throw new IllegalStateException();
+ }
+ if (values == null)
+ {
+ throw new IllegalStateException();
+ }
+ for (int i = 0; i < values.length; i++)
+ {
+ String value = values[i];
+ if (value == null)
+ {
+ throw new IllegalStateException();
+ }
+ }
+ parameters.put(name, values.clone());
+ }
+
+ public void removeParameter(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalStateException();
+ }
+ parameters.remove(name);
+ }
+
+ public Set getParameterNames()
+ {
+ return Collections.unmodifiableSet(parameters.keySet());
+ }
+
+ public String[] getParameterValue(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalStateException();
+ }
+ String[] values = (String[])parameters.get(name);
+ return (String[])values.clone();
+ }
+
+ public DoPostCommand.Body getBody()
+ {
+ return new DoPostCommand.FormBody(parameters);
+ }
+ }
+}
Added: trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,299 @@
+/******************************************************************************
+ * 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.framework.runner;
+
+import org.jboss.portal.test.framework.deployment.Deployer;
+import org.jboss.portal.test.framework.server.NodeManager;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.framework.TestRuntimeContext;
+import org.jboss.portal.test.framework.ServiceLookup;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriverClient;
+import org.jboss.portal.common.test.junit.JUnitAdapter;
+import org.apache.log4j.Logger;
+import org.apache.log4j.Appender;
+import org.apache.log4j.SimpleLayout;
+import org.apache.log4j.Level;
+import org.apache.log4j.ConsoleAppender;
+import junit.framework.Test;
+import junit.framework.TestResult;
+import junit.framework.TestCase;
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class BaseRunner implements Test
+{
+
+ static
+ {
+ Appender appender = new ConsoleAppender(new SimpleLayout());
+ Logger.getRoot().addAppender(appender);
+ Logger.getRoot().setLevel(Level.INFO);
+ }
+
+ private static final int STOPPED = 0;
+ private static final int FAILED = 1;
+ private static final int STARTED = 2;
+
+ /** The injected deployer. */
+ private Deployer deployer;
+
+ /** . */
+ private NodeManager nodeManager;
+
+ /** . */
+ private TestRuntimeContext runtimeContext;
+
+ /** The node id list used for this test suite. */
+ private NodeId[] nodeIds;
+
+ /** . */
+ private String archivePath;
+
+ /** . */
+ private JUnitAdapter adapter;
+
+ /** . */
+ private int state;
+
+ /** . */
+ private Integer testCaseCount;
+
+ /** . */
+ private ServiceLookup httpTestDriverServerLookup;
+
+ /** . */
+ private ServiceLookup testAgentLookup;
+
+ public Deployer getDeployer()
+ {
+ return deployer;
+ }
+
+ public void setDeployer(Deployer deployer)
+ {
+ this.deployer = deployer;
+ }
+
+ public NodeManager getNodeManager()
+ {
+ return nodeManager;
+ }
+
+ public void setNodeManager(NodeManager nodeManager)
+ {
+ this.nodeManager = nodeManager;
+ }
+
+ public ServiceLookup getTestAgentLookup()
+ {
+ return testAgentLookup;
+ }
+
+ public void setTestAgentLookup(ServiceLookup testAgentLookup)
+ {
+ this.testAgentLookup = testAgentLookup;
+ }
+
+ public ServiceLookup getHttpTestDriverServerLookup()
+ {
+ return httpTestDriverServerLookup;
+ }
+
+ public void setHttpTestDriverServerLookup(ServiceLookup httpTestDriverServerLookup)
+ {
+ this.httpTestDriverServerLookup = httpTestDriverServerLookup;
+ }
+
+ public BaseRunner()
+ {
+ this("org/jboss/portal/test/framework/container/jboss-beans.xml");
+ }
+
+ public BaseRunner(String beansDescriptorLocation)
+ {
+ this(beansDescriptorLocation, new NodeId[]{NodeId.DEFAULT});
+ }
+
+ public BaseRunner(String beansDescriptorLocation, NodeId[] nodeIds)
+ {
+ this.runtimeContext = new TestRuntimeContext(beansDescriptorLocation);
+ this.runtimeContext.addBean("TestBean", this);
+ this.nodeIds = (NodeId[])nodeIds.clone();
+ this.archivePath = System.getProperty("test.root");
+ this.state = STOPPED;
+ }
+
+
+ public String getArchivePath()
+ {
+ return archivePath;
+ }
+
+ private void startContext() throws Exception
+ {
+ runtimeContext.start();
+ }
+
+ private void stopContext()
+ {
+ runtimeContext.stop();
+ }
+
+ private void startIfNeeded() throws Exception
+ {
+ if (state == STOPPED)
+ {
+ try
+ {
+ startContext();
+
+ //
+ HttpTestDriverClient driver = new HttpTestDriverClient();
+ driver.setArchivePath(archivePath);
+ driver.setNodeManager(nodeManager);
+ driver.setServerLookup(httpTestDriverServerLookup);
+ driver.setInitialNodeId(NodeId.DEFAULT);
+
+ //
+ adapter = new JUnitAdapter(driver);
+
+ state = STARTED;
+ }
+ finally
+ {
+ if (state == STOPPED)
+ {
+ state = FAILED;
+ }
+ }
+ }
+ }
+
+ private void stopIfNeeded()
+ {
+ if (state == STARTED)
+ {
+ try
+ {
+ stopContext();
+ state = STOPPED;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ if (state == STARTED)
+ {
+ state = FAILED;
+ }
+ adapter = null;
+ }
+ }
+ }
+
+ private Exception e;
+
+ public int countTestCases()
+ {
+ if (testCaseCount == null)
+ {
+ try
+ {
+ startIfNeeded();
+ testCaseCount = new Integer(adapter.countTestCases());
+ }
+ catch (Exception e)
+ {
+ testCaseCount = new Integer(1);
+ this.e = e;
+ }
+ }
+ return testCaseCount.intValue();
+ }
+
+ public void run(TestResult testResult)
+ {
+ if (e == null)
+ {
+ try
+ {
+ startIfNeeded();
+ adapter.run(testResult);
+ stopIfNeeded();
+ }
+ catch (Exception e)
+ {
+ this.e = e;
+ }
+ }
+ if (e != null)
+ {
+ TestCase tc = new TestCase()
+ {
+ public void runBare() throws Throwable
+ {
+ throw e;
+ }
+ };
+ tc.run(testResult);
+ }
+ }
+
+ protected void startRunner() throws Exception
+ {
+ }
+
+ protected void stopRunner() throws Exception
+ {
+ }
+
+ public final void create() throws Exception
+ {
+ }
+
+ public final void start() throws Exception
+ {
+ startRunner();
+ }
+
+ public final void stop()
+ {
+ try
+ {
+ stopRunner();
+ }
+ catch (Exception e)
+ {
+ //
+ }
+ }
+
+ public final void destroy()
+ {
+ }
+}
Modified: trunk/test/src/main/org/jboss/portal/test/framework/server/Node.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/server/Node.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/main/org/jboss/portal/test/framework/server/Node.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,6 +24,9 @@
package org.jboss.portal.test.framework.server;
import javax.management.MBeanServer;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Properties;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -38,11 +41,14 @@
private NodeManager nodeManager;
- public Node(String id, MBeanServer server, NodeManager nodeManager)
+ private Properties jndiEnv;
+
+ public Node(String id, MBeanServer server, NodeManager nodeManager, Properties jndiEnv)
{
this.id = new NodeId(id);
this.server = server;
this.nodeManager = nodeManager;
+ this.jndiEnv = jndiEnv;
//
nodeManager.nodeMap.put(this.id, this);
@@ -58,6 +64,11 @@
return server;
}
+ public InitialContext getInitialContext() throws NamingException
+ {
+ return new InitialContext(jndiEnv);
+ }
+
public String toString()
{
return "Node[" + id + "]";
Modified: trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
===================================================================
--- trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -89,6 +89,22 @@
<parameter><value>default</value></parameter>
<parameter><inject bean="MBeanServerFactory0" property="server"/></parameter>
<parameter><inject bean="NodeManager"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1099</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
</constructor>
</bean>
@@ -97,6 +113,22 @@
<parameter><value>ports-01</value></parameter>
<parameter><inject bean="MBeanServerFactory1" property="server"/></parameter>
<parameter><inject bean="NodeManager"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1199</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
</constructor>
</bean>
@@ -105,26 +137,52 @@
<parameter><value>ports-02</value></parameter>
<parameter><inject bean="MBeanServerFactory2" property="server"/></parameter>
<parameter><inject bean="NodeManager"/></parameter>
+ <parameter name="jndiEnv">
+ <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.provider.url</key>
+ <value>jnp://localhost:1299</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming</value>
+ </entry>
+ </map>
+ </parameter>
</constructor>
</bean>
- <bean name="TestAgentFactory" class="org.jboss.portal.test.framework.agent.TestAgentFactory">
+ <bean name="HttpTestDriverServerLookup" class="org.jboss.portal.test.framework.JNDIServiceLookup">
+ <constructor>
+ <parameter><value>HttpTestDriverServer</value></parameter>
+ </constructor>
</bean>
+ <bean name="TestAgentLookup" class="org.jboss.portal.test.framework.JNDIServiceLookup">
+ <constructor>
+ <parameter><value>TestAgent</value></parameter>
+ </constructor>
+ </bean>
+
<bean name="NodeManager" class="org.jboss.portal.test.framework.server.NodeManager">
</bean>
<bean name="Deployer" class="org.jboss.portal.test.framework.deployment.Deployer">
- <property name="testAgentFactory"><inject bean="TestAgentFactory"/></property>
+ <property name="testAgentLookup"><inject bean="TestAgentLookup"/></property>
</bean>
- <bean name="TestBean" class="org.jboss.portal.test.framework.container.client.TestSuite">
+ <bean name="TestBean" class="org.jboss.portal.test.framework.runner.BaseRunner">
<constructor factoryMethod="getBean">
<factory bean="BeanFactory"/>
<parameter>TestBean</parameter>
</constructor>
<property name="deployer"><inject bean="Deployer"/></property>
<property name="nodeManager"><inject bean="NodeManager"/></property>
- <property name="testAgentFactory"><inject bean="TestAgentFactory"/></property>
+ <property name="testAgentLookup"><inject bean="TestAgentLookup"/></property>
+ <property name="httpTestDriverServerLookup"><inject bean="HttpTestDriverServerLookup"/></property>
</bean>
</deployment>
Modified: trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- trunk/tools/etc/buildfragments/modules.ent 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/tools/etc/buildfragments/modules.ent 2006-10-30 13:35:25 UTC (rev 5510)
@@ -14,6 +14,7 @@
<property name="jboss.portal-test.lib" value="${jboss.portal-test.root}/lib"/>
<path id="jboss.portal-test.classpath">
<pathelement path="${jboss.portal-test.lib}/portal-test-lib.jar"/>
+ <pathelement path="${jboss.portal-test.lib}/portal-test-agent-lib.jar"/>
</path>
<!-- cms -->
Modified: trunk/tools/lib/explode.jar
===================================================================
(Binary files differ)
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/build.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -350,16 +350,8 @@
</target>
- <target name="package-test-runner" depends="compile">
- <!--Test runner-->
- <jar jarfile="${build.lib.test}/test-wsrp-test-runner.war">
- <fileset dir="${build.resources.test}/test-wsrp-test-runner-war"/>
- </jar>
-
- </target>
-
<target name="package-consumer-test" description="Generates the consumer test artifacts"
- depends="package-test-runner,compile">
+ depends="compile">
<jar jarfile="${build.lib.test}/test-wsrp-consumer-client.jar">
<fileset dir="${build.resources.test}/test-wsrp-consumer-client"/>
</jar>
@@ -386,7 +378,6 @@
<!--all server side stuff for consumer tests-->
<copy todir="${build.resources.test}/test-wsrp-consumer-sar" overwrite="true">
- <fileset dir="${build.lib.test}" includes="test-wsrp-test-runner.war"/>
<fileset dir="${build.lib.test}" includes="test-wsrp-consumer.war"/>
<fileset dir="${jboss.portal-server.root}/lib" includes="portal-server.sar"/>
</copy>
@@ -404,6 +395,7 @@
includes="portal-portlet-lib.jar, portal-portlet-test-lib.jar"/>
<fileset dir="${jboss.portal-federation.root}/lib" includes="portal-federation-lib.jar"/>
<fileset dir="${jboss.portal-test.lib}" includes="portal-test-lib.jar"/>
+ <fileset dir="${jboss.portal-server.lib}" includes="portal-server-test-lib.jar"/>
</copy>
<jar jarfile="${build.lib.test}/test-wsrp-consumer.sar">
@@ -413,7 +405,7 @@
<!-- Producer tests -->
<target name="package-producer-test" description="Generate the producer test artifacts"
- depends="package-test-portlets,package-test-runner">
+ depends="package-test-portlets">
<jar jarfile="${build.lib.test}/test-wsrp-producer-client.jar">
<fileset dir="${build.resources.test}/test-wsrp-producer-client"/>
</jar>
@@ -439,7 +431,6 @@
</jar>
<copy todir="${build.resources.test}/test-wsrp-producer-sar" overwrite="true">
- <fileset dir="${build.lib.test}" includes="test-wsrp-test-runner.war"/>
<fileset dir="${build.lib.test}" includes="test-wsrp-producer.war"/>
<fileset dir="${jboss.portal-server.root}/lib" includes="portal-server.sar"/>
</copy>
@@ -457,6 +448,7 @@
<fileset dir="${build.lib.test}" includes="test-wsrp-producer.jar"/>
<fileset dir="${build.lib.test}" includes="test-wsrp-producer-client.jar"/>
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
+ <fileset dir="${jboss.portal-server.lib}" includes="portal-server-test-lib.jar"/>
</copy>
<jar jarfile="${build.lib.test}/test-wsrp-producer.sar">
@@ -527,16 +519,18 @@
</target>
<!-- WSRP Producer tests -->
- <target name="producer-test" depends="deploy-producer-test">
+ <target name="producer-test" depends="package-producer-test">
<execute-tests>
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.ProducerTestRunner"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.ProducerTestCase"/>
</x-test>
<x-sysproperty>
+<!--
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=NONE"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787"/>
+-->
<sysproperty key="test.root" value="${build.lib}/tests"/>
</x-sysproperty>
<x-classpath>
@@ -548,20 +542,21 @@
<path refid="apache.codec.classpath"/>
</x-classpath>
</execute-tests>
- <antcall target="undeploy-producer-test"/>
</target>
<!--WSRP Consumer implementation tests-->
- <target name="consumer-test" depends="deploy-consumer-test">
+ <target name="consumer-test" depends="package-consumer-test">
<execute-tests>
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.consumer.ConsumerTestRunner"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.consumer.ConsumerTestCase"/>
</x-test>
<x-sysproperty>
+<!--
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=NONE"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787"/>
+-->
<sysproperty key="test.root" value="${build.lib}/tests"/>
</x-sysproperty>
<x-classpath>
@@ -573,7 +568,6 @@
<path refid="apache.codec.classpath"/>
</x-classpath>
</execute-tests>
- <antcall target="undeploy-consumer-test"/>
</target>
<!--WSRP Deployer implementation tests-->
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -29,9 +29,17 @@
*/
package org.jboss.portal.test.wsrp;
-import junit.framework.TestCase;
import org.jboss.logging.Logger;
-import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.server.HttpTestDriverRegistry;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.junit.POJOJUnitTest;
+import org.jboss.portal.common.junit.ExtendedAssert;
import java.util.Arrays;
import java.util.List;
@@ -44,27 +52,24 @@
* @author <a href="mailto:Boleslaw.Dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @since 2.4 (Feb 20, 2006)
*/
-public abstract class WSRPBaseTest extends TestCase
+public abstract class WSRPBaseTest extends AbstractJBossService implements TestDriver
{
Logger log = Logger.getLogger(WSRPBaseTest.class);
- /** Make it accessible from outter packages. */
- public void setUp() throws Exception
- {
- super.setUp();
- }
+ /** . */
+ private POJOJUnitTest test;
- /** Make it accessible from outter packages. */
- public void tearDown() throws Exception
+ /** . */
+ private HttpTestDriverRegistry testDriverRegistry;
+
+ protected WSRPBaseTest(String name) throws Exception
{
- super.tearDown();
+// log("Instantiated test named '" + name + "'");
}
- protected WSRPBaseTest(String name) throws Exception
+ protected WSRPBaseTest()
{
- super(name);
- log("Instantiated test named '" + name + "'");
}
protected void log(String message)
@@ -72,13 +77,45 @@
log.debug(getClass().getName() + ": " + message);
}
+
+ public HttpTestDriverRegistry getTestDriverRegistry()
+ {
+ return testDriverRegistry;
+ }
+
+ public void setTestDriverRegistry(HttpTestDriverRegistry testDriverRegistry)
+ {
+ this.testDriverRegistry = testDriverRegistry;
+ }
+
+ protected void startService() throws Exception
+ {
+ test = new POJOJUnitTest(this);
+ testDriverRegistry.register(this);
+ }
+
+ protected void stopService() throws Exception
+ {
+ testDriverRegistry.unregister(this);
+ }
+
+ /** Make it accessible from outter packages. */
+ public void setUp() throws Exception
+ {
+ }
+
+ /** Make it accessible from outter packages. */
+ public void tearDown() throws Exception
+ {
+ }
+
public static void assertEquals(Object[] expected, Object[] tested, boolean isOrderRelevant, String failMessage)
{
if (isOrderRelevant)
{
if (!Arrays.equals(expected, tested))
{
- fail(failMessage);
+ ExtendedAssert.fail(failMessage);
}
}
else
@@ -89,24 +126,24 @@
{
if (expected == null || tested == null)
{
- fail(failMessage + " Not both null.");
+ ExtendedAssert.fail(failMessage + " Not both null.");
}
if (expected.getClass().getComponentType() != tested.getClass().getComponentType())
{
- fail(failMessage + " Different classes.");
+ ExtendedAssert.fail(failMessage + " Different classes.");
}
if (expected.length != tested.length)
{
- fail(failMessage + " Different sizes (tested: " + tested.length + ", expected: " + expected.length + ").");
+ ExtendedAssert.fail(failMessage + " Different sizes (tested: " + tested.length + ", expected: " + expected.length + ").");
}
List expectedList = Arrays.asList(expected);
List testedList = Arrays.asList(tested);
if (!expectedList.containsAll(testedList))
{
- fail(failMessage);
+ ExtendedAssert.fail(failMessage);
}
}
}
@@ -175,18 +212,28 @@
public static void assertString1ContainsString2(String string1, String string2)
{
- assertTrue("<" + string1 + "> does not contain <" + string2 + ">", string1.indexOf(string2) >= 0);
+ ExtendedAssert.assertTrue("<" + string1 + "> does not contain <" + string2 + ">", string1.indexOf(string2) >= 0);
}
protected void deploy(String archiveId) throws Exception
{
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ HttpTestContext ctx = HttpTestContext.getCurrentContext();
ctx.deploy(archiveId);
}
protected void undeploy(String archiveId) throws Exception
{
- TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ HttpTestContext ctx = HttpTestContext.getCurrentContext();
ctx.undeploy(archiveId);
}
+
+ public TestItemInfo getInfo()
+ {
+ return test.getInfo();
+ }
+
+ public DriverResponse invoke(DriverCommand command) throws TestDriverException
+ {
+ return test.invoke(command);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,7 +25,7 @@
import org.jboss.portal.test.wsrp.framework.TestWSRPProducer;
import org.jboss.portal.wsrp.WSRPConsumer;
-import org.jboss.portal.wsrp.WSRPProducer;
+import org.jboss.portal.common.junit.ExtendedAssert;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -43,14 +43,13 @@
/** . */
protected WSRPConsumer consumer;
- protected WSRPConsumerBaseTest() throws Exception
+ protected WSRPConsumerBaseTest(String name) throws Exception
{
- this("WSRPConsumerBaseTest");
+ super(name);
}
- protected WSRPConsumerBaseTest(String name) throws Exception
+ protected WSRPConsumerBaseTest() throws Exception
{
- super(name);
}
public void setUp() throws Exception
@@ -58,14 +57,14 @@
consumer.setProducerId(TEST_PRODUCER_ID);
}
- public WSRPProducer getProducer()
+ public TestWSRPProducer getProducer()
{
return producer;
}
- public void setProducer(WSRPProducer producer)
+ public void setProducer(TestWSRPProducer producer)
{
- this.producer = (TestWSRPProducer)producer;
+ this.producer = producer;
}
public WSRPConsumer getConsumer()
@@ -80,6 +79,6 @@
public void testProducerId()
{
- assertEquals(TEST_PRODUCER_ID, consumer.getProducerId());
+ ExtendedAssert.assertEquals(TEST_PRODUCER_ID, consumer.getProducerId());
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPProducerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPProducerBaseTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPProducerBaseTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -39,11 +39,6 @@
/** . */
protected ServiceFactory serviceFactory;
- protected WSRPProducerBaseTest() throws Exception
- {
- this("WSRPProducerBaseTest");
- }
-
protected WSRPProducerBaseTest(String name) throws Exception
{
super(name);
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunner.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunner.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunner.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,36 +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.wsrp;
-
-import org.jboss.portal.test.framework.container.client.TestRunner;
-
-/** @author <a href="mailto:julien at jboss.org">Julien Viet</a> */
-public class WSRPTestRunner extends TestRunner
-{
-
- public WSRPTestRunner()
- {
- super("org/jboss/portal/test/wsrp/jboss-beans.xml");
- }
-}
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunnerServlet.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunnerServlet.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunnerServlet.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,112 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.test.wsrp;
-
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.test.framework.TestCaseContext;
-import org.jboss.portal.test.framework.container.result.AssertResult;
-import org.jboss.portal.test.framework.container.result.EndTestResult;
-import org.jboss.portal.test.wsrp.framework.TestWSRPProducer;
-import org.jboss.portal.wsrp.WSRPConsumer;
-import org.jboss.portal.wsrp.WSRPProducer;
-import org.jboss.portal.wsrp.services.ServiceFactory;
-
-import javax.management.ObjectName;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WSRPTestRunnerServlet extends HttpServlet
-{
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
- {
- WSRPBaseTest test = null;
- try
- {
- TestCaseContext tcc = TestCaseContext.getCurrentContext();
- int pos = tcc.getTestCaseId().indexOf('#');
- String testCaseClassName = tcc.getTestCaseId().substring(0, pos);
- String methodName = tcc.getTestCaseId().substring(pos + 1);
- Class testCaseClass = Thread.currentThread().getContextClassLoader().loadClass(testCaseClassName);
- test = (WSRPBaseTest)testCaseClass.newInstance();
-
- //
- if (test instanceof WSRPConsumerBaseTest)
- {
- WSRPConsumerBaseTest p = (WSRPConsumerBaseTest)test;
- TestWSRPProducer producer = (TestWSRPProducer)MBeanProxy.get(TestWSRPProducer.class, new ObjectName("portal.wsrp:service=WSRPProducer"), MBeanServerLocator.locateJBoss());
- WSRPConsumer consumer = (WSRPConsumer)MBeanProxy.get(WSRPConsumer.class, new ObjectName("portal.wsrp:service=WSRPConsumer"), MBeanServerLocator.locateJBoss());
- p.setConsumer(consumer);
- p.setProducer(producer);
- }
- else
- {
- WSRPProducerBaseTest p = (WSRPProducerBaseTest)test;
- WSRPProducer producer = (WSRPProducer)MBeanProxy.get(WSRPProducer.class, new ObjectName("portal.wsrp:service=WSRPProducer"), MBeanServerLocator.locateJBoss());
- ServiceFactory serviceFactory = (ServiceFactory)MBeanProxy.get(ServiceFactory.class, new ObjectName("portal.wsrp:service=CachingServiceFactory"), MBeanServerLocator.locateJBoss());
- p.setProducer(producer);
- p.setServiceFactory(serviceFactory);
- }
-
- //
- test.setUp();
-
- //
- Method m = testCaseClass.getMethod(methodName, new Class[0]);
- m.invoke(test, new Object[0]);
- TestCaseContext.setCurrentResult(new EndTestResult());
- }
- catch (InvocationTargetException e)
- {
- TestCaseContext.setCurrentResult(new AssertResult(e.getCause()));
- }
- catch (Exception e)
- {
- TestCaseContext.setCurrentResult(new AssertResult(e));
- }
- finally
- {
- if (test != null)
- {
- try
- {
- test.tearDown();
- }
- catch (Exception e)
- {
- TestCaseContext.setCurrentResult(new AssertResult(e));
- }
- }
- }
- }
-}
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.wsrp.v1.consumer;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConsumerTestCase extends ServerTestRunner
+{
+ public ConsumerTestCase()
+ {
+ super("test-wsrp-consumer.sar");
+ }
+}
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestRunner.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestRunner.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestRunner.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -1,80 +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.wsrp.v1.consumer;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.common.junit.TestBuilder;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.wsrp.WSRPTestRunner;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision: 5483 $
- * @since 2.4
- */
-public class ConsumerTestRunner extends junit.framework.TestCase
-{
-
- public ConsumerTestRunner()
- {
- }
-
- public ConsumerTestRunner(String string)
- {
- super(string);
- }
-
- public static TestSuite suite()
- {
- try
- {
- WSRPTestRunner runner = new WSRPTestRunner();
- TestBuilder.introspect(runner, ServiceDescriptionTestCase.class, new ClassNameTestCaseFactory(ServiceDescriptionTestCase.class));
- TestBuilder.introspect(runner, MarkupTestCase.class, new ClassNameTestCaseFactory(MarkupTestCase.class));
- return runner;
- }
- catch (NoSuchMethodException e)
- {
- e.printStackTrace();
- return null;
- }
- }
-
- private static class ClassNameTestCaseFactory implements TestBuilder.TestCaseFactory
- {
- private Class clazz;
-
- public ClassNameTestCaseFactory(Class clazz)
- {
- this.clazz = clazz;
- }
-
- public junit.framework.TestCase createTestCase(Map parametrization, String name) throws Exception
- {
- return new TestCase(clazz.getName() + "#" + name, "/testrunner");
- }
- }
-}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -25,6 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -67,7 +68,7 @@
public void testNullRender() throws Exception
{
- assertTrue(consumer.invoke(createRenderInvocation(NullMarkupBehavior.PORTLET_HANDLE)) instanceof ErrorResponse);
+ ExtendedAssert.assertTrue(consumer.invoke(createRenderInvocation(NullMarkupBehavior.PORTLET_HANDLE)) instanceof ErrorResponse);
}
public void testRender() throws Exception
@@ -75,11 +76,11 @@
RenderInvocation render = createRenderInvocation(BasicMarkupBehavior.PORTLET_HANDLE, Mode.EDIT,
WindowState.NORMAL, "someNS");
FragmentResponse result = checkRenderResult(consumer.invoke(render), "portlet1:edit:normal:someNS");
- assertEquals(15, result.getExpirationSecs());
+ ExtendedAssert.assertEquals(15, result.getExpirationSecs());
render = createRenderInvocation(SessionMarkupBehavior.PORTLET_HANDLE);
result = checkRenderResult(consumer.invoke(render), "portlet2:0:view:maximized");
- assertEquals(0, result.getExpirationSecs());
+ ExtendedAssert.assertEquals(0, result.getExpirationSecs());
}
public void testAction() throws Exception
@@ -87,10 +88,10 @@
ActionInvocation action = createActionInvocation(BasicMarkupBehavior.PORTLET_HANDLE);
PortletInvocationResponse response = consumer.invoke(action);
- assertNotNull(response);
- assertTrue("Was expecting a RenderResponse. Got: " + response, response instanceof RenderResponse);
+ ExtendedAssert.assertNotNull(response);
+ ExtendedAssert.assertTrue("Was expecting a RenderResponse. Got: " + response, response instanceof RenderResponse);
RenderResponse render = (RenderResponse)response;
- assertEquals(BasicMarkupBehavior.NS, render.getNavigationalState().getStringValue());
+ ExtendedAssert.assertEquals(BasicMarkupBehavior.NS, render.getNavigationalState().getStringValue());
}
public void testSessionHandling() throws Exception
@@ -104,11 +105,11 @@
// checking session information
ProducerSessionInformation sessionInfo = consumer.getProducerSessionInformationFrom(render);
String sessionId = sessionInfo.getSessionIdForPortlet(SessionMarkupBehavior.PORTLET_HANDLE);
- assertNotNull(sessionId);
- assertEquals(SessionMarkupBehavior.SESSION_ID, sessionId);
- assertNotNull(sessionInfo.getUserCookie());
- assertFalse(sessionInfo.isPerGroupCookies());
- assertFalse(sessionInfo.isInitCookieDone());
+ ExtendedAssert.assertNotNull(sessionId);
+ ExtendedAssert.assertEquals(SessionMarkupBehavior.SESSION_ID, sessionId);
+ ExtendedAssert.assertNotNull(sessionInfo.getUserCookie());
+ ExtendedAssert.assertFalse(sessionInfo.isPerGroupCookies());
+ ExtendedAssert.assertFalse(sessionInfo.isInitCookieDone());
response = consumer.invoke(render);
checkRenderResult(response, "portlet2:1:view:maximized");
@@ -125,8 +126,8 @@
consumer.invoke(render);
ProducerSessionInformation sessionInfo = consumer.getProducerSessionInformationFrom(session);
- assertFalse(sessionInfo.isPerGroupCookies());
- assertFalse(sessionInfo.isInitCookieDone());
+ ExtendedAssert.assertFalse(sessionInfo.isPerGroupCookies());
+ ExtendedAssert.assertFalse(sessionInfo.isInitCookieDone());
// now require cookie initialization and check that everything went well
producer.setRequiresInitCookie(CookieProtocol.perUser);
@@ -138,22 +139,22 @@
consumer.invoke(render);
sessionInfo = consumer.getProducerSessionInformationFrom(session);
- assertFalse(sessionInfo.isPerGroupCookies());
- assertTrue(sessionInfo.isInitCookieDone());
- assertNotNull(sessionInfo.getUserCookie());
+ ExtendedAssert.assertFalse(sessionInfo.isPerGroupCookies());
+ ExtendedAssert.assertTrue(sessionInfo.isInitCookieDone());
+ ExtendedAssert.assertNotNull(sessionInfo.getUserCookie());
}
private FragmentResponse checkRenderResult(PortletInvocationResponse response, String markup)
{
- assertNotNull(response);
+ ExtendedAssert.assertNotNull(response);
if (response instanceof ErrorResponse)
{
ErrorResponse errorResponse = (ErrorResponse)response;
- fail("Got an ErrorResponse instead of a FragmentResponse. Message: " + errorResponse.getMessage());
+ ExtendedAssert.fail("Got an ErrorResponse instead of a FragmentResponse. Message: " + errorResponse.getMessage());
}
- assertTrue("Was expecting a FragmentResponse. Got: " + response, response instanceof FragmentResponse);
+ ExtendedAssert.assertTrue("Was expecting a FragmentResponse. Got: " + response, response instanceof FragmentResponse);
FragmentResponse fragment = (FragmentResponse)response;
- assertEquals(markup, fragment.getChars().toString());
+ ExtendedAssert.assertEquals(markup, fragment.getChars().toString());
return fragment;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicMarkupBehavior;
import org.jboss.portal.test.wsrp.v1.consumer.behaviors.SessionMarkupBehavior;
+import org.jboss.portal.common.junit.ExtendedAssert;
import java.util.Set;
@@ -49,12 +50,12 @@
Set returnedPortlets = consumer.getPortlets();
//assert we have our two portlets
- assertEquals(2, returnedPortlets.size());
+ ExtendedAssert.assertEquals(2, returnedPortlets.size());
Portlet[] portletArray = (Portlet[])returnedPortlets.toArray(new Portlet[0]);
Portlet p1 = portletArray[0];
Portlet p2 = portletArray[1];
- assertTrue((p1.getContext().getId().equals(BasicMarkupBehavior.PORTLET_HANDLE) && p2.getContext().getId().equals(SessionMarkupBehavior.PORTLET_HANDLE)) ||
+ ExtendedAssert.assertTrue((p1.getContext().getId().equals(BasicMarkupBehavior.PORTLET_HANDLE) && p2.getContext().getId().equals(SessionMarkupBehavior.PORTLET_HANDLE)) ||
(p2.getContext().getId().equals(BasicMarkupBehavior.PORTLET_HANDLE) && p1.getContext().getId().equals(SessionMarkupBehavior.PORTLET_HANDLE)));
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.test.wsrp.WSRPConsumerBaseTest;
import org.jboss.portal.test.wsrp.framework.support.ServiceObjectFactory;
+import org.jboss.portal.common.junit.ExtendedAssert;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -40,12 +41,12 @@
protected void checkPortlet(Portlet portlet, String suffix, String handle)
{
MetaInfo meta = portlet.getInfo().getMeta();
- assertEquals(handle, portlet.getContext().getId());
- assertEquals(ServiceObjectFactory.SAMPLE_DESCRIPTION + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.DESCRIPTION)));
- assertEquals(ServiceObjectFactory.SAMPLE_TITLE + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.TITLE)));
- assertEquals(ServiceObjectFactory.SAMPLE_SHORTTITLE + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.SHORT_TITLE)));
- assertEquals(ServiceObjectFactory.SAMPLE_DISPLAYNAME + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.DISPLAY_NAME)));
- assertEquals(ServiceObjectFactory.SAMPLE_KEYWORD + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.KEYWORDS)));
+ ExtendedAssert.assertEquals(handle, portlet.getContext().getId());
+ ExtendedAssert.assertEquals(ServiceObjectFactory.SAMPLE_DESCRIPTION + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.DESCRIPTION)));
+ ExtendedAssert.assertEquals(ServiceObjectFactory.SAMPLE_TITLE + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.TITLE)));
+ ExtendedAssert.assertEquals(ServiceObjectFactory.SAMPLE_SHORTTITLE + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.SHORT_TITLE)));
+ ExtendedAssert.assertEquals(ServiceObjectFactory.SAMPLE_DISPLAYNAME + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.DISPLAY_NAME)));
+ ExtendedAssert.assertEquals(ServiceObjectFactory.SAMPLE_KEYWORD + suffix, ServiceObjectFactory.extractString(meta.getMetaValue(MetaInfo.KEYWORDS)));
}
public void tearDown() throws Exception
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -42,6 +42,7 @@
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UpdateResponse;
import org.jboss.portal.wsrp.handler.RequestHeaderClientHandler;
+import org.jboss.portal.common.junit.ExtendedAssert;
import java.rmi.RemoteException;
@@ -78,7 +79,7 @@
try
{
markupService.getMarkup(getMarkup);
- fail();
+ ExtendedAssert.fail();
}
catch (UnsupportedModeFault unsupportedModeFault)
{
@@ -118,7 +119,7 @@
assertString1ContainsString2(markupString, "Hello, Anonymous!");
assertString1ContainsString2(markupString, "Counter: 0");
- assertTrue(julienURL instanceof WSRPRenderURL);
+ ExtendedAssert.assertTrue(julienURL instanceof WSRPRenderURL);
WSRPRenderURL julienRender = (WSRPRenderURL)julienURL;
// We're now trying to get a hello for Julien ;)
@@ -129,7 +130,7 @@
// julien.length() * 2 to bypass second link
WSRPPortletURL incrementURL = WSRPPortletURL.create(extractLink(markupString, julienLink.length() * 2));
- assertTrue(incrementURL instanceof WSRPActionURL);
+ ExtendedAssert.assertTrue(incrementURL instanceof WSRPActionURL);
WSRPActionURL incrementAction = (WSRPActionURL)incrementURL;
// let's see now if we can increment the counter
@@ -188,18 +189,18 @@
private void checkMarkupResponseWithSession(MarkupResponse response, int count) throws RemoteException, InvalidRegistrationFault, OperationFailedFault
{
- assertNotNull(response);
+ ExtendedAssert.assertNotNull(response);
// Markup context
MarkupContext markupContext = response.getMarkupContext();
- assertNotNull(markupContext);
- assertEquals("<p>" + count + "</p><div><a href=\"wsrp_rewrite?wsrp-urlType=render" +
+ ExtendedAssert.assertNotNull(markupContext);
+ ExtendedAssert.assertEquals("<p>" + count + "</p><div><a href=\"wsrp_rewrite?wsrp-urlType=render" +
"&wsrp-navigationalState=JBPNS_/wsrp_rewrite\">render</a></div>", markupContext.getMarkupString());
// checking session
ProducerSessionInformation sessionInfo = RequestHeaderClientHandler.getCurrentProducerSessionInformation();
- assertNotNull(sessionInfo);
- assertTrue(sessionInfo.getUserCookie().lastIndexOf("JSESSIONID") != -1);
+ ExtendedAssert.assertNotNull(sessionInfo);
+ ExtendedAssert.assertTrue(sessionInfo.getUserCookie().lastIndexOf("JSESSIONID") != -1);
}
public void testPerformBlockingInteractionNoRedirect() throws Exception
@@ -216,22 +217,22 @@
interactionParams.setFormParameters(formParams);
BlockingInteractionResponse response = markupService.performBlockingInteraction(performBlockingInteraction);
- assertNotNull(response);
+ ExtendedAssert.assertNotNull(response);
// this is not a redirect...
- assertNull(response.getRedirectURL());
+ ExtendedAssert.assertNull(response.getRedirectURL());
// check update response
UpdateResponse updateResponse = response.getUpdateResponse();
- assertNotNull(updateResponse);
+ ExtendedAssert.assertNotNull(updateResponse);
// request was readOnly so no updated portlet context
- assertNull(updateResponse.getPortletContext());
+ ExtendedAssert.assertNull(updateResponse.getPortletContext());
String navigationalState = updateResponse.getNavigationalState();
- assertNotNull(navigationalState);
- assertEquals(updateResponse.getNewMode(), WSRPConstants.VIEW_MODE);
+ ExtendedAssert.assertNotNull(navigationalState);
+ ExtendedAssert.assertEquals(updateResponse.getNewMode(), WSRPConstants.VIEW_MODE);
MarkupContext markupContext = updateResponse.getMarkupContext();
- assertNull(markupContext); // we don't return markup for now
+ ExtendedAssert.assertNull(markupContext); // we don't return markup for now
return navigationalState;
}
@@ -245,16 +246,16 @@
interactionParams.setFormParameters(formParams);
BlockingInteractionResponse response = markupService.performBlockingInteraction(performBlockingInteraction);
- assertNotNull(response);
+ ExtendedAssert.assertNotNull(response);
// this is a redirect...
String redirectURL = response.getRedirectURL();
- assertNotNull(redirectURL);
- assertEquals("/WEB-INF/jsp/help.jsp", redirectURL); // fix-me: handle URL re-writing
+ ExtendedAssert.assertNotNull(redirectURL);
+ ExtendedAssert.assertEquals("/WEB-INF/jsp/help.jsp", redirectURL); // fix-me: handle URL re-writing
// no update response
UpdateResponse updateResponse = response.getUpdateResponse();
- assertNull(updateResponse);
+ ExtendedAssert.assertNull(updateResponse);
}
public void testGMAndPBIInteraction() throws Exception
@@ -276,9 +277,9 @@
MarkupResponse response = markupService.getMarkup(getMarkup);
CacheControl cacheControl = response.getMarkupContext().getCacheControl();
- assertNotNull(cacheControl);
- assertEquals(WSRPConstants.CACHE_PER_USER, cacheControl.getUserScope());
- assertEquals(15, cacheControl.getExpires());
+ ExtendedAssert.assertNotNull(cacheControl);
+ ExtendedAssert.assertEquals(WSRPConstants.CACHE_PER_USER, cacheControl.getUserScope());
+ ExtendedAssert.assertEquals(15, cacheControl.getExpires());
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
String sessionPortletArchive = "test-session-portlet.war";
@@ -287,7 +288,7 @@
response = markupService.getMarkup(createMarkupRequest(sessionPortletArchive));
cacheControl = response.getMarkupContext().getCacheControl();
- assertNull(cacheControl);
+ ExtendedAssert.assertNull(cacheControl);
undeploy(sessionPortletArchive);
}
@@ -379,7 +380,7 @@
{
response = markupService.getMarkup(getMarkup);
//fail("Should have trown an UnsupportetLocaleFault"); // ideally cf http://jira.jboss.com/jira/browse/JBPORTAL-857
- fail("Should have trown an exception"); // right now
+ ExtendedAssert.fail("Should have trown an exception"); // right now
}
catch (Exception e)
{
@@ -422,15 +423,15 @@
private MarkupContext checkMarkupResponse(MarkupResponse response, String markupString)
{
- assertNotNull(response);
+ ExtendedAssert.assertNotNull(response);
// Markup context
MarkupContext markupContext = response.getMarkupContext();
- assertNotNull(markupContext);
- assertEquals("text/html", markupContext.getMimeType());
- assertEquals("title", markupContext.getPreferredTitle());
- assertTrue(markupContext.getRequiresUrlRewriting().booleanValue());
- assertEquals(markupString, markupContext.getMarkupString());
+ ExtendedAssert.assertNotNull(markupContext);
+ ExtendedAssert.assertEquals("text/html", markupContext.getMimeType());
+ ExtendedAssert.assertEquals("title", markupContext.getPreferredTitle());
+ ExtendedAssert.assertTrue(markupContext.getRequiresUrlRewriting().booleanValue());
+ ExtendedAssert.assertEquals(markupString, markupContext.getMarkupString());
return markupContext;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -29,6 +29,7 @@
import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.PropertyList;
+import org.jboss.portal.common.junit.ExtendedAssert;
import javax.xml.soap.SOAPElement;
import java.util.Arrays;
@@ -62,7 +63,7 @@
GetPortletDescription gpd = WSRPTypeFactory.createGetPortletDescription(null, handle);
PortletDescriptionResponse response = portletManagementService.getPortletDescription(gpd);
- assertNotNull(response);
+ ExtendedAssert.assertNotNull(response);
checkBasicPortletDescription(response.getPortletDescription(), handle);
}
@@ -92,7 +93,7 @@
private Property[] checkGetPropertiesResponse(PropertyList response, Property[] expected)
{
- assertNotNull(response);
+ ExtendedAssert.assertNotNull(response);
Property[] properties = response.getProperties();
assertEquals(expected, properties, false, "Didn't receive expected properties!", new PropertyDecorator());
return properties;
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.wsrp.v1.producer;
+
+import org.jboss.portal.test.server.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ProducerTestCase extends ServerTestRunner
+{
+ public ProducerTestCase()
+ {
+ super("test-wsrp-producer.sar");
+ }
+}
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestRunner.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestRunner.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestRunner.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -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.wsrp.v1.producer;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.common.junit.TestBuilder;
-import org.jboss.portal.test.framework.container.client.TestCase;
-import org.jboss.portal.test.wsrp.WSRPTestRunner;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision: 5483 $
- * @since 2.4
- */
-public class ProducerTestRunner extends junit.framework.TestCase
-{
-
- public ProducerTestRunner()
- {
- }
-
- public ProducerTestRunner(String string)
- {
- super(string);
- }
-
- public static TestSuite suite()
- {
- try
- {
- WSRPTestRunner runner = new WSRPTestRunner();
- TestBuilder.introspect(runner, ServiceDescriptionTestCase.class, new ProducerTestRunner.ClassNameTestCaseFactory(ServiceDescriptionTestCase.class));
- TestBuilder.introspect(runner, MarkupTestCase.class, new ProducerTestRunner.ClassNameTestCaseFactory(MarkupTestCase.class));
-// TestBuilder.introspect(runner, RegistrationTestCase.class, new ProducerTestRunner.Blah(RegistrationTestCase.class));
- TestBuilder.introspect(runner, PortletManagementTestCase.class, new ProducerTestRunner.ClassNameTestCaseFactory(PortletManagementTestCase.class));
- return runner;
- }
- catch (NoSuchMethodException e)
- {
- e.printStackTrace();
- return null;
- }
- }
-
- private static class ClassNameTestCaseFactory implements TestBuilder.TestCaseFactory
- {
- private Class clazz;
-
- public ClassNameTestCaseFactory(Class clazz)
- {
- this.clazz = clazz;
- }
-
- public junit.framework.TestCase createTestCase(Map parametrization, String name) throws Exception
- {
- return new TestCase(clazz.getName() + "#" + name, "/testrunner");
- }
- }
-}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -34,6 +34,7 @@
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
import org.jboss.portal.wsrp.core.ServiceDescription;
+import org.jboss.portal.common.junit.ExtendedAssert;
import javax.xml.namespace.QName;
@@ -67,7 +68,7 @@
try
{
serviceDescriptionService.getServiceDescription(gs);
- fail("Consumer tried to access info with a de-registered context. Operations should fail.");
+ ExtendedAssert.fail("Consumer tried to access info with a de-registered context. Operations should fail.");
}
catch (InvalidRegistrationFault invalidRegistrationFault)
{
@@ -93,7 +94,7 @@
try
{
serviceDescriptionService.getServiceDescription(gs);
- fail("Required registration info has been modified: operations should fail until registration is modified.");
+ ExtendedAssert.fail("Required registration info has been modified: operations should fail until registration is modified.");
}
catch (OperationFailedFault operationFailedFault)
{
@@ -106,7 +107,7 @@
gs.setRegistrationContext(null);
PropertyDescription[] pds = serviceDescriptionService.getServiceDescription(gs)
.getRegistrationPropertyDescription().getPropertyDescriptions();
- assertEquals(2, pds.length);
+ ExtendedAssert.assertEquals(2, pds.length);
assertEquals(regProp, pds[1]);
// Update registration data
@@ -132,19 +133,19 @@
//Invoke the Web Service
ServiceDescription sd = serviceDescriptionService.getServiceDescription(gs);
- assertNotNull(sd);
- assertTrue(sd.isRequiresRegistration());
+ ExtendedAssert.assertNotNull(sd);
+ ExtendedAssert.assertTrue(sd.isRequiresRegistration());
// Check registration properties
ModelDescription registrationPropertyDescription = sd.getRegistrationPropertyDescription();
- assertNotNull(registrationPropertyDescription);
+ ExtendedAssert.assertNotNull(registrationPropertyDescription);
PropertyDescription[] propertyDescriptions = registrationPropertyDescription.getPropertyDescriptions();
- assertNotNull(propertyDescriptions);
- assertEquals(1, propertyDescriptions.length);
+ ExtendedAssert.assertNotNull(propertyDescriptions);
+ ExtendedAssert.assertEquals(1, propertyDescriptions.length);
assertEquals(regProp, propertyDescriptions[0]);
// No offered portlets without registration!
- assertNull(sd.getOfferedPortlets());
+ ExtendedAssert.assertNull(sd.getOfferedPortlets());
RegistrationContext registrationContext = registerConsumer();
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -32,6 +32,7 @@
import org.jboss.portal.wsrp.core.GetServiceDescription;
import org.jboss.portal.wsrp.core.ServiceDescription;
import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.junit.ExtendedAssert;
/**
* Tests WSRP Service Description
@@ -58,10 +59,10 @@
ServiceDescription sd = checkServiceDescriptionWithOnlyBasicPortlet(gs);
// registration is not required
- assertFalse(sd.isRequiresRegistration());
+ ExtendedAssert.assertFalse(sd.isRequiresRegistration());
// No registration properties
- assertNull(sd.getRegistrationPropertyDescription());
+ ExtendedAssert.assertNull(sd.getRegistrationPropertyDescription());
}
public void testGetServiceDescriptionLiveDeployment() throws Throwable
@@ -72,22 +73,22 @@
deploy("test-basic-portlet.war");
ServiceDescription sd = serviceDescriptionService.getServiceDescription(gsd);
- assertEquals(1, sd.getOfferedPortlets().length);
+ ExtendedAssert.assertEquals(1, sd.getOfferedPortlets().length);
deploy("test-markup-portlet.war");
sd = serviceDescriptionService.getServiceDescription(gsd);
// should now have 2 offered portlets
- assertEquals(2, sd.getOfferedPortlets().length);
+ ExtendedAssert.assertEquals(2, sd.getOfferedPortlets().length);
deploy("test-session-portlet.war");
sd = serviceDescriptionService.getServiceDescription(gsd);
// should now have 3 offered portlets
- assertEquals(3, sd.getOfferedPortlets().length);
+ ExtendedAssert.assertEquals(3, sd.getOfferedPortlets().length);
undeploy("test-markup-portlet.war");
sd = serviceDescriptionService.getServiceDescription(gsd);
// should now have only 2 offered portlets again
- assertEquals(2, sd.getOfferedPortlets().length);
+ ExtendedAssert.assertEquals(2, sd.getOfferedPortlets().length);
undeploy("test-session-portlet.war");
// only basic portlet should still be offered
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2006-10-30 13:35:25 UTC (rev 5510)
@@ -39,6 +39,7 @@
import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
+import org.jboss.portal.common.junit.ExtendedAssert;
import javax.xml.namespace.QName;
@@ -93,19 +94,19 @@
*/
public void checkBasicPortletDescription(PortletDescription desc, String handle)
{
- assertNotNull(desc);
+ ExtendedAssert.assertNotNull(desc);
/**
* @wsrp.specification
* Portlet handle must be less than 255 characters (WSRP 1.0 5.1.2)
*/
- assertTrue(desc.getPortletHandle().length() <= 255);
+ ExtendedAssert.assertTrue(desc.getPortletHandle().length() <= 255);
if (handle != null)
{
- assertEquals(handle, desc.getPortletHandle());
+ ExtendedAssert.assertEquals(handle, desc.getPortletHandle());
}
- assertEquals("title", desc.getTitle().getValue());
+ ExtendedAssert.assertEquals("title", desc.getTitle().getValue());
MarkupType[] markupTypes = desc.getMarkupTypes();
- assertEquals(1, markupTypes.length);
+ ExtendedAssert.assertEquals(1, markupTypes.length);
MarkupType markupType = markupTypes[0];
assertEquals(new MarkupType("text/html", new String[]{WSRPConstants.VIEW_MODE},
new String[]{WSRPConstants.NORMAL_WINDOW_STATE, WSRPConstants.MAXIMIZED_WINDOW_STATE, WSRPConstants.MINIMIZED_WINDOW_STATE},
@@ -119,12 +120,12 @@
//Invoke the Web Service
ServiceDescription sd = serviceDescriptionService.getServiceDescription(gs);
- assertNotNull("sd != null", sd);
+ ExtendedAssert.assertNotNull("sd != null", sd);
// Check offered portlets
PortletDescription[] offeredPortlets = sd.getOfferedPortlets();
- assertNotNull(offeredPortlets);
- assertEquals(1, offeredPortlets.length);
+ ExtendedAssert.assertNotNull(offeredPortlets);
+ ExtendedAssert.assertEquals(1, offeredPortlets.length);
// Check portlet description
PortletDescription desc = offeredPortlets[0];
@@ -187,7 +188,7 @@
{
if (expected == null || tested == null)
{
- fail(message + "Different classes or not both null.");
+ ExtendedAssert.fail(message + "Different classes or not both null.");
}
@@ -206,14 +207,14 @@
{
if (expected == null || tested == null)
{
- fail(message + "Different classes or not both null.");
+ ExtendedAssert.fail(message + "Different classes or not both null.");
}
assertEquals(expected.getExtensions(), tested.getExtensions(), false, message + "Extensions");
assertEquals(message + "Hint", expected.getHint(), tested.getHint());
assertEquals(message + "Label", expected.getLabel(), tested.getLabel());
- assertEquals(message + "Name", expected.getName(), tested.getName());
- assertEquals(message + "Type", expected.getType(), tested.getType());
+ ExtendedAssert.assertEquals(message + "Name", expected.getName(), tested.getName());
+ ExtendedAssert.assertEquals(message + "Type", expected.getType(), tested.getType());
}
}
@@ -223,12 +224,12 @@
{
if (expected == null || tested == null)
{
- fail(message + "Different classes or not both null.");
+ ExtendedAssert.fail(message + "Different classes or not both null.");
}
- assertEquals(expected.getLang(), tested.getLang());
- assertEquals(expected.getResourceName(), tested.getResourceName());
- assertEquals(expected.getValue(), tested.getValue());
+ ExtendedAssert.assertEquals(expected.getLang(), tested.getLang());
+ ExtendedAssert.assertEquals(expected.getResourceName(), tested.getResourceName());
+ ExtendedAssert.assertEquals(expected.getValue(), tested.getValue());
}
}
}
Modified: trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,22 +24,25 @@
<server>
- <!-- The test agent. -->
-<!--
+ <!-- -->
<mbean
- code="org.jboss.portal.test.framework.agent.JBossTestAgent"
- name="portal.test:service=Agent">
- <depends optional-attribute-name="MainDeployer" proxy-type="attribute">jboss.system:service=MainDeployer</depends>
+ code="org.jboss.portal.test.server.HttpTestDriverRegistryService"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
</mbean>
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=Agent">
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
<depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends optional-attribute-name="TargetName">portal.test:service=Agent</depends>
- <attribute name="JndiName">TestAgent</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.agent.TestAgent</attribute>
+ <depends optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
</mbean>
--->
<!-- Dummy test WSRP Producer implementation -->
<mbean
@@ -97,4 +100,25 @@
<depends optional-attribute-name="ServiceFactory" proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
</mbean>
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.wsrp.v1.consumer.MarkupTestCase"
+ name="portal.test:test=MarkupTestCase"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="Consumer" proxy-type="attribute">portal.wsrp:service=WSRPConsumer</depends>
+ <depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.wsrp.v1.consumer.ServiceDescriptionTestCase"
+ name="portal.test:test=ServiceDescription"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="Consumer" proxy-type="attribute">portal.wsrp:service=WSRPConsumer</depends>
+ <depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
+ </mbean>
</server>
Modified: trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2006-10-30 10:52:11 UTC (rev 5509)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2006-10-30 13:35:25 UTC (rev 5510)
@@ -24,22 +24,25 @@
<server>
- <!-- The test agent. -->
-<!--
+ <!-- -->
<mbean
- code="org.jboss.portal.test.framework.agent.JBossTestAgent"
- name="portal.test:service=Agent">
- <depends optional-attribute-name="MainDeployer" proxy-type="attribute">jboss.system:service=MainDeployer</depends>
+ code="org.jboss.portal.test.server.HttpTestDriverRegistryService"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
</mbean>
<mbean
code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=Agent">
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
<depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends optional-attribute-name="TargetName">portal.test:service=Agent</depends>
- <attribute name="JndiName">TestAgent</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.agent.TestAgent</attribute>
+ <depends optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
</mbean>
--->
<!-- Webapp registry -->
<mbean
@@ -212,4 +215,47 @@
<xmbean/>
<depends optional-attribute-name="Delegate" proxy-type="attribute">portal.wsrp:service=ServiceFactory</depends>
</mbean>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.wsrp.v1.producer.ServiceDescriptionTestCase"
+ name="portal.test:test=ServiceDescription"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="ServiceFactory" proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
+ <depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.wsrp.v1.producer.MarkupTestCase"
+ name="portal.test:test=Markup"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="ServiceFactory" proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
+ <depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.wsrp.v1.producer.RegistrationTestCase"
+ name="portal.test:test=Registration"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="ServiceFactory" proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
+ <depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.wsrp.v1.producer.PortletManagementTestCase"
+ name="portal.test:test=PortletManagement"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry" proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ <depends optional-attribute-name="ServiceFactory" proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
+ <depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
+ </mbean>
+
</server>
More information about the jboss-svn-commits
mailing list