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.test.speed.TestResult;
    18  
    19  /**
    20   * {@code TestSuiteResult} holds the result of a test suite's execution.
    21   * 
    22   * @author Simon Wacker
    23   */
    24  interface org.as2lib.test.speed.TestSuiteResult extends TestResult {
    25  	
    26  	/**
    27  	 * Returns the time needed per method invocation.
    28  	 * 
    29  	 * @return the time needed per method invocation
    30  	 */
    31  	public function getAverageTime(Void):Number;
    32  	
    33  	/**
    34  	 * Returns all profiled method invocations as {@link MethodInvocation} instances.
    35  	 * 
    36  	 * @return all profiled method invocations as {@code MethodInvocation} instances
    37  	 */
    38  	public function getAllMethodInvocations(Void):Array;
    39  	
    40  	/**
    41  	 * Returns whether this result has any method invocations.
    42  	 * 
    43  	 * @return {@code true} if this result has method invocations else {@code false}
    44  	 */
    45  	public function hasMethodInvocations(Void):Boolean;
    46  	
    47  	/**
    48  	 * Returns the total number of method invocations.
    49  	 * 
    50  	 * @return the total number of method invocations
    51  	 */
    52  	public function getMethodInvocationCount(Void):Number;
    53  	
    54  	/**
    55  	 * Returns the percentage of method invocations in relation to the passed-in
    56  	 * {@code totalMethodInvocationCount}.
    57  	 * 
    58  	 * @param totalMethodInvocationCount the total number of method invocations to
    59  	 * calculate the percentage with
    60  	 * @return the percentage of method invocations of this result
    61  	 */
    62  	public function getMethodInvocationPercentage(totalMethodInvocationCount:Number):Number;
    63  	
    64  	/**
    65  	 * Returns all test results as {@link TestResult} instances directly of this test
    66  	 * suite.
    67  	 * 
    68  	 * @return all test results of this test suite
    69  	 */
    70  	public function getTestResults(Void):Array;
    71  	
    72  	/**
    73  	 * Returns whether this test suite result has sub-test results.
    74  	 * 
    75  	 * @return {@code true} if this test suite has sub-test results else {@code false}
    76  	 */
    77  	public function hasTestResults(Void):Boolean;
    78  	
    79  	/**
    80  	 * Returns the number of sub-test results.
    81  	 * 
    82  	 * @return the number of sub-test results
    83  	 */
    84  	public function getTestResultCount(Void):Number;
    85  	
    86  	/**
    87  	 * Sorts this test suite result and its sub-test results.
    88  	 * 
    89  	 * @param property the property to sort by
    90  	 * @param descending determines whether to sort descending {@code true} or
    91  	 * ascending {@code false}
    92  	 */
    93  	public function sort(property:Number, descending:Boolean):Void;
    94  	
    95  }