org.sonatype.tests.http.runner.junit
Class Junit3SuiteConfiguration

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.sonatype.tests.http.runner.junit.Junit3SuiteConfiguration
All Implemented Interfaces:
junit.framework.Test

public abstract class Junit3SuiteConfiguration
extends junit.framework.TestCase

Junit3 test case supporting multiple server configurations for the test class.

Annotations are provided to configure the used configurations. Configurators takes SuiteConfigurator classes and uses them to run every test method. Every entry in ConfiguratorList will be loaded as a resource. The runner expects every line of the resource to be the class name of a SuiteConfigurator. IgnoreConfigurators may be used to to ignore configurators from the list.

If none of the annotations are present, the runner tries to load a default list ( DefaultSuiteConfigurators.list).

Author:
Benjamin Hanzelmann
See Also:
SuiteConfigurator, DefaultSuiteConfiguration

Constructor Summary
Junit3SuiteConfiguration()
           
 
Method Summary
 void configureProvider(ServerProvider provider)
           
 ServerProvider provider()
           
 void setConfigurator(SuiteConfigurator configurator)
           
 void setUp()
           
static junit.framework.TestSuite suite(Class<? extends Junit3SuiteConfiguration> cls)
          Create a TestSuite containing all tests for the given class.
 void tearDown()
           
 String url()
           
 String url(String path, String... parts)
           
 
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Junit3SuiteConfiguration

public Junit3SuiteConfiguration()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

setConfigurator

public void setConfigurator(SuiteConfigurator configurator)

configureProvider

public void configureProvider(ServerProvider provider)

url

public String url()

provider

public ServerProvider provider()

url

public String url(String path,
                  String... parts)

suite

public static junit.framework.TestSuite suite(Class<? extends Junit3SuiteConfiguration> cls)
                                       throws Exception
Create a TestSuite containing all tests for the given class. A test consists of a test method declared in or inherited by the class, combined with a SuiteConfigurator.

Parameters:
cls - the class to scan.
Returns:
the test suite to run.
Throws:
Exception - when reflection fails with the given class.


Copyright © 2010-2013 Sonatype, Inc.. All Rights Reserved.