Author: julien(a)jboss.com
Date: 2007-08-16 10:37:11 -0400 (Thu, 16 Aug 2007)
New Revision: 7953
Removed:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/command/
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/response/
modules/common/trunk/common/src/main/org/jboss/portal/common/test/info/
modules/common/trunk/common/src/main/org/jboss/portal/common/test/junit/
modules/common/trunk/common/src/main/org/jboss/portal/test/common/test/
Modified:
modules/common/trunk/common/build.xml
Log:
remove test related code from common and moving it to the test framework itself
Modified: modules/common/trunk/common/build.xml
===================================================================
--- modules/common/trunk/common/build.xml 2007-08-16 13:16:23 UTC (rev 7952)
+++ modules/common/trunk/common/build.xml 2007-08-16 14:37:11 UTC (rev 7953)
@@ -216,10 +216,6 @@
<test todir="${test.reports}"
name="org.jboss.portal.test.common.io.IOToolsTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.reflect.ReflectionTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.reflect.ModifierTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.common.test.junit.POJOJunitTestTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.common.test.InfoTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.common.test.TestParameterValueTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.common.test.TestParametrizationTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.adapter.AdapterTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.BundleNameIteratorTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.BundleNameParserTestCase"/>
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -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.common.test;
-
-/**
- * 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/common/trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -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.common.test;
-
-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/common/trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -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.common.test;
-
-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/common/trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -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.common.test;
-
-import org.jboss.portal.common.test.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;
- }
-}
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -1,35 +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.test.driver;
-
-import java.io.Serializable;
-
-/**
- * The command in the test protocol.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class DriverCommand implements Serializable
-{
-}
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -1,35 +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.test.driver;
-
-import java.io.Serializable;
-
-/**
- * The response in the test protocol.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public abstract class DriverResponse implements Serializable
-{
-}
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -1,35 +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.test.driver;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class ParameterNotBoundException extends TestDriverException
-{
- public ParameterNotBoundException(String parameterName)
- {
- super("Parameter " + parameterName + " not bound");
- }
-}
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -1,40 +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.test.driver;
-
-import org.jboss.portal.common.test.info.TestItemInfo;
-
-/**
- * The contract that defines what a testable system is and its usage.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public interface TestDriver
-{
- /** Returns the meta information exposed by the driver. */
- TestItemInfo getInfo();
-
- /** Execute a command of the testing protocol. */
- DriverResponse invoke(String testId, DriverCommand command) throws
TestDriverException;
-}
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -1,57 +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.test.driver;
-
-/**
- * Provides an interface for a test driver container.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public interface TestDriverContainer extends TestDriver
-{
- /**
- * Add a driver.
- *
- * @param driver
- * @throws IllegalArgumentException if the driver is null or already registered
- */
- void addDriver(TestDriver driver) throws IllegalArgumentException;
-
- /**
- * Remove a driver.
- *
- * @param driver
- * @throws IllegalArgumentException if the driver is null or does not exist
- */
- void removeDriver(TestDriver driver) throws IllegalArgumentException;
-
- /**
- * Return a driver that is able to understand the specified id.
- *
- * @param testId
- * @return
- * @throws IllegalArgumentException
- */
- TestDriver getDriver(String testId) throws IllegalArgumentException;
-}
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -1,49 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.common.test.driver;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class TestDriverException extends Exception
-{
- public TestDriverException()
- {
- }
-
- public TestDriverException(String message)
- {
- super(message);
- }
-
- public TestDriverException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public TestDriverException(Throwable cause)
- {
- super(cause);
- }
-}
Deleted:
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java
===================================================================
---
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java 2007-08-16
13:16:23 UTC (rev 7952)
+++
modules/common/trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java 2007-08-16
14:37:11 UTC (rev 7953)
@@ -1,143 +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.test.driver;
-
-import org.jboss.portal.common.test.info.TestContainerInfo;
-import org.jboss.portal.common.test.info.TestItemInfo;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * A test suite is a test driver container that expose itself as a test driver.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class TestSuite implements TestDriverContainer
-{
-
- /** . */
- protected final Map entries;
-
- /** . */
- protected final TestContainerInfo info;
-
- public TestSuite(String id)
- {
- entries = new LinkedHashMap();
- info = new TestContainerInfo(id);
- }
-
- public TestDriver getDriver(String testId)
- {
- TestItemInfo itemInfo = info.findItem(testId);
- if (itemInfo == null)
- {
- return null;
- }
-
- // Find original parent
- TestItemInfo currentInfo = itemInfo;
- while (true)
- {
- TestContainerInfo parentInfo = currentInfo.getParent();
- if (parentInfo == null)
- {
- //
- return null;
- }
- else if (parentInfo == info)
- {
- break;
- }
- else
- {
- currentInfo = parentInfo;
- }
- }
-
- //
- return (TestDriver)entries.get(currentInfo.getName());
- }
-
- public void addDriver(TestDriver test) throws IllegalArgumentException
- {
- if (test == null)
- {
- throw new IllegalArgumentException("Cannot add null test");
- }
- TestItemInfo itemInfo = test.getInfo();
- String entryKey = itemInfo.getName();
- if (entries.containsKey(entryKey))
- {
- throw new IllegalArgumentException("Cannot have two tests with the same id
" + entryKey);
- }
-
- //
- info.addChild(itemInfo);
- entries.put(entryKey, test);
- }
-
- public void removeDriver(TestDriver test) throws IllegalArgumentException
- {
- if (test == null)
- {
- throw new IllegalArgumentException("Cannot add null test");
- }
- String entryKey = test.getInfo().getName();
- if (!entries.containsKey(entryKey))
- {
- throw new IllegalArgumentException("Cannot remove test that was not added
previously " + entryKey);
- }
-
- //
- entries.remove(entryKey);
- info.removeChild(entryKey);
- }
-
- // TestDriver implementation
****************************************************************************************
-
- public TestItemInfo getInfo()
- {
- return info;
- }
-
- public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
- {
- TestItemInfo item = info.findItem(testId);
- if (item == null)
- {
- throw new TestDriverException("Driver not found for " + testId);
- }
-
- // Get associated test driver
- TestDriver driver = getDriver(testId);
-
- // Get new relative id
- String newTestId = item.getId(driver.getInfo());
-
- // Route the command to the target driver
- return driver.invoke(newTestId, cmd);
- }
-}