ch.agent.crnickl.junit
Class AbstractTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by ch.agent.crnickl.junit.AbstractTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
T001_SetUpTest, T005_BasicTest, T005_CacheTest, T006_ChronicleTest_NonStrictMode, T006_ChronicleTest_StrictMode, T012_ValueTypeTest, T013_PropertyTest, T015_SchemaChronicleSeriesValueTest, T017_SchemaTest, T040_SeriesTest, T041_UpdatableSeriesTest, T042_SeriesValuesTest, T045_EventTest, T050_ChronicleTest, T060_ByAttributeValueTest

public class AbstractTest
extends junit.framework.TestCase


Constructor Summary
AbstractTest()
           
 
Method Summary
protected static void assertException(Exception e, String... keys)
          Verify an exception and its cause chain against a series of keys.
protected static void expectException()
          Fail with a message stating that an exception should have been thrown.
protected  void firstSetUp()
          This method is called by setUp() before the first test.
protected  Context getContext()
           
protected  void lastTearDown()
          This method is called by tearDown() after the last test.
protected  void setUp()
           
protected  void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
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, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTest

public AbstractTest()
Method Detail

getContext

protected Context getContext()

setUp

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

tearDown

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

firstSetUp

protected void firstSetUp()
                   throws Exception
This method is called by setUp() before the first test. So if you override setUp, you must call super. By default the method does nothing.

Throws:
Exception

lastTearDown

protected void lastTearDown()
                     throws Exception
This method is called by tearDown() after the last test. So if you override tearDown, you must call super. By default the method does nothing.

Throws:
Exception

expectException

protected static void expectException()
Fail with a message stating that an exception should have been thrown.


assertException

protected static void assertException(Exception e,
                                      String... keys)
Verify an exception and its cause chain against a series of keys. Verification fails unless the exception is an instance of KeyedException and its key matches. A null key in the argument list skips a level in the cause chain. For example the following line asserts that the cause of exception e has a key equal to "foo":

 assertException(e, null, "foo");
 
Skipping all levels is equivalent to failing on the original exception. For example the two following lines have the same effect:

 assertException(new RuntimeException("foo"));
 fail(new RuntimeException("foo").toString());
 

Parameters:
e - an exception
keys - a list of strings


Copyright © 2013. All Rights Reserved.