Coverage Report - pt.digitalis.dif.sanitycheck.SanityCheckResult
 
Classes in this File Line Coverage Branch Coverage Complexity
SanityCheckResult
0%
0/25
0%
0/4
1,231
 
 1  0
 package pt.digitalis.dif.sanitycheck;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.Date;
 5  
 import java.util.List;
 6  
 
 7  
 import pt.digitalis.dif.sanitycheck.manager.SanityCheckTestSuiteDefinition;
 8  
 
 9  
 /**
 10  
  * @author Galaio da Silva <a href="mailto:jgalaio@digitalis.pt">jgalaio@digitalis.pt</a><br/>
 11  
  * @created 1 de Jul de 2011
 12  
  */
 13  
 public class SanityCheckResult {
 14  
 
 15  
     /** the test start time */
 16  
     private Date endTime;
 17  
 
 18  
     /** If a execution error occurs */
 19  
     private String executionError;
 20  
 
 21  
     /** Execution Result */
 22  
     private ExecutionResult executionsResult;
 23  
 
 24  
     /** the test start time */
 25  
     private Date startTime;
 26  
 
 27  
     /** List of test execution results */
 28  0
     private List<TestResult> testResults = new ArrayList<TestResult>();
 29  
 
 30  
     /** the test suite definition */
 31  
     private SanityCheckTestSuiteDefinition testSuite;
 32  
 
 33  
     /**
 34  
      * @param testSuite
 35  
      * @param executionsResult
 36  
      */
 37  
     public SanityCheckResult(SanityCheckTestSuiteDefinition testSuite, ExecutionResult executionsResult)
 38  
     {
 39  0
         super();
 40  0
         this.testSuite = testSuite;
 41  0
         this.executionsResult = executionsResult;
 42  0
     }
 43  
 
 44  
     /**
 45  
      * Add a unit Sanity check result
 46  
      * 
 47  
      * @param result
 48  
      *            <code>SanityUnitResult</code>
 49  
      */
 50  
     public void addTestResult(TestResult result)
 51  
     {
 52  0
         this.testResults.add(result);
 53  0
     }
 54  
 
 55  
     /**
 56  
      * Inspector for the 'endTime' attribute.
 57  
      * 
 58  
      * @return the endTime value
 59  
      */
 60  
     public Date getEndTime()
 61  
     {
 62  0
         return endTime;
 63  
     }
 64  
 
 65  
     /**
 66  
      * Inspector for the 'executionError' attribute.
 67  
      * 
 68  
      * @return the executionError value
 69  
      */
 70  
     public String getExecutionError()
 71  
     {
 72  0
         return executionError;
 73  
     }
 74  
 
 75  
     /**
 76  
      * Inspector for the 'executionsResult' attribute.
 77  
      * 
 78  
      * @return the executionsResult value
 79  
      */
 80  
     public ExecutionResult getExecutionsResult()
 81  
     {
 82  0
         return executionsResult;
 83  
     }
 84  
 
 85  
     /**
 86  
      * Inspector for the 'startTime' attribute.
 87  
      * 
 88  
      * @return the startTime value
 89  
      */
 90  
     public Date getStartTime()
 91  
     {
 92  0
         return startTime;
 93  
     }
 94  
 
 95  
     /**
 96  
      * @return the milliseconds that the test execution took, or Null if it has not started/ended yet.
 97  
      */
 98  
     public Long getTestExecutionDuration()
 99  
     {
 100  0
         if (getStartTime() == null || getEndTime() == null)
 101  0
             return null;
 102  
         else
 103  0
             return getEndTime().getTime() - getStartTime().getTime();
 104  
     }
 105  
 
 106  
     /**
 107  
      * Inspector for the 'results' attribute.
 108  
      * 
 109  
      * @return the results value
 110  
      */
 111  
     public List<TestResult> getTestResults()
 112  
     {
 113  0
         return testResults;
 114  
     }
 115  
 
 116  
     /**
 117  
      * Inspector for the 'testSuite' attribute.
 118  
      * 
 119  
      * @return the testSuite value
 120  
      */
 121  
     public SanityCheckTestSuiteDefinition getTestSuite()
 122  
     {
 123  0
         return testSuite;
 124  
     }
 125  
 
 126  
     /**
 127  
      * Modifier for the 'endTime' attribute.
 128  
      * 
 129  
      * @param endTime
 130  
      *            the new endTime value to set
 131  
      */
 132  
     public void setEndTime(Date endTime)
 133  
     {
 134  0
         this.endTime = endTime;
 135  0
     }
 136  
 
 137  
     /**
 138  
      * Modifier for the 'executionError' attribute.
 139  
      * 
 140  
      * @param executionError
 141  
      *            the new executionError value to set
 142  
      */
 143  
     public void setExecutionError(String executionError)
 144  
     {
 145  0
         this.executionError = executionError;
 146  0
     }
 147  
 
 148  
     /**
 149  
      * Modifier for the 'executionsResult' attribute.
 150  
      * 
 151  
      * @param executionsResult
 152  
      *            the new executionsResult value to set
 153  
      */
 154  
     public void setExecutionsResult(ExecutionResult executionsResult)
 155  
     {
 156  0
         this.executionsResult = executionsResult;
 157  0
     }
 158  
 
 159  
     /**
 160  
      * Modifier for the 'startTime' attribute.
 161  
      * 
 162  
      * @param startTime
 163  
      *            the new startTime value to set
 164  
      */
 165  
     public void setStartTime(Date startTime)
 166  
     {
 167  0
         this.startTime = startTime;
 168  0
     }
 169  
 }