1 /** 2 * Copyright 2005-2013 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.kcb.test; 17 18 import org.junit.Before; 19 import org.kuali.rice.core.framework.persistence.dao.GenericDao; 20 import org.kuali.rice.test.BaselineTestCase.BaselineMode; 21 import org.kuali.rice.test.BaselineTestCase.Mode; 22 23 /** 24 * This base class for testing CRUD operations on BOs 25 * 26 * @author Kuali Rice Team (rice.collab@kuali.org) 27 */ 28 @BaselineMode(Mode.ROLLBACK_CLEAR_DB) 29 public abstract class BusinessObjectTestCase extends KCBTestCase { 30 protected GenericDao businessObjectDao; 31 32 @Before 33 @Override 34 public void setUp() throws Exception { 35 super.setUp(); 36 businessObjectDao = services.getKcbGenericDao(); 37 } 38 39 /** 40 * This method should be overridden to test creation 41 */ 42 public abstract void testCreate() throws Exception; 43 /** 44 * This method should be overridden to test invalid creation 45 */ 46 public void testInvalidCreate() throws Exception {} 47 /** 48 * This method should be overridden to test duplicate creation 49 */ 50 public void testDuplicateCreate() throws Exception {} 51 /** 52 * This method should be overridden to test retrieval by id 53 */ 54 public void testReadById() throws Exception {}; 55 /** 56 * This method should be overridden to test retrieval 57 */ 58 public void testReadByQuery() throws Exception {} 59 /** 60 * This method should be overridden to test an invalid retrieval 61 */ 62 public void testInvalidRead() throws Exception {} 63 /** 64 * This method should be overridden to test updating 65 */ 66 public abstract void testUpdate() throws Exception; 67 /** 68 * This method should be overridden to test an invalid update 69 */ 70 public void testInvalidUpdate() throws Exception {} 71 /** 72 * This method should be overridden to test delete 73 */ 74 public abstract void testDelete() throws Exception; 75 /** 76 * This method should be overridden to test an invalid delete 77 */ 78 public void testInvalidDelete() throws Exception {} 79 }