1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.rice.krms.test;
18
19 import org.kuali.rice.core.api.lifecycle.Lifecycle;
20 import org.kuali.rice.core.impl.resourceloader.SpringResourceLoader;
21 import org.kuali.rice.test.BaselineTestCase;
22 import org.kuali.rice.test.BaselineTestCase.BaselineMode;
23 import org.kuali.rice.test.BaselineTestCase.Mode;
24
25 import javax.xml.namespace.QName;
26 import java.util.ArrayList;
27 import java.util.List;
28
29
30
31
32
33
34 @BaselineMode(Mode.ROLLBACK_CLEAR_DB)
35 public abstract class KRMSTestCase extends BaselineTestCase {
36
37 private static final String KRMS_MODULE_NAME = "krms";
38
39 private SpringResourceLoader krmsTestResourceLoader;
40
41 public KRMSTestCase() {
42 super(KRMS_MODULE_NAME);
43 }
44
45 @Override
46 protected List<Lifecycle> getSuiteLifecycles() {
47 List<Lifecycle> suiteLifecycles = super.getSuiteLifecycles();
48 return suiteLifecycles;
49 }
50
51 @Override
52 protected void loadSuiteTestData() throws Exception {
53 super.loadSuiteTestData();
54 }
55
56
57
58 @Override
59 protected Lifecycle getLoadApplicationLifecycle() {
60 if (krmsTestResourceLoader == null) {
61 krmsTestResourceLoader = new SpringResourceLoader(new QName("KRMSTestHarnessApplicationResourceLoader"), "classpath:KRMSTestHarnessSpringBeans.xml", null);
62 krmsTestResourceLoader.setParentSpringResourceLoader(getTestHarnessSpringResourceLoader());
63 getTestHarnessSpringResourceLoader().addResourceLoader(krmsTestResourceLoader);
64 }
65 return krmsTestResourceLoader;
66 }
67
68
69 protected List<String> getPerTestTablesNotToClear() {
70 List<String> tablesNotToClear = new ArrayList<String>();
71 tablesNotToClear.add("KRIM_.*");
72 tablesNotToClear.add("KRNS_.*");
73 tablesNotToClear.add("KREW_.*");
74 tablesNotToClear.add("KREN_.*");
75 tablesNotToClear.add("KRCR_.*");
76 return tablesNotToClear;
77 }
78
79
80
81
82
83 @Override
84 protected String getModuleName() {
85 return KRMS_MODULE_NAME;
86 }
87 }