001    /**
002     * Copyright 2005-2011 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     */
016    package org.kuali.rice.kcb.test;
017    
018    import org.junit.Before;
019    import org.kuali.rice.core.framework.persistence.dao.GenericDao;
020    import org.kuali.rice.test.BaselineTestCase.BaselineMode;
021    import org.kuali.rice.test.BaselineTestCase.Mode;
022    
023    /**
024     * This base class for testing CRUD operations on BOs
025     * 
026     * @author Kuali Rice Team (rice.collab@kuali.org)
027     */
028    @BaselineMode(Mode.ROLLBACK_CLEAR_DB)
029    public abstract class BusinessObjectTestCase extends KCBTestCase {
030        protected GenericDao businessObjectDao;
031    
032        @Before
033        @Override
034        public void setUp() throws Exception {
035            super.setUp();
036            businessObjectDao = services.getKcbGenericDao();
037        }
038    
039            /**
040             * This method should be overridden to test creation
041             */
042        public abstract void testCreate() throws Exception;
043        /**
044         * This method should be overridden to test invalid creation
045         */
046        public void testInvalidCreate() throws Exception {}
047        /**
048         * This method should be overridden to test duplicate creation
049         */
050        public void testDuplicateCreate() throws Exception {}
051        /**
052         * This method should be overridden to test retrieval by id
053         */
054        public void testReadById() throws Exception {};
055        /**
056         * This method should be overridden to test retrieval
057         */
058        public void testReadByQuery() throws Exception {}
059        /**
060         * This method should be overridden to test an invalid retrieval
061         */
062        public void testInvalidRead() throws Exception {}
063        /**
064         * This method should be overridden to test updating
065         */
066        public abstract void testUpdate() throws Exception;
067        /**
068         * This method should be overridden to test an invalid update
069         */
070        public void testInvalidUpdate() throws Exception {}
071        /**
072         * This method should be overridden to test delete
073         */
074        public abstract void testDelete() throws Exception;
075        /**
076         * This method should be overridden to test an invalid delete
077         */
078        public void testInvalidDelete() throws Exception {}
079    }