View Javadoc
1   package test.integration;
2   
3   import org.junit.After;
4   import org.junit.Before;
5   
6   /**
7    * super class for all tests in integration. Implements the multiple inheritance of TestBase and the TestCases with and
8    * without DB
9    * 
10   */
11  public abstract class IntegrationTestSuperClass implements TestBaseInterface {
12  	
13  	/**
14  	 * The TestBase.
15  	 */
16  	private final TestBase testBase;
17  	
18  	/**
19  	 * super class for all tests in integration.
20  	 */
21  	public IntegrationTestSuperClass() {
22  		this.testBase = this.genTestBase();
23  	}
24  	
25  	@Override
26  	@Before
27  	public void setUp() throws Exception {
28  		this.testBase.setUp();
29  	}
30  	
31  	@Override
32  	@After
33  	public void tearDown() throws Exception {
34  		this.testBase.tearDown();
35  	}
36  	
37  	/**
38  	 * Gets the correct TestBase.
39  	 * 
40  	 * @return the correct testbase
41  	 */
42  	protected TestBase getTestBase() {
43  		return this.testBase;
44  	}
45  	
46  	/**
47  	 * This method is a template which called in the constructor. The method has to create the correct TestBase for
48  	 * "With DB" and "Without DB".
49  	 * 
50  	 * @return correct TestBase
51  	 */
52  	protected abstract TestBase genTestBase();
53  	
54  }