Clover Coverage Report - Internal Test Tools 2.0.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
7   54   5   1.75
2   27   0.71   4
4     1.25  
1    
 
  PerSuiteDataLoaderLifecycle       Line # 29 7 0% 5 13 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2007 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in
5    * compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.opensource.org/licenses/ecl2.php
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS
10    * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
11    * language governing permissions and limitations under the License.
12    */
13    package org.kuali.rice.test.lifecycles;
14   
15    import org.kuali.rice.core.api.lifecycle.Lifecycle;
16    import org.kuali.rice.core.api.lifecycle.Lifecycle;
17    import org.kuali.rice.test.RiceTestCase;
18    import org.kuali.rice.test.data.PerSuiteUnitTestData;
19    import org.kuali.rice.test.data.UnitTestData;
20    import org.kuali.rice.test.data.UnitTestDataUtils;
21   
22    /**
23    * A lifecycle for loading SQL datasets based on the PerSuiteUnitTestData annotation. The individual SQL statements are
24    * loaded first, followed by the statements inside the files (files are loaded sequentially in the order listed in the
25    * annotation).
26    *
27    * @author Kuali Rice Team (rice.collab@kuali.org)
28    */
 
29    public class PerSuiteDataLoaderLifecycle implements Lifecycle {
30    private boolean started;
31   
32    private Class<? extends RiceTestCase> annotatedClass;
33   
 
34  0 toggle public PerSuiteDataLoaderLifecycle(Class<? extends RiceTestCase> annotatedClass) {
35  0 this.annotatedClass = annotatedClass;
36    }
37   
 
38  0 toggle public boolean isStarted() {
39  0 return started;
40    }
41   
 
42  0 toggle public void start() throws Exception {
43  0 if (annotatedClass.isAnnotationPresent(PerSuiteUnitTestData.class)) {
44  0 UnitTestData[] data = annotatedClass.getAnnotation(PerSuiteUnitTestData.class).value();
45  0 UnitTestDataUtils.executeDataLoader(data);
46    }
47  0 started = true;
48    }
49   
 
50  0 toggle public void stop() throws Exception {
51  0 started = false;
52    }
53   
54    }