org.sonatype.aether.test.util.connector.suite
Interface ConnectorTestSetup

All Known Implementing Classes:
ConnectorTestSetup.AbstractConnectorTestSetup

public interface ConnectorTestSetup

The callback handler used to configure ConnectorTestSuite.

The specified methods have the same meaning as the corresponding JUnit4-annotations.

Author:
Benjamin Hanzelmann
See Also:
ConnectorTestSetup.AbstractConnectorTestSetup

Nested Class Summary
static class ConnectorTestSetup.AbstractConnectorTestSetup
          Empty implementation of ConnectorTestSetup.
 
Method Summary
 void after(RepositorySystemSession session, RemoteRepository repository, Map<String,Object> context)
          This method is called after each test of the bundle is executed.
 RemoteRepository before(RepositorySystemSession session, Map<String,Object> context)
          This method is called before each test run.
 Map<String,Object> beforeClass(RepositorySystemSession session)
          This method is called before the first test of the bundle is executed.
 RepositoryConnectorFactory factory()
           
 

Method Detail

before

RemoteRepository before(RepositorySystemSession session,
                        Map<String,Object> context)
                        throws Exception
This method is called before each test run.

Parameters:
session - The session used for the test bundle.
context - The context provided by beforeClass(RepositorySystemSession).
Returns:
The repository to use in the next test.
Throws:
Exception

beforeClass

Map<String,Object> beforeClass(RepositorySystemSession session)
                               throws Exception
This method is called before the first test of the bundle is executed.

Parameters:
session - The session used for the test bundle.
Returns:
A map acting as a context for the current test bundle run. This context will not be used by the test cases in the suite, and is only used to provide context for the before/after/afterClass-method calls. This might be used to save setup-specific values (port numbers, directories to clean up after tests, ...)
Throws:
Exception

after

void after(RepositorySystemSession session,
           RemoteRepository repository,
           Map<String,Object> context)
           throws Exception
This method is called after each test of the bundle is executed. Repositories should be cleaned after each test, as previous uploads may influence test results.

Parameters:
session - The session used for the test bundle.
context - The context provided by beforeClass(RepositorySystemSession).
repository - the repository used in the test run.
Throws:
Exception

factory

RepositoryConnectorFactory factory()
Returns:
the factory to use for the tests.


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