|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.keel.util.test.AbstractKeelTest
AbstractKeelTest can be used as the superclass for all kinds of unit tests that require a Keel container. It takes care of initializing the container for you, and cleans up in the tearDown method properly. See the many unit tests in the src/tests directories of each module for examples of this class being used. Please see the Wiki documentation for specific instructions about using the Abstract tests for specific implementations of services. For testing Models, see KeelModelTestCase instead.
| Field Summary | |
protected static java.lang.String |
hintThe default "hint" to be used when looking up services |
protected Container |
myContainerThe Keel container, initialized and ready for use by sub-classes |
| Fields inherited from class junit.framework.TestCase |
|
| Constructor Summary | |
AbstractKeelTest(java.lang.String name)Constructs a test case with the given name. |
|
| Method Summary | |
protected Container |
getContainer() |
java.lang.Object |
getService(java.lang.String role, java.lang.String hint)Returns a service from the container |
static void |
main(java.lang.String[] args)Allows this class to be run directly from the command-line. |
protected void |
setUp()Set up a Keel container. |
static junit.framework.Test |
suite()Your own test class will override this method, subsituting it's class name below as appropriate. |
protected void |
tearDown()Calls "dispose" on the container, closing up anything left open. |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Container myContainer
protected static java.lang.String hint
| Constructor Detail |
public AbstractKeelTest(java.lang.String name)
name -| Method Detail |
protected void setUp()
throws NestedException
NestedException - If container setup fails
protected void tearDown()
throws java.lang.Exception
java.lang.Exceptionpublic static junit.framework.Test suite()
protected Container getContainer()
public java.lang.Object getService(java.lang.String role,
java.lang.String hint)
throws java.lang.Exception
role - The Avalon role for the service interfacehint - The hint defined in config files for the service impl.java.lang.Exception - Whenever the container cannot provide the service
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - Use hint=xxx to use a different default hint.java.lang.Exception - If the tests cannot be run
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||