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

https://github.com/bsdf/trx · ActionScript · 225 lines · 60 code · 64 blank · 101 comment · 0 complexity · 699b167bec727406542b4b5b44656fc1 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. * The 'import' statements should be the first
  39. * non-comment line in a file.
  40. *
  41. * These lines have to be commented out.
  42. * The compiler requires only the parent Class to be imported and not the Subclass folder.
  43. * Hence change in the import statements required.
  44. * import Definitions.Classes.Simple;
  45. * import Definitions.Classes.Ext.FinExtPublicClassPub;
  46. */
  47. import PublicClass.*;
  48. var SECTION = "Definitions\Ext"; // provide a document reference (ie, ECMA section)
  49. var VERSION = "AS 3.0"; // Version of JavaScript or ECMA
  50. var TITLE = "Final Class Extends Public Class Public Methods"; // Provide ECMA section title or a description
  51. var BUGNUMBER = "";
  52. startTest(); // leave this alone
  53. /**
  54. * Calls to AddTestCase here. AddTestCase is a function that is defined
  55. * in shell.js and takes three arguments:
  56. * - a string representation of what is being tested
  57. * - the expected result
  58. * - the actual result
  59. *
  60. * For example, a test might look like this:
  61. *
  62. * var helloWorld = "Hello World";
  63. *
  64. * AddTestCase(
  65. * "var helloWorld = 'Hello World'", // description of the test
  66. * "Hello World", // expected result
  67. * helloWorld ); // actual result
  68. *
  69. */
  70. // Can't create an instance because it's not public
  71. // Hence commenting out the lines where the class is initialized.
  72. // var EXTDCLASS = new FinExtDefaultClassPub();
  73. // Create an array variable which will define the test array to be used
  74. // for the given output.
  75. var arr = new Array(1, 2, 3);
  76. // access default method from a default method of a sub class
  77. AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 );
  78. AddTestCase( "subSetArray( arr ), subGetArray()", arr, ( subSetArray( arr ), subGetArray() ) );
  79. // access default method from a dynamic method of a sub class
  80. AddTestCase( "*** Acess default method from dynamic method of sub class ***", 1, 1 );
  81. AddTestCase( "dynSubSetArray( arr ), dynSubGetArray()", arr, ( dynSubSetArray( arr ), dynSubGetArray()) );
  82. // access default method from a public method of a sub class
  83. AddTestCase( "*** Access default method from public method of sub class ***", 1, 1 );
  84. AddTestCase( "pubSubSetArray( arr ), pubSubGetArray()", arr, ( pubSubSetArray( arr ), pubSubGetArray()) );
  85. // access default method from a private method of a sub class
  86. AddTestCase( "*** Access default method from private method of sub class ***", 1, 1 );
  87. AddTestCase( "testPrivSubArray( arr )", arr, testPrivSubArray( arr ) );
  88. // access default method from a static method of a sub class
  89. AddTestCase( "*** Access default method from static method of sub class ***", 1, 1 );
  90. AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 );
  91. // AddTestCase( "statSubSetArray( arr ), statSubGetArray()", arr, ( statSubSetArray( arr ), statSubGetArray() ) );
  92. // access default method from a final method of a sub class
  93. AddTestCase( "*** Access default method from final method of sub class ***", 1, 1 );
  94. AddTestCase( "finSubSetArray( arr ), finSubGetArray()", arr, ( finSubSetArray( arr ), finSubGetArray() ) );
  95. // access default method from a virtual method of a sub class
  96. AddTestCase( "*** Access default method from virtual method of sub class ***", 1, 1 );
  97. AddTestCase( "virSubSetArray( arr ), virSubSetArray()", arr, ( virSubSetArray( arr ), virSubGetArray() ) );
  98. // access default method from a public dynamic method of a sub class
  99. AddTestCase( "*** Acess default method from public dynamic method of sub class ***", 1, 1 );
  100. AddTestCase( "pubDynSubSetArray( arr ), pubDynSubGetArray()", arr, ( pubDynSubSetArray( arr ), pubDynSubGetArray()) );
  101. // access default method from a public static method of a sub class
  102. AddTestCase( "*** Access default method from public static method of sub class ***", 1, 1 );
  103. AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 );
  104. // AddTestCase( "pubStatSubSetArray( arr ), pubStatSubGetArray()", arr, ( pubStatSubSetArray( arr ), pubStatSubGetArray() ) );
  105. // access default method from a public final method of a sub class
  106. AddTestCase( "*** Access default method from public final method of sub class ***", 1, 1 );
  107. AddTestCase( "pubFinSubSetArray( arr ), pubFinSubGetArray()", arr, ( pubFinSubSetArray( arr ), pubFinSubGetArray() ) );
  108. // access default method from a public virtual method of a sub class
  109. AddTestCase( "*** Access default method from public virtual method of sub class ***", 1, 1 );
  110. AddTestCase( "pubVirSubSetArray( arr ), pubVirSubSetArray()", arr, ( pubVirSubSetArray( arr ), pubVirSubGetArray() ) );
  111. // access default method from a final private method of a sub class
  112. AddTestCase( "*** Access default method from final private method of sub class ***", 1, 1 );
  113. AddTestCase( "testPrivFinSubArray( arr )", arr, testPrivFinSubArray( arr ) );
  114. // access default method from a final static method of a sub class
  115. AddTestCase( "*** Access default method from final static method of sub class ***", 1, 1 );
  116. AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 );
  117. // AddTestCase( "finStatSubSetArray( arr ), finStatSubGetArray()", arr, ( finStatSubSetArray( arr ), finStatSubGetArray() ) );
  118. // access default method from a private static method of a sub class
  119. AddTestCase( "*** Access default method from private static method of sub class ***", 1, 1 );
  120. AddTestCase( "*** Static Method cannot access any other methods except static methods of the parent class ***", 1, 1 );
  121. // AddTestCase( "testPrivStatSubArray( arr )", arr, testPrivStatSubArray( arr ) );
  122. // access default method from a private virtual method of a sub class
  123. AddTestCase( "*** Access default method from private virtual method of sub class ***", 1, 1 );
  124. AddTestCase( "testPrivVirSubArray( arr )", arr, testPrivVirSubArray( arr ) );
  125. // access public property from outside the class
  126. AddTestCase( "*** Access public property from outside the class ***", 1, 1 );
  127. AddTestCase( "pubArray = arr", arr, (pubArray = arr, pubArray) );
  128. // <TODO> fill in the rest of the cases here
  129. // access public property from outside the class
  130. AddTestCase( "*** Access default property from outside the class ***", 1, 1 );
  131. AddTestCase( "array = arr", arr, (array = arr, array) );
  132. // access public property from a default method of a sub class
  133. AddTestCase( "*** Access default property from default method of sub class ***", 1, 1 );
  134. AddTestCase( "subSetDPArray( arr ), subGetDPArray()", arr, ( subSetDPArray( arr ), subGetDPArray() ) );
  135. // access public property from a dynamic method of a sub class
  136. AddTestCase( "*** Access default property from dynamic method of sub class ***", 1, 1 );
  137. AddTestCase( "dynSubSetDPArray( arr ), dynSubGetDPArray()", arr, ( dynSubSetDPArray( arr ), dynSubGetDPArray() ) );
  138. // access public property from a public method of a sub class
  139. AddTestCase( "*** Access default property from public method of sub class ***", 1, 1 );
  140. AddTestCase( "pubSubSetDPArray( arr ), pubSubGetDPArray()", arr, ( pubSubSetDPArray( arr ), pubSubGetDPArray() ) );
  141. // access public property from a private method of a sub class
  142. AddTestCase( "*** Access default property from private method of sub class ***", 1, 1 );
  143. AddTestCase( "testPrivSubDPArray( arr )", arr, testPrivSubDPArray( arr ) );
  144. // access public property from a static method of a sub class
  145. AddTestCase( "*** Access default property from static method of sub class ***", 1, 1 );
  146. AddTestCase( "statSubSetDPArray( arr ), statSubGetDPArray()", arr, ( statSubSetDPArray( arr ), statSubGetDPArray() ) );
  147. // access public property from a final method of a sub class
  148. AddTestCase( "*** Access default property from final method of sub class ***", 1, 1 );
  149. AddTestCase( "finSubSetDPArray( arr ), finSubGetDPArray()", arr, ( finSubSetDPArray( arr ), finSubGetDPArray() ) );
  150. // access public property from a private virtual method of a sub class
  151. AddTestCase( "*** Access default property from private virtual method of sub class ***", 1, 1 );
  152. AddTestCase( "virSubSetDPArray( arr ), virSubGetDPArray()", arr, ( virSubSetDPArray( arr ), virSubGetDPArray() ) );
  153. // access public property from a public static method of a sub class
  154. AddTestCase( "*** Access default property from public static method of sub class ***", 1, 1 );
  155. AddTestCase( "pubStatSubSetDPArray( arr ), pubStatSubGetDPArray()", arr, ( pubStatSubSetDPArray( arr ), pubStatSubGetDPArray() ) );
  156. // access public property from a private static method of a sub class
  157. AddTestCase( "*** Access default property from private static method of sub class ***", 1, 1 );
  158. AddTestCase( "testPrivStatSubDPArray( arr )", arr, testPrivStatSubDPArray( arr ) );
  159. test(); // Leave this function alone.
  160. // This function is for executing the test case and then
  161. // displaying the result on to the console or the LOG file.