You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2014/07/10 01:39:02 UTC
[06/26] git commit: [flex-falcon] [refs/heads/experimental/VF2JS] -
Update VF2JS MXML node tests with tests for attributes.
Update VF2JS MXML node tests with tests for attributes.
Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/cf1d8a3d
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/cf1d8a3d
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/cf1d8a3d
Branch: refs/heads/experimental/VF2JS
Commit: cf1d8a3d962c1056f759f893354c0210019292e7
Parents: da4ed7a
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Mon Jun 30 12:08:28 2014 +0200
Committer: Jose Barragan <jo...@apache.org>
Committed: Thu Jul 10 01:33:43 2014 +0200
----------------------------------------------------------------------
.../codegen/mxml/vf2js/TestVF2JSMXMLNodes.java | 46 +++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/cf1d8a3d/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLNodes.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLNodes.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLNodes.java
index 2cd9ac3..24bac96 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLNodes.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLNodes.java
@@ -27,7 +27,7 @@ public class TestVF2JSMXMLNodes extends VF2JSTestBase
{
@Test
- public void testSimpleNode()
+ public void testSimpleButtonNode()
{
String code = "<s:Button />";
@@ -40,4 +40,48 @@ public class TestVF2JSMXMLNodes extends VF2JSTestBase
assertOut("<Button></Button>");
}
+ @Test
+ public void testButtonNodeWithVF2JSAttribute()
+ {
+ String code = "<s:Button label=\"hello\" />";
+
+ IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+ code, IMXMLPropertySpecifierNode.class,
+ MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+ mxmlBlockWalker.visitPropertySpecifier(node);
+
+ assertOut("<Button label=\"hello\"></Button>");
+ }
+
+ @Test
+ public void testButtonNodeWithNonVF2JSAttribute()
+ {
+ String code = "<s:Button string=\"bye\" />";
+
+ IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+ code, IMXMLPropertySpecifierNode.class,
+ MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+ mxmlBlockWalker.visitPropertySpecifier(node);
+
+ // (erikdebruin) The attribute doesn't exist in VF2JS, so it's ignored
+ assertOut("<Button></Button>");
+ }
+
+ @Test
+ public void testButtonNodeWithBothVF2JSAndNonVF2JSAttribute()
+ {
+ String code = "<s:Button label=\"hello\" string=\"bye\" />";
+
+ IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+ code, IMXMLPropertySpecifierNode.class,
+ MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+ mxmlBlockWalker.visitPropertySpecifier(node);
+
+ // (erikdebruin) The attribute 'string' doesn't exist in VF2JS, so it's ignored
+ assertOut("<Button label=\"hello\"></Button>");
+ }
+
}