View Javadoc

1   /*
2    * Copyright 2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springunit.framework.junit4;
18  
19  import org.junit.After;
20  import org.junit.Before;
21  import org.junit.runner.RunWith;
22  import org.springunit.framework.SpringUnitTransactionalTest;
23  
24  /**
25   * SpringUnitTransactionalTest enabled for use with JUnit4 annotations.<br/>
26   * <br/>
27   * The approach followed here follows the example given by Derek Young,
28   * "Adapting Spring's JUnit 3.x base classes to JUnit 4",
29   * Tuesday, April 3, 2007,
30   * http://dmy999.com/article/21/adapting-a-springs-junit-3x-base-classes-to-junit-4.
31   * <br/>
32   * 
33   * @author <a href="mailto:ted@velkoff.com">Ted Velkoff</a>
34   *
35   */
36  @RunWith(NameRunner.class)
37  public abstract class SpringUnit4TransactionalTest extends SpringUnitTransactionalTest {
38  
39  	@Before
40  	final public void callSetUp() throws Exception {
41  		this.setName(NameRunner.getTestMethodName());
42  		super.setUp();
43  	}
44  	
45  	@After
46  	final public void callTearDown() throws Exception {
47  		super.tearDown();
48  	}
49  
50  }