| 1 |  |  | 
            
  
    | 2 |  |  | 
            
  
    | 3 |  |  | 
            
  
    | 4 |  |  | 
            
  
    | 5 |  |  | 
            
  
    | 6 |  |  | 
            
  
    | 7 |  |  | 
            
  
    | 8 |  |  | 
            
  
    | 9 |  |  | 
            
  
    | 10 |  |  | 
            
  
    | 11 |  |  | 
            
  
    | 12 |  |  | 
            
  
    | 13 |  | package org.kuali.rice.test.lifecycles; | 
            
  
    | 14 |  |  | 
            
  
    | 15 |  | import java.lang.reflect.Method; | 
            
  
    | 16 |  |  | 
            
  
    | 17 |  | import org.kuali.rice.core.api.lifecycle.Lifecycle; | 
            
  
    | 18 |  | import org.kuali.rice.test.data.PerTestUnitTestData; | 
            
  
    | 19 |  | import org.kuali.rice.test.data.UnitTestData; | 
            
  
    | 20 |  | import org.kuali.rice.test.data.UnitTestDataUtils; | 
            
  
    | 21 |  |  | 
            
  
    | 22 |  |  | 
            
  
    | 23 |  |  | 
            
  
    | 24 |  |  | 
            
  
    | 25 |  |  | 
            
  
    | 26 |  |  | 
            
  
    | 27 |  | @author | 
            
  
    | 28 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 23 (23) | Complexity: 7 | Complexity Density: 0.54 |  | 
  
  
    | 29 |  | public class PerTestDataLoaderLifecycle implements Lifecycle { | 
            
  
    | 30 |  | private boolean started; | 
            
  
    | 31 |  | private Method method; | 
            
  
    | 32 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 33 | 0 |  public PerTestDataLoaderLifecycle(Method method) {... | 
            
  
    | 34 | 0 | this.method = method; | 
            
  
    | 35 |  | } | 
            
  
    | 36 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 37 | 0 |  public boolean isStarted() {... | 
            
  
    | 38 | 0 | return started; | 
            
  
    | 39 |  | } | 
            
  
    | 40 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 11 (11) | Complexity: 3 | Complexity Density: 0.43 |  | 
  
  
    | 41 | 0 |  public void start() throws Exception {... | 
            
  
    | 42 | 0 | if (method.getDeclaringClass().isAnnotationPresent(PerTestUnitTestData.class)) { | 
            
  
    | 43 | 0 | UnitTestData[] data = method.getDeclaringClass().getAnnotation(PerTestUnitTestData.class).value(); | 
            
  
    | 44 | 0 | UnitTestDataUtils.executeDataLoader(data); | 
            
  
    | 45 |  | } | 
            
  
    | 46 | 0 | if (method.isAnnotationPresent(UnitTestData.class)) { | 
            
  
    | 47 | 0 | UnitTestData data = method.getAnnotation(UnitTestData.class); | 
            
  
    | 48 | 0 | UnitTestDataUtils.executeDataLoader(data); | 
            
  
    | 49 |  | } | 
            
  
    | 50 | 0 | started = true; | 
            
  
    | 51 |  | } | 
            
  
    | 52 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 6 (6) | Complexity: 2 | Complexity Density: 0.5 |  | 
  
  
    | 53 | 0 |  public void stop() throws Exception {... | 
            
  
    | 54 | 0 | if (method.getDeclaringClass().isAnnotationPresent(PerTestUnitTestData.class)) { | 
            
  
    | 55 | 0 | UnitTestData[] data = method.getDeclaringClass().getAnnotation(PerTestUnitTestData.class).tearDown(); | 
            
  
    | 56 | 0 | UnitTestDataUtils.executeDataLoader(data); | 
            
  
    | 57 |  | } | 
            
  
    | 58 | 0 | started = false; | 
            
  
    | 59 |  | } | 
            
  
    | 60 |  | } |