View Javadoc

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