flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [1/2] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - - Continued making the Unit-Tests use the TestAdapters
Date Sun, 27 Mar 2016 14:14:30 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/feature/maven-migration 0c1b60efa -> f74063cae


- Continued making the Unit-Tests use the TestAdapters


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

Branch: refs/heads/feature/maven-migration
Commit: 2741581a5a7394b5c0a3c87b77301fd30f893026
Parents: 80e344a
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Sun Mar 27 16:08:58 2016 +0200
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Sun Mar 27 16:08:58 2016 +0200

----------------------------------------------------------------------
 .../codegen/js/flexjs/TestFlexJSProject.java    | 25 ++++++++++----------
 .../codegen/js/goog/TestGoogProject.java        |  4 ++--
 .../flex/compiler/internal/test/TestBase.java   | 15 ++++++++----
 3 files changed, 24 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2741581a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
index b20d8f5..fec0d2f 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
@@ -27,6 +27,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import junit.framework.Assert;
 import org.apache.flex.compiler.driver.IBackend;
 import org.apache.flex.compiler.exceptions.ConfigurationException;
 import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogProject;
@@ -139,8 +140,7 @@ public class TestFlexJSProject extends TestGoogProject
         try {
 			((FlexJSProject)project).config.setCompilerAllowSubclassOverrides(null, true);
 		} catch (ConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+            Assert.fail(e.getMessage());
 		}
         project.setTargetSettings(new TargetSettings(((FlexJSProject)project).config));
         
@@ -163,8 +163,7 @@ public class TestFlexJSProject extends TestGoogProject
         try {
 			((FlexJSProject)project).config.setCompilerAllowSubclassOverrides(null, true);
 		} catch (ConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+            Assert.fail(e.getMessage());
 		}
         project.setTargetSettings(new TargetSettings(((FlexJSProject)project).config));
         
@@ -176,15 +175,15 @@ public class TestFlexJSProject extends TestGoogProject
 
         String out = sb.toString();
         out = out.replace("\\", "/");
-        
-        String expected = "test-files/flexjs/projects/bad_overrides/Test.as(31:29)\n" +
-        					"interface method someFunction in interface IA is implemented with an incompatible
signature in class Test\n" +
-        					"test-files/flexjs/projects/bad_overrides/Test.as(36:26)\n" +
-        					"interface method someOtherFunction in interface IA is implemented with an incompatible
signature in class Test\n" +
-        					"test-files/flexjs/projects/bad_overrides/Test.as(31:29)\n" +
-        					"Incompatible override.\n" +
-        					"test-files/flexjs/projects/bad_overrides/Test.as(36:26)\n" +
-        					"Incompatible override.\n";
+
+        String expected = testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(31:29)\n"
+
+                "interface method someFunction in interface IA is implemented with an incompatible
signature in class Test\n" +
+                testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(36:26)\n"
+
+                "interface method someOtherFunction in interface IA is implemented with an
incompatible signature in class Test\n" +
+                testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(31:29)\n"
+
+                "Incompatible override.\n" +
+                testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(36:26)\n"
+
+                "Incompatible override.\n";
         assertThat(out, is(expected));
     }
     

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2741581a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
index c79e967..a120ec0 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
@@ -30,6 +30,7 @@ import java.util.List;
 
 import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 /**
  * This class tests the production of valid 'goog' JS code from an external
@@ -74,8 +75,7 @@ public class TestGoogProject extends ASTestBase
     {
     	if (compiledFileNames.size() == 0)
     	{
-    		assertThat("No Compiled files", is("Compiled Files"));
-    		return;
+            fail("Expected compiled files");
     	}
         for (String compiledFileName : compiledFileNames)
         {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2741581a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
index d51e7ec..186f690 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
@@ -64,6 +64,7 @@ import org.apache.flex.utils.EnvProperties;
 import org.apache.flex.compiler.visitor.as.IASBlockWalker;
 import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
 import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.ITestAdapter;
 import org.apache.flex.utils.TestAdapterFactory;
 import org.junit.After;
 import org.junit.Before;
@@ -75,6 +76,8 @@ import com.google.common.collect.Iterables;
 @Ignore
 public class TestBase implements ITestBase
 {
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
     protected List<ICompilerProblem> errors;
 
     protected static EnvProperties env = EnvProperties.initiate();
@@ -283,11 +286,13 @@ public class TestBase implements ITestBase
         	for (ICompilerProblem error : errors)
         	{
         		String fn = error.getSourcePath();
-        		int c = fn.indexOf("test-files");
-        		fn = fn.substring(c);
-        		sb.append(fn);
-        		sb.append("(" + error.getLine() + ":" + error.getColumn() + ")\n");
-        		sb.append(error.toString() + "\n");
+                if(fn != null) {
+                    int c = fn.indexOf(testAdapter.getUnitTestBaseDir().getPath());
+                    fn = fn.substring(c);
+                    sb.append(fn);
+                    sb.append("(" + error.getLine() + ":" + error.getColumn() + ")\n");
+                    sb.append(error.toString() + "\n");
+                }
         	}
         	System.out.println(sb.toString());
         	return compiledFileNames;


Mime
View raw message