[jboss-svn-commits] JBoss Portal SVN: r5493 - in trunk: cms/src/main/org/jboss/portal/test/cms cms/src/main/org/jboss/portal/test/cms/clustering common/src/main/org/jboss/portal/common/junit core/src/main/org/jboss/portal/test/core/model/instance identity/src/main/org/jboss/portal/test/identity portlet/src/main/org/jboss/portal/portlet/test 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/jsr168/tck/portletinterface/spec portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec server/src/main/org/jboss/portal/server/deployment server/src/main/org/jboss/portal/test/server server/src/main/org/jboss/portal/test/server/charset server/src/main/org/jboss/portal/test/server/parameters server/src/main/org/jboss/portal/test/server/servlet test/src/main/org/jboss/portal/test/framework test/src/main/org/jboss/portal/test/framework/agent test/src/main/org/j! boss/portal/test/framework/container test/src/main/org/jboss/portal/test/framework/container/client test/src/main/org/jboss/portal/test/framework/container/server test/src/main/org/jboss/portal/test/framework/deployment test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container test/src/resources/portal-test-sar/META-INF tools/lib wsrp wsrp/src/main/org/jboss/portal/test/wsrp wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer wsrp/src/resources/tests wsrp/src/resources/tests/test-wsrp-consumer-jar/org/jboss/portal/test/wsrp wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF wsrp/src/resources/tests/test-wsrp-producer-jar/org/jboss/portal/test/wsrp wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF wsrp/src/resources/tests/test-wsrp-test-runner-war wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Oct 23 10:47:07 EDT 2006
Author: julien at jboss.com
Date: 2006-10-23 10:45:45 -0400 (Mon, 23 Oct 2006)
New Revision: 5493
Added:
trunk/common/src/main/org/jboss/portal/common/junit/TestBuilder.java
trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java
trunk/test/src/main/org/jboss/portal/test/framework/agent/
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/agent/TestAgentFactory.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestRunner.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/
trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/
trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/jboss-web.xml
trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/web.xml
Removed:
trunk/common/src/main/org/jboss/portal/common/junit/TestCaseFactory.java
trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContext.java
trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContextAccessor.java
trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCaseContextAccessorProxy.java
trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorService.java
trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorServiceMBean.java
trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacade.java
trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacadeMBean.java
Modified:
trunk/cms/src/main/org/jboss/portal/test/cms/AbstractCMSTestCase.java
trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileModSequenceBuilder.java
trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/DBUserTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleRoleModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleUserModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticGroupStrategyTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticRoleStrategyTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/LDAPUserTestCase.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.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/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/spec/RequestDispatchingDependingOnModePortlet.java
trunk/server/src/main/org/jboss/portal/server/deployment/WebAppAdapter.java
trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.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/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.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/TestSuite.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/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
trunk/test/src/resources/portal-test-sar/META-INF/jboss-service.xml
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/producer/NeedPortletHandleTest.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-jar/org/jboss/portal/test/wsrp/jboss-beans.xml
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/web.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-jar/org/jboss/portal/test/wsrp/jboss-beans.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
- updated the test framework to perform server side deployment
- updated wsrp tests to run inside jboss, removing thirdparty issues that we are currently having
Modified: trunk/cms/src/main/org/jboss/portal/test/cms/AbstractCMSTestCase.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/AbstractCMSTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/AbstractCMSTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -24,7 +24,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
import org.jboss.portal.test.framework.TestRuntimeContext;
@@ -71,7 +71,7 @@
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DataSourceConfig"), DataSourceSupport.Config.fromXML2(configsURL));
- TestSuite suite = TestCaseFactory.create(testCaseMD, clazz);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, clazz);
return suite;
}
}
Modified: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/clustering/FileModSequenceBuilder.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -30,7 +30,7 @@
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.container.TestCaseContext;
+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;
Copied: trunk/common/src/main/org/jboss/portal/common/junit/TestBuilder.java (from rev 5492, trunk/common/src/main/org/jboss/portal/common/junit/TestCaseFactory.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/TestCaseFactory.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/common/src/main/org/jboss/portal/common/junit/TestBuilder.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -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.junit;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.Collections;
+
+import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestBuilder
+{
+
+ public static TestSuite createTestSuite(TestCaseMetaData testCaseMD, Class clazz, TestCaseFactory factory) throws NoSuchMethodException
+ {
+ TestSuite suite = new TestSuite();
+ for (Iterator i = testCaseMD.getParametrizations().iterator();i.hasNext();)
+ {
+ Map parametrization = (Map)i.next();
+
+ //
+ introspect(suite, parametrization, clazz, factory);
+ }
+ return suite;
+ }
+
+ public static TestSuite createTestSuite(TestCaseMetaData testCaseMD, Class clazz) throws NoSuchMethodException
+ {
+ return createTestSuite(testCaseMD, clazz, new ReflectedTestCaseFactory(clazz));
+ }
+
+ public static void introspect(TestSuite suite, Class clazz) throws NoSuchMethodException
+ {
+ introspect(suite, clazz, new ReflectedTestCaseFactory(clazz));
+ }
+
+ public static void introspect(TestSuite suite, Class clazz, TestCaseFactory factory) throws NoSuchMethodException
+ {
+ introspect(suite, Collections.EMPTY_MAP, clazz, factory);
+ }
+
+ private static void introspect(TestSuite suite, Map parametrization, Class clazz, TestCaseFactory factory)
+ {
+ try
+ {
+ Method[] methods = clazz.getMethods();
+ for (int j = 0; j < methods.length; j++)
+ {
+ Method method = methods[j];
+ int modifiers = method.getModifiers();
+ if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers) && method.getName().startsWith("test"))
+ {
+ TestCase testCase = factory.createTestCase(parametrization, method.getName());
+ suite.addTest(testCase);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException();
+ iae.initCause(e);
+ throw iae;
+ }
+ }
+
+ public static class ReflectedTestCaseFactory implements TestCaseFactory
+ {
+
+ /** . */
+ private final Constructor ctor;
+
+ public ReflectedTestCaseFactory(Class clazz) throws NoSuchMethodException
+ {
+ this.ctor = clazz.getConstructor(new Class[]{Map.class});
+ }
+
+ public TestCase createTestCase(Map parametrization, String name) throws IllegalAccessException, InvocationTargetException, InstantiationException
+ {
+ TestCase testCase = (TestCase)ctor.newInstance(new Object[]{parametrization});
+ testCase.setName(name);
+ return testCase;
+ }
+ }
+
+ public interface TestCaseFactory
+ {
+ TestCase createTestCase(Map parametrization, String name) throws Exception;
+ }
+}
Deleted: trunk/common/src/main/org/jboss/portal/common/junit/TestCaseFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/TestCaseFactory.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/common/src/main/org/jboss/portal/common/junit/TestCaseFactory.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -1,102 +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.common.junit;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Iterator;
-
-import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestCaseFactory
-{
-
- public static TestSuite create(TestCaseMetaData testCaseMD, Class clazz)
- {
- TestSuite suite = new TestSuite();
- for (Iterator i = testCaseMD.getParametrizations().iterator();i.hasNext();)
- {
- Map parametrization = (Map)i.next();
-
- //
- introspect(suite, parametrization, clazz);
- }
- return suite;
- }
-
- private static void introspect(TestSuite suite, Map parametrization, Class clazz)
- {
- try
- {
- Constructor ctor = clazz.getConstructor(new Class[]{Map.class});
-
- //
- Method[] methods = clazz.getMethods();
- for (int j = 0; j < methods.length; j++)
- {
- Method method = methods[j];
- int modifiers = method.getModifiers();
- if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers) && method.getName().startsWith("test"))
- {
- TestCase testCase = (TestCase)ctor.newInstance(new Object[]{parametrization});
- testCase.setName(method.getName());
- suite.addTest(testCase);
- }
- }
- }
- catch (InstantiationException e)
- {
- IllegalArgumentException iae = new IllegalArgumentException();
- iae.initCause(e);
- throw iae;
- }
- catch (NoSuchMethodException e)
- {
- IllegalArgumentException iae = new IllegalArgumentException();
- iae.initCause(e);
- throw iae;
- }
- catch (IllegalAccessException e)
- {
- IllegalArgumentException iae = new IllegalArgumentException();
- iae.initCause(e);
- throw iae;
- }
- catch (InvocationTargetException e)
- {
- IllegalArgumentException iae = new IllegalArgumentException();
- iae.initCause(e);
- throw iae;
- }
- }
-}
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -38,7 +38,7 @@
import org.apache.log4j.SimpleLayout;
import org.hibernate.Session;
import org.jboss.portal.Mode;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.TransactionAssert;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
@@ -107,7 +107,7 @@
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DataSourceConfig"), DataSourceSupport.Config.fromXML2(configsURL));
testCaseMD.bindExternalParameters();
- TestSuite suite = TestCaseFactory.create(testCaseMD, InstanceContainerTestCase.class);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, InstanceContainerTestCase.class);
return suite;
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/DBUserTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/DBUserTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/DBUserTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -28,7 +28,7 @@
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
import org.jboss.portal.common.p3p.P3PConstants;
@@ -57,7 +57,7 @@
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DataSourceConfig"), DataSourceSupport.Config.fromXML2(configsURL));
- TestSuite suite = TestCaseFactory.create(testCaseMD, DBUserTestCase.class);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, DBUserTestCase.class);
return suite;
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleRoleModuleTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleRoleModuleTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleRoleModuleTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.identity;
import junit.framework.TestSuite;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
import org.jboss.portal.identity2.RoleModule;
@@ -48,7 +48,7 @@
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("directories.xml");
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DirectoryServerConfig"), DSConfig.fromXML2(configsURL));
- TestSuite suite = TestCaseFactory.create(testCaseMD, LDAPSimpleRoleModuleTestCase.class);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, LDAPSimpleRoleModuleTestCase.class);
return suite;
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleUserModuleTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleUserModuleTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/LDAPSimpleUserModuleTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.identity;
import junit.framework.TestSuite;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
import org.jboss.portal.identity2.UserModule;
@@ -48,7 +48,7 @@
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("directories.xml");
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DirectoryServerConfig"), DSConfig.fromXML2(configsURL));
- TestSuite suite = TestCaseFactory.create(testCaseMD, LDAPSimpleUserModuleTestCase.class);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, LDAPSimpleUserModuleTestCase.class);
return suite;
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticGroupStrategyTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticGroupStrategyTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticGroupStrategyTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.identity;
import junit.framework.TestSuite;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
import org.jboss.portal.identity2.ldap.StaticGroupLDAPMembershipStrategyImpl;
@@ -47,7 +47,7 @@
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("directories.xml");
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DirectoryServerConfig"), DSConfig.fromXML2(configsURL));
- TestSuite suite = TestCaseFactory.create(testCaseMD, LDAPStaticGroupStrategyTestCase.class);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, LDAPStaticGroupStrategyTestCase.class);
return suite;
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticRoleStrategyTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticRoleStrategyTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/LDAPStaticRoleStrategyTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.identity;
import junit.framework.TestSuite;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
import org.jboss.portal.identity2.ldap.StaticRoleLDAPMembershipStrategyImpl;
@@ -47,7 +47,7 @@
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("directories.xml");
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DirectoryServerConfig"), DSConfig.fromXML2(configsURL));
- TestSuite suite = TestCaseFactory.create(testCaseMD, LDAPStaticRoleStrategyTestCase.class);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, LDAPStaticRoleStrategyTestCase.class);
return suite;
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/LDAPUserTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/LDAPUserTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/LDAPUserTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -29,7 +29,7 @@
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
-import org.jboss.portal.common.junit.TestCaseFactory;
+import org.jboss.portal.common.junit.TestBuilder;
import org.jboss.portal.common.junit.metadata.TestCaseMetaData;
import org.jboss.portal.common.junit.metadata.TestCaseParameterMetaData;
import org.jboss.portal.test.framework.TestRuntimeContext;
@@ -59,7 +59,7 @@
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("directories.xml");
TestCaseMetaData testCaseMD = new TestCaseMetaData();
testCaseMD.bindParameter(new TestCaseParameterMetaData("DirectoryServerConfig"), DSConfig.fromXML2(configsURL));
- TestSuite suite = TestCaseFactory.create(testCaseMD, LDAPUserTestCase.class);
+ TestSuite suite = TestBuilder.createTestSuite(testCaseMD, LDAPUserTestCase.class);
return suite;
}
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -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.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.components;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet.components;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.portal.test.framework.container.result.Result;
import javax.portlet.ActionRequest;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.framework.portlet.components;
import org.apache.log4j.Logger;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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.portlet.Joinpoint;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.framework.portlet.components;
import org.apache.log4j.Logger;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.portal.test.framework.container.result.Result;
import org.jboss.portal.test.framework.portlet.Joinpoint;
import org.jboss.portal.test.framework.portlet.Sequence;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.ha.session;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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.portlet.components.AbstractTestPortlet;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.ActionRequest;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.ActionRequest;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.ActionRequest;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
import javax.portlet.PortletException;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck.portletmode.spec;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/WebAppAdapter.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/WebAppAdapter.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/WebAppAdapter.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -24,7 +24,7 @@
import org.jboss.deployment.DeploymentException;
import org.jboss.portal.server.deployment.jboss.ServerDeployerMBean;
-import org.jboss.portal.test.framework.deployment.MainDeployerFacade;
+import org.jboss.portal.test.framework.agent.JBossTestAgent;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -55,7 +55,7 @@
}
catch (DeploymentException e)
{
- MainDeployerFacade.log(e);
+ JBossTestAgent.log(e);
}
}
@@ -67,7 +67,7 @@
}
catch (DeploymentException e)
{
- MainDeployerFacade.log(e);
+ JBossTestAgent.log(e);
}
}
}
Modified: trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/RequestControllerTestImpl.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
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.container.TestCaseContext;
+import org.jboss.portal.test.framework.TestCaseContext;
import org.jboss.portal.test.framework.container.result.Result;
import java.util.HashMap;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/GetTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataNoCharsetTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -26,7 +26,7 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostMultipartFormDataUTF8Test.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -26,7 +26,7 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedNoCharsetTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -26,7 +26,7 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/charset/PostXWWWFormURLEncodedUTF8Test.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -26,7 +26,7 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/GetTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/PostApplicationXWWWFormURLEncodedTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/parameters/PostMultipartFormDataTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.AbstractServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/servlet/DefaultServletMappingTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/servlet/PathMappingTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/server/src/main/org/jboss/portal/test/server/servlet/RootPathMappingTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -25,7 +25,7 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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;
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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/JBossServiceLookup.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -36,7 +36,7 @@
{
/** . */
- private Node node;
+ private MBeanServerFactory serverFactory;
/** . */
private String name;
@@ -44,19 +44,42 @@
/** . */
private String proxyClassName;
- public JBossServiceLookup(Node node, String name, String proxyClassName)
+ public JBossServiceLookup(final Node node, String name, String proxyClassName)
{
- this.node = node;
+ 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)
+ {
+ this.serverFactory = new MBeanServerFactory()
+ {
+ public MBeanServer getServer()
+ {
+ return server;
+ }
+ };
+ this.name = name;
+ this.proxyClassName = proxyClassName;
}
public Object getService() throws Exception
{
Class proxyClass = Thread.currentThread().getContextClassLoader().loadClass(proxyClassName);
ObjectName name = new ObjectName(this.name);
- MBeanServer server = node.getServer();
+ MBeanServer server = serverFactory.getServer();
return MBeanProxy.get(proxyClass, name, server);
}
+
+ private interface MBeanServerFactory
+ {
+ MBeanServer getServer();
+ }
}
Copied: trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java (from rev 5492, trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContext.java)
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContext.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -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;
+
+import org.jboss.portal.test.framework.container.result.Result;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.framework.agent.TestAgent;
+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$
+ */
+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 + "]";
+ }
+}
Property changes on: trunk/test/src/main/org/jboss/portal/test/framework/TestCaseContext.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgent.java (from rev 5492, trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacade.java)
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacade.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgent.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,149 @@
+/******************************************************************************
+ * 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.deployment.DeploymentException;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.portal.test.framework.TestCaseContext;
+import org.jboss.invocation.Invocation;
+
+import java.net.URL;
+import java.lang.reflect.Method;
+
+/**
+ * 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$
+ */
+public class JBossTestAgent extends ServiceMBeanSupport implements JBossTestAgentMBean
+{
+
+ /** Keep a thread local of sessions. */
+ private static final ThreadLocal local = new ThreadLocal();
+
+ public static void log(DeploymentException e)
+ {
+ // Record the exception only if we have a session otherwise we may leek the exception in the thread local
+ Session session = (Session)local.get();
+ if (session != null && session.e == null)
+ {
+ session.e = e;
+ }
+ }
+
+ /** The main deployer delegate. */
+ private MainDeployerMBean mainDeployer;
+
+ public MainDeployerMBean getMainDeployer()
+ {
+ return mainDeployer;
+ }
+
+ public void setMainDeployer(MainDeployerMBean mainDeployer)
+ {
+ 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);
+ }
+
+ public void undeploy(URL url) throws DeploymentException
+ {
+ perform(url, false);
+ }
+
+ private void perform(URL url, boolean deploy) throws DeploymentException
+ {
+ try
+ {
+ Session session = new Session();
+ local.set(session);
+
+ // The main deployer could throw an exception but that will be an exception not related to jboss portal
+ if (deploy)
+ {
+ mainDeployer.deploy(url);
+ }
+ else
+ {
+ mainDeployer.undeploy(url);
+ }
+
+ // If e is not null that means an exception was thrown into jboss portal layer and we rethrow it
+ // to the client
+ if (session.e != null)
+ {
+ throw session.e;
+ }
+ }
+ finally
+ {
+ local.set(null);
+ }
+ }
+
+ /** Just a place holder for the deployment exception. */
+ private static class Session
+ {
+ private DeploymentException e;
+ }
+
+ /**
+ * 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);
+ }
+}
Property changes on: trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgent.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/JBossTestAgentMBean.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.deployment.MainDeployerMBean;
+import org.jboss.mx.util.ObjectNameFactory;
+import org.jboss.system.ServiceMBean;
+import org.jboss.invocation.Invocation;
+
+import javax.management.ObjectName;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JBossTestAgentMBean extends TestAgent, ServiceMBean
+{
+ ObjectName OBJECT_NAME = ObjectNameFactory.create("portal.test:service=Agent");
+
+ MainDeployerMBean getMainDeployer();
+
+ void setMainDeployer(MainDeployerMBean mainDeployer);
+
+ Object invoke(Invocation invocation) throws Exception;
+}
Added: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgent.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.deployment.DeploymentException;
+import org.jboss.portal.test.framework.TestCaseContext;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface TestAgent
+{
+ /**
+ *
+ */
+ void deploy(URL url) throws DeploymentException;
+
+ /**
+ *
+ */
+ void undeploy(URL url) throws DeploymentException;
+
+ /**
+ *
+ */
+ void setContext(TestCaseContext context);
+
+ /**
+ *
+ */
+ TestCaseContext getContext();
+}
Added: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/agent/TestAgentFactory.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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/TestCaseContext.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContext.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContext.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -1,212 +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;
-
-import org.jboss.portal.test.framework.container.result.Result;
-import org.jboss.portal.test.framework.server.NodeId;
-
-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;
- }
-
- /** Set the current 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;
-
- public TestCaseContext(String testCaseId, int requestCount)
- {
- this.testCaseId = testCaseId;
- this.requestCount = requestCount;
- }
-
- /**
- * 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 = -1;
- 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 = null;
- 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 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 + "]";
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContextAccessor.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContextAccessor.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/TestCaseContextAccessor.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -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;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface TestCaseContextAccessor
-{
- void setContext(TestCaseContext context);
-
- TestCaseContext getContext();
-}
Modified: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -37,19 +37,17 @@
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.log4j.Logger;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.portal.test.framework.container.TestCaseContext;
+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.container.server.TestCaseContextAccessorServiceMBean;
import org.jboss.portal.test.framework.server.Node;
import org.jboss.portal.test.framework.server.NodeId;
-import javax.management.MBeanServer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -71,8 +69,8 @@
/** The test case id. */
protected String testCaseId;
- /** The suite we belong to. */
- protected TestSuite suite;
+ /** The runner we belong to. */
+ protected TestRunner runner;
/** The initial uri. */
protected String uri;
@@ -132,9 +130,9 @@
client.getState().setCredentials(AuthScope.ANY, defaultcreds);
}
- public void setSuite(TestSuite suite)
+ public void setRunner(TestRunner runner)
{
- this.suite = suite;
+ this.runner = runner;
}
/** Override with the test case id. */
@@ -147,7 +145,7 @@
protected final void runTest() throws Throwable
{
log.info("# Starting '" + testCaseId + "' test");
- currentNode = suite.getNodeManager().getNode(initialNodeId);
+ currentNode = runner.getNodeManager().getNode(initialNodeId);
if (currentNode == null)
{
throw new IllegalStateException("No such node " + initialNodeId);
@@ -255,7 +253,8 @@
private ClientCommand evaluateHttpMethodResponse(HttpMethod hm) throws Exception
{
- TestCaseContext ctx = getContextAccessor(currentNode).getContext();
+ TestAgent agent = runner.getTestAgent(currentNode);
+ TestCaseContext ctx = agent.getContext();
Result result = ctx.getResult();
int status = hm.getStatusCode();
switch (status)
@@ -326,10 +325,11 @@
//
HostConfiguration cfg = new HostConfiguration();
cfg.setHost(host, port);
- TestCaseContext ctx = new TestCaseContext(testCaseId, requestCount);
+ TestCaseContext ctx = new TestCaseContext(testCaseId, requestCount, runner.getArchivePath());
log.info("# Updating test case context of : " + currentNode + " : " + ctx);
- getContextAccessor(currentNode).setContext(ctx);
+ TestAgent agent = runner.getTestAgent(currentNode);
+ agent.setContext(ctx);
//
log.info("# Invoking test case over http " + cfg + " " + method.getURI());
@@ -352,7 +352,7 @@
nodeId = NodeId.PORTS_02;
break;
}
- return suite.getNodeManager().getNode(nodeId);
+ return runner.getNodeManager().getNode(nodeId);
}
public int getPort(Node node)
@@ -372,10 +372,4 @@
}
return -1;
}
-
- private TestCaseContextAccessorServiceMBean getContextAccessor(Node node) throws Exception
- {
- MBeanServer server = node.getServer();
- return (TestCaseContextAccessorServiceMBean)MBeanProxy.get(TestCaseContextAccessorServiceMBean.class, TestCaseContextAccessorServiceMBean.OBJECT_NAME, server);
- }
}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCaseContextAccessorProxy.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCaseContextAccessorProxy.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestCaseContextAccessorProxy.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -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.framework.container.client;
-
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.portal.test.framework.container.TestCaseContext;
-import org.jboss.portal.test.framework.container.TestCaseContextAccessor;
-import org.jboss.portal.test.framework.container.server.TestCaseContextAccessorServiceMBean;
-
-import javax.management.MBeanServer;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class TestCaseContextAccessorProxy implements TestCaseContextAccessor
-{
-
- /** The remote server. */
- private MBeanServer server;
-
- /** The remote mbean. */
- private TestCaseContextAccessorServiceMBean mbean;
-
- public MBeanServer getServer()
- {
- return server;
- }
-
- public void setServer(MBeanServer server)
- {
- this.server = server;
- }
-
- public void create()
- {
- }
-
- public void start() throws Exception
- {
- mbean = (TestCaseContextAccessorServiceMBean)MBeanProxy.get(TestCaseContextAccessorServiceMBean.class, TestCaseContextAccessorServiceMBean.OBJECT_NAME, server);
- }
-
- public void stop()
- {
- mbean = null;
- }
-
- public void destroy()
- {
- }
-
- public void setContext(TestCaseContext context)
- {
- mbean.setContext(context);
- }
-
- public TestCaseContext getContext()
- {
- return mbean.getContext();
- }
-}
Added: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestRunner.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,204 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.apache.log4j.Appender;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.SimpleLayout;
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+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.server.NodeManager;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.deployment.Deployer;
+
+import java.net.URL;
+import java.io.File;
+
+import junit.framework.TestSuite;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.Test;
+
+import javax.management.MBeanServer;
+
+/**
+ * @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()
+ {
+ }
+}
Modified: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/client/TestSuite.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,63 +22,34 @@
******************************************************************************/
package org.jboss.portal.test.framework.container.client;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-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.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;
import java.util.ArrayList;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class TestSuite extends junit.framework.TestSuite
+public class TestSuite extends TestRunner
{
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.INFO);
- }
-
/** The test suite id. */
- private String testSuiteId;
+ protected String testSuiteId;
- /** . */
- private TestRuntimeContext runtimeContext;
-
- /** . */
- private URL url;
-
- /** The injected deployer. */
- private Deployer deployer;
-
- /** The injected node manager. */
- private NodeManager nodeManager;
-
- /** The node id list used for this test suite. */
- private NodeId[] nodeIds;
-
public TestSuite(String testSuiteId)
{
- this(testSuiteId, new NodeId[]{NodeId.DEFAULT});
- }
+ super("org/jboss/portal/test/framework/container/jboss-beans.xml");
- public TestSuite(String testSuiteId, String beansDescriptorLocation)
- {
- this(testSuiteId, beansDescriptorLocation, new NodeId[]{NodeId.DEFAULT});
+ //
+ if (testSuiteId == null)
+ {
+ throw new IllegalArgumentException("Was expecting a test suite id");
+ }
+
+ //
+ this.testSuiteId = testSuiteId;
}
public TestSuite(String testSuiteId, NodeId[] nodeIds)
@@ -88,82 +59,22 @@
public TestSuite(String testSuiteId, String beansDescriptorLocation, NodeId[] nodeIds)
{
+ super(beansDescriptorLocation, nodeIds);
+
+ //
if (testSuiteId == null)
{
- throw new IllegalArgumentException("Test suite id must not be null");
+ throw new IllegalArgumentException("Was expecting a test suite id");
}
+ //
this.testSuiteId = testSuiteId;
- this.runtimeContext = new TestRuntimeContext(beansDescriptorLocation);
- this.nodeIds = (NodeId[])nodeIds.clone();
}
- 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;
- }
-
- public void addTest(org.jboss.portal.test.framework.container.client.TestCase test)
- {
- test.setSuite(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();
- TestCase tc = new TestCase()
- {
- protected void runTest() throws Throwable
- {
- if (e.getCause() != null)
- {
- fail("Was not able to deploy war file for " + testSuiteId);
- }
- }
- };
- runTest(tc, testResult);
- }
- finally
- {
- runtimeContext.stop();
- }
- }
-
public void deploy() throws Exception
{
- File root = new File(System.getProperty("test.root"));
+ String archivePath = getArchivePath();
+ File root = new File(archivePath);
File f = new File(root, testSuiteId);
if (!f.exists())
{
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorService.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorService.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorService.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -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.server;
-
-import org.jboss.portal.test.framework.container.TestCaseContext;
-import org.jboss.system.ServiceMBeanSupport;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class TestCaseContextAccessorService extends ServiceMBeanSupport implements TestCaseContextAccessorServiceMBean
-{
-
- public void setContext(TestCaseContext context)
- {
- TestCaseContext.setCurrentContext(context);
- }
-
- public TestCaseContext getContext()
- {
- return TestCaseContext.getCurrentContext();
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorServiceMBean.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorServiceMBean.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/container/server/TestCaseContextAccessorServiceMBean.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -1,37 +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.server;
-
-import org.jboss.mx.util.ObjectNameFactory;
-import org.jboss.portal.test.framework.container.TestCaseContextAccessor;
-
-import javax.management.ObjectName;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface TestCaseContextAccessorServiceMBean extends TestCaseContextAccessor
-{
- ObjectName OBJECT_NAME = ObjectNameFactory.create("portal.test:service=TestCaseContextAccessor");
-}
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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -23,6 +23,7 @@
package org.jboss.portal.test.framework.deployment;
import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.agent.TestAgentFactory;
import java.io.File;
import java.net.MalformedURLException;
@@ -35,6 +36,8 @@
import java.util.Map;
/**
+ * Client side view of deployment.
+ *
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
@@ -44,6 +47,19 @@
/** . */
private Map deployments;
+ /** . */
+ private TestAgentFactory testAgentFactory;
+
+ public TestAgentFactory getTestAgentFactory()
+ {
+ return testAgentFactory;
+ }
+
+ public void setTestAgentFactory(TestAgentFactory testAgentFactory)
+ {
+ this.testAgentFactory = testAgentFactory;
+ }
+
public void create()
{
}
@@ -83,7 +99,7 @@
public void deploy(URL url, Collection nodes) throws Exception
{
Deployment deployment = new Deployment(nodes, url);
- deployment.deploy();
+ deployment.deploy(testAgentFactory);
deployments.put(url, deployment);
}
@@ -92,7 +108,7 @@
Deployment deployment = (Deployment)deployments.remove(url);
if (deployment != null)
{
- deployment.undeploy();
+ deployment.undeploy(testAgentFactory);
}
}
@@ -126,26 +142,26 @@
}
catch (MalformedURLException ignore)
{
- // archive parameter was not a URL, try to build one from "standard" locations, by considering it as a file name
- String locs[] = {archive, "output/libs/" + archive, "test/outputs/libs/" + archive, "output/lib/" + archive,
- "test/output/lib/" + archive, "../output/lib/" + archive, "../test/output/lib/" + archive,
- "../output/lib/tests/" + archive};
-
- for (int i = 0; i < locs.length && url == null; i++)
- {
- File file = new File(locs[i]);
- if (file.exists())
- {
- try
- {
- url = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // shouldn't happen
- }
- }
- }
+// // archive parameter was not a URL, try to build one from "standard" locations, by considering it as a file name
+// String locs[] = {archive, "output/libs/" + archive, "test/outputs/libs/" + archive, "output/lib/" + archive,
+// "test/output/lib/" + archive, "../output/lib/" + archive, "../test/output/lib/" + archive,
+// "../output/lib/tests/" + archive};
+//
+// for (int i = 0; i < locs.length && url == null; i++)
+// {
+// File file = new File(locs[i]);
+// if (file.exists())
+// {
+// try
+// {
+// url = file.toURL();
+// }
+// catch (MalformedURLException e)
+// {
+// // shouldn't happen
+// }
+// }
+// }
}
// if we still don't have a URL at this point, we won't find one: declare failure!
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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployment.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -26,13 +26,9 @@
import org.apache.log4j.Logger;
import org.jboss.deployment.DeploymentException;
import org.jboss.portal.test.framework.server.Node;
+import org.jboss.portal.test.framework.agent.TestAgent;
+import org.jboss.portal.test.framework.agent.TestAgentFactory;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
@@ -44,12 +40,12 @@
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class Deployment
+class Deployment
{
private static final Logger log = Logger.getLogger(Deployment.class);
- /** The rmi adaptor to JBoss. */
+ /** The nodes we must deploy to. */
private final Collection nodes;
/** The local url of the deployment to make. */
@@ -82,7 +78,7 @@
* @throws IllegalArgumentException if the application name does not give a valid deployment
* @throws java.io.IOException
*/
- public void deploy() throws DeploymentException, IllegalArgumentException, IllegalStateException, IOException
+ void deploy(TestAgentFactory testAgentFactory) throws DeploymentException, IllegalArgumentException, IllegalStateException, IOException
{
if (deployed)
{
@@ -95,20 +91,15 @@
for (Iterator i = nodes.iterator(); i.hasNext();)
{
Node node = (Node)i.next();
- MBeanServer server = node.getServer();
- server.invoke(
- new ObjectName("portal:service=MainDeployerFacade"),
- "deploy",
- new Object[]{url},
- new String[]{URL.class.getName()});
+ TestAgent agent = testAgentFactory.getTestAgent(node);
+ agent.deploy(url);
}
}
- catch (MBeanException e)
+ catch (Exception e)
{
- Exception te = e.getTargetException();
- if (te instanceof DeploymentException)
+ if (e instanceof DeploymentException)
{
- throw(DeploymentException)te;
+ throw(DeploymentException)e;
}
else
{
@@ -117,31 +108,13 @@
throw error;
}
}
- catch (ReflectionException e)
- {
- AssertionFailedError error = new AssertionFailedError();
- error.initCause(e);
- throw error;
- }
- catch (InstanceNotFoundException e)
- {
- AssertionFailedError error = new AssertionFailedError();
- error.initCause(e);
- throw error;
- }
- catch (MalformedObjectNameException e)
- {
- AssertionFailedError error = new AssertionFailedError();
- error.initCause(e);
- throw error;
- }
//
deployed = true;
}
/** Undeploy a portlet application. This method blocks until the undeployment is finished. */
- public void undeploy()
+ void undeploy(TestAgentFactory testAgentFactory)
{
URL url = this.url;
this.url = null;
@@ -152,12 +125,8 @@
try
{
Node node = (Node)i.next();
- MBeanServer server = node.getServer();
- server.invoke(
- new ObjectName("portal:service=MainDeployerFacade"),
- "undeploy",
- new Object[]{url},
- new String[]{URL.class.getName()});
+ TestAgent agent = testAgentFactory.getTestAgent(node);
+ agent.undeploy(url);
}
catch (Exception e)
{
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacade.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacade.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacade.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -1,115 +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.deployment;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.system.ServiceMBeanSupport;
-
-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$
- */
-public class MainDeployerFacade extends ServiceMBeanSupport implements MainDeployerFacadeMBean
-{
-
- /** Keep a thread local of sessions. */
- private static final ThreadLocal local = new ThreadLocal();
-
- public static void log(DeploymentException e)
- {
- // Record the exception only if we have a session otherwise we may leek the exception in the thread local
- Session session = (Session)MainDeployerFacade.local.get();
- if (session != null && session.e == null)
- {
- session.e = e;
- }
- }
-
- /** The main deployer delegate. */
- private MainDeployerMBean mainDeployer;
-
- public MainDeployerMBean getMainDeployer()
- {
- return mainDeployer;
- }
-
- public void setMainDeployer(MainDeployerMBean mainDeployer)
- {
- this.mainDeployer = mainDeployer;
- }
-
- public void deploy(URL url) throws DeploymentException
- {
- perform(url, true);
- }
-
- public void undeploy(URL url) throws DeploymentException
- {
- perform(url, false);
- }
-
- private void perform(URL url, boolean deploy) throws DeploymentException
- {
- try
- {
- Session session = new Session();
- MainDeployerFacade.local.set(session);
-
- // The main deployer could throw an exception but that will be an exception not related to jboss portal
- if (deploy)
- {
- mainDeployer.deploy(url);
- }
- else
- {
- mainDeployer.undeploy(url);
- }
-
- // If e is not null that means an exception was thrown into jboss portal layer and we rethrow it
- // to the client
- if (session.e != null)
- {
- throw session.e;
- }
- }
- finally
- {
- MainDeployerFacade.local.set(null);
- }
- }
-
- /** Just a place holder for the deployment exception. */
- private static class Session
- {
- private DeploymentException e;
- }
-}
Deleted: trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacadeMBean.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacadeMBean.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/main/org/jboss/portal/test/framework/deployment/MainDeployerFacadeMBean.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -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.framework.deployment;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.MainDeployerMBean;
-
-import java.net.URL;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface MainDeployerFacadeMBean
-{
- MainDeployerMBean getMainDeployer();
-
- void setMainDeployer(MainDeployerMBean mainDeployer);
-
- void deploy(URL url) throws DeploymentException;
-
- void undeploy(URL url) throws DeploymentException;
-}
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-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -108,10 +108,14 @@
</constructor>
</bean>
+ <bean name="TestAgentFactory" class="org.jboss.portal.test.framework.agent.TestAgentFactory">
+ </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>
</bean>
<bean name="TestBean" class="org.jboss.portal.test.framework.container.client.TestSuite">
@@ -121,5 +125,6 @@
</constructor>
<property name="deployer"><inject bean="Deployer"/></property>
<property name="nodeManager"><inject bean="NodeManager"/></property>
+ <property name="testAgentFactory"><inject bean="TestAgentFactory"/></property>
</bean>
</deployment>
Modified: trunk/test/src/resources/portal-test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/test/src/resources/portal-test-sar/META-INF/jboss-service.xml 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/test/src/resources/portal-test-sar/META-INF/jboss-service.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,16 +22,20 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<server>
- <!-- Only used by the remote tests -->
+
+ <!-- The test agent. -->
<mbean
- code="org.jboss.portal.test.framework.deployment.MainDeployerFacade"
- name="portal:service=MainDeployerFacade">
+ 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>
</mbean>
- <!-- -->
<mbean
- code="org.jboss.portal.test.framework.container.server.TestCaseContextAccessorService"
- name="portal.test:service=TestCaseContextAccessor">
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=Agent">
+ <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>
</mbean>
<!-- OpenDS service (LDAP) -->
Modified: trunk/tools/lib/explode.jar
===================================================================
(Binary files differ)
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/build.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -349,7 +349,16 @@
</jar>
</target>
- <target name="package-consumer-test" description="Generates the consumer test artifacts" depends="compile">
+
+ <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">
<jar jarfile="${build.lib.test}/test-wsrp-consumer-client.jar">
<fileset dir="${build.resources.test}/test-wsrp-consumer-client"/>
</jar>
@@ -376,21 +385,24 @@
<!--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="${build.lib.test}" includes="test-wsrp-consumer.jar"/>
- <fileset dir="${build.lib.test}" includes="test-wsrp-consumer-client.jar"/>
- <fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-server.root}/lib" includes="portal-server.sar"/>
</copy>
<mkdir dir="${build.resources.test}/test-wsrp-consumer-sar/lib"/>
<copy todir="${build.resources.test}/test-wsrp-consumer-sar/lib" overwrite="true">
+ <fileset dir="${junit.junit.lib}" includes="junit.jar"/>
+ <fileset dir="${build.lib.test}" includes="test-wsrp-consumer.jar"/>
+ <fileset dir="${build.lib.test}" includes="test-wsrp-consumer-client.jar"/>
+ <fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
<fileset dir="${build.lib.test}" includes="test-wsrp-consumer-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-portlet.root}/lib"
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"/>
</copy>
<jar jarfile="${build.lib.test}/test-wsrp-consumer.sar">
@@ -400,7 +412,7 @@
<!-- Producer tests -->
<target name="package-producer-test" description="Generate the producer test artifacts"
- depends="package-test-portlets">
+ depends="package-test-portlets,package-test-runner">
<jar jarfile="${build.lib.test}/test-wsrp-producer-client.jar">
<fileset dir="${build.resources.test}/test-wsrp-producer-client"/>
</jar>
@@ -426,20 +438,24 @@
</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="${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.root}/lib" includes="portal-server.sar"/>
</copy>
<mkdir dir="${build.resources.test}/test-wsrp-producer-sar/lib"/>
<copy todir="${build.resources.test}/test-wsrp-producer-sar/lib" overwrite="true">
+ <fileset dir="${build.lib}" includes="portal-wsrp-lib.jar"/>
<fileset dir="${build.lib.test}" includes="test-wsrp-producer-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-portlet.root}/lib" includes="portal-portlet-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="${junit.junit.lib}" includes="junit.jar"/>
+ <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"/>
</copy>
<jar jarfile="${build.lib.test}/test-wsrp-producer.sar">
@@ -513,9 +529,11 @@
<target name="producer-test" depends="deploy-producer-test">
<execute-tests>
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.PortletManagementTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.MarkupTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.ServiceDescriptionTestCase"/>
+ <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.PortletManagementTestCase"/>-->
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.MarkupTestCase"/>-->
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.ServiceDescriptionTestCase"/>-->
+
<!--<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.producer.RegistrationTestCase"/>-->
</x-test>
<x-sysproperty>
@@ -523,7 +541,7 @@
<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}"/>
+ <sysproperty key="test.root" value="${build.lib}/tests"/>
</x-sysproperty>
<x-classpath>
<fileset dir="${build.lib.test}" includes="test-wsrp-producer.jar, test-wsrp-producer-lib.jar"/>
@@ -531,6 +549,7 @@
<path refid="library.classpath"/>
<path refid="dependentmodule.classpath"/>
<path refid="ws.classpath"/>
+ <path refid="apache.codec.classpath"/>
</x-classpath>
</execute-tests>
<antcall target="undeploy-producer-test"/>
@@ -540,15 +559,16 @@
<target name="consumer-test" depends="deploy-consumer-test">
<execute-tests>
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.consumer.MarkupTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.consumer.ServiceDescriptionTestCase"/>
+ <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.MarkupTestCase"/>-->
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.v1.consumer.ServiceDescriptionTestCase"/>-->
</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}"/>
+ <sysproperty key="test.root" value="${build.lib}/tests"/>
</x-sysproperty>
<x-classpath>
<fileset dir="${build.lib.test}" includes="test-wsrp-consumer.jar, test-wsrp-consumer-lib.jar"/>
@@ -556,6 +576,7 @@
<path refid="library.classpath"/>
<path refid="dependentmodule.classpath"/>
<path refid="ws.classpath"/>
+ <path refid="apache.codec.classpath"/>
</x-classpath>
</execute-tests>
<antcall target="undeploy-consumer-test"/>
@@ -572,7 +593,7 @@
<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}"/>
+ <sysproperty key="test.root" value="${build.lib}/tests"/>
</x-sysproperty>
<x-classpath>
<fileset dir="${build.lib}" includes="portal-wsrp-lib.jar"/>
@@ -594,7 +615,7 @@
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.handler.RequestHeaderClientHandlerTestCase"/>
</x-test>
<x-sysproperty>
- <sysproperty key="test.root" value="${build.lib}"/>
+ <sysproperty key="test.root" value="${build.lib}/tests"/>
</x-sysproperty>
<x-classpath>
<fileset dir="${build.lib}" includes="portal-wsrp-lib.jar"/>
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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -31,11 +31,7 @@
import junit.framework.TestCase;
import org.jboss.logging.Logger;
-import org.jboss.portal.test.framework.TestRuntimeContext;
-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 org.jboss.portal.test.framework.TestCaseContext;
import java.util.Arrays;
import java.util.List;
@@ -50,27 +46,21 @@
*/
public abstract class WSRPBaseTest extends TestCase
{
+
Logger log = Logger.getLogger(WSRPBaseTest.class);
- protected TestRuntimeContext runtimeContext;
- protected Deployer deployer;
- protected boolean initialized = false;
- protected NodeManager nodeManager;
- protected NodeId nodeId;
-
- protected WSRPBaseTest() throws Exception
+ /**
+ * Make it accessible from outter packages.
+ */
+ public void setUp() throws Exception
{
- this("WSRPBaseTest");
+ super.setUp();
}
protected WSRPBaseTest(String name) throws Exception
{
super(name);
log("Instantiated test named '" + name + "'");
- nodeId = NodeId.DEFAULT;
- runtimeContext = new TestRuntimeContext("org/jboss/portal/test/wsrp/jboss-beans.xml");
- runtimeContext.addBean("TestBean", this);
- runtimeContext.start();
}
protected void log(String message)
@@ -78,34 +68,6 @@
log.debug(getClass().getName() + ": " + message);
}
- public Deployer getDeployer()
- {
- return deployer;
- }
-
- public void setDeployer(Deployer deployer)
- {
- this.deployer = deployer;
- }
-
- protected void deploy(String archiveName) throws Exception
- {
- log("Deploying archive '" + archiveName + "'");
- Node node = nodeManager.getNode(nodeId);
- deployer.deploy(archiveName, node);
- }
-
- protected void undeploy(String archiveName) throws Exception
- {
- log("Undeploying archive '" + archiveName + "'");
- deployer.undeploy(archiveName);
- }
-
- protected void tearDown() throws Exception
- {
- runtimeContext.stop();
- }
-
public static void assertEquals(Object[] expected, Object[] tested, boolean isOrderRelevant, String failMessage)
{
if (isOrderRelevant)
@@ -212,13 +174,15 @@
assertTrue("<" + string1 + "> does not contain <" + string2 + ">", string1.indexOf(string2) >= 0);
}
- public NodeManager getNodeManager()
+ protected void deploy(String archiveId) throws Exception
{
- return nodeManager;
+ TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ ctx.deploy(archiveId);
}
- public void setNodeManager(NodeManager nodeManager)
+ protected void undeploy(String archiveId) throws Exception
{
- this.nodeManager = nodeManager;
+ TestCaseContext ctx = TestCaseContext.getCurrentContext();
+ ctx.undeploy(archiveId);
}
}
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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.wsrp;
-import org.jboss.portal.test.framework.ServiceLookup;
import org.jboss.portal.test.wsrp.framework.TestWSRPProducer;
import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.WSRPProducer;
/**
* @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -32,10 +32,15 @@
*/
public abstract class WSRPConsumerBaseTest extends WSRPBaseTest
{
- protected ServiceLookup producerProxy;
+
+ /** . */
+ private static final String TEST_PRODUCER_ID = "test_producer";
+
+ /** . */
protected TestWSRPProducer producer;
+
+ /** . */
protected WSRPConsumer consumer;
- private static final String TEST_PRODUCER_ID = "test_producer";
protected WSRPConsumerBaseTest() throws Exception
{
@@ -45,33 +50,21 @@
protected WSRPConsumerBaseTest(String name) throws Exception
{
super(name);
-
- if (producer == null && getProducerProxy() != null)
- {
- producer = (TestWSRPProducer)getProducerProxy().getService();
- }
-
- consumer.setProducerId(TEST_PRODUCER_ID);
}
- public ServiceLookup getProducerProxy()
+ public void setUp() throws Exception
{
- return producerProxy;
+ consumer.setProducerId(TEST_PRODUCER_ID);
}
- public void setProducerProxy(ServiceLookup producerProxy)
+ public WSRPProducer getProducer()
{
- this.producerProxy = producerProxy;
- }
-
- public TestWSRPProducer getProducer()
- {
return producer;
}
- public void setProducer(TestWSRPProducer producer)
+ public void setProducer(WSRPProducer producer)
{
- this.producer = producer;
+ this.producer = (TestWSRPProducer)producer;
}
public WSRPConsumer getConsumer()
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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPProducerBaseTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -24,6 +24,7 @@
import org.jboss.portal.test.framework.ServiceLookup;
import org.jboss.portal.wsrp.WSRPProducer;
+import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.services.ServiceFactory;
/**
@@ -33,8 +34,10 @@
public abstract class WSRPProducerBaseTest extends WSRPBaseTest
{
- protected ServiceLookup producerProxy;
+ /** . */
protected WSRPProducer producer;
+
+ /** . */
protected ServiceFactory serviceFactory;
protected WSRPProducerBaseTest() throws Exception
@@ -45,17 +48,16 @@
protected WSRPProducerBaseTest(String name) throws Exception
{
super(name);
- producer = (WSRPProducer)getProducerProxy().getService();
}
- public ServiceLookup getProducerProxy()
+ public void setProducer(WSRPProducer producer)
{
- return producerProxy;
+ this.producer = producer;
}
- public void setProducerProxy(ServiceLookup producerProxy)
+ public WSRPProducer getProducer()
{
- this.producerProxy = producerProxy;
+ return producer;
}
public ServiceFactory getServiceFactory()
@@ -67,5 +69,4 @@
{
this.serviceFactory = serviceFactory;
}
-
}
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunner.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunner.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunner.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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");
+ }
+}
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunnerServlet.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunnerServlet.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPTestRunnerServlet.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,96 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.TestCaseContext;
+import org.jboss.portal.test.framework.container.result.EndTestResult;
+import org.jboss.portal.test.framework.container.result.AssertResult;
+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 org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanServerLocator;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import javax.management.ObjectName;
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * @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
+ {
+ 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);
+ WSRPBaseTest o = (WSRPBaseTest)testCaseClass.newInstance();
+
+ //
+ if (o instanceof WSRPConsumerBaseTest)
+ {
+ WSRPConsumerBaseTest p = (WSRPConsumerBaseTest)o;
+ 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)o;
+ 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);
+ }
+
+ //
+ o.setUp();
+
+ //
+ Method m = testCaseClass.getMethod(methodName, new Class[0]);
+ m.invoke(o, new Object[0]);
+ TestCaseContext.setCurrentResult(new EndTestResult());
+ }
+ catch (AssertionFailedError e)
+ {
+ TestCaseContext.setCurrentResult(new AssertResult(e));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Added: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestRunner.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,77 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.wsrp.WSRPTestRunner;
+import org.jboss.portal.test.framework.container.client.TestCase;
+import org.jboss.portal.common.junit.TestBuilder;
+import junit.framework.TestSuite;
+
+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 Blah(ServiceDescriptionTestCase.class));
+ TestBuilder.introspect(runner, MarkupTestCase.class, new Blah(MarkupTestCase.class));
+ return runner;
+ }
+ catch (NoSuchMethodException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ private static class Blah implements TestBuilder.TestCaseFactory
+ {
+ private Class clazz;
+ public Blah(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/NeedPortletHandleTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -29,6 +29,7 @@
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PortletDescription;
import org.jboss.portal.wsrp.core.ServiceDescription;
+import org.jboss.portal.common.NotYetImplemented;
import java.rmi.RemoteException;
import java.util.HashMap;
@@ -140,7 +141,7 @@
// printMappings("undeploy");
}
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
deploy(portletWARFileName);
Added: 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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestRunner.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,79 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.test.wsrp.WSRPTestRunner;
+import org.jboss.portal.test.framework.container.client.TestCase;
+import org.jboss.portal.common.junit.TestBuilder;
+
+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.Blah(ServiceDescriptionTestCase.class));
+ TestBuilder.introspect(runner, MarkupTestCase.class, new ProducerTestRunner.Blah(MarkupTestCase.class));
+// TestBuilder.introspect(runner, RegistrationTestCase.class, new ProducerTestRunner.Blah(RegistrationTestCase.class));
+ TestBuilder.introspect(runner, PortletManagementTestCase.class, new ProducerTestRunner.Blah(PortletManagementTestCase.class));
+ return runner;
+ }
+ catch (NoSuchMethodException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ private static class Blah implements TestBuilder.TestCaseFactory
+ {
+ private Class clazz;
+ public Blah(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/ServiceDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -31,6 +31,7 @@
import org.jboss.portal.wsrp.core.GetServiceDescription;
import org.jboss.portal.wsrp.core.ServiceDescription;
+import org.jboss.portal.common.NotYetImplemented;
/**
* Tests WSRP Service Description
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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2006-10-23 14:45:45 UTC (rev 5493)
@@ -64,6 +64,14 @@
throws Exception
{
super(name);
+ }
+
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ //
serviceDescriptionService = (WSRP_v1_ServiceDescription_PortType)serviceFactory.getService(WSRP_v1_ServiceDescription_PortType.class);
markupService = (WSRP_v1_Markup_PortType)serviceFactory.getService(WSRP_v1_Markup_PortType.class);
registrationService = (WSRP_v1_Registration_PortType)serviceFactory.getService(WSRP_v1_Registration_PortType.class);
Modified: trunk/wsrp/src/resources/tests/test-wsrp-consumer-jar/org/jboss/portal/test/wsrp/jboss-beans.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-consumer-jar/org/jboss/portal/test/wsrp/jboss-beans.xml 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/resources/tests/test-wsrp-consumer-jar/org/jboss/portal/test/wsrp/jboss-beans.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -27,7 +27,7 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
- <bean name="MBeanServerFactory" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <bean name="MBeanServerFactory0" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
<property name="env">
<map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
@@ -46,30 +46,7 @@
</property>
</bean>
- <bean name="Node" class="org.jboss.portal.test.framework.server.Node">
- <constructor>
- <parameter><value>default</value></parameter>
- <parameter><inject bean="MBeanServerFactory" property="server"/></parameter>
- <parameter><inject bean="NodeManager"/></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">
- </bean>
-
- <bean name="WSRPProducer" class="org.jboss.portal.test.framework.JBossServiceLookup">
- <constructor>
- <parameter><inject bean="Node"/></parameter>
- <parameter>portal.wsrp:service=WSRPProducer</parameter>
- <parameter>org.jboss.portal.test.wsrp.framework.TestWSRPProducer</parameter>
- </constructor>
- </bean>
-
- <!-- Service factory using the RMI invoker to test bypassing the WS stack -->
- <bean name="RMIServiceFactory" class="org.jboss.portal.wsrp.services.RMIInvokerServiceFactory">
+ <bean name="MBeanServerFactory1" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
<property name="env">
<map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
@@ -78,24 +55,17 @@
</entry>
<entry>
<key>java.naming.provider.url</key>
- <value>jnp://localhost:1099</value>
+ <value>jnp://localhost:1199</value>
</entry>
<entry>
<key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming.client</value>
+ <value>org.jboss.naming</value>
</entry>
- <entry>
- <key>j2ee.clientName</key>
- <value>wsrp-client</value>
- </entry>
</map>
</property>
</bean>
- <!-- Service factory using the SOAP invoker to test using the WS stack -->
- <bean name="SOAPServiceFactory" class="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory">
- <!-- endpoint URL is optional and allows to configure where the producer endpoints are -->
- <property name="endpointURL">http://localhost:8080/test-wsrp-consumer/</property>
+ <bean name="MBeanServerFactory2" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
<property name="env">
<map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
@@ -104,68 +74,57 @@
</entry>
<entry>
<key>java.naming.provider.url</key>
- <value>jnp://localhost:1099</value>
+ <value>jnp://localhost:1299</value>
</entry>
<entry>
<key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming.client</value>
+ <value>org.jboss.naming</value>
</entry>
- <entry>
- <key>j2ee.clientName</key>
- <value>wsrp-client</value>
- </entry>
</map>
</property>
- <property name="portJNDIMapping">
- <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</key>
- <value>java:comp/env/service/ServiceDescriptionService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</key>
- <value>java:comp/env/service/MarkupService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</key>
- <value>java:comp/env/service/RegistrationService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</key>
- <value>java:comp/env/service/PortletManagementService</value>
- </entry>
- </map>
- </property>
</bean>
- <!-- Service factory that gets its service end points from a WSDL definition -->
- <!--
- <bean name="RemoteSOAPServiceFactory" class="org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory">
- <property name="wsdlDefinitionURL">http://localhost:8080/portal-wsrp/WSRPService?wsdl</property>
+ <bean name="Node0" class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>default</value></parameter>
+ <parameter><inject bean="MBeanServerFactory0" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
+ </constructor>
</bean>
- -->
- <bean name="CachingServiceFactory" class="org.jboss.portal.wsrp.services.CachingServiceFactory">
- <property name="delegate"><inject bean="SOAPServiceFactory"/></property>
+ <bean name="Node1" class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-01</value></parameter>
+ <parameter><inject bean="MBeanServerFactory1" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
+ </constructor>
</bean>
- <!--
- Change the bean name for the serviceFactory property to the appropriate value to use either RMI or SOAP invoker for
- testing purposes.
- -->
- <bean name="WSRPConsumer" class="org.jboss.portal.wsrp.consumer.WSRPConsumerImpl">
- <property name="serviceFactory"><inject bean="CachingServiceFactory"/></property>
+ <bean name="Node2" class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-02</value></parameter>
+ <parameter><inject bean="MBeanServerFactory2" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
+ </constructor>
</bean>
- <bean name="TestBean" class="org.jboss.portal.test.wsrp.WSRPConsumerBaseTest">
+ <bean name="TestAgentFactory" class="org.jboss.portal.test.framework.agent.TestAgentFactory">
+ </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>
+ </bean>
+
+ <bean name="TestBean" class="org.jboss.portal.test.framework.container.client.TestSuite">
<constructor factoryMethod="getBean">
<factory bean="BeanFactory"/>
<parameter>TestBean</parameter>
</constructor>
- <property name="nodeManager"><inject bean="NodeManager"/></property>
<property name="deployer"><inject bean="Deployer"/></property>
- <property name="producerProxy"><inject bean="WSRPProducer"/></property>
- <property name="consumer"><inject bean="WSRPConsumer"/></property>
+ <property name="nodeManager"><inject bean="NodeManager"/></property>
+ <property name="testAgentFactory"><inject bean="TestAgentFactory"/></property>
</bean>
-
</deployment>
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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -24,6 +24,23 @@
<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>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=Agent">
+ <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>
+ </mbean>
+-->
+
<!-- Dummy test WSRP Producer implementation -->
<mbean
code="org.jboss.portal.test.wsrp.framework.TestWSRPProducerImpl"
@@ -33,7 +50,6 @@
<xmbean/>
</mbean>
-
<!-- Hack to get access to req/resp -->
<mbean
code="org.jboss.portal.wsrp.servlet.ServletAccessService"
@@ -43,37 +59,42 @@
<xmbean/>
</mbean>
- <!-- Invokers -->
+ <!-- -->
<mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=ServiceDescriptionService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/ServiceDescriptionService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</attribute>
+ code="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory"
+ name="portal.wsrp:service=ServiceFactory"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="EndpointURL">http://localhost:8080/test-wsrp-consumer</attribute>
+ <attribute name="Env">
+ java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+ java.naming.provider.url=jnp://localhost:1099
+ java.naming.factory.url.pkgs=org.jboss.naming.client
+ j2ee.clientName=wsrp-client
+ </attribute>
+ <attribute name="PortJNDIMapping">
+ org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType=java:comp/env/service/ServiceDescriptionService
+ org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType=java:comp/env/service/MarkupService
+ org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType=java:comp/env/service/RegistrationService
+ org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType=java:comp/env/service/PortletManagementService
+ </attribute>
</mbean>
<mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=MarkupService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/MarkupService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</attribute>
+ code="org.jboss.portal.wsrp.services.CachingServiceFactory"
+ name="portal.wsrp:service=CachingServiceFactory"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Delegate" proxy-type="attribute">portal.wsrp:service=ServiceFactory</depends>
</mbean>
<mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=RegistrationService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/RegistrationService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType</attribute>
+ code="org.jboss.portal.wsrp.consumer.WSRPConsumerImpl"
+ name="portal.wsrp:service=WSRPConsumer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="ServiceFactory" proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
</mbean>
- <mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=PortletManagementService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/PortletManagementService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType</attribute>
- </mbean>
+
</server>
Modified: trunk/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/web.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/web.xml 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/resources/tests/test-wsrp-consumer-war/WEB-INF/web.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -53,6 +53,7 @@
<param-value>org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</param-value>
</init-param>
</servlet>
+
<servlet-mapping>
<servlet-name>ServiceDescriptionService</servlet-name>
<url-pattern>/ServiceDescriptionService</url-pattern>
Modified: trunk/wsrp/src/resources/tests/test-wsrp-producer-jar/org/jboss/portal/test/wsrp/jboss-beans.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-jar/org/jboss/portal/test/wsrp/jboss-beans.xml 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-jar/org/jboss/portal/test/wsrp/jboss-beans.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -27,7 +27,7 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
- <bean name="MBeanServerFactory" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
+ <bean name="MBeanServerFactory0" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
<property name="env">
<map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
@@ -46,30 +46,7 @@
</property>
</bean>
- <bean name="Node" class="org.jboss.portal.test.framework.server.Node">
- <constructor>
- <parameter><value>default</value></parameter>
- <parameter><inject bean="MBeanServerFactory" property="server"/></parameter>
- <parameter><inject bean="NodeManager"/></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">
- </bean>
-
- <bean name="WSRPProducer" class="org.jboss.portal.test.framework.JBossServiceLookup">
- <constructor>
- <parameter><inject bean="Node"/></parameter>
- <parameter>portal.wsrp:service=WSRPProducer</parameter>
- <parameter>org.jboss.portal.wsrp.WSRPProducer</parameter>
- </constructor>
- </bean>
-
- <!-- Service factory using the RMI invoker to test bypassing the WS stack -->
- <bean name="RMIServiceFactory" class="org.jboss.portal.wsrp.services.RMIInvokerServiceFactory">
+ <bean name="MBeanServerFactory1" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
<property name="env">
<map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
@@ -78,23 +55,17 @@
</entry>
<entry>
<key>java.naming.provider.url</key>
- <value>jnp://localhost:1099</value>
+ <value>jnp://localhost:1199</value>
</entry>
<entry>
<key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming.client</value>
+ <value>org.jboss.naming</value>
</entry>
- <entry>
- <key>j2ee.clientName</key>
- <value>wsrp-client</value>
- </entry>
</map>
</property>
</bean>
- <!-- Service factory using the SOAP invoker to test using the WS stack -->
- <bean name="SOAPServiceFactory" class="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory">
- <property name="endpointURL">http://localhost:8080/test-wsrp-producer/</property>
+ <bean name="MBeanServerFactory2" class="org.jboss.portal.test.framework.jmx.MBeanServerFactory">
<property name="env">
<map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
@@ -103,100 +74,57 @@
</entry>
<entry>
<key>java.naming.provider.url</key>
- <value>jnp://localhost:1099</value>
+ <value>jnp://localhost:1299</value>
</entry>
<entry>
<key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming.client</value>
+ <value>org.jboss.naming</value>
</entry>
- <entry>
- <key>j2ee.clientName</key>
- <value>wsrp-client</value>
- </entry>
</map>
</property>
- <property name="portJNDIMapping">
- <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</key>
- <value>java:comp/env/service/ServiceDescriptionService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</key>
- <value>java:comp/env/service/MarkupService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType</key>
- <value>java:comp/env/service/RegistrationService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType</key>
- <value>java:comp/env/service/PortletManagementService</value>
- </entry>
- </map>
- </property>
</bean>
- <!--<bean name="RemoteSOAPServiceFactory" class="org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory">
- <property name="wsdlDefinitionURL">http://wsrp.bea.com:7001/producer/producer?WSDL</property>
- <property name="env">
- <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.client</value>
- </entry>
- <entry>
- <key>j2ee.clientName</key>
- <value>wsrp-client</value>
- </entry>
- </map>
- </property>
- <property name="portJNDIMapping">
- <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</key>
- <value>java:comp/env/service/ServiceDescriptionService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</key>
- <value>java:comp/env/service/MarkupService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType</key>
- <value>java:comp/env/service/RegistrationService</value>
- </entry>
- <entry>
- <key>org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType</key>
- <value>java:comp/env/service/PortletManagementService</value>
- </entry>
- </map>
- </property>
- </bean>-->
+ <bean name="Node0" class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>default</value></parameter>
+ <parameter><inject bean="MBeanServerFactory0" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
+ </constructor>
+ </bean>
- <bean name="CachingServiceFactory" class="org.jboss.portal.wsrp.services.CachingServiceFactory">
- <property name="delegate"><inject bean="SOAPServiceFactory"/></property>
+ <bean name="Node1" class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-01</value></parameter>
+ <parameter><inject bean="MBeanServerFactory1" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
+ </constructor>
</bean>
- <!--
- Change the bean name for the serviceFactory property to the appropriate value to use either RMI or SOAP invoker for
- testing purposes.
- -->
- <bean name="TestBean" class="org.jboss.portal.test.wsrp.WSRPProducerBaseTest">
+ <bean name="Node2" class="org.jboss.portal.test.framework.server.Node">
+ <constructor>
+ <parameter><value>ports-02</value></parameter>
+ <parameter><inject bean="MBeanServerFactory2" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TestAgentFactory" class="org.jboss.portal.test.framework.agent.TestAgentFactory">
+ </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>
+ </bean>
+
+ <bean name="TestBean" class="org.jboss.portal.test.framework.container.client.TestSuite">
<constructor factoryMethod="getBean">
<factory bean="BeanFactory"/>
<parameter>TestBean</parameter>
</constructor>
- <property name="nodeManager"><inject bean="NodeManager"/></property>
<property name="deployer"><inject bean="Deployer"/></property>
- <property name="producerProxy"><inject bean="WSRPProducer"/></property>
- <property name="serviceFactory"><inject bean="CachingServiceFactory"/></property>
+ <property name="nodeManager"><inject bean="NodeManager"/></property>
+ <property name="testAgentFactory"><inject bean="TestAgentFactory"/></property>
</bean>
</deployment>
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-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -24,6 +24,23 @@
<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>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=Agent">
+ <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>
+ </mbean>
+-->
+
<!-- Webapp registry -->
<mbean
code="org.jboss.portal.portlet.container.PortletApplicationRegistryImpl"
@@ -157,7 +174,6 @@
<attribute name="RemotableByDefault">true</attribute>
</mbean>
-
<!-- Hack to get access to req/resp -->
<mbean
code="org.jboss.portal.wsrp.servlet.ServletAccessService"
@@ -167,37 +183,33 @@
<xmbean/>
</mbean>
- <!-- Invokers -->
+ <!-- -->
<mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=ServiceDescriptionService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/ServiceDescriptionService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</attribute>
+ code="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory"
+ name="portal.wsrp:service=ServiceFactory"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="EndpointURL">http://localhost:8080/test-wsrp-producer</attribute>
+ <attribute name="Env">
+ java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+ java.naming.provider.url=jnp://localhost:1099
+ java.naming.factory.url.pkgs=org.jboss.naming.client
+ j2ee.clientName=wsrp-client
+ </attribute>
+ <attribute name="PortJNDIMapping">
+ org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType=java:comp/env/service/ServiceDescriptionService
+ org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType=java:comp/env/service/MarkupService
+ org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType=java:comp/env/service/RegistrationService
+ org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType=java:comp/env/service/PortletManagementService
+ </attribute>
</mbean>
<mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=MarkupService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/MarkupService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType</attribute>
+ code="org.jboss.portal.wsrp.services.CachingServiceFactory"
+ name="portal.wsrp:service=CachingServiceFactory"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Delegate" proxy-type="attribute">portal.wsrp:service=ServiceFactory</depends>
</mbean>
- <mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=RegistrationService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/RegistrationService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType</attribute>
- </mbean>
- <mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.wsrp:service=Invoker,name=PortletManagementService">
- <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=http</depends>
- <depends optional-attribute-name="TargetName">portal.wsrp:service=WSRPProducer</depends>
- <attribute name="JndiName">wsrp/invoker/PortletManagementService</attribute>
- <attribute name="ExportedInterfaces">org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType</attribute>
- </mbean>
</server>
Added: trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/jboss-web.xml 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/jboss-web.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-web>
+ <context-root>/testrunner</context-root>
+</jboss-web>
Added: trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/web.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/web.xml 2006-10-20 16:19:23 UTC (rev 5492)
+++ trunk/wsrp/src/resources/tests/test-wsrp-test-runner-war/WEB-INF/web.xml 2006-10-23 14:45:45 UTC (rev 5493)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>WSRPTestRunnerServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.wsrp.WSRPTestRunnerServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>WSRPTestRunnerServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
+
+
More information about the jboss-svn-commits
mailing list