incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschma...@apache.org
Subject svn commit: r1422932 - in /incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver: TestBase.java TestExpressions.java
Date Mon, 17 Dec 2012 13:55:02 GMT
Author: mschmalle
Date: Mon Dec 17 13:55:02 2012
New Revision: 1422932

URL: http://svn.apache.org/viewvc?rev=1422932&view=rev
Log:
Flex:FalconJx 
- TestExpressions.java subclasses TestWalkerBase
- TestBase; removed extraneous ) in the getNode methods

Modified:
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestBase.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestExpressions.java

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestBase.java?rev=1422932&r1=1422931&r2=1422932&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestBase.java
(original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestBase.java
Mon Dec 17 13:55:02 2012
@@ -172,7 +172,7 @@ public class TestBase
     protected IASNode getNode(String code, Class<? extends IASNode> type)
     {
         String source = "package {public class A {function a():void {" + code
-                + "}})";
+                + "}}";
         IFileNode node = getFileNode(source);
         if (type.isInstance(node))
             return node;
@@ -184,7 +184,7 @@ public class TestBase
             Class<? extends IASNode> type)
     {
         String source = "package {public class A {function a():void {" + code
-                + "}})";
+                + "}}";
         IFileNode node = getFileNode(source);
         IExpressionNode child = (IExpressionNode) findFirstDescendantOfType(
                 node, type);
@@ -194,7 +194,7 @@ public class TestBase
     protected IUnaryOperatorNode getUnaryNode(String code)
     {
         String source = "package {public class A {function a():void {" + code
-                + "}})";
+                + "}}";
         IFileNode node = getFileNode(source);
         IUnaryOperatorNode child = (IUnaryOperatorNode) findFirstDescendantOfType(
                 node, IUnaryOperatorNode.class);
@@ -204,7 +204,7 @@ public class TestBase
     protected IBinaryOperatorNode getBinaryNode(String code)
     {
         String source = "package {public class A {function a():void {" + code
-                + "}})";
+                + "}}";
         IFileNode node = getFileNode(source);
         IBinaryOperatorNode child = (IBinaryOperatorNode) findFirstDescendantOfType(
                 node, IBinaryOperatorNode.class);
@@ -214,7 +214,7 @@ public class TestBase
     protected IDynamicAccessNode getDynamicAccessNode(String code)
     {
         String source = "package {public class A {function a():void {" + code
-                + "}})";
+                + "}}";
         IFileNode node = getFileNode(source);
         IDynamicAccessNode child = (IDynamicAccessNode) findFirstDescendantOfType(
                 node, IDynamicAccessNode.class);

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestExpressions.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestExpressions.java?rev=1422932&r1=1422931&r2=1422932&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestExpressions.java
(original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestExpressions.java
Mon Dec 17 13:55:02 2012
@@ -19,15 +19,6 @@
 
 package org.apache.flex.js.internal.driver;
 
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.StringWriter;
-import java.io.Writer;
-
-import org.apache.flex.compiler.clients.IBackend;
-import org.apache.flex.compiler.internal.driver.JSBackend;
-import org.apache.flex.compiler.internal.js.codgen.JSFilterWriter;
 import org.apache.flex.compiler.internal.tree.as.ArrayLiteralNode;
 import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode;
 import org.apache.flex.compiler.internal.tree.as.ObjectLiteralNode;
@@ -39,43 +30,14 @@ import org.apache.flex.compiler.tree.as.
 import org.apache.flex.compiler.tree.as.IReturnNode;
 import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
 import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
-import org.apache.flex.compiler.visitor.IASBlockVisitor;
-import org.junit.After;
 import org.junit.Ignore;
 import org.junit.Test;
 
 /**
  * @author Michael Schmalle
  */
-public class TestExpressions extends TestBase
+public class TestExpressions extends TestWalkerBase
 {
-    private IASBlockVisitor visitor;
-
-    private Writer out;
-
-    private IBackend backend;
-
-    private JSFilterWriter writer;
-
-    @Override
-    public void setUp()
-    {
-        super.setUp();
-
-        backend = new JSBackend();
-        out = new StringWriter();
-        writer = new JSFilterWriter(out);
-        visitor = backend.createWalker(project, errors, writer);
-    }
-
-    @After
-    public void tearDown()
-    {
-        backend = null;
-        out = null;
-        writer = null;
-        visitor = null;
-    }
 
     // ILanguageIdentifierNode -> IIdentifierNode
 
@@ -716,9 +678,4 @@ public class TestExpressions extends Tes
         visitor.visitReturn(node);
         assertOut("return");
     }
-
-    private void assertOut(String code)
-    {
-        assertThat(out.toString(), is(code));
-    }
 }



Mime
View raw message