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

https://github.com/bsdf/trx · ActionScript · 218 lines · 46 code · 48 blank · 124 comment · 0 complexity · ab4c676722a9bbf21a9650b5034731dc 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. /**
  38. * All 'import' statements should be the first
  39. * in a file.
  40. */
  41. import PublicClass.*;
  42. var SECTION = "Definitions"; // provide a document reference (ie, ECMA section)
  43. var VERSION = "AS 3.0"; // Version of JavaScript or ECMA
  44. var TITLE = "dynamic Class Extends Public Class"; // Provide ECMA section title or a description
  45. var BUGNUMBER = "";
  46. startTest(); // leave this alone
  47. /**
  48. * Calls to AddTestCase here. AddTestCase is a function that is defined
  49. * in shell.js and takes three arguments:
  50. * - a string representation of what is being tested
  51. * - the expected result
  52. * - the actual result
  53. *
  54. * For example, a test might look like this:
  55. *
  56. * var helloWorld = "Hello World";
  57. *
  58. * AddTestCase(
  59. * "var helloWorld = 'Hello World'", // description of the test
  60. * "Hello World", // expected result
  61. * helloWorld ); // actual result
  62. *
  63. */
  64. // create a new Array Object, with 3 instances.
  65. arr = new Array(1, 2, 3);
  66. // ********************************************
  67. // access static method from a default
  68. // method of a sub class
  69. //
  70. // ********************************************
  71. PUBEXTDCLASSS = new PubExtPublicClassStat();
  72. AddTestCase( "*** Access static method from default method of sub class ***", 1, 1 );
  73. AddTestCase( "PUBEXTDCLASSS.testSubArray(arr)", arr, (PUBEXTDCLASSS.testSubArray(arr)) );
  74. // ********************************************
  75. // access static method from a public
  76. // method of a sub class
  77. //
  78. // ********************************************
  79. PUBEXTDCLASSS = new PubExtPublicClassStat();
  80. AddTestCase( "*** Access static method from public method of sub class ***", 1, 1 );
  81. AddTestCase( "PUBEXTDCLASSS.pubSubSetArray(arr), PUBEXTDCLASSS.pubSubGetArray()", arr, (PUBEXTDCLASSS.pubSubSetArray(arr), PUBEXTDCLASSS.pubSubGetArray()) );
  82. // ********************************************
  83. // access static method from a private
  84. // method of a sub class
  85. //
  86. // ********************************************
  87. PUBEXTDCLASSS = new PubExtPublicClassStat();
  88. AddTestCase( "*** Access static method from private method of sub class ***", 1, 1 );
  89. AddTestCase( "PUBEXTDCLASSS.testPrivSubArray(arr)", arr, PUBEXTDCLASSS.testPrivSubArray(arr) );
  90. // ********************************************
  91. // access static method from a final
  92. // method of a sub class
  93. //
  94. // ********************************************
  95. PUBEXTDCLASSS = new PubExtPublicClassStat();
  96. AddTestCase( "PUBEXTDCLASSS.testFinSubArray(arr)", arr, PUBEXTDCLASSS.testFinSubArray(arr) );
  97. // ********************************************
  98. // access static method from a static
  99. // method of a sub class
  100. //
  101. // ********************************************
  102. AddTestCase( "*** Access static method from static method of sub class ***", 1, 1 );
  103. AddTestCase( "PubExtPublicClassStat.testStatSubArray(arr)", arr, PubExtPublicClassStat.testStatSubArray(arr) );
  104. // ********************************************
  105. // access static method from a public static
  106. // method of a sub class
  107. //
  108. // ********************************************
  109. AddTestCase( "*** Access static method from public static method of sub class ***", 1, 1 );
  110. AddTestCase( "PubExtPublicClassStat.pubStatSubSetArray(arr), PubExtPublicClassStat.pubStatSubGetArray()", arr,
  111. (PubExtPublicClassStat.pubStatSubSetArray(arr), PubExtPublicClassStat.pubStatSubGetArray()) );
  112. // ********************************************
  113. // access static method from a private static
  114. // method of a sub class
  115. //
  116. // ********************************************
  117. //var PUBEXTDCLASSS = new PubExtPublicClassStat();
  118. AddTestCase( "*** Access static method from private static method of sub class ***", 1, 1 );
  119. AddTestCase( "PubExtPublicClassStat.testPrivStatSubArray(arr)", arr, PubExtPublicClassStat.testPrivStatSubArray(arr) );
  120. // ********************************************
  121. // access static property from
  122. // default method in sub class
  123. // ********************************************
  124. PUBEXTDCLASSS = new PubExtPublicClassStat();
  125. AddTestCase( "*** Access static property from default method in sub class ***", 1, 1 );
  126. AddTestCase( "PUBEXTDCLASSS.testSubDPArray(arr)", arr, PUBEXTDCLASSS.testSubDPArray(arr) );
  127. // ********************************************
  128. // access static property from
  129. // public method in sub class
  130. // ********************************************
  131. PUBEXTDCLASSS = new PubExtPublicClassStat();
  132. AddTestCase( "*** Access static property from public method in sub class ***", 1, 1 );
  133. AddTestCase( "PUBEXTDCLASSS.pubSubSetDPArray(arr), PUBEXTDCLASSS.pubSubGetDPArray()", arr, (PUBEXTDCLASSS.pubSubSetDPArray(arr), PUBEXTDCLASSS.pubSubGetDPArray()) );
  134. // ********************************************
  135. // access static property from
  136. // private method in sub class
  137. // ********************************************
  138. PUBEXTDCLASSS = new PubExtPublicClassStat();
  139. AddTestCase( "*** Access static property from private method in sub class ***", 1, 1 );
  140. AddTestCase( "PUBEXTDCLASSS.testPrivSubDPArray(arr)", arr, PUBEXTDCLASSS.testPrivSubDPArray(arr) );
  141. // ********************************************
  142. // access static property from
  143. // static method in sub class
  144. // ********************************************
  145. AddTestCase( "*** Access static property from static method in sub class ***", 1, 1 );
  146. AddTestCase( "PubExtPublicClassStat.testStatSubPArray(arr)", arr, PubExtPublicClassStat.testStatSubPArray(arr) );
  147. // ********************************************
  148. // access static property from
  149. // public static method in sub class
  150. // ********************************************
  151. AddTestCase( "*** Access static property from public static method in sub class ***", 1, 1 );
  152. AddTestCase( "PubExtPublicClassStat.pubStatSubSetSPArray(arr), PubExtPublicClassStat.pubStatSubGetSPArray()", arr,
  153. (PubExtPublicClassStat.pubStatSubSetSPArray(arr), PubExtPublicClassStat.pubStatSubGetSPArray()) );
  154. // ********************************************
  155. // access static property from
  156. // private static method in sub class
  157. // ********************************************
  158. PUBEXTDCLASSS = new PubExtPublicClassStat();
  159. AddTestCase( "*** Access static property from private static method in sub class ***", 1, 1 );
  160. AddTestCase( "PUBEXTDCLASSS.testPrivStatSubPArray(arr)", arr, PUBEXTDCLASSS.testPrivStatSubPArray(arr));
  161. // ********************************************
  162. // access static property from
  163. // final method in sub class
  164. // ********************************************
  165. PUBEXTDCLASSS = new PubExtPublicClassStat();
  166. AddTestCase( "*** Access static property from final method in sub class ***", 1, 1 );
  167. AddTestCase( "PUBEXTDCLASSS.testFinSubDPArray(arr)", arr, PUBEXTDCLASSS.testFinSubDPArray(arr) );
  168. test(); // Leave this function alone.
  169. // This function is for executing the test case and then
  170. // displaying the result on to the console or the LOG file.