incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gordonsm...@apache.org
Subject svn commit: r1400522 - in /incubator/flex/falcon/trunk/compiler.tests: .classpath functional-tests/ functional-tests/f/ functional-tests/f/SDKSWCTests.java unit-tests/org/apache/flex/compiler/internal/parsing/mxml/MXMLTokenizerTests.java
Date Sat, 20 Oct 2012 21:43:58 GMT
Author: gordonsmith
Date: Sat Oct 20 21:43:58 2012
New Revision: 1400522

URL: http://svn.apache.org/viewvc?rev=1400522&view=rev
Log:
Falcon: Added a functional-tests folder to the Eclipse project with a SDKSWCTests JUnit file
which will soon test compiling the Flex SWCs with Falcon.

Functional ActionScript tests like this will help us test Falcon's ActionScript functionality
until Adobe donates the ActionScript unit tests.

These tests do not pass yet and are not part of 'ant tests'.

Added:
    incubator/flex/falcon/trunk/compiler.tests/functional-tests/
    incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/
    incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java   (with
props)
Modified:
    incubator/flex/falcon/trunk/compiler.tests/.classpath
    incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/parsing/mxml/MXMLTokenizerTests.java

Modified: incubator/flex/falcon/trunk/compiler.tests/.classpath
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/.classpath?rev=1400522&r1=1400521&r2=1400522&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/.classpath (original)
+++ incubator/flex/falcon/trunk/compiler.tests/.classpath Sat Oct 20 21:43:58 2012
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="unit-tests"/>
+	<classpathentry kind="src" path="functional-tests"/>
 	<classpathentry kind="lib" path="lib/junit-4.10.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="lib" path="/compiler/lib/commons-io.jar"/>

Added: incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java?rev=1400522&view=auto
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java (added)
+++ incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java Sat Oct
20 21:43:58 2012
@@ -0,0 +1,81 @@
+package f;
+
+import static org.junit.Assert.*;
+import static org.hamcrest.core.Is.is;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flex.compiler.clients.COMPC;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests to compile the SWCs of the Flex SDK.
+ * <p>
+ * The projects to compile are in the <code>frameworks/projects</code> directory
+ * referenced by the <code>FLEX_HOME</code> environment variable.
+ * Each project has a config file which the <code>COMPC</code> uses to compile
the SWC.
+ * 
+ * @author Gordon Smith
+ */
+public class SDKSWCTests
+{
+	private void compileSWC(String projectName)
+	{
+		// Construct a command line which simply loads the project's config file.
+		String configFilePath = System.getenv("FLEX_HOME") +
+		    "/frameworks/projects/" + projectName + "/" + projectName + "-config.xml";
+		String[] args = new String[] { "-load-config=" + configFilePath };
+		
+		// Run the COMPC client with the specified command line.
+		COMPC compc = new COMPC();
+		compc.mainNoExit(args);
+		
+		// Check that the SWC compiled cleanly.
+		List<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
+		for (ICompilerProblem problem : compc.getProblems().getFilteredProblems())
+		{
+			problems.add(problem);
+		}
+		assertThat(problems.size(), is(0));
+	}
+	
+	@Ignore
+	@Test
+	public void frameworkSWC()
+	{
+		compileSWC("framework");
+	}
+	
+	@Ignore
+	@Test
+	public void rpcSWC()
+	{
+		compileSWC("rpc");
+	}
+	
+	@Ignore
+	@Test
+	public void textLayoutSWC()
+	{
+		compileSWC("textLayout");
+	}
+	
+	@Ignore
+	@Test
+	public void mxSWC()
+	{
+		compileSWC("mx");
+	}
+	
+	@Ignore
+	@Test
+	public void sparkSWC()
+	{
+		compileSWC("spark");
+	}
+	
+	// others...
+}

Propchange: incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/parsing/mxml/MXMLTokenizerTests.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/parsing/mxml/MXMLTokenizerTests.java?rev=1400522&r1=1400521&r2=1400522&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/parsing/mxml/MXMLTokenizerTests.java
(original)
+++ incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/parsing/mxml/MXMLTokenizerTests.java
Sat Oct 20 21:43:58 2012
@@ -12,6 +12,11 @@ import org.apache.flex.compiler.parsing.
 import org.junit.Ignore;
 import org.junit.Test;
 
+/**
+ * JUnit tests for MXMLTokenizer.
+ * 
+ * @author Gordon Smith
+ */
 public class MXMLTokenizerTests
 {
 	/**



Mime
View raw message