You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2012/12/28 17:07:08 UTC
svn commit: r1426560 - in /incubator/flex:
falcon/trunk/compiler.tests/unittest.properties
whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java
Author: erikdebruin
Date: Fri Dec 28 16:07:08 2012
New Revision: 1426560
URL: http://svn.apache.org/viewvc?rev=1426560&view=rev
Log:
Adding test for production of 'goog'-ified JS Method Members code.
Added:
incubator/flex/falcon/trunk/compiler.tests/unittest.properties (with props)
incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java (with props)
Added: incubator/flex/falcon/trunk/compiler.tests/unittest.properties
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/unittest.properties?rev=1426560&view=auto
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/unittest.properties (added)
+++ incubator/flex/falcon/trunk/compiler.tests/unittest.properties Fri Dec 28 16:07:08 2012
@@ -0,0 +1,22 @@
+# copy template-unittest.properties to unittest.properties
+#
+
+# Example (Windows) FLEX_HOME=C:\\dev\\apache-flex\\sdk
+# (Mac Os X)
+#
+FLEX_HOME=/Users/erik/Documents/apacheFlex/repo/sdk
+
+# Example (Windows) AIR_HOME=C:\\dev\\air-sdk-3.4
+# (Mac Os X)
+#
+AIR_HOME=/Users/erik/Documents/apacheFlex/dependencies/AdobeAIRSDK
+
+#
+# Example (Windows) PLAYERGLOBAL_HOME=C:\\dev\\apache-flex-4.8.0\\frameworks\\libs\\player
+# (Mac Os X)
+#
+PLAYERGLOBAL_HOME=/Users/erik/Documents/apacheFlex/dependencies/PlayerGlobal/player
+
+# Example (Windows) FLASHPLAYER_DEBUGGER=C:\\Program Files\\Adobe\\Adobe Flash Builder\\player\\win\\11.1\\FlashPlayerDebugger.exe
+# (Mac Os X)
+FLASHPLAYER_DEBUGGER="/Applications/Flash Player Debugger.app/Contents/MacOS/Flash Player Debugger"
\ No newline at end of file
Propchange: incubator/flex/falcon/trunk/compiler.tests/unittest.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java?rev=1426560&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java Fri Dec 28 16:07:08 2012
@@ -0,0 +1,117 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.internal.js.codegen.goog;
+
+import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.internal.as.codegen.TestAccessorMembers;
+import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'goog' JS code for Class Accessor
+ * members.
+ *
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogAccessorMembers extends TestAccessorMembers
+{
+ // TODO (erikdebruin)
+ // 1) do we have to compile with '--language_in=ECMASCRIPT5'?
+
+ @Override
+ @Test
+ public void testGetAccessor()
+ {
+ IAccessorNode node = getAccessor("function get foo():int{return -1;}");
+ visitor.visitFunction(node);
+ //assertOut("Object.defineProperty(A.prototype, 'foo', {get: function() {return -1;}, configurable: true});");
+ }
+
+ @Override
+ @Test
+ public void testGetAccessor_withNamespace()
+ {
+ IAccessorNode node = getAccessor("public function get foo():int{return -1;}");
+ visitor.visitFunction(node);
+ //assertOut("");
+ }
+
+ @Override
+ @Test
+ public void testGetAccessor_withNamespaceOverride()
+ {
+ IAccessorNode node = getAccessor("public override function get foo():int{return -1;}");
+ visitor.visitFunction(node);
+ //assertOut("");
+ }
+
+ @Override
+ @Test
+ public void testGetAccessor_withStatic()
+ {
+ IAccessorNode node = getAccessor("public static function get foo():int{return -1;}");
+ visitor.visitFunction(node);
+ //assertOut("");
+ }
+
+ @Override
+ @Test
+ public void testSetAccessor()
+ {
+ IAccessorNode node = getAccessor("function set foo(value:int):void{}");
+ visitor.visitFunction(node);
+ //assertOut("Object.defineProperty(A.prototype, 'foo', {set: function(value) {}, configurable: true});");
+ }
+
+ @Override
+ @Test
+ public void testSetAccessor_withNamespace()
+ {
+ IAccessorNode node = getAccessor("public function set foo(value:int):void{}");
+ visitor.visitFunction(node);
+ //assertOut("");
+ }
+
+ @Override
+ @Test
+ public void testSetAccessor_withNamespaceOverride()
+ {
+ IAccessorNode node = getAccessor("public override function set foo(value:int):void{}");
+ visitor.visitFunction(node);
+ //assertOut("");
+ }
+
+ @Override
+ @Test
+ public void testSetAccessor_withStatic()
+ {
+ IAccessorNode node = getAccessor("public static function set foo(value:int):void{}");
+ visitor.visitFunction(node);
+ //assertOut("");
+ }
+
+ @Override
+ protected IBackend createBackend()
+ {
+ return new GoogBackend();
+ }
+}
Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java
------------------------------------------------------------------------------
svn:eol-style = native