01: package info.jtrac;
02:
03: import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
04:
05: /**
06: * base class for tests that can test either the service layer or dao or both
07: * using the Spring JUnit helper class with the long name, ensures that
08: * the applicationContext is only built once
09: */
10: public abstract class JtracTestBase extends
11: AbstractTransactionalDataSourceSpringContextTests {
12:
13: protected Jtrac jtrac;
14: protected JtracDao dao;
15:
16: public JtracTestBase() {
17: System.setProperty("jtrac.home", "target/home");
18: }
19:
20: // magically autowired by Spring JUnit support
21: public void setDao(JtracDao dao) {
22: this .dao = dao;
23: }
24:
25: // magically autowired by Spring JUnit support
26: public void setJtrac(Jtrac jtrac) {
27: this .jtrac = jtrac;
28: }
29:
30: protected String[] getConfigLocations() {
31: return new String[] {
32: "file:src/main/webapp/WEB-INF/applicationContext.xml",
33: "file:src/main/webapp/WEB-INF/applicationContext-lucene.xml" };
34: }
35:
36: }
|