You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2014/11/28 15:10:13 UTC

git commit: [flex-falcon] [refs/heads/develop] - Added some debug output to the tests, allowing a little more detailed failure analysis.

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 18b403c9c -> ebf72609d


Added some debug output to the tests, allowing a little more detailed failure analysis.


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ebf72609
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ebf72609
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ebf72609

Branch: refs/heads/develop
Commit: ebf72609d28c62ba2c2bef4cfc5dc215f81621a3
Parents: 18b403c
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Fri Nov 28 15:10:06 2014 +0100
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Fri Nov 28 15:10:06 2014 +0100

----------------------------------------------------------------------
 .../mxml/tags/MXMLFeatureTestsBase.java         | 29 +++++++++++++-------
 1 file changed, 19 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ebf72609/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
----------------------------------------------------------------------
diff --git a/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java b/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
index a4b610a..58b732a 100644
--- a/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
+++ b/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
@@ -21,12 +21,15 @@ package mxml.tags;
 
 import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.flex.compiler.clients.MXMLC;
@@ -65,6 +68,8 @@ public class MXMLFeatureTestsBase
 
 	protected void compileAndRun(String mxml, boolean withFramework, boolean withRPC, boolean withSpark, String[] otherOptions)
 	{
+		System.out.println("Generating test:");
+
 		// Write the MXML into a temp file.
 		String tempDir = FilenameNormalization.normalize("temp");
 		File tempMXMLFile = null;
@@ -80,8 +85,9 @@ public class MXMLFeatureTestsBase
 		catch (IOException e1) 
 		{
 			e1.printStackTrace();
+			fail("Error generating test code");
 		}
-		
+
 		// Build the list of SWCs to compile against on the library path.
 		List<String> swcs = new ArrayList<String>();
 		if (withFramework)
@@ -99,7 +105,7 @@ public class MXMLFeatureTestsBase
 			swcs.add(SPARK_SWC);
 			swcs.add(SPARK_RB_SWC);
 		}
-		String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[0]), ",");
+		String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]), ",");
 		
 		List<String> args = new ArrayList<String>();
 		args.add("-external-library-path=" + PLAYERGLOBAL_SWC);
@@ -107,17 +113,19 @@ public class MXMLFeatureTestsBase
 		args.add("-namespace=" + NAMESPACE_2009 + "," + MANIFEST_2009);
 		if (otherOptions != null)
 		{
-			for (String otherOption : otherOptions)
-			{
-				args.add(otherOption);
-			}
+			Collections.addAll(args, otherOptions);
 		}
 		args.add(tempMXMLFile.getAbsolutePath());
-		
+
 		// Use MXMLC to compile the MXML file against playerglobal.swc and possibly other SWCs.
 		MXMLC mxmlc = new MXMLC();
-		int exitCode = mxmlc.mainNoExit(args.toArray(new String[0]));
-		
+		StringBuffer cmdLine = new StringBuffer();
+		for(String arg : args) {
+			cmdLine.append(arg).append(" ");
+		}
+		System.out.println("Compiling test:\n" + cmdLine.toString());
+		int exitCode = mxmlc.mainNoExit(args.toArray(new String[args.size()]));
+
 		// Check that there were no compilation problems.
 		List<ICompilerProblem> problems = mxmlc.getProblems().getProblems();
 		StringBuilder sb = new StringBuilder("Unxpected compilation problems:\n");
@@ -127,13 +135,14 @@ public class MXMLFeatureTestsBase
 			sb.append('\n');
 		}
 		assertThat(sb.toString(), exitCode, is(0));
-		
+
 		// Run the SWF in the standalone player amd wait until the SWF calls System.exit().
 		String swf = FilenameNormalization.normalize(tempMXMLFile.getAbsolutePath());
 		swf = swf.replace(".mxml", ".swf");
 		String[] runArgs = new String[] { FLASHPLAYER, swf };
 		try
 		{
+			System.out.println("Executing test:\n" + Arrays.toString(runArgs));
 			Process process = Runtime.getRuntime().exec(runArgs);
 			process.waitFor();
 			exitCode = process.exitValue();