royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-compiler] 05/09: get feature tests running from eclipse for the compiler project
Date Tue, 19 Dec 2017 20:59:29 GMT
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 94778cef02dd63ceb677228b0af9458a93f9dbf8
Author: Alex Harui <aharui@apache.org>
AuthorDate: Tue Dec 19 11:43:24 2017 -0800

    get feature tests running from eclipse for the compiler project
---
 .../test/java/mxml/tags/MXMLComponentTagTests.java |  4 ++--
 .../java/mxml/tags/MXMLDefinitionTagTests.java     |  3 ++-
 .../test/java/mxml/tags/MXMLFeatureTestsBase.java  |  7 ++++---
 .../internal/tree/mxml/MXMLComponentNodeTests.java | 22 +++++++++++-----------
 .../tree/mxml/MXMLDesignLayerNodeTests.java        |  4 ++--
 .../internal/tree/mxml/MXMLNodeBaseTests.java      |  9 ++++++++-
 6 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/compiler/src/test/java/mxml/tags/MXMLComponentTagTests.java b/compiler/src/test/java/mxml/tags/MXMLComponentTagTests.java
index 0e1e455..3d3d372 100644
--- a/compiler/src/test/java/mxml/tags/MXMLComponentTagTests.java
+++ b/compiler/src/test/java/mxml/tags/MXMLComponentTagTests.java
@@ -52,7 +52,7 @@ public class MXMLComponentTagTests extends MXMLInstanceTagTestsBase
         String[] declarations = new String[]
         {
             "<fx:Component id='c1' className='MyTestInstance'>",
-            "    <custom:TestInstance name='s1'/>",
+            "    <d:Sprite name='s1'/>",
             "</fx:Component>"
         };
         String[] asserts = new String[]
@@ -64,7 +64,7 @@ public class MXMLComponentTagTests extends MXMLInstanceTagTestsBase
             "var properties:Object = ClassFactory(c1).properties;",
             "assertEqual('countProperties(properties)', countProperties(properties), 1);",
             "assertEqual('properties.outerDocument', properties.outerDocument, this);",
-            "assertEqual('c1.newInstance() is TestInstance', c1.newInstance() is TestInstance,
true);",
+            "assertEqual('c1.newInstance() is Sprite', c1.newInstance() is Sprite, true);",
             "assertEqual('c1.newInstance().name', c1.newInstance().name, 's1');",
             "assertEqual('c1.newInstance().outerDocument', c1.newInstance().outerDocument,
this);",
         };
diff --git a/compiler/src/test/java/mxml/tags/MXMLDefinitionTagTests.java b/compiler/src/test/java/mxml/tags/MXMLDefinitionTagTests.java
index d6dc48d..5765509 100644
--- a/compiler/src/test/java/mxml/tags/MXMLDefinitionTagTests.java
+++ b/compiler/src/test/java/mxml/tags/MXMLDefinitionTagTests.java
@@ -49,6 +49,7 @@ public class MXMLDefinitionTagTests extends MXMLInstanceTagTestsBase
 	            "    </fx:Declarations>",
 	            "    <fx:Script>",
 	            "    <![CDATA[",
+	            "        import custom.TestInstance;",	            
 	            "        private function assertEqual(message:String, actualValue:*, expectedValue:*):void",
 	            "        {",
 	            "            if (actualValue !== expectedValue)",
@@ -106,7 +107,7 @@ public class MXMLDefinitionTagTests extends MXMLInstanceTagTestsBase
         };
         String[] declarations = new String[]
         {
-            "<fx:MyDefinitions name='s1'/>"
+            "<fx:MyDefinition id='s1'/>"
         };
         String[] asserts = new String[]
         {
diff --git a/compiler/src/test/java/mxml/tags/MXMLFeatureTestsBase.java b/compiler/src/test/java/mxml/tags/MXMLFeatureTestsBase.java
index 64874a3..3c7e343 100644
--- a/compiler/src/test/java/mxml/tags/MXMLFeatureTestsBase.java
+++ b/compiler/src/test/java/mxml/tags/MXMLFeatureTestsBase.java
@@ -100,7 +100,7 @@ public class MXMLFeatureTestsBase
 
 		// Build the list of SWCs to compile against on the library path.
 		List<String> swcs = new ArrayList<String>();
-    	String customSwcPath = FilenameNormalization.normalize("../../target/custom.swc");
+    	String customSwcPath = FilenameNormalization.normalize("target/custom.swc");
 		swcs.add(customSwcPath);
 		if (withFramework)
 		{
@@ -120,6 +120,7 @@ public class MXMLFeatureTestsBase
 		String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]),
",");
 		
 		List<String> args = new ArrayList<String>();
+		args.add("-debug=true");
 		// Force the testsuite to use en_US as locale, otherwise
 		// the testsuite will only pass on systems with en_US as
 		// locale.
@@ -127,12 +128,12 @@ public class MXMLFeatureTestsBase
         if (hasFlashPlayerGlobal)
         	args.add("-external-library-path=" + testAdapter.getPlayerglobal().getPath());
         else {
-        	String jsSwcPath = FilenameNormalization.normalize("../../../compiler-externc/target/js.swc");
+        	String jsSwcPath = FilenameNormalization.normalize("../compiler-externc/target/js.swc");
         	args.add("-external-library-path=" + jsSwcPath);
         }
 		args.add(libraryPath);
 		args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getFlexManifestPath("mxml-2009"));
-    	String customManifestPath = FilenameNormalization.normalize("../../src/test/resources/custom-manifest.xml");
+    	String customManifestPath = FilenameNormalization.normalize("src/test/resources/custom-manifest.xml");
 		args.add("-namespace+=" + NAMESPACE_TEST + "," + customManifestPath);
 		if (otherOptions != null)
 		{
diff --git a/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLComponentNodeTests.java
b/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLComponentNodeTests.java
index 4165670..3a81a38 100644
--- a/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLComponentNodeTests.java
+++ b/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLComponentNodeTests.java
@@ -89,7 +89,7 @@ public class MXMLComponentNodeTests extends MXMLInstanceNodeTests
 		String[] code = new String[]
 		{
 		    "<fx:Declarations><fx:Component>",
-		    "    <custom:TestInstance/>",
+		    "    <s:Group/>",
 		    "</fx:Component></fx:Declarations>"
 		};
 		IMXMLComponentNode node = getMXMLComponentNode(code);
@@ -98,7 +98,7 @@ public class MXMLComponentNodeTests extends MXMLInstanceNodeTests
 		assertThat("getClassNode", node.getClassNode(), is((IMXMLClassNode)null));
 		assertThat("getClassName", node.getClassName(), is((String)null));
 		assertThat("getContainedClassDefinitionNode", node.getContainedClassDefinitionNode(), is(node.getChild(0)));
-		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("custom.TestInstance",
project), is(true));
+		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("flash.display.Sprite",
project), is(true));
 	}
 	
 	@Test
@@ -107,7 +107,7 @@ public class MXMLComponentNodeTests extends MXMLInstanceNodeTests
 		String[] code = new String[]
 		{
 		    "<fx:Declarations><fx:Component className='MyTestInstance'>",
-		    "    <custom:TestInstance/>",
+		    "    <s:Group/>",
 		    "</fx:Component></fx:Declarations>"
 		};
 		IMXMLComponentNode node = getMXMLComponentNode(code);
@@ -116,7 +116,7 @@ public class MXMLComponentNodeTests extends MXMLInstanceNodeTests
 		assertThat("getClassNode", node.getClassNode(), is((IMXMLClassNode)null));
 		assertThat("getClassName", node.getClassName(), is("MyTestInstance"));
 		assertThat("getContainedClassDefinitionNode", node.getContainedClassDefinitionNode(), is(node.getChild(0)));
-		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("custom.TestInstance",
project), is(true));
+		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("flash.display.Sprite",
project), is(true));
 	}
 	
 	@Test
@@ -125,7 +125,7 @@ public class MXMLComponentNodeTests extends MXMLInstanceNodeTests
 		String[] code = new String[]
 		{
 		    "<fx:Declarations><fx:Component id='c1'>",
-		    "    <custom:TestInstance/>",
+		    "    <s:Group/>",
 		    "</fx:Component></fx:Declarations>"
 		};
 		IMXMLComponentNode node = getMXMLComponentNode(code);
@@ -134,7 +134,7 @@ public class MXMLComponentNodeTests extends MXMLInstanceNodeTests
 		assertThat("getClassNode", node.getClassNode(), is((IMXMLClassNode)null));
 		assertThat("getClassName", node.getClassName(), is((String)null));
 		assertThat("getContainedClassDefinitionNode", node.getContainedClassDefinitionNode(), is(node.getChild(0)));
-		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("custom.TestInstance",
project), is(true));
+		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("flash.display.Sprite",
project), is(true));
 	}
 	
 	@Test
@@ -143,18 +143,18 @@ public class MXMLComponentNodeTests extends MXMLInstanceNodeTests
 		String[] code = new String[]
 		{
 		    "<fx:Declarations><fx:Component id='c1' className='MyTestInstance'>",
-		    "    <custom:TestInstance name='ti'>",
-		    "        <custom:value>100</custom:value>",
-		    "    </custom.TestInstance>",
+		    "    <s:Group name='ti'>",
+		    "        <s:width>100</s:width>",
+		    "    </s:Group>",
 		    "</fx:Component></fx:Declarations>"
 		};
 		IMXMLComponentNode node = getMXMLComponentNode(code);
 		assertThat("getChildCount", node.getChildCount(), is(1));
-		assertThat("getID", node.getID(), is("ti"));
+		assertThat("getID", node.getID(), is("c1"));
 		assertThat("getClassNode", node.getClassNode(), is((IMXMLClassNode)null));
 		assertThat("getClassName", node.getClassName(), is("MyTestInstance"));
 		assertThat("getContainedClassDefinitionNode", node.getContainedClassDefinitionNode(), is(node.getChild(0)));
-		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("custom.MyTestInstance",
project), is(true));
+		assertThat("getContainedClassDefinition", node.getContainedClassDefinition().isInstanceOf("flash.display.Sprite",
project), is(true));
 		assertThat("getContainedClassDefinitionNode.getChildCount", node.getContainedClassDefinitionNode().getChildCount(),
is(2));
 	}
 }
diff --git a/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDesignLayerNodeTests.java
b/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDesignLayerNodeTests.java
index 5feeb3e..8b51ea2 100644
--- a/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDesignLayerNodeTests.java
+++ b/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLDesignLayerNodeTests.java
@@ -105,8 +105,8 @@ public class MXMLDesignLayerNodeTests extends MXMLInstanceNodeTests
 		String[] code = new String[]
 		{
 			"<fx:DesignLayer>",
-			"    <d:Sprite/>",
-			"    <d:Sprite/>",
+			"    <s:Group/>",
+			"    <s:Group/>",
 			"</fx:DesignLayer>"
 		};
 		IMXMLDesignLayerNode node = getMXMLDesignLayerNode(code);
diff --git a/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
b/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
index 1ef9406..66e5799 100644
--- a/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
+++ b/compiler/src/test/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
@@ -153,8 +153,15 @@ public class MXMLNodeBaseTests
 		
 		// Use the MXML 2009 manifest.
 		List<IMXMLNamespaceMapping> namespaceMappings = new ArrayList<IMXMLNamespaceMapping>();
+		File mxml2009File = new File(testAdapter.getUnitTestBaseDir(), "mxml-2009-manifest.xml");
+		if (!mxml2009File.exists())
+			mxml2009File = new File(FilenameNormalization.normalize("src/test/resources/mxml-2009-manifest.xml"));
+		if (withFlex)
+			mxml2009File = new File(testAdapter.getFlexManifestPath("mxml-2009"));
+		if (!mxml2009File.exists())
+			System.out.println("could not find mxml-2009-manifest.xml");
 		IMXMLNamespaceMapping mxml2009 = new MXMLNamespaceMapping(
-		    "http://ns.adobe.com/mxml/2009", new File(testAdapter.getUnitTestBaseDir(), "mxml-2009-manifest.xml").getAbsolutePath());
+		    "http://ns.adobe.com/mxml/2009", mxml2009File.getAbsolutePath());
 		namespaceMappings.add(mxml2009);
 		IMXMLNamespaceMapping custom = new MXMLNamespaceMapping(
 			    "library://ns.apache.org/royale/test", new File(testAdapter.getUnitTestBaseDir(),
"custom-manifest.xml").getAbsolutePath());

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

Mime
View raw message