View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.core.test;
17  
18  import org.junit.Test;
19  import org.junit.runner.RunWith;
20  import org.kuali.rice.core.api.lifecycle.Lifecycle;
21  import org.kuali.rice.core.framework.resourceloader.SpringResourceLoader;
22  import org.kuali.rice.test.BaselineTestCase;
23  import org.kuali.rice.test.runners.BootstrapTest;
24  import org.kuali.rice.test.runners.LoadTimeWeavableTestRunner;
25  
26  import javax.xml.namespace.QName;
27  import java.util.ArrayList;
28  import java.util.List;
29  
30  /**
31   * Default test base for a full KNS enabled unit test.
32   * 
33   * @author Kuali Rice Team (rice.collab@kuali.org)
34   */
35  @BaselineTestCase.BaselineMode(BaselineTestCase.Mode.ROLLBACK_CLEAR_DB)
36  @RunWith(LoadTimeWeavableTestRunner.class)
37  @BootstrapTest(CORETestCase.BootstrapTest.class)
38  public abstract class CORETestCase extends BaselineTestCase {
39  
40      private static final String CORE_MODULE_NAME = "core";
41  
42      public CORETestCase() {
43  		super(CORE_MODULE_NAME);
44  	}
45  
46  	@Override
47  	protected Lifecycle getLoadApplicationLifecycle() {
48          SpringResourceLoader springResourceLoader = new SpringResourceLoader(new QName("CORETestResourceLoader"), "CORETestHarnessSpringBeans.xml", null);
49      	springResourceLoader.setParentSpringResourceLoader(getTestHarnessSpringResourceLoader());
50      	return springResourceLoader;
51  	}
52  
53      /**
54       * Returns the List of tables that should be cleared on every test run.
55       */
56      protected List<String> getPerTestTablesToClear() {
57          List<String> tablesToClear = new ArrayList<String>();
58          tablesToClear.add("KREW_.*");
59          tablesToClear.add("KRSB_.*");
60          tablesToClear.add("KREN_.*");
61          tablesToClear.add("KRMS_.*");
62          return tablesToClear;
63      }
64  
65      public static final class BootstrapTest extends CORETestCase  {
66          @Test
67          public void bootstrapTest() {};
68      }
69  
70  }