Author: julien(a)jboss.com
Date: 2007-10-08 12:08:32 -0400 (Mon, 08 Oct 2007)
New Revision: 8563
Removed:
modules/test/trunk/test/selenium-java-client-driver-backport.jar
modules/test/trunk/test/selenium-java-client-driver.jar
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/driver/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/info/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/junit/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/mc/
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java
modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java
modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java
modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java
modules/test/trunk/test/src/main/org/jboss/test/junit/
Modified:
modules/test/trunk/build/build-thirdparty.xml
modules/test/trunk/test/build.xml
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java
modules/test/trunk/tools/etc/buildfragments/modules.ent
Log:
remove remote stuff from test module that will be reimported based on jboss unit
Modified: modules/test/trunk/build/build-thirdparty.xml
===================================================================
--- modules/test/trunk/build/build-thirdparty.xml 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/build/build-thirdparty.xml 2007-10-08 16:08:32 UTC (rev 8563)
@@ -52,7 +52,6 @@
<componentref name="apache-ant" version="1.6.5"/>
<componentref name="codehaus/cargo"
version="0.9-portal"/>
- <componentref name="testng" version="5.5"/>
<componentref name="hibernate" version="3.2.0.CR2"/>
<componentref name="apache-log4j" version="1.2.8"/>
@@ -63,6 +62,9 @@
<componentref name="sun-opends" version="snapshot"/>
<componentref name="jboss/remoting" version="2.2.1.GA"/>
+ <!-- For embedding components -->
+ <componentref name="jbossas/core-libs"
version="4.0.4.GA"/>
+
<!-- MC 2.0.0.Beta4 -->
<componentref name="jboss/microcontainer"
version="2.0.0.Beta4"/>
<componentref name="jboss/aop" version="2.0.0.alpha6"/>
Modified: modules/test/trunk/test/build.xml
===================================================================
--- modules/test/trunk/test/build.xml 2007-10-08 13:26:57 UTC (rev 8562)
+++ modules/test/trunk/test/build.xml 2007-10-08 16:08:32 UTC (rev 8563)
@@ -82,25 +82,26 @@
<target name="configure" unless="configure.disable">
+ <property name="javac.excludes"
value="org/jboss/portal/test/framework/runner/**"/>
+
<!-- Configure thirdparty libraries -->
&libraries;
<path id="library.classpath">
<path refid="jboss.portal/modules/common.classpath"/>
+
+ <!-- For embedded services -->
<path refid="dom4j.dom4j.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
+ <path refid="sun.opends.classpath"/>
+
<path refid="oswego.concurrent.classpath"/>
- <path refid="apache.httpclient.classpath"/>
<path refid="apache.log4j.classpath"/>
- <path refid="apache.codec.classpath"/>
- <path refid="apache.logging.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="jboss.remoting.classpath"/>
<path refid="codehaus.cargo.classpath"/>
- <path location="selenium-java-client-driver-backport.jar"/>
- <!--<path refid="sun.opends.classpath"/>-->
+
</path>
<!-- Configure modules -->
Deleted: modules/test/trunk/test/selenium-java-client-driver-backport.jar
===================================================================
(Binary files differ)
Deleted: modules/test/trunk/test/selenium-java-client-driver.jar
===================================================================
(Binary files differ)
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/AbstractPortalTestCase.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,144 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2007, 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 junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.SimpleLayout;
-import org.jboss.portal.common.junit.TransactionAssert;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.test.framework.junit.POJOJUnitTest;
-import org.jboss.portal.test.framework.embedded.DataSourceSupport;
-import org.jboss.portal.test.framework.embedded.HibernateSupport;
-import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-
-import java.net.URL;
-
-/**
- * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision: 7954 $
- * @since 2.6
- */
-public abstract class AbstractPortalTestCase extends TestCase
-{
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.DEBUG);
- Logger.getLogger("org.hibernate").setLevel(Level.ERROR);
- }
-
- /** . */
- protected TestRuntimeContext runtimeContext;
- /** . */
- protected DataSourceSupport.Config dataSourceConfigParameter;
- /** . */
- protected HibernateSupport hibernate;
-
- public HibernateSupport getHibernate()
- {
- return hibernate;
- }
-
- public DataSourceSupport.Config getDataSourceConfigParameter()
- {
- return dataSourceConfigParameter;
- }
-
- public void setDataSourceConfigParameter(DataSourceSupport.Config
dataSourceConfigParameter)
- {
- this.dataSourceConfigParameter = dataSourceConfigParameter;
- }
-
- public void setHibernate(HibernateSupport hibernate)
- {
- this.hibernate = hibernate;
- }
-
- public String getName()
- {
- return super.getName() + ",ds=" + dataSourceConfigParameter.getName() +
",Config=" + getConfigParamValue();
- }
-
- protected void setUp() throws Exception
- {
- runtimeContext = new TestRuntimeContext(getConfigLocation());
- runtimeContext.addBean("TestBean", this);
- runtimeContext.addBean("DataSourceConfig", dataSourceConfigParameter);
- runtimeContext.addBean("HibernateConfig",
HibernateSupport.getConfig(dataSourceConfigParameter.getName()));
- configureRuntimeContext(runtimeContext);
- runtimeContext.start();
- }
-
- /**
- * Allows sub-classes to further configure the TestRuntimeContext created in setUp.
Default implementation doesn't do
- * anything.
- *
- * @param runtimeContext
- */
- protected void configureRuntimeContext(TestRuntimeContext runtimeContext)
- {
- // null implementation
- }
-
- protected void tearDown() throws Exception
- {
- // clean up any pending transaction
- TransactionAssert.endTransaction();
-
- runtimeContext.stop();
- }
-
- protected String getConfigLocation()
- {
- return getConfigLocationPrefix() + getConfigParamValue();
- }
-
- protected Object getConfigParamValue()
- {
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- TestParameterValue paramValue =
parametrization.getParameterValue("Config");
- return paramValue.get();
- }
-
- public static TestSuite suite(Class testClass) throws Exception
- {
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- URL configsURL =
Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
- parametrization.setParameterValue("DataSourceConfig",
DataSourceSupport.Config.fromXML2(configsURL));
- POJOJUnitTest abc = new POJOJUnitTest(testClass);
- JUnitAdapter adapter = new JUnitAdapter(abc, parametrization);
- TestSuite suite = new TestSuite();
- suite.addTest(adapter);
- return suite;
- }
-
- protected abstract String getConfigLocationPrefix();
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,46 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.framework;
-
-/**
- * A mono value.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class MonoValuedTestParameterValue extends TestParameterValue
-{
-
- /** The value. */
- protected final Object value;
-
- public MonoValuedTestParameterValue(Object value)
- {
- this.value = value;
- }
-
- public Object get()
- {
- return value;
- }
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,91 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.framework;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * A multi value.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class MultiValuedTestParameterValue extends TestParameterValue
-{
-
- /** . */
- protected final Collection value;
-
- public MultiValuedTestParameterValue(Object[] value) throws IllegalArgumentException
- {
- if (value == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.value = Arrays.asList(value);
- }
-
- public MultiValuedTestParameterValue(Collection value) throws
IllegalArgumentException
- {
- if (value == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.value = value;
- }
-
- public Object get()
- {
- return value;
- }
-
- /** Return an iterator over the values. */
- public Iterator iterator()
- {
- return new Iterator()
- {
- Iterator i = value.iterator();
-
- public boolean hasNext()
- {
- return i.hasNext();
- }
-
- public Object next()
- {
- return new MonoValuedTestParameterValue(i.next());
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- };
- }
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.framework;
-
-import java.io.Serializable;
-
-/**
- * The value of a test parameter.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public abstract class TestParameterValue implements Serializable
-{
- /**
- * Return the actual value.
- *
- * @return
- */
- public abstract Object get();
-
- public int hashCode()
- {
- Object o = get();
- return o == null ? 0 : o.hashCode();
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof TestParameterValue)
- {
- TestParameterValue that = (TestParameterValue)obj;
- Object thisO = get();
- Object thatO = that.get();
- return thisO == null ? thatO == null : thisO.equals(thatO);
- }
- return false;
- }
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,195 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.framework;
-
-import org.jboss.portal.test.framework.info.TestInfo;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * The parametrization of a test.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7230 $
- */
-public class TestParametrization implements Serializable
-{
-
- /** . */
- private Map parameterValues;
-
- public TestParametrization()
- {
- parameterValues = new HashMap();
- }
-
- public TestParametrization(Map parameterValues) throws IllegalArgumentException
- {
- this();
-
- //
- if (parameterValues == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String parameterName = (String)entry.getKey();
- TestParameterValue parameterValue = (TestParameterValue)entry.getValue();
- setParameterValue(parameterName, parameterValue);
- }
- }
-
- /**
- * Set a parameter value, using a null value will remove the parameter.
- *
- * @param parameterName the parameter name
- * @param parameterValue the parameter value
- * @throws IllegalArgumentException if the parameter name is null
- */
- public void setParameterValue(String parameterName, TestParameterValue parameterValue)
throws IllegalArgumentException
- {
- if (parameterName == null)
- {
- throw new IllegalArgumentException();
- }
- if (parameterValue == null)
- {
- parameterValues.remove(parameterName);
- }
- else
- {
- parameterValues.put(parameterName, parameterValue);
- }
- }
-
- /**
- * Return a parameter value.
- *
- * @param parameterName the parameter name
- * @return the parameter value or null if it does not exist
- * @throws IllegalArgumentException if the parameter name is null
- */
- public TestParameterValue getParameterValue(String parameterName) throws
IllegalArgumentException
- {
- if (parameterName == null)
- {
- throw new IllegalArgumentException();
- }
- return (TestParameterValue)parameterValues.get(parameterName);
- }
-
- public boolean isEmpty()
- {
- return parameterValues.isEmpty();
- }
-
- public String toString()
- {
- StringBuffer tmp = new StringBuffer();
- for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String parameterName = (String)entry.getKey();
- TestParameterValue value = (TestParameterValue)entry.getValue();
-
tmp.append(parameterName).append('=').append(value.get()).append(i.hasNext() ?
"," : "");
- }
- return tmp.toString();
- }
-
- /**
- * Build a collection of parametrization that satisfies the parameters exposed by the
test meta information and the
- * parameter provided by the map.
- */
- public Collection create(TestInfo info)
- {
- ArrayList c = new ArrayList();
- c.add(new HashMap());
-
- Set expectedParameters = new HashSet(info.getParameterNames());
-
- //
- for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String parameterName = (String)entry.getKey();
- TestParameterValue value = (TestParameterValue)entry.getValue();
-
- //
- if (expectedParameters.contains(parameterName))
- {
- expectedParameters.remove(parameterName);
-
- //
- if (value instanceof MultiValuedTestParameterValue)
- {
- MultiValuedTestParameterValue multiValue =
(MultiValuedTestParameterValue)value;
- ArrayList tmp = new ArrayList();
- for (Iterator j = multiValue.iterator(); j.hasNext();)
- {
- TestParameterValue o = (TestParameterValue)j.next();
- ArrayList copy = new ArrayList(c.size());
- for (Iterator k = c.iterator(); k.hasNext();)
- {
- Map parametrization = (Map)k.next();
- parametrization = new HashMap(parametrization);
- parametrization.put(parameterName, o);
- copy.add(parametrization);
- }
- tmp.addAll(copy);
- }
- c = tmp;
- }
- else
- {
- for (int j = 0; j < c.size(); j++)
- {
- Map parametrization = (Map)c.get(j);
- parametrization.put(parameterName, value);
- }
- }
- }
- }
-
- //
- for (int i = 0; i < c.size(); i++)
- {
- Map parametrization = (Map)c.get(i);
- TestParametrization ctx = new TestParametrization(parametrization);
- c.set(i, ctx);
- }
-
- //
- return c;
- }
-}
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -25,7 +25,6 @@
import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -112,12 +111,12 @@
toString();
}
- public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
- {
- DSConfig[] configs = fromXML(url);
- List list = Arrays.asList(configs);
- return new MultiValuedTestParameterValue(list);
- }
+// public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
+// {
+// DSConfig[] configs = fromXML(url);
+// List list = Arrays.asList(configs);
+// return new MultiValuedTestParameterValue(list);
+// }
public static DSConfig[] fromXML(URL url) throws Exception
{
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DataSourceSupport.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -25,7 +25,6 @@
import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
import org.jboss.resource.adapter.jdbc.local.LocalTxDataSource;
import org.jboss.resource.connectionmanager.CachedConnectionManagerReference;
import org.w3c.dom.Document;
@@ -254,12 +253,12 @@
this.password = password;
}
- public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
- {
- Config[] configs = fromXML(url);
- List list = Arrays.asList(configs);
- return new MultiValuedTestParameterValue(list);
- }
+// public static MultiValuedTestParameterValue fromXML2(URL url) throws Exception
+// {
+// Config[] configs = fromXML(url);
+// List list = Arrays.asList(configs);
+// return new MultiValuedTestParameterValue(list);
+// }
public static Config[] fromXML(URL url) throws Exception
{
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/apacheds/ApacheDSServiceMBean.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -23,13 +23,11 @@
package org.jboss.portal.test.framework.embedded.apacheds;
-import org.jboss.system.ServiceMBean;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public interface ApacheDSServiceMBean extends ServiceMBean
+public interface ApacheDSServiceMBean
{
/* public String printDiagnostics();
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -24,7 +24,7 @@
package org.jboss.portal.test.framework.embedded.opends;
import org.opends.server.core.DirectoryServer;
-import org.jboss.system.ServiceMBeanSupport;
+import org.apache.log4j.Logger;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -41,8 +41,11 @@
* @version $Revision$
* @since Sep 13, 2006
*/
-public class OpenDSService extends ServiceMBeanSupport implements OpenDSServiceMBean
+public class OpenDSService implements OpenDSServiceMBean
{
+
+ private static final Logger log = Logger.getLogger(OpenDSService.class);
+
public static String objectName = "portal.test:service=OpenDSService";
private String newline = (String)
@@ -70,9 +73,17 @@
DirectoryServer.restart(getClass().getName(), "DS restart");
}
+ public void create() throws Exception
+ {
+ }
+
+ public void start() throws Exception
+ {
+ startService();
+ }
+
public void startService() throws Exception
{
- super.startService();
//Get the location of the conf directory
String confLoc = (String)AccessController.doPrivileged(
@@ -94,12 +105,21 @@
}
+ public void stop() throws Exception
+ {
+ stopService();
+ }
+
public void stopService() throws Exception
{
log.info("Asking DS to shutdown");
DirectoryServer.shutDown(getClass().getName(), "Shut down DS");
}
+ public void destroy() throws Exception
+ {
+ }
+
/**
*
* A GetSystemPropetyAction.
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSServiceMBean.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -23,13 +23,11 @@
package org.jboss.portal.test.framework.embedded.opends;
-import org.jboss.system.ServiceMBean;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public interface OpenDSServiceMBean extends ServiceMBean
+public interface OpenDSServiceMBean
{
/*public String printDiagnostics();
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -23,11 +23,11 @@
package org.jboss.portal.test.framework.embedded.opends;
-import org.jboss.logging.Logger;
import org.opends.server.tools.LDAPCompare;
import org.opends.server.tools.LDAPDelete;
import org.opends.server.tools.LDAPModify;
import org.opends.server.tools.LDAPSearch;
+import org.apache.log4j.Logger;
import java.net.URL;
import java.io.File;
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/generic/config/HTTPTestRunnerConfig.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -22,10 +22,6 @@
******************************************************************************/
package org.jboss.portal.test.framework.impl.generic.config;
-import org.jboss.portal.test.framework.TestParametrization;
-import org.jboss.portal.test.framework.TestParameterValue;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -41,17 +37,17 @@
*/
public String getServerName()
{
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- TestParameterValue archive =
parametrization.getParameterValue("serverName");
+ // TestParametrization parametrization = JUnitAdapter.getParametrization();
+ // TestParameterValue archive =
parametrization.getParameterValue("serverName");
//
- if (archive != null)
- {
- return (String)archive.get();
- }
- else
- {
+// if (archive != null)
+// {
+// return (String)archive.get();
+// }
+// else
+// {
return "RemoteTomcat-6.0";
- }
+// }
}
}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgent.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -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.impl.jboss.agent;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.system.ServiceMBeanSupport;
-
-import java.net.URL;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5669 $
- */
-public class JBossTestAgent extends ServiceMBeanSupport implements JBossTestAgentMBean
-{
-
- /** Keep a thread local of sessions. */
- private static final ThreadLocal local = new ThreadLocal();
-
- /**
- * Record the exception that will be reused later by the same agent to be aware of the
recorded exception.
- *
- * @param e the deployment exception to log.
- */
- public static void record(DeploymentException e)
- {
- Session session = (Session)local.get();
-
- // Record the exception only if we have a session otherwise we may leek the
exception in the thread local.
- 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 Exception
- {
- perform(url, true);
- }
-
- public void undeploy(URL url) throws Exception
- {
- 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;
- }
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/agent/JBossTestAgentMBean.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,38 +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.impl.jboss.agent;
-
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.system.ServiceMBean;
-import org.jboss.portal.test.framework.agent.TestAgent;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface JBossTestAgentMBean extends TestAgent, ServiceMBean
-{
- MainDeployerMBean getMainDeployer();
-
- void setMainDeployer(MainDeployerMBean mainDeployer);
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/MBeanServerFactory.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,131 +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.impl.jboss.jmx;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Properties;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5498 $
- */
-public class MBeanServerFactory
-{
-
- /** . */
- private MBeanServer server;
-
- /** . */
- private Properties env;
-
- public Properties getEnv()
- {
- return env;
- }
-
- public void setEnv(Properties env)
- {
- this.env = env;
- }
-
- public void create()
- {
- }
-
- public void start() throws Exception
- {
- LazyMBeanServer lms = new LazyMBeanServer(env);
- server = lms.getProxy();
- }
-
- public void stop()
- {
- server = null;
- }
-
- public void destroy()
- {
- }
-
- public MBeanServer getServer() throws Exception
- {
- return server;
- }
-
- private static class LazyMBeanServer implements InvocationHandler
- {
-
- private Properties env;
- private MBeanServerConnection remoteServer;
- private MBeanServer proxy;
-
- public LazyMBeanServer(Properties env)
- {
- this.env = env;
- this.proxy =
(MBeanServer)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new
Class[]{MBeanServer.class}, this);
- }
-
- public MBeanServer getProxy()
- {
- return proxy;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- if (remoteServer == null)
- {
- InitialContext ctx = null;
- try
- {
- ctx = new InitialContext(env);
- MBeanServerConnection adaptor =
(MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor");
- remoteServer = new RemoteMBeanServerAdapter(adaptor).getServer();
- }
- finally
- {
- if (ctx != null)
- {
- try
- {
- ctx.close();
- }
- catch (NamingException ignore)
- {
- }
- }
- }
- }
- Method adaptedMethod = MBeanServerConnection.class.getMethod(method.getName(),
method.getParameterTypes());
- return adaptedMethod.invoke(remoteServer, args);
- }
- }
-
-
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanProxy.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -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.impl.jboss.jmx;
-
-import org.jboss.mx.util.MBeanProxy;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5498 $
- */
-public class RemoteMBeanProxy
-{
- public static Object get(Class itf, ObjectName name, MBeanServerConnection
remoteServer) throws Exception
- {
- MBeanServer server = new RemoteMBeanServerAdapter(remoteServer).getServer();
- return MBeanProxy.get(itf, name, server);
- }
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/jmx/RemoteMBeanServerAdapter.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.test.framework.impl.jboss.jmx;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5498 $
- */
-public class RemoteMBeanServerAdapter implements InvocationHandler
-{
-
- private MBeanServerConnection remoteServer;
- private MBeanServer adaptedServer;
-
- public RemoteMBeanServerAdapter(MBeanServerConnection remoteServer)
- {
- this.remoteServer = remoteServer;
- this.adaptedServer =
(MBeanServer)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new
Class[]{MBeanServer.class}, this);
- }
-
- public MBeanServer getServer()
- {
- return adaptedServer;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- Method adaptedMethod = MBeanServerConnection.class.getMethod(method.getName(),
method.getParameterTypes());
- return adaptedMethod.invoke(remoteServer, args);
- }
-}
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl/jboss/server/JBossServiceLookup.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -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.impl.jboss.server;
-
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.portal.test.framework.server.ServiceLookup;
-import org.jboss.portal.test.framework.server.ServiceLookupFailedException;
-
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class JBossServiceLookup implements ServiceLookup
-{
-
- /** . */
- private final MBeanServer mbeanServer;
-
- /** . */
- private final ObjectName objectName;
-
- /** . */
- private final String serviceInterface;
-
- public JBossServiceLookup(MBeanServer mbeanServer, ObjectName objectName, String
serviceInterface)
- {
- this.mbeanServer = mbeanServer;
- this.objectName = objectName;
- this.serviceInterface = serviceInterface;
- }
-
- public ObjectName getObjectName()
- {
- return objectName;
- }
-
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
- public Object lookupService() throws ServiceLookupFailedException
- {
- try
- {
- Class proxyInterface =
Thread.currentThread().getContextClassLoader().loadClass(serviceInterface);
- return MBeanProxy.get(proxyInterface, objectName, mbeanServer);
- }
- catch (ClassNotFoundException e)
- {
- throw new ServiceLookupFailedException(e);
- }
- catch (MBeanProxyCreationException e)
- {
- throw new ServiceLookupFailedException(e);
- }
- }
-}
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/BaseRunner.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -26,9 +26,6 @@
import org.jboss.portal.test.framework.server.NodeManager;
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverClient;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.test.framework.TestParametrization;
import org.apache.log4j.Logger;
import org.apache.log4j.Appender;
import org.apache.log4j.SimpleLayout;
@@ -36,7 +33,6 @@
import org.apache.log4j.ConsoleAppender;
import junit.framework.Test;
import junit.framework.TestResult;
-import junit.framework.TestCase;
import junit.framework.AssertionFailedError;
import java.net.URL;
@@ -77,7 +73,7 @@
private String archivePath;
/** . */
- private JUnitAdapter adapter;
+// private JUnitAdapter adapter;
/** . */
private int state;
@@ -86,7 +82,7 @@
private Integer testCaseCount;
/** . */
- private RemoteTestDriverClient testDriverClient;
+// private RemoteTestDriverClient testDriverClient;
/** The node id list used for this test suite. */
private NodeId[] nodeIds;
@@ -130,16 +126,16 @@
this.nodeManager = nodeManager;
}
- public RemoteTestDriverClient getTestDriverClient()
- {
- return testDriverClient;
- }
+// public RemoteTestDriverClient getTestDriverClient()
+// {
+// return testDriverClient;
+// }
+//
+// public void setTestDriverClient(RemoteTestDriverClient testDriverClient)
+// {
+// this.testDriverClient = testDriverClient;
+// }
- public void setTestDriverClient(RemoteTestDriverClient testDriverClient)
- {
- this.testDriverClient = testDriverClient;
- }
-
private void startContext() throws Exception
{
runtimeContext.start();
@@ -159,15 +155,15 @@
startContext();
// Configure driver further more (todo find a way to do that int the bean
assembly)
- testDriverClient.setInitialNodeId(nodeIds[0]);
- testDriverClient.setArchivePath(archivePath);
- testDriverClient.setNodeManager(nodeManager);
+ // testDriverClient.setInitialNodeId(nodeIds[0]);
+ // testDriverClient.setArchivePath(archivePath);
+ // testDriverClient.setNodeManager(nodeManager);
// Get optional parametrization
- TestParametrization parametrization = JUnitAdapter.getParametrization();
+ // TestParametrization parametrization = JUnitAdapter.getParametrization();
//
- adapter = new JUnitAdapter(testDriverClient, parametrization);
+ // adapter = new JUnitAdapter(testDriverClient, parametrization);
state = STARTED;
}
finally
@@ -199,7 +195,7 @@
{
state = FAILED;
}
- adapter = null;
+ // adapter = null;
}
}
}
@@ -213,7 +209,7 @@
try
{
startIfNeeded();
- testCaseCount = new Integer(adapter.countTestCases());
+ // testCaseCount = new Integer(adapter.countTestCases());
}
catch (Exception e)
{
@@ -231,7 +227,7 @@
try
{
startIfNeeded();
- adapter.run(testResult);
+ // adapter.run(testResult);
}
catch (Exception e)
{
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/HTTPTestRunner.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -23,8 +23,6 @@
package org.jboss.portal.test.framework.runner;
import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.test.framework.TestParametrization;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
import java.io.File;
import java.net.MalformedURLException;
@@ -61,15 +59,15 @@
private String getArchiveName()
{
- if (archiveName == null)
- {
- TestParametrization parametrization = JUnitAdapter.getParametrization();
- return (String)parametrization.getParameterValue("archive").get();
- }
- else
- {
+// if (archiveName == null)
+// {
+// TestParametrization parametrization = JUnitAdapter.getParametrization();
+// return (String)parametrization.getParameterValue("archive").get();
+// }
+// else
+// {
return archiveName;
- }
+// }
}
public void startRunner() throws Exception
Deleted:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner/WebTestRunner.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,117 +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.runner;
-
-import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.test.framework.TestParametrization;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import junit.framework.AssertionFailedError;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WebTestRunner extends BaseRunner
-{
-
- /** . */
- public static final String JBOSS_BEANS_LOCATION =
"org/jboss/portal/test/framework/container/web-runner-beans.xml";
-
- /** . */
- private String archiveName;
-
- public WebTestRunner()
- {
- super(JBOSS_BEANS_LOCATION);
-
- //
- init(null);
- }
-
- public WebTestRunner(NodeId[] nodeIds)
- {
- super(JBOSS_BEANS_LOCATION, nodeIds);
-
- //
- init(null);
- }
-
- public WebTestRunner(String archiveName)
- {
- super(JBOSS_BEANS_LOCATION);
-
- //
- init(archiveName);
- }
-
- public WebTestRunner(String archiveName, NodeId[] nodeIds)
- {
- super(JBOSS_BEANS_LOCATION, nodeIds);
-
- //
- init(archiveName);
- }
-
- private void init(String archiveName)
- {
- if (archiveName == null)
- {
- TestParametrization abc = JUnitAdapter.getParametrization();
- this.archiveName = (String)abc.getParameterValue("archive").get();
- }
- else
- {
- this.archiveName = archiveName;
- }
- }
-
- public void startRunner() throws Exception
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- deploy(f.toURL());
- }
-
- public void stopRunner()
- {
- try
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- undeploy(f.toURL());
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- }
-
- public void testDummy()
- {
- throw new AssertionFailedError("Test dummy should not be called, it's a
place holder so that running it from ant does not fail");
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java 2007-10-08 13:26:57
UTC (rev 8562)
+++ modules/test/trunk/test/src/main/org/jboss/test/InfoTestCase.java 2007-10-08 16:08:32
UTC (rev 8563)
@@ -1,231 +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.test;
-
-import junit.framework.TestCase;
-import org.jboss.portal.test.framework.info.TestContainerInfo;
-import org.jboss.portal.test.framework.info.TestInfo;
-import org.jboss.portal.test.framework.info.TestParameterInfo;
-import org.jboss.portal.common.util.CollectionBuilder;
-
-import java.util.Collections;
-import java.util.HashSet;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class InfoTestCase extends TestCase
-{
-
- public void testTestContainerConstructor()
- {
- try
- {
- new TestContainerInfo((String)null);
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
- try
- {
- new TestContainerInfo(null, "");
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
-
- //
- TestContainerInfo c1 = new TestContainerInfo("foo", null);
- assertEquals("foo", c1.getName());
- assertEquals(null, c1.getDescription());
- assertEquals(Collections.EMPTY_SET, c1.getChildNames());
-
- //
- TestContainerInfo c2 = new TestContainerInfo("foo", "bar");
- assertEquals("foo", c2.getName());
- assertEquals("bar", c2.getDescription());
- assertEquals(Collections.EMPTY_SET, c2.getChildNames());
- }
-
- public void testTestConstructor()
- {
- try
- {
- new TestInfo((String)null);
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
- try
- {
- new TestInfo(null, "");
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
-
- //
- TestInfo t1 = new TestInfo("foo");
- assertEquals("foo", t1.getName());
- assertEquals(null, t1.getDescription());
-
- //
- TestInfo t2 = new TestInfo("foo", "bar");
- assertEquals("foo", t2.getName());
- assertEquals("bar", t2.getDescription());
- }
-
- public void testParameterConstructor()
- {
- try
- {
- new TestParameterInfo(null);
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
- try
- {
- new TestInfo(null, "");
- fail("Was expecting an IAE");
- }
- catch (IllegalArgumentException e)
- {
- }
-
- //
- TestParameterInfo p1 = new TestParameterInfo("foo");
- assertEquals("foo", p1.getName());
- assertEquals(null, p1.getDescription());
-
- //
- TestParameterInfo p2 = new TestParameterInfo("foo", "bar");
- assertEquals("foo", p2.getName());
- assertEquals("bar", p2.getDescription());
- }
-
- public void testTestParameters()
- {
- TestInfo test = new TestInfo("foo");
- assertEquals(new HashSet(), new HashSet(test.getParameterNames()));
-
- //
- TestParameterInfo p1 = new TestParameterInfo("p1");
- test.addParameter(p1);
- assertEquals(p1, test.getParameter("p1"));
- assertEquals(Collections.singleton("p1"), test.getParameterNames());
-
- //
- try
- {
- test.addParameter(new TestParameterInfo("p1"));
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- assertEquals(p1, test.getParameter("p1"));
- assertEquals(Collections.singleton("p1"), test.getParameterNames());
-
- //
- TestParameterInfo p2 = new TestParameterInfo("p2");
- test.addParameter(p2);
- assertEquals(p1, test.getParameter("p1"));
- assertEquals(p2, test.getParameter("p2"));
- assertEquals(new
CollectionBuilder().add("p1").add("p2").toHashSet(),
test.getParameterNames());
- }
-
- public void testId()
- {
- TestContainerInfo root = new TestContainerInfo("root");
- assertEquals("/", root.getId(null));
- assertEquals("", root.getId(root));
- try
- {
- root.getId(new TestContainerInfo("tmp"));
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- //
- TestInfo a = new TestInfo("a");
- root.addChild(a);
- assertEquals("/a", a.getId(null));
- assertEquals("a", a.getId(root));
- assertEquals("", a.getId(a));
-
- //
- TestContainerInfo b = new TestContainerInfo("b");
- root.addChild(b);
- assertEquals("/b", b.getId(null));
- assertEquals("b", b.getId(root));
- assertEquals("", b.getId(b));
-
- //
- TestInfo c = new TestInfo("c");
- b.addChild(c);
- assertEquals("/b/c", c.getId(null));
- assertEquals("b/c", c.getId(root));
- assertEquals("c", c.getId(b));
- assertEquals("", c.getId(c));
- }
-
- public void testClone()
- {
-
- }
-
- public void testVisitor()
- {
-
- }
-
- public void testFind()
- {
- TestContainerInfo root = new TestContainerInfo("root");
- TestInfo a = new TestInfo("a");
- root.addChild(a);
- TestContainerInfo b = new TestContainerInfo("b");
- root.addChild(b);
- TestInfo c = new TestInfo("c");
- b.addChild(c);
-
- //
- assertEquals(root, root.findItem(""));
- assertEquals(a, a.findItem(""));
- assertEquals(a, root.findItem("a"));
- assertEquals(b, b.findItem(""));
- assertEquals(b, root.findItem("b"));
- assertEquals(c, c.findItem(""));
- assertEquals(c, b.findItem("c"));
- assertEquals(c, root.findItem("b/c"));
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/test/TestParameterValueTestCase.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,103 +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.test;
-
-import org.jboss.portal.test.framework.MonoValuedTestParameterValue;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
-import junit.framework.TestCase;
-
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestParameterValueTestCase extends TestCase
-{
-
- public void testMono()
- {
- Object o = new Object();
- assertEquals(o, new MonoValuedTestParameterValue(o).get());
- assertEquals(null, new MonoValuedTestParameterValue(null).get());
-
- //
- assertEquals(new MonoValuedTestParameterValue("abc"), new
MonoValuedTestParameterValue("abc"));
- assertEquals(new MonoValuedTestParameterValue(o), new
MonoValuedTestParameterValue(o));
- assertEquals(new MonoValuedTestParameterValue(null), new
MonoValuedTestParameterValue(null));
-
- //
- assertFalse(new MonoValuedTestParameterValue(o).equals(new
MonoValuedTestParameterValue(new Object())));
- assertFalse(new MonoValuedTestParameterValue(o).equals(new
MonoValuedTestParameterValue(null)));
- assertFalse(new MonoValuedTestParameterValue(new Object()).equals(new
MonoValuedTestParameterValue(o)));
- assertFalse(new MonoValuedTestParameterValue(null).equals(new
MonoValuedTestParameterValue(o)));
- }
-
- public void testMulti()
- {
- try
- {
- new MultiValuedTestParameterValue((Collection)null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- try
- {
- new MultiValuedTestParameterValue((Object[])null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- ArrayList toto = new ArrayList();
- toto.add("abc");
- toto.add("def");
- MultiValuedTestParameterValue t = new MultiValuedTestParameterValue(toto);
- assertEquals(toto, t.get());
- Iterator i = t.iterator();
- assertNotNull(i);
- assertTrue(i.hasNext());
- Object i0 = i.next();
- assertNotNull(i0);
- assertTrue(i0 instanceof MonoValuedTestParameterValue);
- assertEquals("abc", ((MonoValuedTestParameterValue)i0).get());
- assertTrue(i.hasNext());
- Object i1 = i.next();
- assertNotNull(i1);
- assertTrue(i1 instanceof MonoValuedTestParameterValue);
- assertEquals("def", ((MonoValuedTestParameterValue)i1).get());
- assertFalse(i.hasNext());
- try
- {
- i.next();
- }
- catch (NoSuchElementException expected)
- {
- }
- }
-}
Deleted: modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java 2007-10-08
13:26:57 UTC (rev 8562)
+++
modules/test/trunk/test/src/main/org/jboss/test/TestParametrizationTestCase.java 2007-10-08
16:08:32 UTC (rev 8563)
@@ -1,116 +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.test;
-
-import junit.framework.TestCase;
-import org.jboss.portal.test.framework.info.TestInfo;
-import org.jboss.portal.test.framework.info.TestParameterInfo;
-import org.jboss.portal.test.framework.TestParametrization;
-import org.jboss.portal.test.framework.MonoValuedTestParameterValue;
-import org.jboss.portal.test.framework.MultiValuedTestParameterValue;
-import org.jboss.portal.common.util.CollectionBuilder;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestParametrizationTestCase extends TestCase
-{
-
- public void testGet()
- {
- try
- {
- new TestParametrization().getParameterValue(null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- }
-
- public void testSet()
- {
- try
- {
- new TestParametrization().setParameterValue(null, null);
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- try
- {
- new TestParametrization().setParameterValue(null, new
MonoValuedTestParameterValue("abc"));
- fail();
- }
- catch (IllegalArgumentException expected)
- {
- }
- TestParametrization p = new TestParametrization();
- MonoValuedTestParameterValue v = new
MonoValuedTestParameterValue("def");
- p.setParameterValue("abc", v);
- assertEquals(v, p.getParameterValue("abc"));
- p.setParameterValue("abc", null);
- assertEquals(null, p.getParameterValue("abc"));
- }
-
- public void testCreate()
- {
- TestInfo info = new TestInfo("test");
- info.addParameter(new TestParameterInfo("foo"));
- info.addParameter(new TestParameterInfo("bar"));
-
- //
- TestParametrization p1 = new TestParametrization();
- p1.setParameterValue("foo", new
MonoValuedTestParameterValue("foo1"));
- p1.setParameterValue("abc", new
MonoValuedTestParameterValue("def"));
- Collection c1 = p1.create(info);
- assertNotNull(c1);
- assertEquals(1, c1.size());
- TestParametrization q1 = (TestParametrization)c1.iterator().next();
- assertEquals(new MonoValuedTestParameterValue("foo1"),
q1.getParameterValue("foo"));
- assertEquals(null, q1.getParameterValue("abc"));
-
- //
- TestParametrization p2 = new TestParametrization();
- p2.setParameterValue("foo", new
MonoValuedTestParameterValue("foo1"));
- p2.setParameterValue("abc", new
MonoValuedTestParameterValue("def"));
- p2.setParameterValue("bar", new MultiValuedTestParameterValue(new
CollectionBuilder().add("bar1").add("bar2").toArrayList()));
- Collection c2 = p2.create(info);
- assertNotNull(c2);
- assertEquals(2, c2.size());
- Iterator i2 = c2.iterator();
- TestParametrization q2_1 = (TestParametrization)i2.next();
- assertEquals(new MonoValuedTestParameterValue("foo1"),
q2_1.getParameterValue("foo"));
- assertEquals(new MonoValuedTestParameterValue("bar1"),
q2_1.getParameterValue("bar"));
- assertEquals(null, q2_1.getParameterValue("abc"));
- TestParametrization q2_2 = (TestParametrization)i2.next();
- assertEquals(new MonoValuedTestParameterValue("foo1"),
q2_2.getParameterValue("foo"));
- assertEquals(new MonoValuedTestParameterValue("bar2"),
q2_2.getParameterValue("bar"));
- assertEquals(null, q2_2.getParameterValue("abc"));
- }
-}
Modified: modules/test/trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- modules/test/trunk/tools/etc/buildfragments/modules.ent 2007-10-08 13:26:57 UTC (rev
8562)
+++ modules/test/trunk/tools/etc/buildfragments/modules.ent 2007-10-08 16:08:32 UTC (rev
8563)
@@ -2,204 +2,21 @@
<target name="configure-modules"
unless="configure-modules.disabled">
- <!-- common -->
- <property name="jboss.portal-common.root"
value="${project.root}/common/output"/>
- <property name="jboss.portal-common.lib"
value="${jboss.portal-common.root}/lib"/>
- <path id="jboss.portal-common.classpath">
- <pathelement
path="${jboss.portal-common.lib}/portal-common-lib.jar"/>
+ <!-- unit -->
+ <property name="jboss.unit.root"
value="${project.root}/unit/output"/>
+ <property name="jboss.unit.lib"
value="${jboss.unit.root}/lib"/>
+ <path id="jboss.unit.classpath">
+ <pathelement path="${jboss.unit.lib}/jboss-unit-lib.jar"/>
</path>
- <!-- web -->
- <property name="jboss.portal-web.root"
value="${project.root}/web/output"/>
- <property name="jboss.portal-web.lib"
value="${jboss.portal-web.root}/lib"/>
- <path id="jboss.portal-web.classpath">
- <pathelement path="${jboss.portal-web.lib}/portal-web-lib.jar"/>
+ <!-- unit -->
+ <property name="portal.test.root"
value="${project.root}/test/output"/>
+ <property name="portal.test.lib"
value="${portal.test.root}/lib"/>
+ <path id="portal.test.classpath">
+ <pathelement path="${portal.test.lib}/portal-test-lib.jar"/>
</path>
- <!-- test -->
- <property name="jboss.portal-test.root"
value="${project.root}/test/output"/>
- <property name="jboss.portal-test.lib"
value="${jboss.portal-test.root}/lib"/>
- <path id="jboss.portal-test.classpath">
- <pathelement path="${jboss.portal-test.lib}/portal-test-lib.jar"/>
- <pathelement
path="${jboss.portal-test.lib}/portal-test-agent-lib.jar"/>
- </path>
- <!-- cms -->
- <property name="jboss.portal-cms.root"
value="${project.root}/cms/output"/>
- <property name="jboss.portal-cms.lib"
value="${jboss.portal-cms.root}/lib"/>
- <path id="jboss.portal-cms.classpath">
- <pathelement path="${jboss.portal-cms.lib}/portal-cms-lib.jar"/>
- </path>
-
- <!-- search -->
- <property name="jboss.portal-search.root"
value="${project.root}/search/output"/>
- <property name="jboss.portal-search.lib"
value="${jboss.portal-search.root}/lib"/>
- <path id="jboss.portal-search.classpath">
- <pathelement
path="${jboss.portal-search.lib}/portal-search-lib.jar"/>
- </path>
-
- <!-- server -->
- <property name="jboss.portal-server.root"
value="${project.root}/server/output"/>
- <property name="jboss.portal-server.lib"
value="${jboss.portal-server.root}/lib"/>
- <path id="jboss.portal-server.classpath">
- <pathelement
path="${jboss.portal-server.lib}/portal-server-lib.jar"/>
- <pathelement
path="${jboss.portal-server.lib}/portal-server-test-framework-lib.jar"/>
- </path>
-
- <!-- api -->
- <property name="jboss.portlet-api.root"
value="${project.root}/api/output"/>
- <property name="jboss.portlet-api.lib"
value="${jboss.portlet-api.root}/lib"/>
- <path id="jboss.portlet-api.classpath">
- <pathelement path="${jboss.portlet-api.lib}/portlet-api-lib.jar"/>
- <pathelement path="${jboss.portlet-api.lib}/portal-api-lib.jar"/>
- </path>
-
- <!-- faces -->
- <property name="jboss.portal-faces.root"
value="${project.root}/faces/output"/>
- <property name="jboss.portal-faces.lib"
value="${jboss.portal-faces.root}/lib"/>
- <path id="jboss.portal-faces.classpath">
- <pathelement path="${jboss.portal-faces.lib}/portal-faces-lib.jar"/>
- </path>
-
- <!-- jems -->
- <property name="jboss.portal-jems.root"
value="${project.root}/jems/output"/>
- <property name="jboss.portal-jems.lib"
value="${jboss.portal-jems.root}/lib"/>
- <path id="jboss.portal-jems.classpath">
- <pathelement path="${jboss.portal-jems.lib}/portal-jems-lib.jar"/>
- </path>
-
- <!-- portlet -->
- <property name="jboss.portal-portlet.root"
value="${project.root}/portlet/output"/>
- <property name="jboss.portal-portlet.lib"
value="${jboss.portal-portlet.root}/lib"/>
- <path id="jboss.portal-portlet.classpath">
- <pathelement
path="${jboss.portal-portlet.lib}/portal-portlet-lib.jar"/>
- <pathelement
path="${jboss.portal-portlet.lib}/portal-portlet-test-lib.jar"/>
- <pathelement
path="${jboss.portal-portlet.lib}/portal-portlet-test-framework-lib.jar"/>
- </path>
-
- <!-- portlet-server -->
- <property name="jboss.portal-portlet-server.root"
value="${project.root}/portlet-server/output"/>
- <property name="jboss.portal-portlet-server.lib"
value="${jboss.portal-portlet-server.root}/lib"/>
- <path id="jboss.portal-portlet-server.classpath">
- <pathelement
path="${jboss.portal-portlet-server.lib}/portal-portlet-server-lib.jar"/>
- </path>
-
- <!-- portlet-federation -->
- <property name="jboss.portal-portlet-federation.root"
value="${project.root}/portlet-federation/output"/>
- <property name="jboss.portal-portlet-federation.lib"
value="${jboss.portal-portlet-federation.root}/lib"/>
- <path id="jboss.portal-portlet-federation.classpath">
- <pathelement
path="${jboss.portal-portlet-federation.lib}/portal-portlet-federation-lib.jar"/>
- </path>
-
- <!-- bridge -->
- <property name="jboss.portal-bridge.root"
value="${project.root}/bridge/output"/>
- <property name="jboss.portal-bridge.lib"
value="${jboss.portal-bridge.root}/lib"/>
- <path id="jboss.portal-bridge.classpath">
- <pathelement
path="${jboss.portal-bridge.lib}/portal-bridge-lib.jar"/>
- </path>
-
- <!-- format -->
- <property name="jboss.portal-format.root"
value="${project.root}/format/output"/>
- <property name="jboss.portal-format.lib"
value="${jboss.portal-format.root}/lib"/>
- <path id="jboss.portal-format.classpath">
- <pathelement
path="${jboss.portal-format.lib}/portal-format-lib.jar"/>
- </path>
-
- <!-- core -->
- <property name="jboss.portal-core.root"
value="${project.root}/core/output"/>
- <property name="jboss.portal-core.lib"
value="${jboss.portal-core.root}/lib"/>
- <path id="jboss.portal-core.classpath">
- <pathelement path="${jboss.portal-core.lib}/portal-core-lib.jar"/>
- <pathelement
path="${jboss.portal-core.lib}/jboss-portlet-api-lib.jar"/>
- </path>
-
- <!-- core-admin -->
- <property name="jboss.portal-core-admin.root"
value="${project.root}/core-admin/output"/>
- <property name="jboss.portal-core-admin.lib"
value="${jboss.portal-core-admin.root}/lib"/>
- <path id="jboss.portal-core-admin.classpath">
- <pathelement
path="${jboss.portal-core-admin.lib}/portal-core-admin-lib.jar"/>
- </path>
-
- <!-- core-cms -->
- <property name="jboss.portal-core-cms.root"
value="${project.root}/core-cms/output"/>
- <property name="jboss.portal-core-cms.lib"
value="${jboss.portal-core-cms.root}/lib"/>
- <path id="jboss.portal-core-cms.classpath">
- <pathelement
path="${jboss.portal-core-cms.lib}/portal-core-cms-lib.jar"/>
- </path>
-
- <!-- core-management -->
- <property name="jboss.portal-core-management.root"
value="${project.root}/core-management/output"/>
- <property name="jboss.portal-core-management.lib"
value="${jboss.portal-core-management.root}/lib"/>
- <path id="jboss.portal-core-management.classpath">
- <pathelement
path="${jboss.portal-core-management.lib}/portal-core-management-lib.jar"/>
- </path>
-
- <!-- core-samples -->
- <property name="jboss.portal-core-samples.root"
value="${project.root}/core-samples/output"/>
- <property name="jboss.portal-core-samples.lib"
value="${jboss.portal-core-samples.root}/lib"/>
- <path id="jboss.portal-core-samples.classpath">
- <pathelement
path="${jboss.portal-core-samples.lib}/portal-core-samples-lib.jar"/>
- </path>
-
- <!-- core-wsrp -->
- <property name="jboss.portal-core-wsrp.root"
value="${project.root}/core-wsrp/output"/>
- <property name="jboss.portal-core-wsrp.lib"
value="${jboss.portal-core-wsrp.root}/lib"/>
- <path id="jboss.portal-core-wsrp.classpath">
- <pathelement
path="${jboss.portal-core-wsrp.lib}/portal-core-wsrp-lib.jar"/>
- </path>
-
- <!-- theme -->
- <property name="jboss.portal-theme.root"
value="${project.root}/theme/output"/>
- <property name="jboss.portal-theme.lib"
value="${jboss.portal-theme.root}/lib"/>
- <path id="jboss.portal-theme.classpath">
- <pathelement path="${jboss.portal-theme.lib}/portal-theme-lib.jar"/>
- </path>
-
- <!-- wsrp -->
- <property name="jboss.portal-wsrp.root"
value="${project.root}/wsrp/output"/>
- <property name="jboss.portal-wsrp.lib"
value="${jboss.portal-wsrp.root}/lib"/>
- <path id="jboss.portal-wsrp.classpath">
- <pathelement path="${jboss.portal-wsrp.lib}/portal-wsrp-lib.jar"/>
- <pathelement
path="${jboss.portal-wsrp.lib}/portal-wsrp-test-lib.jar"/>
- </path>
-
- <!-- registration -->
- <property name="jboss.portal-registration.root"
value="${project.root}/registration/output"/>
- <property name="jboss.portal-registration.lib"
value="${jboss.portal-registration.root}/lib"/>
- <path id="jboss.portal-registration.classpath">
- <pathelement
path="${jboss.portal-registration.lib}/portal-registration-lib.jar"/>
- <pathelement
path="${jboss.portal-registration.lib}/portal-registration-test-lib.jar"/>
- </path>
-
- <!-- security -->
- <property name="jboss.portal-security.root"
value="${project.root}/security/output"/>
- <property name="jboss.portal-security.lib"
value="${jboss.portal-security.root}/lib"/>
- <path id="jboss.portal-security.classpath">
- <pathelement
path="${jboss.portal-security.lib}/portal-security-lib.jar"/>
- <pathelement
path="${jboss.portal-security.lib}/portal-security-test-lib.jar"/>
- </path>
-
- <!-- identity -->
- <property name="jboss.portal-identity.root"
value="${project.root}/identity/output"/>
- <property name="jboss.portal-identity.lib"
value="${jboss.portal-identity.root}/lib"/>
- <path id="jboss.portal-identity.classpath">
- <pathelement
path="${jboss.portal-identity.lib}/portal-identity-lib.jar"/>
- </path>
-
- <!-- workflow -->
- <property name="jboss.portal-workflow.root"
value="${project.root}/workflow/output"/>
- <property name="jboss.portal-workflow.lib"
value="${jboss.portal-workflow.root}/lib"/>
- <path id="jboss.portal-workflow.classpath">
- <pathelement
path="${jboss.portal-workflow.lib}/portal-workflow-lib.jar"/>
- </path>
-
- <!-- samples -->
- <property name="jboss.portal-samples.root"
value="${project.root}/samples/output"/>
- <property name="jboss.portal-samples.lib"
value="${jboss.portal-samples.root}/lib"/>
- <path id="jboss.portal-samples.classpath">
- <pathelement
path="${jboss.portal-samples.lib}/portal-samples-lib.jar"/>
- </path>
-
<!-- unit module -->
<property name="jboss.unit.root"
value="${project.root}/unit/output"/>
<property name="jboss.unit.lib"
value="${jboss.unit.root}/lib"/>