Author: thomas.heute(a)jboss.com
Date: 2007-09-21 11:53:21 -0400 (Fri, 21 Sep 2007)
New Revision: 8417
Added:
modules/test/trunk/test/src/main/java/
modules/test/trunk/test/src/main/java/org/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParameterValue.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParametrization.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/impl/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/info/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/junit/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/mc/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/runner/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/server/
modules/test/trunk/test/src/main/java/org/jboss/test/
Removed:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParameterValue.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParametrization.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/impl/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/info/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/junit/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/mc/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/runner/
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/server/
modules/test/trunk/test/src/main/java/org/jboss/test/
modules/test/trunk/test/src/main/org/
Modified:
modules/test/trunk/test/.classpath
Log:
Moving the classes at the correct place
Modified: modules/test/trunk/test/.classpath
===================================================================
--- modules/test/trunk/test/.classpath 2007-09-21 15:49:06 UTC (rev 8416)
+++ modules/test/trunk/test/.classpath 2007-09-21 15:53:21 UTC (rev 8417)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib"
path="/thirdparty/apache-ant/lib/ant.jar"/>
<classpathentry kind="lib"
path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
Copied: modules/test/trunk/test/src/main/java/org (from rev 8414,
modules/test/trunk/test/src/main/org)
Deleted:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java 2007-09-21
15:26:48 UTC (rev 8414)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -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;
- }
-}
Copied:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
(from rev 8415,
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java)
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java
(rev 0)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MonoValuedTestParameterValue.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.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/java/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java 2007-09-21
15:26:48 UTC (rev 8414)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -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();
- }
- };
- }
-}
Copied:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
(from rev 8415,
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java)
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java
(rev 0)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/MultiValuedTestParameterValue.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.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/java/org/jboss/portal/test/framework/TestParameterValue.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java 2007-09-21
15:26:48 UTC (rev 8414)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParameterValue.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -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;
- }
-}
Copied:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParameterValue.java
(from rev 8415,
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParameterValue.java)
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParameterValue.java
(rev 0)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParameterValue.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.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/java/org/jboss/portal/test/framework/TestParametrization.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java 2007-09-21
15:26:48 UTC (rev 8414)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParametrization.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -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;
- }
-}
Copied:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParametrization.java
(from rev 8415,
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/TestParametrization.java)
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParametrization.java
(rev 0)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/TestParametrization.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -0,0 +1,195 @@
+/******************************************************************************
+ * 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;
+ }
+}
Deleted:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java
===================================================================
---
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java 2007-09-21
15:26:48 UTC (rev 8414)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -1,89 +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.driver.web;
-
-import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverProtocolHandler;
-import org.jboss.portal.test.framework.driver.remote.TestConversation;
-import org.jboss.portal.test.framework.driver.remote.RemoteDriverCommandContext;
-import org.jboss.portal.test.framework.driver.remote.RemoteDriverResponseContext;
-import org.jboss.portal.test.framework.driver.DriverCommand;
-import org.jboss.portal.test.framework.driver.DriverResponse;
-import org.jboss.portal.test.framework.driver.web.response.WebDriverResponse;
-import org.jboss.portal.test.framework.driver.web.response.PerformClickResponse;
-import org.jboss.portal.test.framework.driver.web.response.GetPageResponse;
-import org.jboss.portal.test.framework.driver.web.response.DnDResponse;
-import org.jboss.portal.test.framework.driver.web.command.PerformClickCommand;
-import org.jboss.portal.test.framework.driver.web.command.GetPageCommand;
-import org.jboss.portal.test.framework.driver.web.command.DnDCommand;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WebTestDriverHandler implements RemoteTestDriverProtocolHandler
-{
-
- public DriverCommand createCommand(RemoteDriverResponseContext responseContext)
- {
- if (responseContext.getResponse() instanceof WebDriverResponse)
- {
- DriverResponse resp = responseContext.getResponse();
-
- //
- if (resp instanceof PerformClickResponse)
- {
- PerformClickResponse performClick = (PerformClickResponse)resp;
- return new PerformClickCommand(performClick.getId());
- }
- else if (resp instanceof GetPageResponse)
- {
- GetPageResponse getPage = (GetPageResponse)resp;
- return new GetPageCommand(getPage.getURI());
- }
- else if (resp instanceof DnDResponse)
- {
- DnDResponse dnd = (DnDResponse)resp;
- return new DnDCommand(dnd.getFromId(), dnd.getDeltaX(), dnd.getDeltaY());
- }
- }
-
- //
- return null;
- }
-
-
- public RemoteDriverResponseContext invoke(TestConversation conversation,
RemoteDriverCommandContext commandContext) throws Exception
- {
- WebTestConversation webConversation =
(WebTestConversation)conversation.getAttribute("web.conversation");
-
- //
- if (webConversation == null)
- {
- webConversation = new WebTestConversation(conversation);
- conversation.setAttribute("web.conversation", webConversation);
- }
-
- //
- return webConversation.invoke(commandContext);
- }
-}
Copied:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java
(from rev 8415,
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java)
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java
(rev 0)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/driver/web/WebTestDriverHandler.java 2007-09-21
15:53:21 UTC (rev 8417)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.driver.web;
+
+import org.jboss.portal.test.framework.driver.remote.RemoteTestDriverProtocolHandler;
+import org.jboss.portal.test.framework.driver.remote.TestConversation;
+import org.jboss.portal.test.framework.driver.remote.RemoteDriverCommandContext;
+import org.jboss.portal.test.framework.driver.remote.RemoteDriverResponseContext;
+import org.jboss.portal.test.framework.driver.DriverCommand;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.web.response.WebDriverResponse;
+import org.jboss.portal.test.framework.driver.web.response.PerformClickResponse;
+import org.jboss.portal.test.framework.driver.web.response.GetPageResponse;
+import org.jboss.portal.test.framework.driver.web.response.DnDResponse;
+import org.jboss.portal.test.framework.driver.web.command.PerformClickCommand;
+import org.jboss.portal.test.framework.driver.web.command.GetPageCommand;
+import org.jboss.portal.test.framework.driver.web.command.DnDCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebTestDriverHandler implements RemoteTestDriverProtocolHandler
+{
+
+ public DriverCommand createCommand(RemoteDriverResponseContext responseContext)
+ {
+ if (responseContext.getResponse() instanceof WebDriverResponse)
+ {
+ DriverResponse resp = responseContext.getResponse();
+
+ //
+ if (resp instanceof PerformClickResponse)
+ {
+ PerformClickResponse performClick = (PerformClickResponse)resp;
+ return new PerformClickCommand(performClick.getId());
+ }
+ else if (resp instanceof GetPageResponse)
+ {
+ GetPageResponse getPage = (GetPageResponse)resp;
+ return new GetPageCommand(getPage.getURI());
+ }
+ else if (resp instanceof DnDResponse)
+ {
+ DnDResponse dnd = (DnDResponse)resp;
+ return new DnDCommand(dnd.getFromId(), dnd.getDeltaX(), dnd.getDeltaY());
+ }
+ }
+
+ //
+ return null;
+ }
+
+
+ public RemoteDriverResponseContext invoke(TestConversation conversation,
RemoteDriverCommandContext commandContext) throws Exception
+ {
+ WebTestConversation webConversation =
(WebTestConversation)conversation.getAttribute("web.conversation");
+
+ //
+ if (webConversation == null)
+ {
+ webConversation = new WebTestConversation(conversation);
+ conversation.setAttribute("web.conversation", webConversation);
+ }
+
+ //
+ return webConversation.invoke(commandContext);
+ }
+}
Copied: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded
(from rev 8415,
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded)
Copied: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/impl (from
rev 8415, modules/test/trunk/test/src/main/org/jboss/portal/test/framework/impl)
Copied: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/info (from
rev 8415, modules/test/trunk/test/src/main/org/jboss/portal/test/framework/info)
Copied: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/junit (from
rev 8415, modules/test/trunk/test/src/main/org/jboss/portal/test/framework/junit)
Copied: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/mc (from rev
8415, modules/test/trunk/test/src/main/org/jboss/portal/test/framework/mc)
Copied: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/runner (from
rev 8415, modules/test/trunk/test/src/main/org/jboss/portal/test/framework/runner)
Copied: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/server (from
rev 8415, modules/test/trunk/test/src/main/org/jboss/portal/test/framework/server)
Copied: modules/test/trunk/test/src/main/java/org/jboss/test (from rev 8415,
modules/test/trunk/test/src/main/org/jboss/test)