1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.test;
17
18 import org.junit.Before;
19 import org.junit.Test;
20 import org.junit.runner.RunWith;
21 import org.kuali.rice.core.api.lifecycle.Lifecycle;
22 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
23 import org.kuali.rice.core.framework.resourceloader.SpringResourceLoader;
24 import org.kuali.rice.core.impl.cache.DistributedCacheManagerDecorator;
25 import org.kuali.rice.krms.api.KrmsConstants;
26 import org.kuali.rice.test.BaselineTestCase;
27 import org.kuali.rice.test.BaselineTestCase.BaselineMode;
28 import org.kuali.rice.test.BaselineTestCase.Mode;
29 import org.kuali.rice.test.runners.BootstrapTest;
30 import org.kuali.rice.test.runners.LoadTimeWeavableTestRunner;
31
32 import javax.xml.namespace.QName;
33 import java.util.ArrayList;
34 import java.util.List;
35
36
37
38
39
40
41 @BaselineMode(Mode.ROLLBACK_CLEAR_DB)
42 @RunWith(LoadTimeWeavableTestRunner.class)
43 @BootstrapTest(KRMSTestCase.BootstrapTest.class)
44 public abstract class KRMSTestCase extends BaselineTestCase {
45
46 private static final String KRMS_MODULE_NAME = "krms";
47
48 private SpringResourceLoader krmsTestResourceLoader;
49
50 public KRMSTestCase() {
51 super(KRMS_MODULE_NAME);
52 }
53
54 @Override
55 protected List<Lifecycle> getSuiteLifecycles() {
56 List<Lifecycle> suiteLifecycles = super.getSuiteLifecycles();
57 return suiteLifecycles;
58 }
59
60 @Override
61 protected void loadSuiteTestData() throws Exception {
62 super.loadSuiteTestData();
63 }
64
65
66
67 @Override
68 protected Lifecycle getLoadApplicationLifecycle() {
69 if (krmsTestResourceLoader == null) {
70 krmsTestResourceLoader = new SpringResourceLoader(new QName("KRMSTestHarnessApplicationResourceLoader"), "classpath:KRMSTestHarnessSpringBeans.xml", null);
71 krmsTestResourceLoader.setParentSpringResourceLoader(getTestHarnessSpringResourceLoader());
72 getTestHarnessSpringResourceLoader().addResourceLoader(krmsTestResourceLoader);
73 }
74 return krmsTestResourceLoader;
75 }
76
77 @Override
78 protected List<String> getPerTestTablesNotToClear() {
79 List<String> tablesNotToClear = new ArrayList<String>();
80
81 tablesNotToClear.addAll(super.getPerTestTablesNotToClear());
82 tablesNotToClear.add("KRIM_.*");
83 tablesNotToClear.add("KRNS_.*");
84 tablesNotToClear.add("KREW_.*");
85 tablesNotToClear.add("KREN_.*");
86 tablesNotToClear.add("KRCR_.*");
87
88 return tablesNotToClear;
89 }
90
91 protected List<String> getPerTestTablesToClear() {
92 List<String> tablesToClear = new ArrayList<String>();
93
94 tablesToClear.addAll(super.getPerTestTablesToClear());
95 tablesToClear.add("KRMS_.*");
96
97 return tablesToClear;
98 }
99
100
101
102
103 @Override
104 protected String getModuleName() {
105 return KRMS_MODULE_NAME;
106 }
107
108 public static final class BootstrapTest extends KRMSTestCase {
109 @Test public void bootstrapTest() {};
110 }
111 }