Hibernate example source code file (EnversRunner.java)
This example Hibernate source code file (EnversRunner.java) is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.
package org.hibernate.envers.test;
import org.hibernate.testing.junit4.CustomRunner;
import org.junit.runner.Runner;
import org.junit.runner.manipulation.NoTestsRemainException;
import org.junit.runners.Parameterized;
import org.junit.runners.Suite;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.TestClass;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* Copied & modified from {@link org.junit.runners.Parameterized}.
*
* The modification is that the generated runners extend {@link CustomRunner} instead of the default
* {@code TestClassRunnerForParameters}.
*
* The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
* it doesn't override {@code classBlock} which causes the custom {@code @BeforeClassOnce} and {@code @AfterClassOnce}
* annotations to work.
* @author Adam Warski (adam at warski dot org)
*/
public class EnversRunner extends Suite {
private class TestClassCustomRunnerForParameters extends CustomRunner {
private final int fParameterSetNumber;
private final List<Object[]> fParameterList;
TestClassCustomRunnerForParameters(Class<?> type, List
Other Hibernate examples (source code examples)
Here is a short list of links related to this Hibernate EnversRunner.java source code file: