org.geotools.test
Class FixtureUtilities

Object
  extended by FixtureUtilities

public class FixtureUtilities
extends Object

Static methods to support the implementation of tests that use fixture configuration files. See OnlineTestCase and OnlineTestSupport for details.

Author:
Ben Caradoc-Davies, CSIRO Earth Science and Resource Engineering

Constructor Summary
FixtureUtilities()
           
 
Method Summary
static Properties loadFixture(String fixtureId)
          Return Properties loaded from a fixture configuration file, or null if not found.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixtureUtilities

public FixtureUtilities()
Method Detail

loadFixture

public static Properties loadFixture(String fixtureId)
Return Properties loaded from a fixture configuration file, or null if not found.

If a fixture configuration file is not found, a notice is printed to standard output stating that tests for this fixture id are skipped.

This method allows tests that cannot extend OnlineTestCase or OnlineTestSupport because they already extend another class (for example, a non-online test framework) to access fixture configuration files in the same way that those classes do. Only basic fixture configuration loading is supported. This method does not support the extra services such as fixture caching and connection testing provided by OnlineTestCase and OnlineTestSupport.

A JUnit 4 test fixture can readily be disabled in the absence of a fixture configuration file by placing Assume.assumeNotNull(FixtureUtilities.loadFixture(fixtureId)) or similar in its @BeforeClass method. JUnit 3 tests must provide their own logic, typically overriding TestCase.run() or TestCase.runTest(), or providing a suite.

Parameters:
fixtureId - the fixture id, where dots "." are converted to subdirectories.
Returns:
the fixture Properties or null
See Also:
OnlineTestCase, OnlineTestSupport


Copyright © 1996-2010 Geotools. All Rights Reserved.