Author: julien(a)jboss.com
Date: 2007-10-04 18:41:52 -0400 (Thu, 04 Oct 2007)
New Revision: 8537
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProvider.java
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandler.java
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandlerSupport.java
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/TestHandlerSupportPOJOTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitProvider.java
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/annotations/Provider.java
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java
Log:
renamed TestHandler -> TestProvider
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-04
22:40:54 UTC (rev 8536)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.test.unit.pojo;
-import org.jboss.unit.spi.pojo.TestHandler;
+import org.jboss.unit.spi.pojo.TestProvider;
import org.jboss.unit.spi.pojo.TestCaseLifeCycleException;
import org.jboss.unit.spi.pojo.TestCaseDescriptor;
import org.jboss.unit.spi.pojo.TestCase;
@@ -40,38 +40,38 @@
{
/** . */
- private TestHandler handler;
+ private TestProvider provider;
- public TestHandlerSupportPOJOTest(TestHandler handler)
+ public TestHandlerSupportPOJOTest(TestProvider provider)
{
- this.handler = handler;
+ this.provider = provider;
}
public Set<String> getParameterNames()
{
- return handler.getDescriptor().getParameters().keySet();
+ return provider.getDescriptor().getParameters().keySet();
}
public Set<String> getTestCaseNames()
{
- return handler.getDescriptor().getTestCases().keySet();
+ return provider.getDescriptor().getTestCases().keySet();
}
public Set<String> getKeywords()
{
- return handler.getDescriptor().getKeywords();
+ return provider.getDescriptor().getKeywords();
}
public Set<String> getTestCaseKeywords(String testCaseName)
{
- TestCaseDescriptor descriptor =
handler.getDescriptor().getTestCases().get(testCaseName);
+ TestCaseDescriptor descriptor =
provider.getDescriptor().getTestCases().get(testCaseName);
assertNotNull(descriptor);
return descriptor.getKeywords();
}
public Set<String> getTestCaseParameterNames(String testCaseName)
{
- TestCaseDescriptor descriptor =
handler.getDescriptor().getTestCases().get(testCaseName);
+ TestCaseDescriptor descriptor =
provider.getDescriptor().getTestCases().get(testCaseName);
assertNotNull(descriptor);
return descriptor.getParameters().keySet();
}
@@ -82,11 +82,11 @@
boolean invokeDestroy = false;
try
{
- testCase = handler.getLifeCycle().newTestCase(testName);
- handler.getLifeCycle().testCaseParametrize(testCase, parametrization);
+ testCase = provider.getLifeCycle().newTestCase(testName);
+ provider.getLifeCycle().testCaseParametrize(testCase, parametrization);
invokeDestroy = true;
- handler.getLifeCycle().testCaseCreate(testCase);
- handler.getLifeCycle().testCaseInvoke(testCase);
+ provider.getLifeCycle().testCaseCreate(testCase);
+ provider.getLifeCycle().testCaseInvoke(testCase);
return InvokeResult.PASS;
}
catch (TestCaseLifeCycleException e)
@@ -105,7 +105,7 @@
{
if (invokeDestroy)
{
- handler.getLifeCycle().testCaseDestroy(testCase);
+ provider.getLifeCycle().testCaseDestroy(testCase);
}
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTests.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTests.java 2007-10-04
22:40:54 UTC (rev 8536)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTests.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.test.unit.pojo;
-import org.jboss.unit.spi.pojo.TestHandlerSupport;
+import org.jboss.unit.spi.pojo.TestProviderSupport;
import org.jboss.unit.api.Assert;
/**
@@ -37,7 +37,7 @@
{
try
{
- new TestHandlerSupport(clazz);
+ new TestProviderSupport(clazz);
Assert.fail();
}
catch (IllegalArgumentException expected)
@@ -47,6 +47,6 @@
protected AbstractPOJOTest assertCanBuildSuite(Class clazz)
{
- return new TestHandlerSupportPOJOTest(new TestHandlerSupport(clazz));
+ return new TestHandlerSupportPOJOTest(new TestProviderSupport(clazz));
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitProvider.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitProvider.java 2007-10-04
22:40:54 UTC (rev 8536)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitProvider.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.unit.api.pojo.junit;
-import org.jboss.unit.spi.pojo.TestHandler;
+import org.jboss.unit.spi.pojo.TestProvider;
import org.jboss.unit.spi.pojo.TestSuiteDescriptor;
import org.jboss.unit.spi.pojo.TestLifeCycle;
@@ -32,7 +32,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class JUnitProvider implements TestHandler
+public class JUnitProvider implements TestProvider
{
/** . */
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java 2007-10-04
22:40:54 UTC (rev 8536)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -36,7 +36,7 @@
{
/** . */
- TestHandlerSupport driver;
+ TestProviderSupport driver;
/** . */
final Method method;
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandler.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandler.java 2007-10-04
22:40:54 UTC (rev 8536)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandler.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.spi.pojo;
-
-/**
- * Allow a pojo class to take care of providing its description and perform test case
life cycle management.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface TestHandler
-{
-
- TestSuiteDescriptor getDescriptor();
-
- TestLifeCycle getLifeCycle();
-
-}
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandlerSupport.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandlerSupport.java 2007-10-04
22:40:54 UTC (rev 8536)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandlerSupport.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -1,597 +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.unit.spi.pojo;
-
-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;
-import java.util.Map;
-import java.util.HashMap;
-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;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.annotation.Annotation;
-import java.beans.Introspector;
-
-/**
- * Provide a default implementation that relies on the annotation defined in the
<code>annotations</code> package.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestHandlerSupport implements TestHandler, TestLifeCycle,
TestSuiteDescriptor
-{
-
- /** . */
- private final String suiteName;
-
- /** . */
- private final String suiteDescription;
-
- /** . */
- private final Map<String, TestCaseDef> testCases;
-
- /** . */
- private final Method create;
-
- /** . */
- private final Method destroy;
-
- /** . */
- final Map<String, PropertyTestParameter> suiteParameters;
-
- /** . */
- private final Constructor ctor;
-
- /** . */
- private final Set<String> suiteKeywords;
-
- public TestHandlerSupport(Class testClass)
- {
- if (testClass == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- if (Modifier.isAbstract(testClass.getModifiers()))
- {
- throw new IllegalArgumentException("Test class is abstract");
- }
-
- // Check constructor
- Constructor ctor;
- try
- {
- ctor = testClass.getConstructor();
- }
- catch (NoSuchMethodException e)
- {
- throw new IllegalArgumentException(e);
- }
-
- //
- Test testAnnotation = ((AnnotatedElement)testClass).getAnnotation(Test.class);
- String suiteName = testAnnotation != null ? testAnnotation.name() : "";
- if (suiteName.length() == 0)
- {
- suiteName = testClass.getName();
- }
-
- //
- Description descriptionAnnotation =
((AnnotatedElement)testClass).getAnnotation(Description.class);
- 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())
- {
- MethodKey key = new MethodKey(method);
- methods.put(key, method);
- }
-
- //
- 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)
- {
- throw new IllegalArgumentException();
- }
-
- //
- if (createMethodAnnotation != null && parameterMethodAnnotation !=
null)
- {
- throw new IllegalArgumentException();
- }
- if (createMethodAnnotation != null && testMethodAnnotation != null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- if (destroyMethodAnnotation != null && parameterMethodAnnotation !=
null)
- {
- throw new IllegalArgumentException();
- }
- if (destroyMethodAnnotation != null && testMethodAnnotation != null)
- {
- throw new IllegalArgumentException();
- }
- if (destroyMethodAnnotation != null && createMethodAnnotation != null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- if (parameterMethodAnnotation != null)
- {
- if (!methodName.startsWith("set"))
- {
- throw new IllegalArgumentException();
- }
- if (methodName.length() < 4)
- {
- throw new IllegalArgumentException();
- }
- if (method.getParameterTypes().length != 1)
- {
- 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();
- }
-
- //
- String name = parameterMethodAnnotation.name();
- if (name.length() == 0)
- {
- name = Introspector.decapitalize(method.getName().substring(3));
- }
-
- //
- Description descriptionMethodAnnotation =
method.getAnnotation(Description.class);
- String description = descriptionMethodAnnotation != null ?
descriptionMethodAnnotation.description() : "";
- if (description.length() == 0)
- {
- description = "Parameter " + name;
- }
-
- //
- PropertyTestParameter parameter = suiteParameters.get(name);
- if (parameter == null)
- {
- parameter = new PropertyTestParameter(name, description);
- suiteParameters.put(name, parameter);
- }
-
- //
- parameter.addSetter(method);
- }
- 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();
- }
-
- //
- 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>();
- for (Annotation parameterAnnotation : parameterAnnotations)
- {
- Class<? extends Annotation> blah =
parameterAnnotation.annotationType();
- parameterAnnotationMap.put(blah, parameterAnnotation);
- }
-
- //
- Parameter argumentParameterAnnotation =
(Parameter)parameterAnnotationMap.get(Parameter.class);
-
- //
- if (argumentParameterAnnotation != null)
- {
- //
- String name = argumentParameterAnnotation.name();
- if (name.length() == 0)
- {
- throw new IllegalArgumentException();
- }
- if (methodParameters.containsKey(name))
- {
- throw new IllegalArgumentException();
- }
-
- //
- Description descriptionArgumentParameterAnnotation =
(Description)parameterAnnotationMap.get(Description.class);
- String description = descriptionArgumentParameterAnnotation != null ?
descriptionArgumentParameterAnnotation.description() : "";
- if (description.length() == 0)
- {
- description = "Method parameter " + name;
- }
-
- //
- methodParameters.put(name, new ArgumentTestParameter(name,
description));
- }
- else
- {
- throw new IllegalArgumentException();
- }
- }
-
- //
- String name = testMethodAnnotation.name();
- if (testMethodAnnotation.name().length() == 0)
- {
- name = method.getName();
- }
-
- //
- Description descriptionMethodAnnotation =
method.getAnnotation(Description.class);
- String description = descriptionMethodAnnotation != null ?
descriptionMethodAnnotation.description() : "";
- if (description.length() == 0)
- {
- description = "Test of method " + method.getName();
- }
-
- //
- Set<String> keywords = new HashSet<String>();
- Tag tagMethodAnnotation = method.getAnnotation(Tag.class);
- if (tagMethodAnnotation != null)
- {
- keywords.addAll(CollectionTools.set(tagMethodAnnotation.value()));
- }
-
- Map<String,TestParameter> parameters = new HashMap<String,
TestParameter>(suiteParameters);
- parameters.putAll(methodParameters);
-
- //
- TestCaseDef testCaseDef = new TestCaseDef(method, name, description,
parameters, methodParameters, keywords);
-
- //
- if (testCases.put(testCaseDef.getName(), testCaseDef) != null)
- {
- throw new IllegalArgumentException();
- }
- }
- }
-
- //
- this.suiteName = suiteName;
- this.suiteDescription = suiteDescription;
- this.suiteKeywords = suiteKeywords;
- this.suiteParameters = suiteParameters;
- this.testCases = testCases;
- this.ctor = ctor;
- this.create = create;
- this.destroy = destroy;
- }
-
- public TestSuiteDescriptor getDescriptor()
- {
- return this;
- }
-
- public TestLifeCycle getLifeCycle()
- {
- return this;
- }
-
- public String getName()
- {
- return suiteName;
- }
-
- public String getDescription()
- {
- return suiteDescription;
- }
-
- public Set<String> getKeywords()
- {
- return suiteKeywords;
- }
-
- public Map<String, ? extends ParameterDescriptor> getParameters()
- {
- return Collections.unmodifiableMap(suiteParameters);
- }
-
- public Map<String, ? extends TestCaseDescriptor> getTestCases()
- {
- return Collections.unmodifiableMap(testCases);
- }
-
- public TestCase newTestCase(String name) throws TestCaseLifeCycleException
- {
- TestCaseDef testCaseDef = testCases.get(name);
-
- //
- if (testCaseDef == null)
- {
- throw new TestCaseLifeCycleException("No such test case <" + name +
">");
- }
-
- //
- Object instance;
- try
- {
- instance = ctor.newInstance();
- }
- catch (InvocationTargetException e)
- {
- throw new TestCaseLifeCycleException("Cannot create test case " +
name, e.getCause());
- }
- catch (Exception e)
- {
- throw new TestCaseLifeCycleException("Cannot configure parameter " +
name, e);
- }
-
- //
- return new TestCaseImpl(testCaseDef, instance);
- }
-
- public void testCaseParametrize(TestCase _testCase, Map<String,String>
parametrization) throws TestCaseLifeCycleException
- {
- TestCaseImpl testCase = (TestCaseImpl)_testCase;
-
- // Save parametrization
- testCase.parametrization = parametrization;
-
- //
- for (PropertyTestParameter parameter : suiteParameters.values())
- {
- if (!parametrization.containsKey(parameter.getName()))
- {
- throw new TestCaseLifeCycleException("Missing parameter " +
parameter.getName());
- }
- String parameterValue = parametrization.get(parameter.getName());
- for (Method setter : parameter.setters)
- {
- try
- {
- setter.invoke(testCase.pojo, parameterValue);
- }
- catch (InvocationTargetException e)
- {
- throw new TestCaseLifeCycleException("Cannot configure parameter
" + parameter.getName(), e.getCause());
- }
- catch (Exception e)
- {
- throw new TestCaseLifeCycleException("Cannot configure parameter
" + parameter.getName(), e);
- }
- }
- }
- }
-
- public void testCaseCreate(TestCase _testCase) throws TestCaseLifeCycleException
- {
- TestCaseImpl testCase = (TestCaseImpl)_testCase;
-
- //
- if (create != null)
- {
- try
- {
- create.invoke(testCase.getPOJO());
- }
- catch (InvocationTargetException e)
- {
- throw new TestCaseLifeCycleException("Cannot create test case",
e.getCause());
- }
- catch (Exception e)
- {
- throw new TestCaseLifeCycleException("Cannot create test case",
e);
- }
- }
- }
-
- public void testCaseInvoke(TestCase _testCase) throws TestCaseLifeCycleException
- {
- TestCaseImpl testCase = (TestCaseImpl)_testCase;
-
- List<Object> argList = new ArrayList<Object>();
- for (String parameterName : testCase.def.arguments.keySet())
- {
- if (!testCase.parametrization.containsKey(parameterName))
- {
- throw new TestCaseLifeCycleException("Missing parameter " +
parameterName);
- }
- String parameterValue = testCase.parametrization.get(parameterName);
- if (parameterValue == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- argList.add(parameterValue);
- }
- Object[] args = argList.toArray();
-
- try
- {
- testCase.def.method.invoke(testCase.pojo, args);
- }
- catch (InvocationTargetException e)
- {
- throw new TestCaseLifeCycleException("Cannot invoke test case",
e.getCause());
- }
- catch (Exception e)
- {
- throw new TestCaseLifeCycleException("Cannot invoke test case", e);
- }
- }
-
- public void testCaseDestroy(TestCase _testCase)
- {
- TestCaseImpl testCase = (TestCaseImpl)_testCase;
-
- //
- if (destroy != null)
- {
- try
- {
- destroy.invoke(testCase.getPOJO());
- }
- catch (Throwable t)
- {
- // Log this as a warn
- // t.printStackTrace();
- }
- }
- }
-}
Copied: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProvider.java (from
rev 8536, modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandler.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProvider.java
(rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProvider.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.unit.spi.pojo;
+
+/**
+ * Allow a pojo class to take care of providing its description and perform test case
life cycle management.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface TestProvider
+{
+
+ TestSuiteDescriptor getDescriptor();
+
+ TestLifeCycle getLifeCycle();
+
+}
Copied: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java
(from rev 8536,
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestHandlerSupport.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -0,0 +1,597 @@
+/******************************************************************************
+ * 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.unit.spi.pojo;
+
+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;
+import java.util.Map;
+import java.util.HashMap;
+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;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.annotation.Annotation;
+import java.beans.Introspector;
+
+/**
+ * Provide a default implementation that relies on the annotation defined in the
<code>annotations</code> package.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestProviderSupport implements TestProvider, TestLifeCycle,
TestSuiteDescriptor
+{
+
+ /** . */
+ private final String suiteName;
+
+ /** . */
+ private final String suiteDescription;
+
+ /** . */
+ private final Map<String, TestCaseDef> testCases;
+
+ /** . */
+ private final Method create;
+
+ /** . */
+ private final Method destroy;
+
+ /** . */
+ final Map<String, PropertyTestParameter> suiteParameters;
+
+ /** . */
+ private final Constructor ctor;
+
+ /** . */
+ private final Set<String> suiteKeywords;
+
+ public TestProviderSupport(Class testClass)
+ {
+ if (testClass == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ if (Modifier.isAbstract(testClass.getModifiers()))
+ {
+ throw new IllegalArgumentException("Test class is abstract");
+ }
+
+ // Check constructor
+ Constructor ctor;
+ try
+ {
+ ctor = testClass.getConstructor();
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new IllegalArgumentException(e);
+ }
+
+ //
+ Test testAnnotation = ((AnnotatedElement)testClass).getAnnotation(Test.class);
+ String suiteName = testAnnotation != null ? testAnnotation.name() : "";
+ if (suiteName.length() == 0)
+ {
+ suiteName = testClass.getName();
+ }
+
+ //
+ Description descriptionAnnotation =
((AnnotatedElement)testClass).getAnnotation(Description.class);
+ 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())
+ {
+ MethodKey key = new MethodKey(method);
+ methods.put(key, method);
+ }
+
+ //
+ 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)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ if (createMethodAnnotation != null && parameterMethodAnnotation !=
null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (createMethodAnnotation != null && testMethodAnnotation != null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ if (destroyMethodAnnotation != null && parameterMethodAnnotation !=
null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (destroyMethodAnnotation != null && testMethodAnnotation != null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (destroyMethodAnnotation != null && createMethodAnnotation != null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ if (parameterMethodAnnotation != null)
+ {
+ if (!methodName.startsWith("set"))
+ {
+ throw new IllegalArgumentException();
+ }
+ if (methodName.length() < 4)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (method.getParameterTypes().length != 1)
+ {
+ 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();
+ }
+
+ //
+ String name = parameterMethodAnnotation.name();
+ if (name.length() == 0)
+ {
+ name = Introspector.decapitalize(method.getName().substring(3));
+ }
+
+ //
+ Description descriptionMethodAnnotation =
method.getAnnotation(Description.class);
+ String description = descriptionMethodAnnotation != null ?
descriptionMethodAnnotation.description() : "";
+ if (description.length() == 0)
+ {
+ description = "Parameter " + name;
+ }
+
+ //
+ PropertyTestParameter parameter = suiteParameters.get(name);
+ if (parameter == null)
+ {
+ parameter = new PropertyTestParameter(name, description);
+ suiteParameters.put(name, parameter);
+ }
+
+ //
+ parameter.addSetter(method);
+ }
+ 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();
+ }
+
+ //
+ 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>();
+ for (Annotation parameterAnnotation : parameterAnnotations)
+ {
+ Class<? extends Annotation> blah =
parameterAnnotation.annotationType();
+ parameterAnnotationMap.put(blah, parameterAnnotation);
+ }
+
+ //
+ Parameter argumentParameterAnnotation =
(Parameter)parameterAnnotationMap.get(Parameter.class);
+
+ //
+ if (argumentParameterAnnotation != null)
+ {
+ //
+ String name = argumentParameterAnnotation.name();
+ if (name.length() == 0)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (methodParameters.containsKey(name))
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ Description descriptionArgumentParameterAnnotation =
(Description)parameterAnnotationMap.get(Description.class);
+ String description = descriptionArgumentParameterAnnotation != null ?
descriptionArgumentParameterAnnotation.description() : "";
+ if (description.length() == 0)
+ {
+ description = "Method parameter " + name;
+ }
+
+ //
+ methodParameters.put(name, new ArgumentTestParameter(name,
description));
+ }
+ else
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ //
+ String name = testMethodAnnotation.name();
+ if (testMethodAnnotation.name().length() == 0)
+ {
+ name = method.getName();
+ }
+
+ //
+ Description descriptionMethodAnnotation =
method.getAnnotation(Description.class);
+ String description = descriptionMethodAnnotation != null ?
descriptionMethodAnnotation.description() : "";
+ if (description.length() == 0)
+ {
+ description = "Test of method " + method.getName();
+ }
+
+ //
+ Set<String> keywords = new HashSet<String>();
+ Tag tagMethodAnnotation = method.getAnnotation(Tag.class);
+ if (tagMethodAnnotation != null)
+ {
+ keywords.addAll(CollectionTools.set(tagMethodAnnotation.value()));
+ }
+
+ Map<String,TestParameter> parameters = new HashMap<String,
TestParameter>(suiteParameters);
+ parameters.putAll(methodParameters);
+
+ //
+ TestCaseDef testCaseDef = new TestCaseDef(method, name, description,
parameters, methodParameters, keywords);
+
+ //
+ if (testCases.put(testCaseDef.getName(), testCaseDef) != null)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+ }
+
+ //
+ this.suiteName = suiteName;
+ this.suiteDescription = suiteDescription;
+ this.suiteKeywords = suiteKeywords;
+ this.suiteParameters = suiteParameters;
+ this.testCases = testCases;
+ this.ctor = ctor;
+ this.create = create;
+ this.destroy = destroy;
+ }
+
+ public TestSuiteDescriptor getDescriptor()
+ {
+ return this;
+ }
+
+ public TestLifeCycle getLifeCycle()
+ {
+ return this;
+ }
+
+ public String getName()
+ {
+ return suiteName;
+ }
+
+ public String getDescription()
+ {
+ return suiteDescription;
+ }
+
+ public Set<String> getKeywords()
+ {
+ return suiteKeywords;
+ }
+
+ public Map<String, ? extends ParameterDescriptor> getParameters()
+ {
+ return Collections.unmodifiableMap(suiteParameters);
+ }
+
+ public Map<String, ? extends TestCaseDescriptor> getTestCases()
+ {
+ return Collections.unmodifiableMap(testCases);
+ }
+
+ public TestCase newTestCase(String name) throws TestCaseLifeCycleException
+ {
+ TestCaseDef testCaseDef = testCases.get(name);
+
+ //
+ if (testCaseDef == null)
+ {
+ throw new TestCaseLifeCycleException("No such test case <" + name +
">");
+ }
+
+ //
+ Object instance;
+ try
+ {
+ instance = ctor.newInstance();
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new TestCaseLifeCycleException("Cannot create test case " +
name, e.getCause());
+ }
+ catch (Exception e)
+ {
+ throw new TestCaseLifeCycleException("Cannot configure parameter " +
name, e);
+ }
+
+ //
+ return new TestCaseImpl(testCaseDef, instance);
+ }
+
+ public void testCaseParametrize(TestCase _testCase, Map<String,String>
parametrization) throws TestCaseLifeCycleException
+ {
+ TestCaseImpl testCase = (TestCaseImpl)_testCase;
+
+ // Save parametrization
+ testCase.parametrization = parametrization;
+
+ //
+ for (PropertyTestParameter parameter : suiteParameters.values())
+ {
+ if (!parametrization.containsKey(parameter.getName()))
+ {
+ throw new TestCaseLifeCycleException("Missing parameter " +
parameter.getName());
+ }
+ String parameterValue = parametrization.get(parameter.getName());
+ for (Method setter : parameter.setters)
+ {
+ try
+ {
+ setter.invoke(testCase.pojo, parameterValue);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new TestCaseLifeCycleException("Cannot configure parameter
" + parameter.getName(), e.getCause());
+ }
+ catch (Exception e)
+ {
+ throw new TestCaseLifeCycleException("Cannot configure parameter
" + parameter.getName(), e);
+ }
+ }
+ }
+ }
+
+ public void testCaseCreate(TestCase _testCase) throws TestCaseLifeCycleException
+ {
+ TestCaseImpl testCase = (TestCaseImpl)_testCase;
+
+ //
+ if (create != null)
+ {
+ try
+ {
+ create.invoke(testCase.getPOJO());
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new TestCaseLifeCycleException("Cannot create test case",
e.getCause());
+ }
+ catch (Exception e)
+ {
+ throw new TestCaseLifeCycleException("Cannot create test case",
e);
+ }
+ }
+ }
+
+ public void testCaseInvoke(TestCase _testCase) throws TestCaseLifeCycleException
+ {
+ TestCaseImpl testCase = (TestCaseImpl)_testCase;
+
+ List<Object> argList = new ArrayList<Object>();
+ for (String parameterName : testCase.def.arguments.keySet())
+ {
+ if (!testCase.parametrization.containsKey(parameterName))
+ {
+ throw new TestCaseLifeCycleException("Missing parameter " +
parameterName);
+ }
+ String parameterValue = testCase.parametrization.get(parameterName);
+ if (parameterValue == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ argList.add(parameterValue);
+ }
+ Object[] args = argList.toArray();
+
+ try
+ {
+ testCase.def.method.invoke(testCase.pojo, args);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new TestCaseLifeCycleException("Cannot invoke test case",
e.getCause());
+ }
+ catch (Exception e)
+ {
+ throw new TestCaseLifeCycleException("Cannot invoke test case", e);
+ }
+ }
+
+ public void testCaseDestroy(TestCase _testCase)
+ {
+ TestCaseImpl testCase = (TestCaseImpl)_testCase;
+
+ //
+ if (destroy != null)
+ {
+ try
+ {
+ destroy.invoke(testCase.getPOJO());
+ }
+ catch (Throwable t)
+ {
+ // Log this as a warn
+ // t.printStackTrace();
+ }
+ }
+ }
+}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/annotations/Provider.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/annotations/Provider.java 2007-10-04
22:40:54 UTC (rev 8536)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/annotations/Provider.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.unit.spi.pojo.annotations;
-import org.jboss.unit.spi.pojo.TestHandler;
+import org.jboss.unit.spi.pojo.TestProvider;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
@@ -39,5 +39,5 @@
@Target({ElementType.ANNOTATION_TYPE,ElementType.TYPE})
public @interface Provider
{
- Class<? extends TestHandler> value();
+ Class<? extends TestProvider> value();
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java 2007-10-04
22:40:54 UTC (rev 8536)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java 2007-10-04
22:41:52 UTC (rev 8537)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.unit.unit.pojo;
-import org.jboss.unit.spi.pojo.TestHandler;
-import org.jboss.unit.spi.pojo.TestHandlerSupport;
+import org.jboss.unit.spi.pojo.TestProvider;
+import org.jboss.unit.spi.pojo.TestProviderSupport;
import org.jboss.unit.spi.pojo.TestCaseLifeCycleException;
import org.jboss.unit.spi.pojo.TestLifeCycle;
import org.jboss.unit.spi.pojo.TestCase;
@@ -53,7 +53,7 @@
{
/** . */
- private TestHandler handler;
+ private TestProvider provider;
/** . */
private TestSuiteInfo info;
@@ -81,9 +81,9 @@
{
try
{
- Class<? extends TestHandler> providerClass = provider.value();
- Constructor<? extends TestHandler> providerCtor =
providerClass.getConstructor(Class.class);
- handler = providerCtor.newInstance(testClass);
+ Class<? extends TestProvider> providerClass = provider.value();
+ Constructor<? extends TestProvider> providerCtor =
providerClass.getConstructor(Class.class);
+ this.provider = providerCtor.newInstance(testClass);
}
catch (NoSuchMethodException e)
{
@@ -100,11 +100,11 @@
// }
else
{
- handler = new TestHandlerSupport(testClass);
+ this.provider = new TestProviderSupport(testClass);
}
//
- info = new POJOTestSuiteInfo(handler.getDescriptor());
+ info = new POJOTestSuiteInfo(this.provider.getDescriptor());
}
public TestInfo getInfo()
@@ -125,7 +125,7 @@
}
//
- TestLifeCycle lifeCycle = handler.getLifeCycle();
+ TestLifeCycle lifeCycle = provider.getLifeCycle();
//
String name = id.getName(0);