001/**
002 * Copyright 2005-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.core.test;
017
018import org.junit.Test;
019import org.junit.runner.RunWith;
020import org.kuali.rice.core.api.lifecycle.Lifecycle;
021import org.kuali.rice.core.framework.resourceloader.SpringResourceLoader;
022import org.kuali.rice.test.BaselineTestCase;
023import org.kuali.rice.test.runners.BootstrapTest;
024import org.kuali.rice.test.runners.LoadTimeWeavableTestRunner;
025
026import javax.xml.namespace.QName;
027import java.util.ArrayList;
028import java.util.List;
029
030/**
031 * Default test base for a full KNS enabled unit test.
032 * 
033 * @author Kuali Rice Team (rice.collab@kuali.org)
034 */
035@BaselineTestCase.BaselineMode(BaselineTestCase.Mode.ROLLBACK_CLEAR_DB)
036@RunWith(LoadTimeWeavableTestRunner.class)
037@BootstrapTest(CORETestCase.BootstrapTest.class)
038public abstract class CORETestCase extends BaselineTestCase {
039
040    private static final String CORE_MODULE_NAME = "core";
041
042    public CORETestCase() {
043                super(CORE_MODULE_NAME);
044        }
045
046        @Override
047        protected Lifecycle getLoadApplicationLifecycle() {
048        SpringResourceLoader springResourceLoader = new SpringResourceLoader(new QName("CORETestResourceLoader"), "CORETestHarnessSpringBeans.xml", null);
049        springResourceLoader.setParentSpringResourceLoader(getTestHarnessSpringResourceLoader());
050        return springResourceLoader;
051        }
052
053    /**
054     * Returns the List of tables that should be cleared on every test run.
055     */
056    protected List<String> getPerTestTablesToClear() {
057        List<String> tablesToClear = new ArrayList<String>();
058        tablesToClear.add("KREW_.*");
059        tablesToClear.add("KRSB_.*");
060        tablesToClear.add("KREN_.*");
061        tablesToClear.add("KRMS_.*");
062        return tablesToClear;
063    }
064
065    public static final class BootstrapTest extends CORETestCase  {
066        @Test
067        public void bootstrapTest() {};
068    }
069
070}