You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2017/12/19 20:59:32 UTC

[royale-compiler] 08/09: fix integration tests

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit fdf99a773460ed1b62a9a9bd053358bcee072c8f
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Dec 19 12:43:59 2017 -0800

    fix integration tests
---
 .../codegen/js/royale/TestRoyaleClass.java         |  4 ++--
 .../royale/compiler/internal/test/TestBase.java    | 28 ++++++++++++++--------
 .../test/resources/royale/files/models/MyModel.as  |  4 ++--
 .../royale/files/models/MyModel_result.js          |  6 ++---
 4 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleClass.java b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleClass.java
index c6d292d..f223030 100644
--- a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleClass.java
+++ b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/codegen/js/royale/TestRoyaleClass.java
@@ -135,7 +135,7 @@ public class TestRoyaleClass extends TestGoogClass
     {
         IClassNode node = getClassNode("public class B {public function B() {}; public var event:Event = new Event(); public function foo():String {return event.type;};}");
         asBlockWalker.visitClass(node);
-        String expected = "/**\n * @constructor\n */\norg.apache.royale.B = function() {\n\nthis.event = new custom.TestEvent();\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('org.apache.royale.B', org.apache.royale.B);\n\n\n/**\n * @export\n * @type {custom.TestEvent}\n */\norg.apache.royale.B.prototype.event;\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.royale.B.prototype.foo = function() {\n  return this.event.type;\n};";
+        String expected = "/**\n * @constructor\n */\norg.apache.royale.B = function() {\n\nthis.event = new Event();\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('org.apache.royale.B', org.apache.royale.B);\n\n\n/**\n * @export\n * @type {Event}\n */\norg.apache.royale.B.prototype.event;\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.royale.B.prototype.foo = function() {\n  return this.event.type;\n};";
         assertOut(expected);
     }
 
@@ -468,7 +468,7 @@ public class TestRoyaleClass extends TestGoogClass
     {
         FileNode node = (FileNode)getNode("package org.apache.royale {\npublic class A {\nimport flash.display.Sprite; Sprite;\n}}", FileNode.class, 0);
         asBlockWalker.visitFile(node);
-        assertOut("/**\n * org.apache.royale.A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n */\n\ngoog.provide('org.apache.royale.A');\n\ngoog.require('flash.display.Sprite');\n\n\n\n/**\n * @constructor\n */\norg.apache.royale.A = function() {\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('org.apache.royale.A', org.apache.royale.A);");
+        assertOut("/**\n * org.apache.royale.A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n */\n\ngoog.provide('org.apache.royale.A');\n\n\n\n/**\n * @constructor\n */\norg.apache.royale.A = function() {\n};\n\n\n/**\n * Prevent renaming of class. Needed for reflection.\n */\ngoog.exportSymbol('org.apache.royale.A', org.apache.royale.A);");
     }
     
     @Override
diff --git a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/TestBase.java b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/TestBase.java
index 950d2c0..944b06e 100644
--- a/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/TestBase.java
+++ b/compiler-jx/src/test/java/org/apache/royale/compiler/internal/test/TestBase.java
@@ -163,6 +163,10 @@ public class TestBase implements ITestBase
     	StringBuilder actualErrors = new StringBuilder();
     	for (ICompilerProblem problem : errors)
     	{
+    		if (problem.toString().equals("An externally-visible definition with the name 'Array' was unexpectedly found."))
+    			continue;
+    		if (problem.toString().equals("An externally-visible definition with the name 'Function' was unexpectedly found."))
+    			continue;
     		if (problem.toString().equals("An externally-visible definition with the name 'Object' was unexpectedly found."))
     			continue;
     		if (problem.toString().equals("An externally-visible definition with the name 'String' was unexpectedly found."))
@@ -183,25 +187,29 @@ public class TestBase implements ITestBase
     			continue;
     		if (problem.toString().equals("An externally-visible definition with the name 'uint' was unexpectedly found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.Object' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.Array' was found."))
+    			continue;
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.Function' was found."))
+    			continue;
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.Object' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.String' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.String' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.Number' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.Number' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.Boolean' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.Boolean' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.Error' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.Error' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.RangeError' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.RangeError' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.ReferenceError' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.ReferenceError' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.TypeError' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.TypeError' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.int' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.int' was found."))
     			continue;
-    		if (problem.toString().equals("No externally-visible definition with the name 'externals.as.classes.uint' was found."))
+    		if (problem.toString().equals("No externally-visible definition with the name 'typedefs.as.classes.uint' was found."))
     			continue;
     		if (problem.toString().equals("An externally-visible definition with the name 'RoyaleTest_A' was unexpectedly found."))
     			continue;
diff --git a/compiler-jx/src/test/resources/royale/files/models/MyModel.as b/compiler-jx/src/test/resources/royale/files/models/MyModel.as
index c743d44..113df2d 100644
--- a/compiler-jx/src/test/resources/royale/files/models/MyModel.as
+++ b/compiler-jx/src/test/resources/royale/files/models/MyModel.as
@@ -19,9 +19,9 @@
 package models
 {
 	import org.apache.royale.events.Event;
-	import org.apache.royale.events.TestImplementation;
+	import org.apache.royale.events.EventDispatcher;
 	
-	public class MyModel extends TestImplementation
+	public class MyModel extends EventDispatcher
 	{
 		public function MyModel()
 		{
diff --git a/compiler-jx/src/test/resources/royale/files/models/MyModel_result.js b/compiler-jx/src/test/resources/royale/files/models/MyModel_result.js
index 07f5110..ba0011d 100644
--- a/compiler-jx/src/test/resources/royale/files/models/MyModel_result.js
+++ b/compiler-jx/src/test/resources/royale/files/models/MyModel_result.js
@@ -22,13 +22,13 @@
 goog.provide('models.MyModel');
 
 goog.require('org.apache.royale.events.Event');
-goog.require('org.apache.royale.events.TestImplementation');
+goog.require('org.apache.royale.events.EventDispatcher');
 
 
 
 /**
  * @constructor
- * @extends {org.apache.royale.events.TestImplementation}
+ * @extends {org.apache.royale.events.EventDispatcher}
  */
 models.MyModel = function() {
   models.MyModel.base(this, 'constructor');
@@ -36,7 +36,7 @@ models.MyModel = function() {
 this._strings = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
 this._cities = ["London", "Miami", "Paris", "Sydney", "Tokyo"];
 };
-goog.inherits(models.MyModel, org.apache.royale.events.TestImplementation);
+goog.inherits(models.MyModel, org.apache.royale.events.EventDispatcher);
 
 
 /**

-- 
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.