1  /**
     2   * Copyright the original author or authors.
     3   * 
     4   * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (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.mozilla.org/MPL/MPL-1.1.html
     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  import org.as2lib.core.BasicInterface;
    18  import org.as2lib.data.holder.array.TypedArray;
    19  import org.as2lib.data.type.Time;
    20  
    21  /**
    22   * {@code TestResult} represents the infromations that got collected during the
    23   * execution of a related {@code Test}.
    24   * 
    25   * <p>A {@code Test} should not contain the informations about its execution.
    26   * {@code TestResult} represents the pool of all informations collected during
    27   * the execution of the {@code Test} by its {@code TestRunner}.
    28   * 
    29   * <p>Every {@code TestResult} depends to the state of the execution of the
    30   * related {@code Test}. Different informations changed during the execution.
    31   * 
    32   * @author Martin Heidegger
    33   * @version 1.0
    34   * @see org.as2lib.test.unit.TestRunner
    35   * @see org.as2lib.test.unit.Test
    36   */
    37  interface org.as2lib.test.unit.TestResult extends BasicInterface {
    38  	
    39  	/**
    40  	 * Returns the percentage ({@code 0}-{@code 100}) of the execution.
    41  	 * 
    42  	 * @return percentage of execution
    43  	 */
    44  	public function getPercentage(Void):Number;
    45  	
    46  	/**
    47  	 * Returns {@code true} if the {@code TestCase} has been finished.
    48  	 * 
    49  	 * @return {@code true} if the {@code TestCase} has been finished.
    50  	 */
    51  	public function hasFinished(Void):Boolean;
    52  	
    53  	/**
    54  	 * Returns {@code true} if the {@code TestCase} has been started.
    55  	 * 
    56  	 * @return {@code true} if the {@code TestCase} has been started
    57  	 */
    58  	public function hasStarted(Void):Boolean;
    59  	
    60  	/**
    61  	 * Returns the name of the {@code TestResult}.
    62  	 * 
    63  	 * @return name of the {@code TestResult}
    64  	 */
    65  	public function getName(Void):String;
    66  	
    67  	/**
    68  	 * Returns the total operation time for all methods executed for the
    69  	 * related {@code Test}.
    70  	 * 
    71  	 * @return total operation time of the {@code Test}
    72  	 */
    73  	public function getOperationTime(Void):Time;
    74  	
    75  	/**
    76  	 * Returns {@code true} if the errors occured during the execution of the
    77  	 * related {@code Test}.
    78  	 * 
    79  	 * @return {@code true} if the errors occured during the execution of the
    80  	 * 		   related {@code Test}.
    81  	 */
    82  	public function hasErrors(Void):Boolean;
    83  	
    84  	/**
    85  	 * Returns all {@code TestResult}s for the {@code Test}s contained
    86  	 * within the related {@code Test}.
    87  	 * 
    88  	 * <p>Since its possible to add more than one {@code Test} to a {@code TestSuite}
    89  	 * its necessary to get the {@code TestResult}s to all added {@code Test}s.
    90  	 *
    91  	 * <p>It flattens out all {@code TestResults}, this means it concats all
    92  	 * {@code getTestResults} of every added {@code Test}. 
    93  	 * 
    94  	 * @return all {@code TestResult}s to all contained {@code Test}s
    95  	 */
    96  	public function getTestResults(Void):TypedArray;
    97  	
    98  	/**
    99  	 * Returns all {@code TestCaseResult}s for the {@code TestCase}s contained
   100  	 * within the related {@code Test}.
   101  	 * 
   102  	 * <p>Since its possible to add more than one {@code Test} to a {@code TestSuite}
   103  	 * its necessary to get the {@code TestResult}s to all added {@code Test}s.
   104  	 * 
   105  	 * <p>{@code TestCase} represents the lowest level of {@code Test} therefor
   106  	 * its important to get all added {@code TestCaseResults} seperatly.
   107  	 *
   108  	 * <p>It flattens out all {@code TestResults}, this means it concats all
   109  	 * {@code getTestCaseResults} of every added {@code Test}. 
   110  	 * 
   111  	 * @return all {@code TestResult}s to all contained {@code Test}s
   112  	 */
   113  	public function getTestCaseResults(Void):TypedArray;
   114  }