Author: julien(a)jboss.com
Date: 2007-10-01 18:01:06 -0400 (Mon, 01 Oct 2007)
New Revision: 8505
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag1.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag2.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag3.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag1.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag2.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag3.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTest.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/ParameterDescriptor.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDef.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDescriptor.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestParameter.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/annotations/Tag.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java
modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestCaseInfo.java
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestCaseInfo.java
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestInfo.java
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java
Log:
- make TestCaseDescriptor and TestParameterDescriptor interfaces
- implement and test keyword tagging of tests
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTest.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTest.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTest.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -38,6 +38,10 @@
public abstract Set<String> getTestCaseParameterNames(String testCaseName);
+ public abstract Set<String> getKeywords();
+
+ public abstract Set<String> getTestCaseKeywords(String testCaseName);
+
public abstract InvokeResult invoke(String testName, Map<String,String>
parametrization);
public enum InvokeResult
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -24,6 +24,8 @@
import org.jboss.unit.api.Assert;
+import static org.jboss.unit.util.CollectionTools.*;
+
import java.util.Map;
import java.util.Collections;
import java.util.HashMap;
@@ -50,6 +52,7 @@
testClassWithoutAnnotations();
testAbstractClassAnnotatedWithTest();
testClassAnnotatedWithTest();
+ testClassAnnotatedWithTag();
//
testMethodAnnotatedWithTest();
@@ -57,6 +60,7 @@
testTestMethodAnnotatedWithConflictingAnnotations();
testMethodAnnotatedWithParameter();
testMethodAnnotatedWithCreate();
+ testMethodAnnotatedWithTag();
//
testClassHavingSamePropertyParameterAndMethodArgumentParameter();
@@ -69,6 +73,32 @@
testLifeCycleSequence();
}
+ private void testClassAnnotatedWithTag()
+ {
+ testClassAnnotatedWithTag(ClassAnnotatedWithTag1.class,
set("annotation_foo"));
+ testClassAnnotatedWithTag(ClassAnnotatedWithTag2.class,
set("annotation_foo", "annotation_bar"));
+ testClassAnnotatedWithTag(ClassAnnotatedWithTag3.class, new
HashSet<String>());
+ }
+
+ private void testClassAnnotatedWithTag(Class clazz, Set<String> keywords)
+ {
+ AbstractPOJOTest driver = assertCanBuildSuite(clazz);
+ Assert.assertEquals(keywords, driver.getKeywords());
+ }
+
+ private void testMethodAnnotatedWithTag()
+ {
+ testMethodAnnotatedWithTag(MethodAnnotatedWithTag1.class, "testFoo",
set("annotation_foo"));
+ testMethodAnnotatedWithTag(MethodAnnotatedWithTag2.class, "testFoo",
set("annotation_foo", "annotation_bar"));
+ testMethodAnnotatedWithTag(MethodAnnotatedWithTag3.class, "testFoo", new
HashSet<String>());
+ }
+
+ private void testMethodAnnotatedWithTag(Class clazz, String testName,
Set<String> keywords)
+ {
+ AbstractPOJOTest driver = assertCanBuildSuite(clazz);
+ Assert.assertEquals(keywords, driver.getTestCaseKeywords(testName));
+ }
+
private void testLifeCycleSequence()
{
testLifeCycleSequence(LifeCycleSequence01.class,
AbstractPOJOTest.InvokeResult.ERROR, null, false);
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag1.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag1.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag1.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+@Tag("annotation_foo")
+public class ClassAnnotatedWithTag1
+{
+}
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag2.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag2.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag2.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+@Tag({"annotation_foo","annotation_bar"})
+public class ClassAnnotatedWithTag2
+{
+}
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag3.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag3.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassAnnotatedWithTag3.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.test.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassAnnotatedWithTag3
+{
+}
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag1.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag1.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag1.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.test.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MethodAnnotatedWithTag1
+{
+
+ @Test
+ @Tag("annotation_foo")
+ public void testFoo()
+ {
+
+ }
+
+}
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag2.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag2.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag2.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.test.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MethodAnnotatedWithTag2
+{
+
+ @Test
+ @Tag({"annotation_foo","annotation_bar"})
+ public void testFoo()
+ {
+
+ }
+
+}
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag3.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag3.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAnnotatedWithTag3.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MethodAnnotatedWithTag3
+{
+
+ @Test
+ public void testFoo()
+ {
+
+ }
+
+}
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -66,11 +66,24 @@
return suiteInfo.getParameters().keySet();
}
+ public Set<String> getKeywords()
+ {
+ return suiteInfo.getKeywords();
+ }
+
public Set<String> getTestCaseNames()
{
return suiteInfo.getNames();
}
+ public Set<String> getTestCaseKeywords(String testCaseName)
+ {
+ TestInfo info = suiteInfo.getTest(testCaseName);
+ assertNotNull(info);
+ TestCaseInfo testCaseInfo = assertInstanceOf(info, TestCaseInfo.class);
+ return testCaseInfo.getKeywords();
+ }
+
public Set<String> getTestCaseParameterNames(String testCaseName)
{
TestInfo info = suiteInfo.getTest(testCaseName);
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -56,6 +56,18 @@
return handler.getTestCases().keySet();
}
+ public Set<String> getKeywords()
+ {
+ return handler.getKeywords();
+ }
+
+ public Set<String> getTestCaseKeywords(String testCaseName)
+ {
+ TestCaseDescriptor descriptor = handler.getTestCases().get(testCaseName);
+ assertNotNull(descriptor);
+ return descriptor.getKeywords();
+ }
+
public Set<String> getTestCaseParameterNames(String testCaseName)
{
TestCaseDescriptor descriptor = handler.getTestCases().get(testCaseName);
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -23,6 +23,9 @@
package org.jboss.test.unit.runner;
import org.jboss.unit.runner.TestRunner;
+import org.jboss.unit.runner.AbstractTestRunner;
+import org.jboss.unit.runner.TestFilter;
+import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
import org.jboss.unit.runner.impl.composite.CompositeTestRunner;
@@ -41,20 +44,62 @@
public static void main(String[] args)
{
- EventDrivenTestRunner srunner = new EventDrivenTestRunner(
- new StartRunnerEvent(),
- new EndRunnerEvent()
- );
+ MyRunner1 runner1 = new MyRunner1();
+ MyRunner1 runner2 = new MyRunner1();
Collection<TestRunner> runners = new ArrayList<TestRunner>();
- runners.add(srunner);
+ runners.add(runner1);
+ runners.add(runner2);
CompositeTestRunner runner = new CompositeTestRunner(runners);
runner.run();
+
+ }
+ private static class MyRunner1 extends AbstractTestRunner
+ {
+
+ /** . */
+ final TestRunnerEvent event = new MyEvent();
+
+ boolean invoked;
+
+ protected void internalRun(TestFilter filter)
+ {
+ invoked = true;
+ fireEvent(event);
+ }
}
+ private static class MyRunner2 extends AbstractTestRunner
+ {
+
+ /** . */
+ final RuntimeException exception = new RuntimeException();
+
+ protected void internalRun(TestFilter filter)
+ {
+ throw exception;
+ }
+ }
+
+ private static class MyRunner3 extends AbstractTestRunner
+ {
+
+ /** . */
+ final Error error = new Error();
+
+ protected void internalRun(TestFilter filter)
+ {
+ throw error;
+ }
+ }
+
+ private static class MyEvent extends TestRunnerEvent
+ {
+ }
+
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/ParameterDescriptor.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/ParameterDescriptor.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/ParameterDescriptor.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -30,51 +30,12 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ParameterDescriptor
+public interface ParameterDescriptor
{
- /** . */
- private String name;
+ String getName();
- /** . */
- private String description;
+ String getDescription();
- /** . */
- private List<String> defaultValues;
-
- public ParameterDescriptor(String name)
- {
- if (name == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public List<String> getDefaultValues()
- {
- return defaultValues;
- }
-
- public void setDefaultValues(List<String> defaultValues)
- {
- this.defaultValues = defaultValues;
- }
+ List<String> getDefaultValues();
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDef.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDef.java 2007-10-01
16:34:06 UTC (rev 8504)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDef.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -24,12 +24,16 @@
import java.lang.reflect.Method;
import java.util.LinkedHashMap;
+import java.util.Set;
+import java.util.Map;
+import java.util.Collections;
+import java.util.HashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-class TestCaseDef
+class TestCaseDef implements TestCaseDescriptor
{
/** . */
@@ -45,38 +49,28 @@
final String description;
/** . */
- final LinkedHashMap<String,ArgumentTestParameter> parameters;
+ final LinkedHashMap<String,ArgumentTestParameter> arguments;
-// /** . */
-// private final TestCaseInfo info = new TestCaseInfo()
-// {
-// public String getName()
-// {
-// return name;
-// }
-// public String getDescription()
-// {
-// return description;
-// }
-// public Map<String, ? extends ParameterInfo> getParameters()
-// {
-// Map<String, ParameterInfo> merge = new HashMap<String,
ParameterInfo>();
-// merge.putAll(driver.getInfo().getParameters());
-// merge.putAll(parameters);
-// return merge;
-// }
-// public Set<String> getTags()
-// {
-// return Collections.emptySet();
-// }
-// };
+ /** . */
+ final Map<String,TestParameter> parameters;
- TestCaseDef(Method method, String name, String description, LinkedHashMap<String,
ArgumentTestParameter> parameters)
+ /** . */
+ final Set<String> keywords;
+
+ TestCaseDef(
+ Method method,
+ String name,
+ String description,
+ Map<String, TestParameter> parameters,
+ LinkedHashMap<String, ArgumentTestParameter> arguments,
+ Set<String> keywords)
{
this.method = method;
this.name = name;
this.description = description;
+ this.arguments = arguments;
this.parameters = parameters;
+ this.keywords = keywords;
}
public String getName()
@@ -88,4 +82,14 @@
{
return description;
}
+
+ public Map<String, ? extends ParameterDescriptor> getParameters()
+ {
+ return Collections.unmodifiableMap(parameters);
+ }
+
+ public Set<String> getKeywords()
+ {
+ return Collections.unmodifiableSet(keywords);
+ }
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDescriptor.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDescriptor.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestCaseDescriptor.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -23,54 +23,20 @@
package org.jboss.unit.api.pojo;
import java.util.Map;
+import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestCaseDescriptor
+public interface TestCaseDescriptor
{
- /** . */
- private String name;
+ String getName();
- /** . */
- private String description;
+ String getDescription();
- /** . */
- private Map<String,ParameterDescriptor> parameters;
+ Map<String, ? extends ParameterDescriptor> getParameters();
- public TestCaseDescriptor(String name)
- {
- if (name == null)
- {
- throw new IllegalArgumentException();
- }
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public Map<String, ParameterDescriptor> getParameters()
- {
- return parameters;
- }
-
- public void setParameters(Map<String, ParameterDescriptor> parameters)
- {
- this.parameters = parameters;
- }
+ Set<String> getKeywords();
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java 2007-10-01
16:34:06 UTC (rev 8504)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -26,6 +26,7 @@
import org.jboss.unit.api.pojo.TestCaseDescriptor;
import java.util.Map;
+import java.util.Set;
/**
* Allow a pojo class to take care of providing its description and perform test case
life cycle management.
@@ -51,18 +52,25 @@
String getDescription();
/**
+ * Returns the keywords for the test.
+ *
+ * @return the test keywords
+ */
+ Set<String> getKeywords();
+
+ /**
* Return the test parameters.
*
* @return the test parameters
*/
- Map<String,ParameterDescriptor> getParameters();
+ Map<String,? extends ParameterDescriptor> getParameters();
/**
* Return the test case descriptions.
*
* @return the test case descriptions
*/
- Map<String, TestCaseDescriptor> getTestCases();
+ Map<String,? extends TestCaseDescriptor> getTestCases();
/**
* Instantiate life cycle operation of a test case.
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.unit.api.pojo;
-import org.jboss.unit.api.pojo.ParameterDescriptor;
-import org.jboss.unit.api.pojo.TestCaseDescriptor;
import org.jboss.unit.api.pojo.annotations.Test;
import org.jboss.unit.api.pojo.annotations.Parameter;
import org.jboss.unit.api.pojo.annotations.Create;
import org.jboss.unit.api.pojo.annotations.Destroy;
import org.jboss.unit.api.pojo.annotations.Description;
+import org.jboss.unit.api.pojo.annotations.Tag;
+import org.jboss.unit.util.CollectionTools;
import java.util.SortedMap;
import java.util.TreeMap;
@@ -37,6 +37,9 @@
import java.util.LinkedHashMap;
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
import java.lang.reflect.Modifier;
import java.lang.reflect.Constructor;
import java.lang.reflect.AnnotatedElement;
@@ -55,32 +58,29 @@
{
/** . */
- private String suiteName;
+ private final String suiteName;
/** . */
- private String suiteDescription;
+ private final String suiteDescription;
/** . */
- private Map<String, TestCaseDef> testCases;
+ private final Map<String, TestCaseDef> testCases;
/** . */
- private Method create;
+ private final Method create;
/** . */
- private Method destroy;
+ private final Method destroy;
/** . */
- private Map<String, PropertyTestParameter> parameters;
+ final Map<String, PropertyTestParameter> suiteParameters;
/** . */
- private Map<String, ParameterDescriptor> parameterDescriptors;
+ private final Constructor ctor;
/** . */
- private Map<String, TestCaseDescriptor> testCasesDescriptors;
+ private final Set<String> suiteKeywords;
- /** . */
- private Constructor ctor;
-
public TestHandlerSupport(Class testClass)
{
if (testClass == null)
@@ -95,6 +95,7 @@
}
// Check constructor
+ Constructor ctor;
try
{
ctor = testClass.getConstructor();
@@ -106,7 +107,7 @@
//
Test testAnnotation = ((AnnotatedElement)testClass).getAnnotation(Test.class);
- suiteName = testAnnotation != null ? testAnnotation.name() : "";
+ String suiteName = testAnnotation != null ? testAnnotation.name() : "";
if (suiteName.length() == 0)
{
suiteName = testClass.getName();
@@ -114,12 +115,19 @@
//
Description descriptionAnnotation =
((AnnotatedElement)testClass).getAnnotation(Description.class);
- suiteDescription = descriptionAnnotation != null ?
descriptionAnnotation.description() : "";
+ String suiteDescription = descriptionAnnotation != null ?
descriptionAnnotation.description() : "";
if (suiteDescription.length() == 0)
{
suiteDescription = "Test of class " + testClass.getName();
}
+ Tag tag = ((AnnotatedElement)testClass).getAnnotation(Tag.class);
+ Set<String> suiteKeywords = new HashSet<String>();
+ if (tag != null)
+ {
+ suiteKeywords.addAll(CollectionTools.set(tag.value()));
+ }
+
//
SortedMap<MethodKey, Method> methods = new TreeMap<MethodKey,
Method>();
for (Method method : testClass.getMethods())
@@ -129,20 +137,20 @@
}
//
- parameters = new HashMap<String, PropertyTestParameter>();
- testCases = new HashMap<String, TestCaseDef>();
+ Map<String, PropertyTestParameter> suiteParameters = new HashMap<String,
PropertyTestParameter>();
+ Map<String, TestCaseDef> testCases = new HashMap<String,
TestCaseDef>();
+ Method create = null;
+ Method destroy = null;
- //
+ // First pass for parameters and life cycle annotations
for (Method method : methods.values())
{
String methodName = method.getName();
int modifiers = method.getModifiers();
-
- //
Parameter parameterMethodAnnotation = method.getAnnotation(Parameter.class);
-
- //
Test testMethodAnnotation = method.getAnnotation(Test.class);
+ Create createMethodAnnotation = method.getAnnotation(Create.class);
+ Destroy destroyMethodAnnotation = method.getAnnotation(Destroy.class);
//
if (testMethodAnnotation != null && parameterMethodAnnotation != null)
@@ -150,8 +158,6 @@
throw new IllegalArgumentException();
}
- Create createMethodAnnotation = method.getAnnotation(Create.class);
-
//
if (createMethodAnnotation != null && parameterMethodAnnotation !=
null)
{
@@ -162,8 +168,6 @@
throw new IllegalArgumentException();
}
- Destroy destroyMethodAnnotation = method.getAnnotation(Destroy.class);
-
//
if (destroyMethodAnnotation != null && parameterMethodAnnotation !=
null)
{
@@ -226,18 +230,22 @@
}
//
- PropertyTestParameter parameter = parameters.get(name);
+ PropertyTestParameter parameter = suiteParameters.get(name);
if (parameter == null)
{
parameter = new PropertyTestParameter(name, description);
- parameters.put(name, parameter);
+ suiteParameters.put(name, parameter);
}
//
parameter.addSetter(method);
}
- else if (testMethodAnnotation != null)
+ else if (createMethodAnnotation != null)
{
+ if (create != null)
+ {
+ throw new IllegalArgumentException();
+ }
if (method.getReturnType() != void.class)
{
throw new IllegalArgumentException();
@@ -254,9 +262,74 @@
{
throw new IllegalArgumentException();
}
+ if (method.getParameterTypes().length > 0)
+ {
+ throw new IllegalArgumentException();
+ }
//
- LinkedHashMap<String, ArgumentTestParameter> argumentParameters = new
LinkedHashMap<String, ArgumentTestParameter>();
+ create = method;
+ }
+ else if (destroyMethodAnnotation != null)
+ {
+ if (destroy != null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (method.getReturnType() != void.class)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (Modifier.isAbstract(modifiers))
+ {
+ throw new IllegalArgumentException();
+ }
+ if (!Modifier.isPublic(modifiers))
+ {
+ throw new IllegalArgumentException();
+ }
+ if (Modifier.isStatic(modifiers))
+ {
+ throw new IllegalArgumentException();
+ }
+ if (method.getParameterTypes().length > 0)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ destroy = method;
+ }
+ }
+
+ // Second pass for test annotations
+ for (Method method : methods.values())
+ {
+ int modifiers = method.getModifiers();
+ Test testMethodAnnotation = method.getAnnotation(Test.class);
+
+ //
+ if (testMethodAnnotation != null)
+ {
+ if (method.getReturnType() != void.class)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (Modifier.isAbstract(modifiers))
+ {
+ throw new IllegalArgumentException();
+ }
+ if (!Modifier.isPublic(modifiers))
+ {
+ throw new IllegalArgumentException();
+ }
+ if (Modifier.isStatic(modifiers))
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ LinkedHashMap<String, ArgumentTestParameter> methodParameters = new
LinkedHashMap<String, ArgumentTestParameter>();
for (Annotation[] parameterAnnotations : method.getParameterAnnotations())
{
Map<Class<? extends Annotation>,Annotation>
parameterAnnotationMap = new HashMap<Class<? extends Annotation>,
Annotation>();
@@ -278,7 +351,7 @@
{
throw new IllegalArgumentException();
}
- if (argumentParameters.containsKey(name))
+ if (methodParameters.containsKey(name))
{
throw new IllegalArgumentException();
}
@@ -292,7 +365,7 @@
}
//
- argumentParameters.put(name, new ArgumentTestParameter(name,
description));
+ methodParameters.put(name, new ArgumentTestParameter(name,
description));
}
else
{
@@ -316,106 +389,38 @@
}
//
- TestCaseDef testCaseDef = new TestCaseDef(method, name, description,
argumentParameters);
-
- //
- if (testCases.put(testCaseDef.getName(), testCaseDef) != null)
+ Set<String> keywords = new HashSet<String>();
+ Tag tagMethodAnnotation = method.getAnnotation(Tag.class);
+ if (tagMethodAnnotation != null)
{
- throw new IllegalArgumentException();
+ keywords.addAll(CollectionTools.set(tagMethodAnnotation.value()));
}
- }
- else if (createMethodAnnotation != null)
- {
- if (create != null)
- {
- throw new IllegalArgumentException();
- }
- if (method.getReturnType() != void.class)
- {
- throw new IllegalArgumentException();
- }
- if (Modifier.isAbstract(modifiers))
- {
- throw new IllegalArgumentException();
- }
- if (!Modifier.isPublic(modifiers))
- {
- throw new IllegalArgumentException();
- }
- if (Modifier.isStatic(modifiers))
- {
- throw new IllegalArgumentException();
- }
- if (method.getParameterTypes().length > 0)
- {
- throw new IllegalArgumentException();
- }
+ Map<String,TestParameter> parameters = new HashMap<String,
TestParameter>(suiteParameters);
+ parameters.putAll(methodParameters);
+
//
- create = method;
- }
- else if (destroyMethodAnnotation != null)
- {
- if (destroy != null)
+ TestCaseDef testCaseDef = new TestCaseDef(method, name, description,
parameters, methodParameters, keywords);
+
+ //
+ if (testCases.put(testCaseDef.getName(), testCaseDef) != null)
{
throw new IllegalArgumentException();
}
- if (method.getReturnType() != void.class)
- {
- throw new IllegalArgumentException();
- }
- if (Modifier.isAbstract(modifiers))
- {
- throw new IllegalArgumentException();
- }
- if (!Modifier.isPublic(modifiers))
- {
- throw new IllegalArgumentException();
- }
- if (Modifier.isStatic(modifiers))
- {
- throw new IllegalArgumentException();
- }
- if (method.getParameterTypes().length > 0)
- {
- throw new IllegalArgumentException();
- }
-
- //
- destroy = method;
}
}
- // Init parameter descriptors
- parameterDescriptors = buildDescriptorMap(parameters);
-
//
- testCasesDescriptors = new LinkedHashMap<String, TestCaseDescriptor>();
- for (TestCaseDef testCaseDef : testCases.values())
- {
- TestCaseDescriptor testCaseDescriptor = new
TestCaseDescriptor(testCaseDef.getName());
- testCaseDescriptor.setDescription(testCaseDef.name);
- Map<String, ParameterDescriptor> merge = new LinkedHashMap<String,
ParameterDescriptor>();
- merge.putAll(parameterDescriptors);
- merge.putAll(buildDescriptorMap(testCaseDef.parameters));
- testCaseDescriptor.setParameters(merge);
- testCasesDescriptors.put(testCaseDescriptor.getName(), testCaseDescriptor);
- }
+ this.suiteName = suiteName;
+ this.suiteDescription = suiteDescription;
+ this.suiteKeywords = suiteKeywords;
+ this.suiteParameters = suiteParameters;
+ this.testCases = testCases;
+ this.ctor = ctor;
+ this.create = create;
+ this.destroy = destroy;
}
- private static Map<String, ParameterDescriptor>
buildDescriptorMap(Map<String, ? extends TestParameter> parameters)
- {
- Map<String, ParameterDescriptor> parameterDescriptors = new
LinkedHashMap<String, ParameterDescriptor>();
- for (TestParameter parameter : parameters.values())
- {
- ParameterDescriptor parameterDescriptor = new
ParameterDescriptor(parameter.getName());
- parameterDescriptor.setDescription(parameter.getDescription());
- parameterDescriptor.setDefaultValues(new ArrayList<String>());
- parameterDescriptors.put(parameter.getName(), parameterDescriptor);
- }
- return parameterDescriptors;
- }
-
public String getName()
{
return suiteName;
@@ -426,16 +431,21 @@
return suiteDescription;
}
- public Map<String, ParameterDescriptor> getParameters()
+ public Set<String> getKeywords()
{
- return parameterDescriptors;
+ return suiteKeywords;
}
- public Map<String, TestCaseDescriptor> getTestCases()
+ public Map<String, ? extends ParameterDescriptor> getParameters()
{
- return testCasesDescriptors;
+ return Collections.unmodifiableMap(suiteParameters);
}
+ public Map<String, ? extends TestCaseDescriptor> getTestCases()
+ {
+ return Collections.unmodifiableMap(testCases);
+ }
+
public Object newTestCase(String name) throws TestCaseLifeCycleException
{
TestCaseDef testCaseDef = testCases.get(name);
@@ -473,7 +483,7 @@
testCase.parametrization = parametrization;
//
- for (PropertyTestParameter parameter : parameters.values())
+ for (PropertyTestParameter parameter : suiteParameters.values())
{
if (!parametrization.containsKey(parameter.getName()))
{
@@ -525,7 +535,7 @@
TestCase testCase = (TestCase)_testCase;
List<Object> argList = new ArrayList<Object>();
- for (String parameterName : testCase.def.parameters.keySet())
+ for (String parameterName : testCase.def.arguments.keySet())
{
if (!testCase.parametrization.containsKey(parameterName))
{
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestParameter.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestParameter.java 2007-10-01
16:34:06 UTC (rev 8504)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestParameter.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-class TestParameter
+class TestParameter implements ParameterDescriptor
{
/** . */
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/annotations/Tag.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/annotations/Tag.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/annotations/Tag.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -28,6 +28,8 @@
import java.lang.annotation.ElementType;
/**
+ * Annotate something with keywords.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -22,64 +22,12 @@
******************************************************************************/
package org.jboss.unit.api.pojo.junit;
-import org.jboss.unit.api.pojo.TestHandler;
-import org.jboss.unit.api.pojo.TestCaseLifeCycleException;
-import org.jboss.unit.api.pojo.ParameterDescriptor;
-import org.jboss.unit.api.pojo.TestCaseDescriptor;
-
-import java.util.Map;
-
/**
* @todo
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class JUnitTestHandler implements TestHandler
+public class JUnitTestHandler
{
-
- public String getName()
- {
- return null;
- }
-
- public String getDescription()
- {
- return null;
- }
-
- public Map<String, ParameterDescriptor> getParameters()
- {
- return null;
- }
-
- public Map<String, TestCaseDescriptor> getTestCases()
- {
- return null;
- }
-
- public Object newTestCase(String name) throws TestCaseLifeCycleException
- {
- return null;
- }
-
- public void testCaseParametrize(Object testCase, Map<String, String>
parametrization) throws TestCaseLifeCycleException
- {
-
- }
-
- public void testCaseCreate(Object testCase) throws TestCaseLifeCycleException
- {
-
- }
-
- public void testCaseInvoke(Object testCase) throws TestCaseLifeCycleException
- {
-
- }
-
- public void testCaseDestroy(Object testCase)
- {
-
- }
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java 2007-10-01 16:34:06
UTC (rev 8504)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java 2007-10-01 22:01:06
UTC (rev 8505)
@@ -57,9 +57,9 @@
Map<String,? extends ParameterInfo> getParameters();
/**
- * Returns the set of tags.
+ * Returns the set of keywords.
*
- * @return the set of tags
+ * @return the set of keywords
*/
- Set<String> getTags();
+ Set<String> getKeywords();
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -30,7 +30,9 @@
import java.util.Collection;
/**
- * A composite test runner.
+ * A composite test runner that executes a suite of test runners. If a runner throws an
unchecked throwable during
+ * the execution of its <code>run</code> method then composite runner will
not make an attempt to catch it
+ * and thus the execution will stop.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestCaseInfo.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestCaseInfo.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestCaseInfo.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -59,7 +59,7 @@
return Collections.emptyMap();
}
- public Set<String> getTags()
+ public Set<String> getKeywords()
{
return Collections.emptySet();
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestCaseInfo.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestCaseInfo.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestCaseInfo.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -37,7 +37,7 @@
public POJOTestCaseInfo(TestCaseDescriptor descriptor)
{
- super(descriptor.getParameters());
+ super(descriptor.getParameters(), descriptor.getKeywords());
//
this.descriptor = descriptor;
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestInfo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestInfo.java 2007-10-01
16:34:06 UTC (rev 8504)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestInfo.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -41,7 +41,10 @@
/** . */
private Map<String,POJOParameterInfo> parameters;
- public POJOTestInfo(Map<String,ParameterDescriptor> parameterDescriptors)
+ /** . */
+ private Set<String> keywords;
+
+ public POJOTestInfo(Map<String,? extends ParameterDescriptor>
parameterDescriptors, Set<String> keywords)
{
Map<String, POJOParameterInfo> parameters = new HashMap<String,
POJOParameterInfo>();
for (ParameterDescriptor parameterDescriptor : parameterDescriptors.values())
@@ -52,6 +55,7 @@
//
this.parameters = parameters;
+ this.keywords = keywords;
}
public Map<String, ? extends ParameterInfo> getParameters()
@@ -59,8 +63,8 @@
return parameters;
}
- public Set<String> getTags()
+ public Set<String> getKeywords()
{
- return Collections.emptySet();
+ return keywords;
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java 2007-10-01
16:34:06 UTC (rev 8504)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java 2007-10-01
22:01:06 UTC (rev 8505)
@@ -47,7 +47,7 @@
public POJOTestSuiteInfo(TestHandler handler)
{
- super(handler.getParameters());
+ super(handler.getParameters(), handler.getKeywords());
//
HashMap<String, POJOTestCaseInfo> testCases = new HashMap<String,
POJOTestCaseInfo>();