net.java.ao.test.junit
Class ActiveObjectsJUnitRunner

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
          extended by org.junit.runners.BlockJUnit4ClassRunner
              extended by net.java.ao.test.junit.ActiveObjectsJUnitRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public final class ActiveObjectsJUnitRunner
extends org.junit.runners.BlockJUnit4ClassRunner

A JUnit test runner that provides helpful behavior for tests that rely on ActiveObjects.

Before each test method is executed, the test runner creates an EntityManager instance and injects it into the test class; the test class (or a superclass) must have a member field of type EntityManager for this purpose. The EntityManager configuration is based on the test class annotations @Jdbc, @Data and @NameConverters; in the absence of these annotations, the default configuration uses an in-memory HSQL database.

By default, each test method is executed within a separate transaction, which is then rolled back so the next test is executed with a fresh database state. If you annotate a test method with @NonTransactional, then it is not executed inside a transaction; instead, the database is completely reinitialized after executing the test.


Constructor Summary
ActiveObjectsJUnitRunner(Class<?> klass)
           
 
Method Summary
protected  List<org.junit.rules.MethodRule> rules(Object test)
           
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, getTestRules, methodBlock, methodInvoker, possiblyExpectingExceptions, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
 
Methods inherited from class org.junit.runner.Runner
testCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveObjectsJUnitRunner

public ActiveObjectsJUnitRunner(Class<?> klass)
                         throws org.junit.runners.model.InitializationError
Throws:
org.junit.runners.model.InitializationError
Method Detail

rules

protected List<org.junit.rules.MethodRule> rules(Object test)
Overrides:
rules in class org.junit.runners.BlockJUnit4ClassRunner


Copyright © 2007-2015. All Rights Reserved.