Clover Coverage Report - Kuali Student 1.1.0-M10-SNAPSHOT (Aggregated)
Coverage timestamp: Fri Dec 17 2010 05:04:51 EST
../../../../../img/srcFileCovDistChart7.png 43% of files have more coverage
22   62   12   7.33
18   40   0.55   1.5
3     4  
2    
 
  DtoConstants       Line # 3 0 - 0 0 - -1.0
  DtoConstants.DtoState       Line # 9 22 0% 12 14 67.4% 0.6744186
 
  (4)
 
1    package org.kuali.student.core.dto;
2   
 
3    public class DtoConstants {
4   
5    public static final String DTO_STATE = "DtoState";
6    public static final String DTO_NEXT_STATE = "DtoNextState";
7   
8    //FIXME: Need to split out proposal states (ie. workflow states) versus dto states
 
9    public enum DtoState {
10    DRAFT, SUBMITTED, APPROVED, ACTIVE, INACTIVE, RETIRED, SUPERSEDED, SAVED, ENROUTE;
11   
 
12  14 toggle public boolean equalsString(String state){
13  14 if (state != null){
14  14 return this.toString().equals(state.toUpperCase());
15    }
16   
17  0 return false;
18    }
19   
20    /**
21    * This is used to determine the next state.
22    *
23    * TODO: Ideally this method should not be hardcoded here. Also determining next state may
24    * be a more complicated and not just be a simple sequence.
25    *
26    * @param state
27    * @return the next state
28    */
 
29  8 toggle public static DtoState getNextState(String state){
30    // Element States
31  8 if (DRAFT.equalsString(state)) {
32  7 return SUBMITTED;
33  1 } else if (SUBMITTED.equalsString(state)) {
34  0 return APPROVED;
35  1 } else if (APPROVED.equalsString(state)) {
36  0 return ACTIVE;
37  1 } else if (ACTIVE.equalsString(state)) {
38  0 return INACTIVE;
39  1 } else if (INACTIVE.equalsString(state)) {
40  0 return RETIRED;
41   
42    // Proposal States
43  1 } else if (SAVED.equalsString(state)) {
44  0 return ENROUTE;
45  1 } else if (ENROUTE.equalsString(state)) {
46  0 return APPROVED;
47    }
48   
49   
50  1 return null;
51    }
52   
 
53  8 toggle public static String getNextStateAsString(String state){
54  8 DtoState dtoState = getNextState(state);
55  8 if (dtoState == null){
56  1 return null;
57    } else {
58  7 return dtoState.toString();
59    }
60    }
61    }
62    }