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