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

https://github.com/changm/tessa · ActionScript · 143 lines · 26 code · 30 blank · 87 comment · 0 complexity · f249736e785be4a0bb8a45fdf8ee9ad2 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. var SECTION = "Definitions"; // provide a document reference (ie, ECMA section)
  38. var VERSION = "AS 3.0"; // Version of JavaScript or ECMA
  39. var TITLE = "extend public class"; // Provide ECMA section title or a description
  40. var BUGNUMBER = "";
  41. startTest(); // leave this alone
  42. /**
  43. * Calls to AddTestCase here. AddTestCase is a function that is defined
  44. * in shell.js and takes three arguments:
  45. * - a string representation of what is being tested
  46. * - the expected result
  47. * - the actual result
  48. *
  49. * For example, a test might look like this:
  50. *
  51. * var helloWorld = "Hello World";
  52. *
  53. * AddTestCase(
  54. * "var helloWorld = 'Hello World'", // description of the test
  55. * "Hello World", // expected result
  56. * helloWorld ); // actual result
  57. *
  58. */
  59. import PublicClass.*;
  60. // ********************************************
  61. // access default method from a default
  62. // method of a sub class
  63. //
  64. // ********************************************
  65. var arr = new Array(1, 2, 3);
  66. PUBEXTDCLASS = new PubExtPublicClass();
  67. AddTestCase( "*** Access default method from default method of sub class ***", 1, 1 );
  68. AddTestCase( "PUBEXTDCLASS.testSubGetSetArray(arr)", arr, PUBEXTDCLASS.testSubGetSetArray(arr) );
  69. // <TODO> fill in the rest of the cases here
  70. // ********************************************
  71. // access default method from a public
  72. // method of a sub class
  73. //
  74. // ********************************************
  75. PUBEXTDCLASS = new PubExtPublicClass();
  76. AddTestCase( "*** Access default 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 default method from a private
  81. // method of a sub class
  82. //
  83. // ********************************************
  84. PUBEXTDCLASS = new PubExtPublicClass();
  85. AddTestCase( "*** Access default 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 default property from
  90. // default method in sub class
  91. // ********************************************
  92. PUBEXTDCLASS = new PubExtPublicClass();
  93. AddTestCase( "*** Access default property from method in sub class ***", 1, 1 );
  94. AddTestCase( "PUBEXTDCLASS.testSubGetSetDPArray(arr)", arr, PUBEXTDCLASS.testSubGetSetDPArray(arr) );
  95. // <TODO> fill in the rest of the cases here
  96. // ********************************************
  97. // access default property from
  98. // public method in sub class
  99. // ********************************************
  100. PUBEXTDCLASS = new PubExtPublicClass();
  101. AddTestCase( "*** Access default property from public method in sub class ***", 1, 1 );
  102. AddTestCase( "PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()", arr, (PUBEXTDCLASS.pubSubSetDPArray(arr), PUBEXTDCLASS.pubSubGetDPArray()) );
  103. // <TODO> fill in the rest of the cases here
  104. // ********************************************
  105. // access default property from
  106. // private method in sub class
  107. // ********************************************
  108. PUBEXTDCLASS = new PubExtPublicClass();
  109. AddTestCase( "*** Access default property from private method in sub class ***", 1, 1 );
  110. AddTestCase( "PUBEXTDCLASS.testPrivSubDPArray(arr)", arr, PUBEXTDCLASS.testPrivSubDPArray(arr) );
  111. // <TODO> fill in the rest of the cases here
  112. test(); // leave this alone. this executes the test cases and
  113. // displays results.