/test/acceptance/as3/Definitions/Classes/Ext/PubExtDefaultClassPubStat.as

https://github.com/bsdf/trx · ActionScript · 231 lines · 47 code · 50 blank · 134 comment · 0 complexity · b426b02dcec18c8ab8403a90627b03f3 MD5 · raw file

  1. /* ***** BEGIN LICENSE BLOCK *****
  2. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3. *
  4. * The contents of this file are subject to the Mozilla Public License Version
  5. * 1.1 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * The Original Code is [Open Source Virtual Machine.].
  15. *
  16. * The Initial Developer of the Original Code is
  17. * Adobe System Incorporated.
  18. * Portions created by the Initial Developer are Copyright (C) 2004-2006
  19. * the Initial Developer. All Rights Reserved.
  20. *
  21. * Contributor(s):
  22. * Adobe AS3 Team
  23. *
  24. * Alternatively, the contents of this file may be used under the terms of
  25. * either the GNU General Public License Version 2 or later (the "GPL"), or
  26. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27. * in which case the provisions of the GPL or the LGPL are applicable instead
  28. * of those above. If you wish to allow use of your version of this file only
  29. * under the terms of either the GPL or the LGPL, and not to allow others to
  30. * use your version of this file under the terms of the MPL, indicate your
  31. * decision by deleting the provisions above and replace them with the notice
  32. * and other provisions required by the GPL or the LGPL. If you do not delete
  33. * the provisions above, a recipient may use your version of this file under
  34. * the terms of any one of the MPL, the GPL or the LGPL.
  35. *
  36. * ***** END LICENSE BLOCK ***** */
  37. // imports must be first statments
  38. import DefaultClass.*;
  39. var SECTION = "Definitions"; // provide a document reference (ie, ECMA section)
  40. var VERSION = "AS 3.0"; // Version of JavaScript or ECMA
  41. var TITLE = "public extend Default Class"; // Provide ECMA section title or a description
  42. var BUGNUMBER = "";
  43. startTest(); // leave this alone
  44. /**
  45. * Calls to AddTestCase here. AddTestCase is a function that is defined
  46. * in shell.js and takes three arguments:
  47. * - a string representation of what is being tested
  48. * - the expected result
  49. * - the actual result
  50. *
  51. * For example, a test might look like this:
  52. *
  53. * var helloWorld = "Hello World";
  54. *
  55. * AddTestCase(
  56. * "var helloWorld = 'Hello World'", // description of the test
  57. * "Hello World", // expected result
  58. * helloWorld ); // actual result
  59. *
  60. */
  61. arr = new Array(1, 2, 3);
  62. //*******************************************
  63. // access public static method of parent
  64. // class from outside of class
  65. //*******************************************
  66. AddTestCase( "*** Public Static Methods and Public Static properites ***", 1, 1 );
  67. //AddTestCase( "PubExtDefaultClassPubStat.setStatArray(arr), PubExtDefaultClassPubStat.statArray", arr,
  68. // (PubExtDefaultClassPubStat.setStatArray(arr), PubExtDefaultClassPubStat.statArray) );
  69. // ********************************************
  70. // access public static method from a default
  71. // method of a sub class
  72. //
  73. // ********************************************
  74. EXTDCLASS = new PubExtDefaultClassPubStat();
  75. AddTestCase( "*** Access public static method from default method of sub class ***", 1, 1 );
  76. AddTestCase( "EXTDCLASS.subSetArray(arr), EXTDCLASS.subGetArray()", arr, EXTDCLASS.testSubGetSetArray(arr) );
  77. // <TODO> fill in the rest of the cases here
  78. // ********************************************
  79. // access public static method from a public
  80. // method of a sub class
  81. //
  82. // ********************************************
  83. EXTDCLASS = new PubExtDefaultClassPubStat();
  84. AddTestCase( "*** Access public static method from public method of sub class ***", 1, 1 );
  85. AddTestCase( "EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()", arr, (EXTDCLASS.pubSubSetArray(arr), EXTDCLASS.pubSubGetArray()) );
  86. // <TODO> fill in the rest of the cases here
  87. // ********************************************
  88. // access public static method from a private
  89. // method of a sub class
  90. //
  91. // ********************************************
  92. EXTDCLASS = new PubExtDefaultClassPubStat();
  93. AddTestCase( "*** Access public static method from private method of sub class ***", 1, 1 );
  94. AddTestCase( "EXTDCLASS.testPrivSubArray(arr)", arr, EXTDCLASS.testPrivSubArray(arr) );
  95. // <TODO> fill in the rest of the cases here
  96. // ********************************************
  97. // access public static method from a final
  98. // method of a sub class
  99. //
  100. // ********************************************
  101. EXTDCLASS = new PubExtDefaultClassPubStat();
  102. AddTestCase( "*** Access public static method from final method of sub class ***", 1, 1 );
  103. AddTestCase( "EXTDCLASS.testFinSubArray(arr)", arr, EXTDCLASS.testFinSubArray(arr) );
  104. // ********************************************
  105. // access public static method from a static
  106. // method of a sub class
  107. //
  108. // ********************************************
  109. AddTestCase( "*** Access public static method from static method of sub class ***", 1, 1 );
  110. AddTestCase( "PubExtDefaultClassPubStat.testStatSubArray(arr)", arr, PubExtDefaultClassPubStat.testStatSubArray(arr));
  111. // <TODO> fill in the rest of the cases here
  112. // ********************************************
  113. // access public static method from a public static
  114. // method of a sub class
  115. //
  116. // ********************************************
  117. AddTestCase( "*** Access public static method from public static method of sub class ***", 1, 1 );
  118. AddTestCase( "PubExtDefaultClassPubStat.pubStatSubSetArray(arr), PubExtDefaultClassPubStat.pubStatSubGetArray()", arr,
  119. (PubExtDefaultClassPubStat.pubStatSubSetArray(arr), PubExtDefaultClassPubStat.pubStatSubGetArray()) );
  120. // <TODO> fill in the rest of the cases here
  121. // ********************************************
  122. // access public static method from a private static
  123. // method of a sub class
  124. //
  125. // ********************************************
  126. AddTestCase( "*** Access public static method from private static method of sub class ***", 1, 1 );
  127. AddTestCase( "PubExtDefaultClassPubStat.testPrivStatSubArray(arr)", arr, PubExtDefaultClassPubStat.testPrivStatSubArray(arr) );
  128. // <TODO> fill in the rest of the cases here
  129. // ********************************************
  130. // access public static property from
  131. // default method in sub class
  132. // ********************************************
  133. EXTDCLASS = new PubExtDefaultClassPubStat();
  134. AddTestCase( "*** Access public static property from default method in sub class ***", 1, 1 );
  135. AddTestCase( "EXTDCLASS.subSetDPArray(arr), EXTDCLASS.subGetDPArray()", arr, EXTDCLASS.testSubGetSetDPArray(arr) );
  136. // <TODO> fill in the rest of the cases here
  137. // ********************************************
  138. // access public static property from
  139. // public method in sub class
  140. // ********************************************
  141. EXTDCLASS = new PubExtDefaultClassPubStat();
  142. AddTestCase( "*** Access public static property from public method in sub class ***", 1, 1 );
  143. AddTestCase( "EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()", arr, (EXTDCLASS.pubSubSetDPArray(arr), EXTDCLASS.pubSubGetDPArray()) );
  144. // <TODO> fill in the rest of the cases here
  145. // ********************************************
  146. // access public static property from
  147. // private method in sub class
  148. // ********************************************
  149. EXTDCLASS = new PubExtDefaultClassPubStat();
  150. AddTestCase( "*** Access public static property from private method in sub class ***", 1, 1 );
  151. AddTestCase( "EXTDCLASS.privSubSetDPArray(arr), EXTDCLASS.privSubGetDPArray()", arr, EXTDCLASS.testPrivSubDPArray(arr) );
  152. // <TODO> fill in the rest of the cases here
  153. // ********************************************
  154. // access public static property from
  155. // final method in sub class
  156. // ********************************************
  157. EXTDCLASS = new PubExtDefaultClassPubStat();
  158. AddTestCase( "*** Access public static property from final method in sub class ***", 1, 1 );
  159. AddTestCase( "EXTDCLASS.finSubSetDPArray(arr), EXTDCLASS.finSubGetDPArray()", arr, EXTDCLASS.testFinSubDPArray(arr) );
  160. // ********************************************
  161. // access public static property from
  162. // static method in sub class
  163. // ********************************************
  164. AddTestCase( "*** Access public static property from static method in sub class ***", 1, 1 );
  165. AddTestCase( "PubExtDefaultClassPubStat.statSubSetSPArray(arr), PubExtDefaultClassPubStat.statSubGetSPArray()", arr,PubExtDefaultClassPubStat.testStatSubSPArray(arr) );
  166. // ********************************************
  167. // access public static property from
  168. // public static method in sub class
  169. // ********************************************
  170. AddTestCase( "*** Access public static property from public static method in sub class ***", 1, 1 );
  171. AddTestCase( "PubExtDefaultClassPubStat.pubStatSubSetSPArray(arr), PubExtDefaultClassPubStat.pubStatSubGetSPArray()", arr,
  172. (PubExtDefaultClassPubStat.pubStatSubSetSPArray(arr), PubExtDefaultClassPubStat.pubStatSubGetSPArray()) );
  173. // ********************************************
  174. // access public static property from
  175. // private static method in sub class
  176. // ********************************************
  177. AddTestCase( "*** Access public static property from private static method in sub class ***", 1, 1 );
  178. AddTestCase( "PubExtDefaultClassPubStat.testPrivStatSubPArray(arr)", arr, PubExtDefaultClassPubStat.testPrivStatSubPArray(arr));
  179. // <TODO> fill in the rest of the cases here
  180. test(); // leave this alone. this executes the test cases and
  181. // displays results.