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

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