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

https://github.com/bsdf/trx · ActionScript · 162 lines · 32 code · 35 blank · 95 comment · 0 complexity · f7067fd4aa364412d6295381b6a15c13 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"; // provide a document reference (ie, ECMA section)
  39. var VERSION = "AS 3.0"; // Version of JavaScript or ECMA
  40. var TITLE = "Extend Public Class"; // 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. // ********************************************
  61. // access final method from a default
  62. // method of a sub class
  63. //
  64. // ********************************************
  65. var arr = [1,2,3];
  66. PUBEXTDCLASS = new PubExtPublicClassFin();
  67. AddTestCase( "*** Access final method from default method of sub class ***", 1, 1 );
  68. AddTestCase( "PUBEXTDCLASS.testSubSetArray(arr)", arr, PUBEXTDCLASS.testSubSetArray(arr) );
  69. // <TODO> fill in the rest of the cases here
  70. // ********************************************
  71. // access final method from a public
  72. // method of a sub class
  73. //
  74. // ********************************************
  75. PUBEXTDCLASS = new PubExtPublicClassFin();
  76. AddTestCase( "*** Access final method from public method of sub class ***", 1, 1 );
  77. AddTestCase( "PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()", arr, (PUBEXTDCLASS.pubSubSetArray(arr), PUBEXTDCLASS.pubSubGetArray()) );
  78. // <TODO> fill in the rest of the cases here
  79. // ********************************************
  80. // access final method from a private
  81. // method of a sub class
  82. //
  83. // ********************************************
  84. PUBEXTDCLASS = new PubExtPublicClassFin();
  85. AddTestCase( "*** Access final method from private method of sub class ***", 1, 1 );
  86. AddTestCase( "PUBEXTDCLASS.testPrivSubArray(arr)", arr, PUBEXTDCLASS.testPrivSubArray(arr) );
  87. // <TODO> fill in the rest of the cases here
  88. // ********************************************
  89. // access final method from a final
  90. // method of a sub class
  91. //
  92. // ********************************************
  93. PUBEXTDCLASS = new PubExtPublicClassFin();
  94. AddTestCase( "*** Access final method from final method of sub class ***", 1, 1 );
  95. AddTestCase( "PUBEXTDCLASS.testFinSubSetArray(arr)", arr, PUBEXTDCLASS.testFinSubSetArray(arr) );
  96. // ********************************************
  97. // access final property from
  98. // default method in sub class
  99. // ********************************************
  100. PUBEXTDCLASS = new PubExtPublicClassFin();
  101. AddTestCase( "*** Access final property from method in sub class ***", 1, 1 );
  102. AddTestCase( "PUBEXTDCLASS.testSubSetDPArray(arr)", arr, PUBEXTDCLASS.testSubSetDPArray(arr) );
  103. // <TODO> fill in the rest of the cases here
  104. // ********************************************
  105. // access final property from
  106. // public method in sub class
  107. // ********************************************
  108. PUBEXTDCLASS = new PubExtPublicClassFin();
  109. AddTestCase( "*** Access final property from public method in sub class ***", 1, 1 );
  110. AddTestCase( "PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()", arr, (PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()) );
  111. // <TODO> fill in the rest of the cases here
  112. // ********************************************
  113. // access final property from
  114. // private method in sub class
  115. // ********************************************
  116. PUBEXTDCLASS = new PubExtPublicClassFin();
  117. AddTestCase( "*** Access final property from private method in sub class ***", 1, 1 );
  118. AddTestCase( "PUBEXTDCLASS.testPrivSubSetDPArray(arr)", arr, PUBEXTDCLASS.testPrivSubSetDPArray(arr) );
  119. // ********************************************
  120. // access final property from
  121. // final method in sub class
  122. // ********************************************
  123. PUBEXTDCLASS = new PubExtPublicClassFin();
  124. AddTestCase( "*** Access final property from final method in sub class ***", 1, 1 );
  125. AddTestCase( "PUBEXTDCLASS.testFinSubSetDPArray(arr)", arr, PUBEXTDCLASS.testFinSubSetDPArray(arr) );
  126. test(); // leave this alone. this executes the test cases and
  127. // displays results.