You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/03/23 07:07:51 UTC
[royale-asjs] 01/03: quick sweep through manualtests
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 958b532deea530e4a366bd4e13f8b8eb5604abc6
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon Mar 23 18:18:46 2020 +1300
quick sweep through manualtests
---
manualtests/UnitTests/build.xml | 6 +-
manualtests/UnitTests/pom.xml | 252 ++++++++---------
.../src/main/config/compile-app-config.xml | 15 ++
.../UnitTests/src/main/royale/MyInitialView.mxml | 17 +-
.../UnitTests/src/main/royale/TestClasses.as | 1 +
.../BindingTester.as} | 36 ++-
.../flexUnitTests/binding/BindableCoreTests.as | 298 +++++++++++++++++++++
.../flexUnitTests/binding/BindingCoreTests.as | 281 +++++++++++++++++++
.../binding/support/IBindingTest.as} | 29 +-
.../BaseWithAccesorVariantsBindableClass.as | 93 +++++++
.../BaseWithBindableAndUnbindableVars.as} | 24 +-
.../support/bindables/BaseWithBindableClass.as} | 22 +-
.../support/bindables/BaseWithBindableGetter.as | 69 +++++
.../support/bindables/BaseWithBindableVar.as} | 23 +-
.../bindables/BaseWithGetterBindableClass.as} | 33 +--
.../binding/support/bindables/BindableMxmlTest.as} | 30 +--
.../binding/support/bindables/BindableSetterVO.as} | 29 +-
.../binding/support/bindables/BindableSubVO1.as} | 30 +--
.../binding/support/bindables/BindableSubVO2.as} | 30 +--
.../binding/support/bindables/BindableSubVO3.as} | 30 +--
.../bindables/BindableWithConstructorInit.as} | 37 +--
.../binding/support/bindables/UnbindableBase.as} | 26 +-
.../support/bindables/UnbindableIntermediateVO.as} | 26 +-
.../binding/support/bindings/bindables/ITaskVO.as} | 39 ++-
.../bindings/bindables/OneLayerBindable.as} | 37 ++-
.../binding/support/bindings/bindables/TaskVO.as} | 69 +++--
.../bindings/bindables/TaskVO_on_top_of_class.as | 76 ++++++
.../bindables/TaskVO_on_top_of_property.as | 80 ++++++
.../bindings/bindables/TwoLayerBindable.as} | 26 +-
.../support/bindings/flex/DeepBindingsA.mxml | 156 +++++++++++
.../support/bindings/flex/FunctionBindingsA.mxml | 280 +++++++++++++++++++
.../support/bindings/flex/RendereBindingTestA.mxml | 164 ++++++++++++
.../support/bindings/flex/SimpleBindingsA.mxml | 81 ++++++
.../support/bindings/flex/SimpleBindingsB.mxml | 169 ++++++++++++
.../flex/internalmxml/TaskVOItemRenderer.mxml | 49 ++++
.../support/bindings/royale/DeepBindingsA.mxml | 159 +++++++++++
.../support/bindings/royale/FunctionBindingsA.mxml | 285 ++++++++++++++++++++
.../bindings/royale/RendereBindingTestA.mxml | 182 +++++++++++++
.../support/bindings/royale/SimpleBindingsA.mxml | 92 +++++++
.../support/bindings/royale/SimpleBindingsB.mxml | 174 ++++++++++++
.../royale/internalmxml/TaskVOItemRenderer.mxml | 58 ++++
.../internalmxml/support/ListItemRenderer.as | 147 ++++++++++
.../binding/utils/BindableTestUtil.as | 190 +++++++++++++
.../flexUnitTests/binding/utils/BindingTestUtil.as | 84 ++++++
.../language/LanguageTesterTestArraylikeGetSet.as | 7 +-
.../language/LanguageTesterTestForEach.as | 7 +-
.../flexUnitTests/mxroyale/SharedObjectTest.as | 3 +-
.../network/AMFBinaryDataTesterTest.as | 38 ++-
.../network/support/TestClass7a.as} | 50 ++--
.../network/support/TestClass7b.as} | 50 ++--
.../reflection/ReflectionTesterNativeTypes.as | 3 +-
.../reflection/ReflectionTesterTest.as | 27 +-
.../reflection/ReflectionTesterTestUseCache.as | 11 +-
.../royale/flexUnitTests/xml/XMLNamespaceTest.as | 30 ++-
.../flexUnitTests/xml/XMLTesterGeneralTest.as | 44 +--
.../main/royale/testshim/RoyaleUnitTestRunner.as | 19 +-
manualtests/build.xml | 4 +-
manualtests/build_example.xml | 6 +-
58 files changed, 3749 insertions(+), 584 deletions(-)
diff --git a/manualtests/UnitTests/build.xml b/manualtests/UnitTests/build.xml
index e4fbad5..a01cd3f 100644
--- a/manualtests/UnitTests/build.xml
+++ b/manualtests/UnitTests/build.xml
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<!--
-
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.
@@ -15,10 +14,7 @@
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.
-
-->
-
-
<project name="UnitTests" default="main" basedir=".">
<property name="ROYALE_HOME" location="../.."/>
<property name="example" value="UnitTests" />
@@ -39,7 +35,7 @@
<!--<property name="swf.version" value="30" />
<property name="playerglobal.version" value="19" />-->
<property name="destDir" value="${basedir}/target/swf"/>
- <property name="html_template_base" value="${basedir}/src/main/resources" />
+ <property name="html_template_base" value="${basedir}/swf-html-template" />
<include file="${basedir}/../build_example.xml" />
<target name="main" depends="clean" description="Clean build of ${example}">
diff --git a/manualtests/UnitTests/pom.xml b/manualtests/UnitTests/pom.xml
index 0e7e533..3cfc217 100644
--- a/manualtests/UnitTests/pom.xml
+++ b/manualtests/UnitTests/pom.xml
@@ -52,124 +52,38 @@
<artifactId>royale-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
- <targets>SWF,JSRoyale</targets>
+ <targets>JSRoyale</targets>
<mainClass>${project.artifactId}.mxml</mainClass>
- <removeCirculars>true</removeCirculars>
+ <removeCirculars>true</removeCirculars>
<debug>false</debug>
+ <allowSubclassOverrides>true</allowSubclassOverrides>
<additionalCompilerOptions>
-swf-version=30;
-js-default-initializers;
-source-map=true;
-compiler.exclude-defaults-css-files=MXRoyale-0.9.7-SNAPSHOT-js.swc:defaults.css;
- -compiler.exclude-defaults-css-files=MXRoyale-0.9.7-SNAPSHOT-swf.swc:defaults.css;
- -keep-as3-metadata+=Test,BeforeClass,AfterClass,Before,After,TestVariance,Event,Bindable,TestMeta;
- -keep-code-with-metadata=Test,BeforeClass,AfterClass,Before,After,TestVariance,TestMeta;
+ -keep-as3-metadata+=Test,BeforeClass,AfterClass,Before,After,TestVariance,Event,Bindable,TestMeta,Transient;
+ -keep-code-with-metadata=Test,BeforeClass,AfterClass,Before,After,TestVariance,TestMeta,Transient;
</additionalCompilerOptions>
+ <defines>
+ <define append="true">
+ <name>COMPILE::Flex</name>
+ <value>false</value>
+ </define>
+ <define append="true">
+ <name>COMPILE::Royale</name>
+ <value>true</value>
+ </define>
+ </defines>
<outputDirectory>${basedir}/target</outputDirectory>
- <flashOutputFileName>swf/${project.artifactId}.swf</flashOutputFileName>
<javascriptOutputDirectoryName>javascript</javascriptOutputDirectoryName>
</configuration>
- <!--<executions>
- <execution>
- <id>compile-js</id>
- <phase>process-sources</phase>
- <goals>
- <goal>compile-app</goal>
- </goals>
- <configuration>
- <targets>JSRoyale</targets>
- <mainClass>${project.artifactId}.mxml</mainClass>
- <debug>false</debug>
- <additionalCompilerOptions>-js-default-initializers;-source-map=true;-keep-as3-metadata+=Test,BeforeClass,AfterClass,Before,After,TestVariance,Event,Bindable,TestMeta;-keep-code-with-metadata=Test,BeforeClass,AfterClass,Before,After,TestVariance,TestMeta</additionalCompilerOptions>
- <outputDirectory>${basedir}/target</outputDirectory>
- </configuration>
- </execution>
- </executions>-->
</plugin>
-
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>3.1.0</version>
- <executions>
- <execution>
- <id>copy-template-swf</id>
- <phase>compile</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/swf</outputDirectory>
- <includeEmptyDirs>true</includeEmptyDirs>
- <resources>
- <resource>
- <directory>${basedir}/src/main/resources/swfobject</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.coderplus.maven.plugins</groupId>
- <artifactId>copy-rename-maven-plugin</artifactId>
- <version>1.0.1</version>
- <executions>
- <execution>
- <id>rename-file</id>
- <phase>compile</phase>
- <goals>
- <goal>rename</goal>
- </goals>
- <configuration>
- <sourceFile>${basedir}/target/swf/index.template.html</sourceFile>
- <destinationFile>${basedir}/target/swf/${project.artifactId}.html</destinationFile>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
-
- <!--<plugin>
- <groupId>com.google.code.maven-replacer-plugin</groupId>
- <artifactId>replacer</artifactId>
- <version>1.5.2</version>
- <executions>
- <execution>
- <id>configure-swf-template</id>
- <phase>compile</phase>
- <goals>
- <goal>replace</goal>
- </goals>
- <configuration>
- <file>${basedir}/bin-debug/index.template.html</file>
- <regex>false</regex>
- <replacements>
-
- </replacements>
- </configuration>
- </execution>
- </executions>
- </plugin>-->
</plugins>
</build>
<dependencies>
<dependency>
- <groupId>com.adobe.flash.framework</groupId>
- <artifactId>playerglobal</artifactId>
- <version>${flash.version}</version>
- <type>swc</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.royale.framework</groupId>
- <artifactId>MXRoyale</artifactId>
- <version>0.9.7-SNAPSHOT</version>
- <type>swc</type>
- <classifier>swf</classifier>
- </dependency>
- <dependency>
<groupId>org.apache.royale.framework</groupId>
<artifactId>MXRoyale</artifactId>
<version>0.9.7-SNAPSHOT</version>
@@ -181,13 +95,6 @@
<artifactId>Reflection</artifactId>
<version>0.9.7-SNAPSHOT</version>
<type>swc</type>
- <classifier>swf</classifier>
- </dependency>
- <dependency>
- <groupId>org.apache.royale.framework</groupId>
- <artifactId>Reflection</artifactId>
- <version>0.9.7-SNAPSHOT</version>
- <type>swc</type>
<classifier>js</classifier>
</dependency>
<dependency>
@@ -195,13 +102,6 @@
<artifactId>Network</artifactId>
<version>0.9.7-SNAPSHOT</version>
<type>swc</type>
- <classifier>swf</classifier>
- </dependency>
- <dependency>
- <groupId>org.apache.royale.framework</groupId>
- <artifactId>Network</artifactId>
- <version>0.9.7-SNAPSHOT</version>
- <type>swc</type>
<classifier>js</classifier>
</dependency>
<dependency>
@@ -209,15 +109,121 @@
<artifactId>XML</artifactId>
<version>0.9.7-SNAPSHOT</version>
<type>swc</type>
- <classifier>swf</classifier>
- </dependency>
- <dependency>
- <groupId>org.apache.royale.framework</groupId>
- <artifactId>XML</artifactId>
- <version>0.9.7-SNAPSHOT</version>
- <type>swc</type>
<classifier>js</classifier>
</dependency>
</dependencies>
-
+ <profiles>
+ <profile>
+ <id>option-with-swf</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.royale.compiler</groupId>
+ <artifactId>royale-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <targets>SWF,JSRoyale</targets>
+ <mainClass>${project.artifactId}.mxml</mainClass>
+ <removeCirculars>true</removeCirculars>
+ <debug>false</debug>
+ <allowSubclassOverrides>true</allowSubclassOverrides>
+ <additionalCompilerOptions>
+ -swf-version=30;
+ -js-default-initializers;
+ -source-map=true;
+ -compiler.exclude-defaults-css-files=MXRoyale-0.9.7-SNAPSHOT-js.swc:defaults.css;
+ -compiler.exclude-defaults-css-files=MXRoyale-0.9.7-SNAPSHOT-swf.swc:defaults.css;
+ -keep-as3-metadata+=Test,BeforeClass,AfterClass,Before,After,TestVariance,Event,Bindable,TestMeta,Transient;
+ -keep-code-with-metadata=Test,BeforeClass,AfterClass,Before,After,TestVariance,TestMeta,Transient;
+ </additionalCompilerOptions>
+ <defines>
+ <define append="true">
+ <name>COMPILE::Flex</name>
+ <value>false</value>
+ </define>
+ <define append="true">
+ <name>COMPILE::Royale</name>
+ <value>true</value>
+ </define>
+ </defines>
+ <outputDirectory>${basedir}/target</outputDirectory>
+ <flashOutputFileName>swf/${project.artifactId}.swf</flashOutputFileName>
+ <javascriptOutputDirectoryName>javascript</javascriptOutputDirectoryName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>3.1.0</version>
+ <executions>
+ <execution>
+ <id>copy-template-swf</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/swf</outputDirectory>
+ <includeEmptyDirs>true</includeEmptyDirs>
+ <resources>
+ <resource>
+ <directory>${basedir}/swf-html-template/swfobject</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <version>1.0.1</version>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>rename</goal>
+ </goals>
+ <configuration>
+ <sourceFile>${basedir}/target/swf/index.template.html</sourceFile>
+ <destinationFile>${basedir}/target/swf/${project.artifactId}.html</destinationFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>com.adobe.flash.framework</groupId>
+ <artifactId>playerglobal</artifactId>
+ <version>${flash.version}</version>
+ <type>swc</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>MXRoyale</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Reflection</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Network</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
diff --git a/manualtests/UnitTests/src/main/config/compile-app-config.xml b/manualtests/UnitTests/src/main/config/compile-app-config.xml
index 9e40011..61fe692 100644
--- a/manualtests/UnitTests/src/main/config/compile-app-config.xml
+++ b/manualtests/UnitTests/src/main/config/compile-app-config.xml
@@ -26,6 +26,21 @@
<swf-version>30</swf-version>
<source-map>true</source-map>
<compiler>
+ <library-path append="true">
+ <path-element>../../../../../frameworks/libs/MXRoyale.swc</path-element>
+ </library-path>
+ <js-library-path append="true">
+ <path-element>../../../../../frameworks/js/libs//MXRoyaleJS.swc</path-element>
+ </js-library-path>
+ <define append="true">
+ <name>COMPILE::Flex</name>
+ <value>false</value>
+ </define>
+ <define append="true">
+ <name>COMPILE::Royale</name>
+ <value>true</value>
+ </define>
+
<keep-as3-metadata append="true">
<name>Test</name>
<name>BeforeClass</name>
diff --git a/manualtests/UnitTests/src/main/royale/MyInitialView.mxml b/manualtests/UnitTests/src/main/royale/MyInitialView.mxml
index 32eaa9e..a2ba582 100644
--- a/manualtests/UnitTests/src/main/royale/MyInitialView.mxml
+++ b/manualtests/UnitTests/src/main/royale/MyInitialView.mxml
@@ -58,6 +58,9 @@ limitations under the License.
<fx:Script>
<![CDATA[
import org.apache.royale.html.Label;
+ import org.apache.royale.html.Group;
+ import org.apache.royale.core.IParent;
+ import org.apache.royale.core.UIBase;
import org.apache.royale.reflection.VariableDefinition;
import org.apache.royale.reflection.getDefinitionByName;
import org.apache.royale.reflection.describeType;
@@ -83,11 +86,22 @@ limitations under the License.
return '';
}
+ private static var _instance:MyInitialView;
+ public static function getInstance():MyInitialView{
+ return _instance;
+ }
+
+ public function get bindingsTestParent():IParent{
+ return bindingTestHolder;
+ }
+
private var _tests:Array;
public function runTests():void {
+ _instance = this;
setPlatform();
+
RoyaleUnitTestRunner.swfVersion = getSwfVersion();
var label:Label;
var groups:Array = TestClasses.testClasses;
@@ -134,7 +148,7 @@ limitations under the License.
}
}
}
-
+ // testArrayLike()
}
@@ -231,4 +245,5 @@ limitations under the License.
<js:VerticalFlexLayout />
</js:beads>
</js:Group>
+ <js:Group localId="bindingTestHolder" />
</js:View>
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/TestClasses.as
index 11f141c..9332ebd 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/TestClasses.as
@@ -35,6 +35,7 @@ package
,NetworkTester
,XMLTester
,MXRoyaleTester
+ ,BindingTester
];
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/BindingTester.as
similarity index 73%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/BindingTester.as
index 11f141c..08dd137 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/BindingTester.as
@@ -16,26 +16,24 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests
{
- //test groups
- import flexUnitTests.*;
+ import flexUnitTests.binding.*
+
+ [Suite]
+
+ /**
+ * @royalesuppresspublicvarwarning
+ */
+ public class BindingTester
+ {
+ public function BindingTester()
+ {
+ }
+ public var bindableCoreTest:BindableCoreTests;
+
+ public var bindingCoreTest:BindingCoreTests;
- public class TestClasses
- {
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
- }
+ }
}
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/BindableCoreTests.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/BindableCoreTests.as
new file mode 100644
index 0000000..42204c5
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/BindableCoreTests.as
@@ -0,0 +1,298 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding
+{
+
+COMPILE::Royale{
+ import org.apache.royale.test.asserts.*;
+ import org.apache.royale.events.IEventDispatcher;
+}
+
+COMPILE::Flex{
+ import royale.flexunitcompatible.asserts.*;
+ import flash.events.IEventDispatcher;
+}
+
+
+
+import flexUnitTests.binding.support.bindables.*;
+import flexUnitTests.binding.utils.BindableTestUtil;
+
+public class BindableCoreTests
+{
+
+
+ public static var testUtil:BindableTestUtil;
+
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
+ testUtil = BindableTestUtil.instance;
+ }
+
+ [AfterClass]
+ public static function tearDownAfterClass():void
+ {
+ testUtil.reset();
+ testUtil = null;
+ }
+
+ [Before]
+ public function setUp():void
+ {
+
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ testUtil.reset();
+ }
+
+ //no bindings, UnBindable is not IEventDispatcher
+ [Test]
+ public function testBasicUnbindable():void
+ {
+ var unbindable:UnbindableBase = new UnbindableBase();
+
+ assertFalse(unbindable is IEventDispatcher, 'unbindable should not have IEventDispatcher-ness')
+ }
+
+ [Test]
+ public function testBasicBindableVar():void
+ {
+ // a variable member is marked [Bindable], but the class itself is not
+ testUtil.reset();
+ var bindable:BaseWithBindableVar = new BaseWithBindableVar();
+
+ assertTrue(bindable is IEventDispatcher, 'bindable should have IEventDispatcher-ness');
+
+ var bindableDispatcher:IEventDispatcher = bindable as IEventDispatcher;
+ testUtil.listenTo(bindableDispatcher, BindableTestUtil.VALUE_CHANGE_EVENT);
+
+ bindable.bindableVarOfBaseWithBindableVar = 'a new assigned value';
+ bindable.bindableVarOfBaseWithBindableVar = 'a second assigned value';
+
+ var expected:String =
+ '0:ValueChangeEvent::property(bindableVarOfBaseWithBindableVar), oldVal:(bindableVarOfBaseWithBindableVar_value), newValue:(a new assigned value)\n' +
+ '1:ValueChangeEvent::property(bindableVarOfBaseWithBindableVar), oldVal:(a new assigned value), newValue:(a second assigned value)';
+
+ assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
+
+ testUtil.reset();
+ }
+
+ [Test]
+ public function testBasicBindableClass():void
+ {
+ // a class is marked [Bindable], but not its variable member(s)
+ testUtil.reset();
+ var bindable:BaseWithBindableClass = new BaseWithBindableClass();
+
+ assertTrue(bindable is IEventDispatcher, 'bindable should have IEventDispatcher-ness');
+
+ var bindableDispatcher:IEventDispatcher = bindable as IEventDispatcher;
+ testUtil.listenTo(bindableDispatcher, BindableTestUtil.VALUE_CHANGE_EVENT);
+
+ bindable.varOfBaseWithBindableClass = 'a new assigned value';
+ bindable.varOfBaseWithBindableClass = 'a second assigned value';
+
+ var expected:String =
+ '0:ValueChangeEvent::property(varOfBaseWithBindableClass), oldVal:(varOfBaseWithBindableClass_value), newValue:(a new assigned value)\n' +
+ '1:ValueChangeEvent::property(varOfBaseWithBindableClass), oldVal:(a new assigned value), newValue:(a second assigned value)';
+
+ assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
+
+ testUtil.reset();
+ }
+
+
+ [Test]
+ public function testBasicBindableAndUnbindableVar():void
+ {
+ // a variable member is marked [Bindable] and another is not, and the class itself is not [Bindable]
+ testUtil.reset();
+ var bindable:BaseWithBindableAndUnbindableVars = new BaseWithBindableAndUnbindableVars();
+
+ assertTrue(bindable is IEventDispatcher, 'bindable should have IEventDispatcher-ness');
+
+ var bindableDispatcher:IEventDispatcher = bindable as IEventDispatcher;
+ testUtil.listenTo(bindableDispatcher, BindableTestUtil.VALUE_CHANGE_EVENT);
+
+ bindable.bindableVarOfBaseWithBindableAndUnbindableVars = 'a new assigned value for bindable';
+ bindable.unbindableVarOfBaseWithBindableAndUnbindableVars = 'a new assigned value for unbindable';
+ bindable.bindableVarOfBaseWithBindableAndUnbindableVars = 'a second assigned value for bindable';
+ bindable.unbindableVarOfBaseWithBindableAndUnbindableVars = 'a second assigned value for unbindable';
+ //events are only expected from the Bindable member:
+ var expected:String =
+ '0:ValueChangeEvent::property(bindableVarOfBaseWithBindableAndUnbindableVars), oldVal:(bindableVarOfBaseWithBindableAndUnbindableVars_value), newValue:(a new assigned value for bindable)\n' +
+ '1:ValueChangeEvent::property(bindableVarOfBaseWithBindableAndUnbindableVars), oldVal:(a new assigned value for bindable), newValue:(a second assigned value for bindable)';
+
+ assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
+
+ testUtil.reset();
+ }
+
+ [Test]
+ public function testBasicBindableGetter():void
+ {
+ // an accessor member is marked [Bindable], but the class itself is not
+ testUtil.reset();
+ var bindable:BaseWithBindableGetter = new BaseWithBindableGetter();
+
+ assertTrue(bindable is IEventDispatcher, 'bindable should have IEventDispatcher-ness');
+
+ var bindableDispatcher:IEventDispatcher = bindable as IEventDispatcher;
+ testUtil.listenTo(bindableDispatcher, BindableTestUtil.VALUE_CHANGE_EVENT);
+
+ bindable.accessorOfBaseWithBindableGetter = 'a new assigned value';
+ bindable.accessorOfBaseWithBindableGetter = 'a second assigned value';
+
+
+ var expected:String =
+ '0:history:accessing value from original getter , accessorOfBaseWithBindableGetter_value\n' +
+ '1:history:assigning value in original setter , a new assigned value\n' +
+ '2:ValueChangeEvent::property(accessorOfBaseWithBindableGetter), oldVal:(accessorOfBaseWithBindableGetter_value), newValue:(a new assigned value)\n' +
+ '3:history:accessing value from original getter , a new assigned value\n' +
+ '4:history:assigning value in original setter , a second assigned value\n' +
+ '5:ValueChangeEvent::property(accessorOfBaseWithBindableGetter), oldVal:(a new assigned value), newValue:(a second assigned value)';
+
+ assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
+
+ testUtil.reset();
+ }
+
+
+ [Test]
+ public function testBasicBindableGetterVariations():void
+ {
+ // an accessor member is marked [Bindable], but the class itself is not
+ testUtil.reset();
+ var bindable:BaseWithBindableGetter = new BaseWithBindableGetter();
+
+ assertTrue(bindable is IEventDispatcher, 'bindable should have IEventDispatcher-ness');
+
+ var bindableDispatcher:IEventDispatcher = bindable as IEventDispatcher;
+ testUtil.listenTo(bindableDispatcher, BindableTestUtil.VALUE_CHANGE_EVENT);
+ testUtil.listenTo(bindableDispatcher,'testEvent');
+ testUtil.listenTo(bindableDispatcher,'somethingChanged');
+
+ bindable.accessorOfBaseWithBindableGetter2 = 'a new assigned value';
+ bindable.accessorOfBaseWithBindableGetter2 = 'a second assigned value';
+ bindable.something = 'this does not dispatch';
+
+
+
+ var expected:String =
+ '0:history:accessing value from original getter , _accessorOfBaseWithBindableGetter2_value\n' +
+ '1:history:assigning value in original setter , a new assigned value\n' +
+ '2:Event(type="testEvent", bubbles=false, cancelable=false)\n' +
+ '3:ValueChangeEvent::property(accessorOfBaseWithBindableGetter2), oldVal:(_accessorOfBaseWithBindableGetter2_value), newValue:(a new assigned value)\n' +
+ '4:history:accessing value from original getter , a new assigned value\n' +
+ '5:history:assigning value in original setter , a second assigned value\n' +
+ '6:Event(type="testEvent", bubbles=false, cancelable=false)\n' +
+ '7:ValueChangeEvent::property(accessorOfBaseWithBindableGetter2), oldVal:(a new assigned value), newValue:(a second assigned value)';
+
+ assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
+
+ testUtil.reset();
+ }
+
+
+
+ [Test]
+ public function testBasicBindableClassGetter():void
+ {
+ // a class is marked [Bindable], but not its accessor member(s)
+ testUtil.reset();
+ var bindable:BaseWithGetterBindableClass = new BaseWithGetterBindableClass();
+
+ assertTrue(bindable is IEventDispatcher, 'bindable should have IEventDispatcher-ness');
+
+ var bindableDispatcher:IEventDispatcher = bindable as IEventDispatcher;
+ testUtil.listenTo(bindableDispatcher, BindableTestUtil.VALUE_CHANGE_EVENT);
+
+ bindable.accessorOfBaseWithGetterBindableClass = 'a new assigned value';
+ bindable.accessorOfBaseWithGetterBindableClass = 'a second assigned value';
+
+
+ var expected:String =
+ '0:history:accessing value from original getter , accessorOfBaseWithGetterBindableClass_value\n' +
+ '1:history:assigning value in original setter , a new assigned value\n' +
+ '2:ValueChangeEvent::property(accessorOfBaseWithGetterBindableClass), oldVal:(accessorOfBaseWithGetterBindableClass_value), newValue:(a new assigned value)\n' +
+ '3:history:accessing value from original getter , a new assigned value\n' +
+ '4:history:assigning value in original setter , a second assigned value\n' +
+ '5:ValueChangeEvent::property(accessorOfBaseWithGetterBindableClass), oldVal:(a new assigned value), newValue:(a second assigned value)';
+
+ assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
+
+ testUtil.reset();
+ }
+
+
+ [Test]
+ public function testBindableClassWithAccessorVariations():void
+ {
+ // a class is marked [Bindable], but not its accessor member(s)
+ testUtil.reset();
+ var bindable:BaseWithAccesorVariantsBindableClass = new BaseWithAccesorVariantsBindableClass();
+
+ assertTrue(bindable is IEventDispatcher, 'bindable should have IEventDispatcher-ness');
+
+ var bindableDispatcher:IEventDispatcher = bindable as IEventDispatcher;
+ testUtil.listenTo(bindableDispatcher, BindableTestUtil.VALUE_CHANGE_EVENT);
+ testUtil.listenTo(bindableDispatcher, 'alternateChanged');
+ testUtil.listenTo(bindableDispatcher, 'alternate2Changed');
+
+ bindable.accessorOfBaseWithAccesorVariantsBindableClass = 'a new assigned value';
+ bindable.accessorOfBaseWithAccesorVariantsBindableClass = 'a second assigned value';
+ var val:String = bindable.getterOnly;
+ bindable.setterOnly = 'assigned value for setterOnly with val from getter:' + val;
+ bindable.alternate = 'new value for alternate';
+ bindable.alternate = 'another new value for alternate';
+ bindable.alternate2 = 'new value for alternate2';
+ bindable.alternate2 = 'another new value for alternate2';
+
+
+ var expected:String =
+ '0:history:accessing value from original getter , BaseWithAccessorVariantsBindableClass_value\n' +
+ '1:history:assigning value in original setter , a new assigned value\n' +
+ '2:ValueChangeEvent::property(accessorOfBaseWithAccesorVariantsBindableClass), oldVal:(BaseWithAccessorVariantsBindableClass_value), newValue:(a new assigned value)\n' +
+ '3:history:accessing value from original getter , a new assigned value\n' +
+ '4:history:assigning value in original setter , a second assigned value\n' +
+ '5:ValueChangeEvent::property(accessorOfBaseWithAccesorVariantsBindableClass), oldVal:(a new assigned value), newValue:(a second assigned value)\n' +
+ '6:history:getting non bindable getterOnly , getterOnly\n' +
+ '7:history:setting non bindable setterOnly , assigned value for setterOnly with val from getter:getterOnly\n' +
+ '8:history:setting alternate value with explicit Bindable event , new value for alternate\n' +
+ '9:Event(type="alternateChanged", bubbles=false, cancelable=false)\n' +
+ '10:history:setting alternate value with explicit Bindable event , another new value for alternate\n' +
+ '11:Event(type="alternateChanged", bubbles=false, cancelable=false)\n' +
+ '12:history:setting alternate2 value with both types of Bindable event , new value for alternate2\n' +
+ '13:Event(type="alternate2Changed", bubbles=false, cancelable=false)\n' +
+ '14:history:setting alternate2 value with both types of Bindable event , another new value for alternate2\n' +
+ '15:Event(type="alternate2Changed", bubbles=false, cancelable=false)';
+
+
+ assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
+
+ testUtil.reset();
+ }
+
+}
+}
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/BindingCoreTests.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/BindingCoreTests.as
new file mode 100644
index 0000000..d244915
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/BindingCoreTests.as
@@ -0,0 +1,281 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding
+{
+
+
+COMPILE::Royale{
+ import flexUnitTests.binding.support.bindings.royale.SimpleBindingsA;
+ import flexUnitTests.binding.support.bindings.royale.SimpleBindingsB;
+ import flexUnitTests.binding.support.bindings.royale.FunctionBindingsA;
+ import flexUnitTests.binding.support.bindings.royale.DeepBindingsA;
+ import flexUnitTests.binding.support.bindings.royale.RendereBindingTestA;
+ import org.apache.royale.test.asserts.*;
+}
+COMPILE::Flex{
+ import flexUnitTests.binding.support.bindings.flex.SimpleBindingsA;
+ import flexUnitTests.binding.support.bindings.flex.SimpleBindingsB;
+ import flexUnitTests.binding.support.bindings.flex.FunctionBindingsA;
+ import flexUnitTests.binding.support.bindings.flex.DeepBindingsA;
+ import flexUnitTests.binding.support.bindings.flex.RendereBindingTestA;
+
+
+ // reverse message arguments between RoyaleUnit and FlexUnit
+ //wild card import does not seem to work here in Flex:
+ //using specific imports:
+ import royale.flexunitcompatible.asserts.assertEquals;
+ import royale.flexunitcompatible.asserts.assertStrictlyEquals;
+}
+
+import flexUnitTests.binding.support.IBindingTest;
+import flexUnitTests.binding.utils.BindingTestUtil;
+
+/**
+ * @royalesuppresspublicvarwarning
+ */
+public class BindingCoreTests
+{
+
+
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
+ COMPILE::Royale{
+ //Main is the Flex application
+ BindingTestUtil.setTestParent(MyInitialView.getInstance().bindingsTestParent)
+ }
+ COMPILE::Flex{
+ //Main is the Flex application
+ BindingTestUtil.setTestParent(Main.getInstance().bindingsTestParent)
+ }
+ }
+
+ [AfterClass]
+ public static function tearDownAfterClass():void
+ {
+ BindingTestUtil.reset();
+ }
+
+ private var testInstance:Object;
+
+ [Before]
+ public function setUp():void
+ {
+
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ if (testInstance) {
+ BindingTestUtil.removeInstance(testInstance);
+ }
+ }
+
+ private function createTestInstance(clazz:Class):IBindingTest{
+ return (testInstance = BindingTestUtil.createAndAddInstance(clazz)) as IBindingTest;
+ }
+
+
+ //no bindings, just test startup values
+ [Test]
+ public function testPlainLabel():void
+ {
+
+ var simpleBindings:IBindingTest = createTestInstance(SimpleBindingsA);
+
+ //initial value should be '' for the Label
+ //in flex this is null for Spark Label and '' for mx Label
+ //using mx Label as 'expected' emulation ....
+ assertEquals(simpleBindings.getBindingResultValue(0), '', 'Bad initial value in simple binding');
+
+
+ }
+
+
+ [Test]
+ public function testSimpleBindings():void
+ {
+ var simpleBindings:IBindingTest = createTestInstance(SimpleBindingsA);
+
+ //simpleBindings.labelText = 'testSimpleBindings';
+ simpleBindings.setInboundValue('testSimpleBindings', 0);
+ //simpleBindings.testLabel.text
+ assertEquals(simpleBindings.getBindingResultValue(0), 'testSimpleBindings', 'Bad binding text value in simple binding');
+
+ //simpleBindings.labelText = null;
+ simpleBindings.setInboundValue(null, 0);
+ //in flex this is null for Spark Label and '' for mx Label
+ //using mx Label as 'expected' emulation ....
+ assertEquals(simpleBindings.getBindingResultValue(0), '', 'Bad null inbound value in simple text binding');
+
+ simpleBindings.setInboundValue(undefined, 0);
+ //in flex this is null for Spark Label and '' for mx Label
+ //using mx Label as 'expected' emulation ....
+ assertEquals(simpleBindings.getBindingResultValue(0), '', 'Bad null inbound value in simple text binding');
+
+ //simpleBindings.labelText = 'testSimpleBindings'; check the binding target with a 'this' binding
+ simpleBindings.setInboundValue('testSimpleBindingsThis', 1);
+ //simpleBindings.testLabel.text
+ assertEquals(simpleBindings.getBindingResultValue(1), 'testSimpleBindingsThis', 'Bad binding text value in simple binding');
+
+ }
+
+
+ [Test]
+ public function testSimpleBindingsB():void
+ {
+ var simpleBindings:IBindingTest = createTestInstance(SimpleBindingsB);
+
+ //simpleBindings.labelText = 'testSimpleBindings';
+ simpleBindings.setInboundValue('setStringValue', 0);
+ //simpleBindings.testLabel.text
+ assertEquals(simpleBindings.getBindingResultValue(0), 'setStringValue', 'Bad binding text value in simple binding');
+ assertEquals(simpleBindings.getBindingResultValue(1), 'setStringValue', 'Bad binding Object target value in simple binding');
+
+
+ //this is not really a Binding test, more a mxml codgen test, there were errors before a compiler fix:
+ assertEquals(simpleBindings.getBindingResultValue(2), 'test', 'Bad codegen for fx:Object tag');
+
+ simpleBindings.setInboundValue('testval', 2);
+ assertEquals(simpleBindings.getBindingResultValue(2), 'testval', 'Bad codegen for fx:Object tag');
+ simpleBindings.setInboundValue('testval', 3);
+ assertEquals(simpleBindings.getBindingResultValue(3), 'testval', 'Bad codegen for fx:Object tag');
+
+
+ simpleBindings.setInboundValue(99, 4);
+ assertStrictlyEquals(simpleBindings.getBindingResultValue(4), 99, 'Bad binding numeric value in simple binding');
+ simpleBindings.setInboundValue(99, 5);
+ assertStrictlyEquals(simpleBindings.getBindingResultValue(5), '99', 'Bad binding text value in simple binding');
+
+
+ simpleBindings.setInboundValue(99, 6);
+ assertStrictlyEquals(simpleBindings.getBindingResultValue(6), 99, 'Bad binding numeric value in simple binding');
+
+ simpleBindings.setInboundValue(99, 7);
+ assertStrictlyEquals(simpleBindings.getBindingResultValue(7), 99, 'Bad binding numeric value in simple binding');
+
+ }
+
+
+
+
+ [Test]
+ public function testDeepBindingsA():void
+ {
+ var deepBindings:IBindingTest = createTestInstance(DeepBindingsA);
+
+ deepBindings.setInboundValue('setStringValue', 0);
+ //deepBindings.testLabel.text
+ assertEquals(deepBindings.getBindingResultValue(0), 'setStringValue', 'Bad binding text value in simple binding');
+ assertEquals(deepBindings.getBindingResultValue(1), 'setStringValue', 'Bad binding Object target value in simple binding');
+
+ deepBindings.setInboundValue(99, 2);
+ assertStrictlyEquals(deepBindings.getBindingResultValue(2), 99, 'Bad binding numeric value in simple binding');
+ deepBindings.setInboundValue(99, 3);
+ assertStrictlyEquals(deepBindings.getBindingResultValue(3), '99', 'Bad binding text value in simple binding');
+
+
+ deepBindings.setInboundValue(99, 4);
+ assertStrictlyEquals(deepBindings.getBindingResultValue(4), 99, 'Bad binding numeric value in simple binding');
+
+
+ }
+
+ [Test]
+ public function testFunctionBindingsA():void
+ {
+ var funcBindings:IBindingTest = createTestInstance(FunctionBindingsA);
+
+ //check startup values for all
+ assertEquals(funcBindings.getBindingResultValue(0), 'Internally false', 'Bad binding text value in function binding');
+ assertEquals(funcBindings.getBindingResultValue(1), 'Internally false', 'Bad binding Object target value in function binding');
+
+ assertEquals(funcBindings.getBindingResultValue(2), 'Inbound only', 'Bad binding text value in function binding');
+ assertEquals(funcBindings.getBindingResultValue(3), 'Inbound only', 'Bad binding Object target value in function binding');
+
+ assertEquals(funcBindings.getBindingResultValue(4), 'Internally false', 'Bad binding text value in function binding');
+ assertEquals(funcBindings.getBindingResultValue(5), 'Internally false', 'Bad binding Object target value in function binding');
+
+ assertEquals(funcBindings.getBindingResultValue(6), 'Inbound only', 'Bad binding text value in function binding');
+ assertEquals(funcBindings.getBindingResultValue(7), 'Inbound only', 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(true,8); //changes:
+ assertEquals(funcBindings.getBindingResultValue(8), 'Internally false', 'Bad binding text value in function binding');
+ assertEquals(funcBindings.getBindingResultValue(9), 'Internally false', 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(true,10);
+
+ assertEquals(funcBindings.getBindingResultValue(10), "Both are true", 'Bad binding text value in function binding');
+ assertEquals(funcBindings.getBindingResultValue(11), "Both are true", 'Bad binding Object target value in function binding');
+
+ //bindable2.bindableOne.toggle = value;
+ funcBindings.setInboundValue(true,12);
+
+ assertEquals(funcBindings.getBindingResultValue(12), 'Internally false', 'Bad binding text value in function binding');
+ funcBindings.setInboundValue(true,13);
+ assertEquals(funcBindings.getBindingResultValue(13), 'Internally false', 'Bad binding Object target value in function binding');
+ funcBindings.setInboundValue(false,13);
+ assertEquals(funcBindings.getBindingResultValue(13), 'Internally false', 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(true,14);
+ assertEquals(funcBindings.getBindingResultValue(14), 'Internally false', 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(false,14);
+ assertEquals(funcBindings.getBindingResultValue(14), 'Internally false', 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(true,15);
+ assertEquals(funcBindings.getBindingResultValue(15), 'Internally false', 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(false,15);
+ assertEquals(funcBindings.getBindingResultValue(15), 'Internally false', 'Bad binding Object target value in function binding');
+
+
+ funcBindings.setInboundValue(true,16);
+ assertEquals(funcBindings.getBindingResultValue(16), "Inbound only", 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(false,16);
+ assertEquals(funcBindings.getBindingResultValue(16), "Inbound only", 'Bad binding Object target value in function binding');
+
+
+ funcBindings.setInboundValue(true,17);
+ assertEquals(funcBindings.getBindingResultValue(17), "Both are true", 'Bad binding Object target value in function binding');
+
+ funcBindings.setInboundValue(false,17);
+ assertEquals(funcBindings.getBindingResultValue(17), "Inbound only", 'Bad binding Object target value in function binding');
+
+ }
+
+
+ [Test]
+ public function testRendererBinding():void{
+ var rendererTest:IBindingTest = createTestInstance(RendereBindingTestA);
+
+ assertEquals(rendererTest.getBindingResultValue(0), '', 'Bad binding startup value in renderer binding');
+
+ rendererTest.setInboundValue(0,1);
+ assertEquals(rendererTest.getBindingResultValue(1), "myTaskVOlabel1 - mytooltip1", 'Bad binding Object target value in renderer binding');
+
+
+
+ }
+
+
+}
+}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/IBindingTest.as
similarity index 74%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/IBindingTest.as
index 11f141c..26dd829 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/IBindingTest.as
@@ -16,26 +16,13 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
-{
- //test groups
- import flexUnitTests.*;
+package flexUnitTests.binding.support {
+ public interface IBindingTest {
+ function get testName():String;
+ function get internalTestCount():uint;
+ function setInboundValue(value:*, internalTestNum:uint=0):void
+ function getBindingResultValue(internalTestNum:uint=0):*;
- public class TestClasses
- {
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
- }
-}
+ }
+}
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithAccesorVariantsBindableClass.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithAccesorVariantsBindableClass.as
new file mode 100644
index 0000000..46bcba3
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithAccesorVariantsBindableClass.as
@@ -0,0 +1,93 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding.support.bindables
+{
+ import flexUnitTests.binding.utils.BindableTestUtil;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.IEventDispatcher;
+
+ [Bindable]
+ public class BaseWithAccesorVariantsBindableClass
+ {
+ private var _accessorOfBaseWithAccesorVariantsBindableClass:String = "BaseWithAccessorVariantsBindableClass_value";
+ private var _alternate:String = 'alternate_value';
+
+ public function get accessorOfBaseWithAccesorVariantsBindableClass():String
+ {
+ BindableTestUtil.instance.addHistoryItem('accessing value from original getter', _accessorOfBaseWithAccesorVariantsBindableClass);
+ return _accessorOfBaseWithAccesorVariantsBindableClass;
+ }
+
+ public function set accessorOfBaseWithAccesorVariantsBindableClass(value:String):void
+ {
+ BindableTestUtil.instance.addHistoryItem('assigning value in original setter', value);
+ _accessorOfBaseWithAccesorVariantsBindableClass = value;
+ }
+
+ private var _setterOnly:String;
+ public function set setterOnly(value:String):void{
+ BindableTestUtil.instance.addHistoryItem('setting non bindable setterOnly', value);
+ _setterOnly = value;
+ }
+
+
+ public function get getterOnly():String{
+ BindableTestUtil.instance.addHistoryItem('getting non bindable getterOnly', 'getterOnly');
+ return 'getterOnly';
+ }
+
+ [Bindable('alternateChanged')]
+ public function get alternate():String{
+ BindableTestUtil.instance.addHistoryItem('getting alternate value with explicit Bindable event', _alternate);
+ return _alternate
+ }
+
+ public function set alternate(value:String):void{
+ BindableTestUtil.instance.addHistoryItem('setting alternate value with explicit Bindable event', value);
+ var dispatch:Boolean = value != _alternate;
+ _alternate = value;
+ if (dispatch) {
+ (this as IEventDispatcher).dispatchEvent(new Event('alternateChanged'));
+ }
+ }
+
+
+ private var _alternate2:String = 'alternate2_value';
+ [Bindable]
+ public function get alternate2():String{
+ BindableTestUtil.instance.addHistoryItem('getting alternate2 value with both types of Bindable event', _alternate2);
+ return _alternate2
+ }
+
+ [Bindable('alternate2Changed')]
+ public function set alternate2(value:String):void{
+ BindableTestUtil.instance.addHistoryItem('setting alternate2 value with both types of Bindable event', value);
+ var dispatch:Boolean = value != _alternate2;
+ _alternate2 = value;
+ if (dispatch) {
+ (this as IEventDispatcher).dispatchEvent(new Event('alternate2Changed'));
+ }
+ }
+
+ //this should get normal [Bindable] treatment from the class [Bindable] meta (because it is a variable):
+ [Bindable('somethingChanged')]
+ public var something:String;
+
+ }
+}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
similarity index 72%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
index 11f141c..f3b5066 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
@@ -16,26 +16,14 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class BaseWithBindableAndUnbindableVars
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+ [Bindable]
+ public var bindableVarOfBaseWithBindableAndUnbindableVars:String = "bindableVarOfBaseWithBindableAndUnbindableVars_value";
+
+ public var unbindableVarOfBaseWithBindableAndUnbindableVars:String = "unbindableVarOfBaseWithBindableAndUnbindableVars_value";
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
similarity index 75%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
index 11f141c..4ebb202 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
@@ -16,26 +16,12 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ [Bindable]
+ public class BaseWithBindableClass
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+ public var varOfBaseWithBindableClass:String = "varOfBaseWithBindableClass_value";
}
}
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableGetter.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableGetter.as
new file mode 100644
index 0000000..bd4bc1b
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableGetter.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding.support.bindables
+{
+ import flexUnitTests.binding.utils.BindableTestUtil;
+
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.IEventDispatcher;
+
+ public class BaseWithBindableGetter
+ {
+ private var _accessorOfBaseWithBindableGetter:String = "accessorOfBaseWithBindableGetter_value";
+
+ [Bindable]
+ public function get accessorOfBaseWithBindableGetter():String
+ {
+ BindableTestUtil.instance.addHistoryItem('accessing value from original getter', _accessorOfBaseWithBindableGetter);
+ return _accessorOfBaseWithBindableGetter;
+ }
+
+ public function set accessorOfBaseWithBindableGetter(value:String):void
+ {
+ BindableTestUtil.instance.addHistoryItem('assigning value in original setter', value);
+ _accessorOfBaseWithBindableGetter = value;
+ }
+
+ private var _accessorOfBaseWithBindableGetter2:String = '_accessorOfBaseWithBindableGetter2_value';
+
+ //this has at least one [Bindable] so should code-gen Bindable code
+ [Bindable]
+ [Bindable(event='testEvent')]
+ public function get accessorOfBaseWithBindableGetter2():String
+ {
+ BindableTestUtil.instance.addHistoryItem('accessing value from original getter', _accessorOfBaseWithBindableGetter2);
+ return _accessorOfBaseWithBindableGetter2;
+ }
+
+ public function set accessorOfBaseWithBindableGetter2(value:String):void
+ {
+ BindableTestUtil.instance.addHistoryItem('assigning value in original setter', value);
+ if (value != _accessorOfBaseWithBindableGetter2) {
+ _accessorOfBaseWithBindableGetter2 = value;
+ IEventDispatcher(this).dispatchEvent(new Event('testEvent'));
+ }
+
+ }
+
+ //this should be ignored, because this class itself is not marked [Bindable]
+ [Bindable('somethingChanged')]
+ public var something:String;
+
+ }
+}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
similarity index 75%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
index 11f141c..ad7823b 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
@@ -16,26 +16,13 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class BaseWithBindableVar
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+ [Bindable]
+ public var bindableVarOfBaseWithBindableVar:String = "bindableVarOfBaseWithBindableVar_value";
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithGetterBindableClass.as
similarity index 57%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithGetterBindableClass.as
index 11f141c..a692780 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BaseWithGetterBindableClass.as
@@ -16,26 +16,27 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
+import flexUnitTests.binding.utils.BindableTestUtil;
-
- public class TestClasses
+[Bindable]
+ public class BaseWithGetterBindableClass
{
+ private var _accessorOfBaseWithGetterBindableClass:String = "accessorOfBaseWithGetterBindableClass_value";
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
+
+ public function get accessorOfBaseWithGetterBindableClass():String
+ {
+ BindableTestUtil.instance.addHistoryItem('accessing value from original getter', _accessorOfBaseWithGetterBindableClass);
+ return _accessorOfBaseWithGetterBindableClass;
}
+
+ public function set accessorOfBaseWithGetterBindableClass(value:String):void
+ {
+ BindableTestUtil.instance.addHistoryItem('assigning value in original setter', value);
+ _accessorOfBaseWithGetterBindableClass = value;
+ }
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableMxmlTest.as
similarity index 69%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableMxmlTest.as
index 11f141c..d2e24b7 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableMxmlTest.as
@@ -1,4 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
+0.////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
@@ -16,26 +16,18 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class BindableMxmlTest
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+
+
+
+ [Bindable]
+ public var fieldofBindableMxmlTest:String = "fieldofBindableMxmlTest_value";
+
+
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
similarity index 72%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
index 11f141c..f931a77 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
@@ -16,26 +16,23 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class BindableSetterVO
{
+ private var _fieldOfBindableSetterVO:String = "fieldOfBindableSetterVO_value";
+
+ public function get fieldOfBindableSetterVO():String
+ {
+ return _fieldOfBindableSetterVO;
+ }
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
+ [Bindable]
+ public function set fieldOfBindableSetterVO(value:String):void
+ {
+ _fieldOfBindableSetterVO = value;
}
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO1.as
similarity index 69%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO1.as
index 11f141c..d289fd1 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO1.as
@@ -1,4 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
+0.////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
@@ -16,26 +16,18 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class BindableSubVO1 extends BaseWithBindableVar
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+
+
+
+ [Bindable]
+ public var fieldOfBindableSubVO1:String = "fieldOfBindableSubVO1_value";
+
+
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO2.as
similarity index 69%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO2.as
index 11f141c..4ba6685 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO2.as
@@ -1,4 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
+0.////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
@@ -16,26 +16,18 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class BindableSubVO2 extends UnbindableBase
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+
+
+
+ [Bindable]
+ public var fieldofBindableSubVO2:String = "fieldofBindableSubVO2_value";
+
+
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO3.as
similarity index 69%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO3.as
index 11f141c..13db540 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableSubVO3.as
@@ -1,4 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
+0.////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
@@ -16,26 +16,18 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class BindableSubVO3 extends UnbindableIntermediateVO
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+
+
+
+ [Bindable]
+ public var fieldofBindableSubVO3:String = "fieldofBindableSubVO3_value";
+
+ [Bindable]
+ public var rangeEnd:Object;
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableWithConstructorInit.as
similarity index 63%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableWithConstructorInit.as
index 11f141c..2438b20 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/BindableWithConstructorInit.as
@@ -16,26 +16,31 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+
+ [Bindable]
+ public class BindableWithConstructorInit
{
+
+ public static const STATIC_INIT:BindableWithConstructorInit = new BindableWithConstructorInit( "STATIC_INIT" ,-1 );
+
+ public var ordinal:int;
+ public var value:String;
+
+ public function BindableWithConstructorInit (value:String, ordinal:int )
+ {
+ this.value = value;
+ this.ordinal = ordinal;
+ }
+
+
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
+ public function equals( other:BindableWithConstructorInit ):Boolean
+ {
+ return ( this.ordinal == other.ordinal && this.value == other.value );
}
}
+
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as
similarity index 75%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as
index 11f141c..be38204 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as
@@ -16,26 +16,16 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class UnbindableBase
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+
+
+
+ public var fieldOfUnbindableBaseVO:String = "fieldOfUnbindableBaseVO_value";
+
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
similarity index 75%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
index 11f141c..33e13e6 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
@@ -16,26 +16,16 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindables
{
- //test groups
- import flexUnitTests.*;
-
- public class TestClasses
+ public class UnbindableIntermediateVO extends BaseWithBindableVar
{
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
+
+
+
+ public var fieldOfUnbindableIntermediateVO:String = "fieldOfUnbindableIntermediateVO_value";
+
+
}
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/ITaskVO.as
similarity index 66%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/ITaskVO.as
index 11f141c..42b7e8f 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/ITaskVO.as
@@ -16,26 +16,25 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
-{
- //test groups
- import flexUnitTests.*;
+package flexUnitTests.binding.support.bindings.bindables {
+[Bindable]
+ public interface ITaskVO {
+
+
+ function get label():String;
+ function set label(value:String):void;
+
+ function get data():String;
+ function set data(value:String):void;
+
+
+ function get tooltip():String;
+ function set tooltip(value:String):void;
+
+ function get selected():Boolean;
+ function set selected(value:Boolean):void;
+ }
- public class TestClasses
- {
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
- }
}
+
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
similarity index 64%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
index 11f141c..2812fb4 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
@@ -16,26 +16,25 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindings.bindables
{
- //test groups
- import flexUnitTests.*;
+[Bindable]
+public class OneLayerBindable
+{
+ public var bindableString:String;
+
+ public var bindableNumber:Number;
+
+ public var bindableBoolean:Boolean;
+
+ public function getSomething():String{
+ return bindableBoolean ? 'Internally true' : 'Internally false';
+ }
+
+ public function getSomethingBasedOn(something:Boolean):String{
+ return bindableBoolean && something ? "Both are true" : (bindableBoolean ? "Local only" : "Inbound only");
+ }
- public class TestClasses
- {
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
- }
}
+}
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO.as
similarity index 50%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO.as
index 11f141c..c40a1af 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO.as
@@ -16,26 +16,61 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindings.bindables
{
- //test groups
- import flexUnitTests.*;
+ [Bindable]
+ public class TaskVO implements ITaskVO
+ {
+ public function TaskVO(label:String = null, data:String = null, tooltip:String = null)
+ {
+ this.label = label;
+ this.data = data;
+ this.tooltip = tooltip;
+ }
+
+ private var _label:String;
+
+ public function get label():String
+ {
+ return _label;
+ }
+
+ public function set label(value:String):void
+ {
+ _label = value;
+ }
- public class TestClasses
- {
+ private var _data:String;
+
+ public function get data():String
+ {
+ return _data;
+ }
+
+ public function set data(value:String):void
+ {
+ _data = value;
+ }
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
+ private var _tooltip:String;
+
+ public function get tooltip():String
+ {
+ return _tooltip;
+ }
+
+ public function set tooltip(value:String):void
+ {
+ _tooltip = value;
+ }
+
+ private var _selected:Boolean;
+ public function get selected():Boolean{
+ return _selected;
+ }
+ public function set selected(value:Boolean):void{
+ _selected = value;
}
}
-}
+}
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_class.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_class.as
new file mode 100644
index 0000000..7348fb3
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_class.as
@@ -0,0 +1,76 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding.support.bindings.bindables
+{
+ [Bindable]
+ public class TaskVO_on_top_of_class implements ITaskVO
+ {
+ public function TaskVO_on_top_of_class(label:String = null, data:String = null, tooltip:String = null)
+ {
+
+ this.label = label;
+ this.data = data;
+ this.tooltip = tooltip;
+ }
+
+ private var _label:String;
+
+ public function get label():String
+ {
+ return _label;
+ }
+
+ public function set label(value:String):void
+ {
+ _label = value;
+ }
+
+ private var _data:String;
+
+ public function get data():String
+ {
+ return _data;
+ }
+
+ public function set data(value:String):void
+ {
+ _data = value;
+ }
+
+ private var _tooltip:String;
+
+ public function get tooltip():String
+ {
+ return _tooltip;
+ }
+
+ public function set tooltip(value:String):void
+ {
+ _tooltip = value;
+ }
+
+ private var _selected:Boolean
+ public function get selected():Boolean{
+ return _selected;
+ }
+ public function set selected(value:Boolean):void{
+ _selected = value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_property.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_property.as
new file mode 100644
index 0000000..fd91e8c
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_property.as
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding.support.bindings.bindables
+{
+ public class TaskVO_on_top_of_property implements ITaskVO
+ {
+ public function TaskVO_on_top_of_property(label:String = null, data:String = null, tooltip:String = null)
+ {
+
+ this.label = label;
+ this.data = data;
+ this.tooltip = tooltip;
+ }
+
+ private var _label:String;
+
+ [Bindable]
+ public function get label():String
+ {
+ return _label;
+ }
+
+ public function set label(value:String):void
+ {
+ _label = value;
+ }
+
+ private var _data:String;
+
+ [Bindable]
+ public function get data():String
+ {
+ return _data;
+ }
+
+ public function set data(value:String):void
+ {
+ _data = value;
+ }
+
+ private var _tooltip:String;
+
+ [Bindable]
+ public function get tooltip():String
+ {
+ return _tooltip;
+ }
+
+ public function set tooltip(value:String):void
+ {
+ _tooltip = value;
+ }
+
+
+ private var _selected:Boolean;
+ [Bindable]
+ public function get selected():Boolean{
+ return _selected;
+ }
+ public function set selected(value:Boolean):void{
+ _selected = value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TwoLayerBindable.as
similarity index 75%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TwoLayerBindable.as
index 11f141c..ab7ee35 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/bindables/TwoLayerBindable.as
@@ -16,26 +16,14 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.binding.support.bindings.bindables
{
- //test groups
- import flexUnitTests.*;
+[Bindable]
+public class TwoLayerBindable
+{
+ public var bindableOne:OneLayerBindable;
- public class TestClasses
- {
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
- }
+ public var toggle:Boolean;
}
+}
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/DeepBindingsA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/DeepBindingsA.mxml
new file mode 100644
index 0000000..cfc54c6
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/DeepBindingsA.mxml
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
+ initialize="initCompleteHandler()">
+
+
+ <fx:Declarations>
+ <bindables:TwoLayerBindable id="bindable2" >
+ <bindables:bindableOne>
+ <bindables:OneLayerBindable bindableString="deepBindable"/>
+ </bindables:bindableOne>
+ </bindables:TwoLayerBindable>
+ <fx:Object id="destinationObject"
+ something="true"
+ destString="{bindable2.bindableOne.bindableString}"
+ destNumber="{bindable2.bindableOne.bindableNumber}"
+ destBoolean="{bindable2.bindableOne.bindableBoolean}">
+ <fx:sub>
+ <fx:Object test="test" somelongname="test" lowerLevelNumDest="{bindable2.bindableOne.bindableNumber}"/>
+ </fx:sub>
+ </fx:Object>
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+
+
+ import flash.utils.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ }
+ ,
+ { //test 2 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 3 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 4 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 5 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.lowerLevelNumDest;
+ }
+ }
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+
+
+ <mx:Label id="testLabel1" text="{bindable2.bindableOne.bindableString}" />
+ <mx:Label id="testLabel2" text="{bindable2.bindableOne.bindableNumber}" />
+ <mx:Label id="testLabel3" text="{bindable2.bindableOne.bindableBoolean}" />
+
+</s:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/FunctionBindingsA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/FunctionBindingsA.mxml
new file mode 100644
index 0000000..79e379b
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/FunctionBindingsA.mxml
@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
+ initialize="initCompleteHandler()">
+
+
+ <fx:Declarations>
+ <bindables:OneLayerBindable id="bindable1" />
+ <bindables:TwoLayerBindable id="bindable2" >
+ <bindables:bindableOne>
+ <bindables:OneLayerBindable bindableString="deepBindable"/>
+ </bindables:bindableOne>
+ </bindables:TwoLayerBindable>
+ <fx:Object id="destinationObject"
+ something="true"
+ destString="{bindable1.getSomething()}"
+ altString="{bindable1.getSomethingBasedOn(bindable2.toggle)}"
+ >
+ <fx:sub>
+ <fx:Object deepLowerLevelString0="{bindable1.getSomething()}"
+ deepLowerLevelString1="{bindable2.bindableOne.getSomething()}"
+ deepLowerLevelString2="{bindable2.bindableOne.getSomethingBasedOn(bindable2.toggle)}"
+ />
+ </fx:sub>
+ </fx:Object>
+
+
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+
+ import flash.utils.getQualifiedClassName;
+
+
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ public function getValue(something:*):*{
+ return 'cat'
+ }
+
+ public static function SOMETHING():String{
+ return 'something';
+ }
+
+ public function getFunctParams():Function{
+ return function(test:Boolean=false):Array{
+ return [bindable2.toggle, getValue('blueberry'), SOMETHING(), bindable1.getSomething()];
+ }
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ //check start values
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 2 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.altString;
+ }
+ },
+ { //test 3 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 4 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString0;
+ }
+ },
+ { //test 5 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString1
+ }
+ }
+ ,
+ { //test 6String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString2
+ }
+ },
+ { //test 7 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString2
+ }
+ },
+//now actually do some change based testing
+ { //test 8 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ },
+ { //test 9 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 10 String
+ 'setVal': function (value:*):void {
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.altString;
+ }
+ },
+ { //test 11 String
+ 'setVal': function (value:*):void {
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ },
+ { //test 12 String deeper destination
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString0;
+ }
+ },
+ //now some of the deeper source bindings, and deeper desintations (in some cases)
+ { //test 13 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return testLabel3.text;
+ }
+ }
+ ,
+ { //test 14 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString1;
+ }
+ },
+ { //test 15 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return testLabel3.text;
+ }
+ }
+ ,
+ { //test 16 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString2
+ }
+ },
+ { //test 17 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return testLabel4.text;
+ }
+ }
+
+
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+
+ <mx:Label id="testLabel1" text="{bindable1.getSomething()}" />
+ <mx:Label id="testLabel2" text="{bindable1.getSomethingBasedOn(bindable2.toggle)}" />
+ <mx:Label id="testLabel3" text="{bindable2.bindableOne.getSomething()}" />
+ <mx:Label id="testLabel4" text="{bindable2.bindableOne.getSomethingBasedOn(bindable2.toggle)}" />
+</s:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/RendereBindingTestA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/RendereBindingTestA.mxml
new file mode 100644
index 0000000..b58c8c7
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/RendereBindingTestA.mxml
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:internalmxml="flexUnitTests.binding.support.bindings.flex.internalmxml.*"
+ initialize="initCompleteHandler()">
+
+
+ <fx:Script>
+ <![CDATA[
+ import flash.utils.getQualifiedClassName;
+ import flexUnitTests.binding.support.bindings.bindables.ITaskVO;
+ import flexUnitTests.binding.support.bindings.bindables.TaskVO;
+ import flexUnitTests.binding.support.bindings.bindables.TaskVO_on_top_of_class;
+ import flexUnitTests.binding.support.bindings.bindables.TaskVO_on_top_of_property;
+
+ //IBindingTest methods
+ public function get testName():String {
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ _tests = [
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ //do nothing, this test is to get the initial value
+ },
+ 'getVal': function ():* {
+ return testRenderer.checkBoxTarget.label;
+ }
+ }
+ /*{ //test 0 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ }
+ ,
+ { //test 2 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 3 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 4 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 5 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.lowerLevelNumDest;
+ }
+ }*/
+ ]
+ }
+ return _tests;
+ }
+
+
+
+ private var testItems:Array;
+ public function getTestItem(index:int):ITaskVO {
+ if (!testItems) {
+ testItems = [
+ new TaskVO('myTaskVOlabel1', 'mydata1','mytooltip1'),
+ new TaskVO('myTaskVOlabel2', 'mydata2','mytooltip2'),
+ new TaskVO_on_top_of_class('myTaskVOClassToplabel3', 'mydata3','mytooltip3'),
+ new TaskVO_on_top_of_class('myTaskVOClassToplabel4', 'mydata4','mytooltip4'),
+ new TaskVO_on_top_of_property('myTaskVOPropToplabel5', 'mydata5','mytooltip5'),
+ new TaskVO_on_top_of_property('myTaskVOPropToplabel6', 'mydata6','mytooltip6')
+ ];
+
+ }
+
+ return testItems[index];
+ }
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ ]]>
+ </fx:Script>
+
+
+
+ <internalmxml:TaskVOItemRenderer id="testRenderer" />
+</s:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsA.mxml
new file mode 100644
index 0000000..d5f1e04
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsA.mxml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ initialize="initCompleteHandler()">
+
+ <fx:Script>
+ <![CDATA[
+
+ import flash.utils.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ getTests()[internalTestNum]['setVal'](value)
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ return getTests()[internalTestNum]['getVal']()
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ { //test 0
+ 'setVal': function (value:*):void {
+ labelText = value
+ },
+ 'getVal': function ():* {
+ return testLabel.text;
+ }
+ }
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+
+
+ <mx:Label id="testLabel" text="{labelText}" />
+
+</s:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsB.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsB.mxml
new file mode 100644
index 0000000..a3ab5df
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsB.mxml
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
+ initialize="initCompleteHandler()">
+
+ <fx:Declarations>
+ <bindables:OneLayerBindable id="bindable1" />
+ <fx:Object id="destinationObject"
+ something="true"
+ destString="{bindable1.bindableString}"
+ destNumber="{bindable1.bindableNumber}"
+ destBoolean="{bindable1.bindableBoolean}">
+ <fx:sub>
+ <fx:Object test="test" somelongname="test" lowerLevelNumDest="{bindable1.bindableNumber}"/>
+ </fx:sub>
+ <fx:other>
+ <bindables:OneLayerBindable bindableString="test"/>
+ </fx:other>
+ </fx:Object>
+
+
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+
+ import flash.utils.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableString = value
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ }
+ ,
+ { //test 2 Codegen test only. Testing a compiler-jx fix for fx:Object output for the above definition (also release mode fixes)
+ 'setVal': function (value:*):void {
+ destinationObject.sub.somelongname = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.somelongname;
+ }
+ },
+ { //test 3 Codegen test only. Testing a compiler-jx fix for fx:Object output for the above definition (release mode)
+ 'setVal': function (value:*):void {
+ destinationObject.other.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.other.bindableString;
+ }
+ },
+ { //test 4 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 5 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 6 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 7 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.lowerLevelNumDest;
+ }
+ }
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+ <mx:Label id="testLabel1" text="{bindable1.bindableString}" />
+ <mx:Label id="testLabel2" text="{bindable1.bindableNumber}" />
+ <mx:Label id="testLabel3" text="{bindable1.bindableBoolean}" />
+
+</s:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/internalmxml/TaskVOItemRenderer.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/internalmxml/TaskVOItemRenderer.mxml
new file mode 100644
index 0000000..7f039a5
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/flex/internalmxml/TaskVOItemRenderer.mxml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ >
+
+ <fx:Script>
+ <![CDATA[
+
+ import flexUnitTests.binding.support.bindings.bindables.ITaskVO;
+
+ import flash.events.Event;
+
+ [Bindable("dataChange")]
+ public function get partitionTaskVo():ITaskVO
+ {
+ return data as ITaskVO;
+ }
+
+ protected function onSelectionChanged(event:Event):void
+ {
+ data.isSelected = event.target["selected"];
+ }
+
+ ]]>
+ </fx:Script>
+
+ <s:HGroup width="100%">
+ <s:CheckBox id="checkBoxTarget" label="{partitionTaskVo.label + ' - ' + partitionTaskVo.tooltip}" change="onSelectionChanged(event)"
+ percentWidth="100"/>
+ </s:HGroup>
+</s:ItemRenderer>
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/DeepBindingsA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/DeepBindingsA.mxml
new file mode 100644
index 0000000..408ab2d
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/DeepBindingsA.mxml
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
+ initComplete="initCompleteHandler()">
+
+
+ <fx:Declarations>
+ <bindables:TwoLayerBindable id="bindable2" >
+ <bindables:bindableOne>
+ <bindables:OneLayerBindable bindableString="deepBindable"/>
+ </bindables:bindableOne>
+ </bindables:TwoLayerBindable>
+ <fx:Object id="destinationObject"
+ something="true"
+ destString="{bindable2.bindableOne.bindableString}"
+ destNumber="{bindable2.bindableOne.bindableNumber}"
+ destBoolean="{bindable2.bindableOne.bindableBoolean}">
+ <fx:sub>
+ <fx:Object test="test" somelongname="test" lowerLevelNumDest="{bindable2.bindableOne.bindableNumber}"/>
+ </fx:sub>
+ </fx:Object>
+
+
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+
+
+ import org.apache.royale.reflection.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ }
+ ,
+ { //test 2 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 3 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 4 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 5 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.lowerLevelNumDest;
+ }
+ }
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+ <js:beads>
+ <js:ContainerDataBinding/>
+ </js:beads>
+
+ <js:Label localId="testLabel1" text="{bindable2.bindableOne.bindableString}" />
+ <js:Label localId="testLabel2" text="{bindable2.bindableOne.bindableNumber}" />
+ <js:Label localId="testLabel3" text="{bindable2.bindableOne.bindableBoolean}" />
+
+</js:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA.mxml
new file mode 100644
index 0000000..9148b04
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA.mxml
@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
+ initComplete="initCompleteHandler()">
+
+
+ <fx:Declarations>
+ <bindables:OneLayerBindable id="bindable1" />
+ <bindables:TwoLayerBindable id="bindable2" >
+ <bindables:bindableOne>
+ <bindables:OneLayerBindable bindableString="deepBindable"/>
+ </bindables:bindableOne>
+ </bindables:TwoLayerBindable>
+ <fx:Object id="destinationObject"
+ something="true"
+ destString="{bindable1.getSomething()}"
+ altString="{bindable1.getSomethingBasedOn(bindable2.toggle)}"
+ >
+ <fx:sub>
+ <fx:Object deepLowerLevelString0="{bindable1.getSomething()}"
+ deepLowerLevelString1="{bindable2.bindableOne.getSomething()}"
+ deepLowerLevelString2="{bindable2.bindableOne.getSomethingBasedOn(bindable2.toggle)}"
+ />
+ </fx:sub>
+ </fx:Object>
+
+
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+
+
+
+
+
+ import org.apache.royale.reflection.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ public function getValue(something:*):*{
+ return 'cat'
+ }
+
+ public static function SOMETHING():String{
+ return 'something';
+ }
+
+ public function getFunctParams():Function{
+ return function(test:Boolean=false):Array{
+ return [bindable2.toggle, getValue('blueberry'), SOMETHING(), bindable1.getSomething()];
+ }
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ //check start values
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 2 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.altString;
+ }
+ },
+ { //test 3 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 4 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString0;
+ }
+ },
+ { //test 5 String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString1
+ }
+ }
+ ,
+ { //test 6String
+ 'setVal': function (value:*):void {
+ //do nothing
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString2
+ }
+ },
+ { //test 7 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString2
+ }
+ },
+//now actually do some change based testing
+ { //test 8 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ },
+ { //test 9 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 10 String
+ 'setVal': function (value:*):void {
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.altString;
+ }
+ },
+ { //test 11 String
+ 'setVal': function (value:*):void {
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ },
+ { //test 12 String deeper destination
+ 'setVal': function (value:*):void {
+ bindable1.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString0;
+ }
+ },
+ //now some of the deeper source bindings, and deeper desintations (in some cases)
+ { //test 13 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return testLabel3.text;
+ }
+ }
+ ,
+ { //test 14 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString1;
+ }
+ },
+ { //test 15 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ },
+ 'getVal': function ():* {
+ return testLabel3.text;
+ }
+ }
+ ,
+ { //test 16 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.deepLowerLevelString2
+ }
+ },
+ { //test 17 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableBoolean = value;
+ bindable2.toggle = value;
+ },
+ 'getVal': function ():* {
+ return testLabel4.text;
+ }
+ }
+
+
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+ <js:beads>
+ <js:ContainerDataBinding/>
+ </js:beads>
+
+ <js:Label localId="testLabel1" text="{bindable1.getSomething()}" />
+ <js:Label localId="testLabel2" text="{bindable1.getSomethingBasedOn(bindable2.toggle)}" />
+ <js:Label localId="testLabel3" text="{bindable2.bindableOne.getSomething()}" />
+ <js:Label localId="testLabel4" text="{bindable2.bindableOne.getSomethingBasedOn(bindable2.toggle)}" />
+</js:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/RendereBindingTestA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/RendereBindingTestA.mxml
new file mode 100644
index 0000000..c5cde0f
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/RendereBindingTestA.mxml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:bindings="flexUnitTests.binding.support.bindings.royale.*"
+ xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
+ xmlns:internalmxml="flexUnitTests.binding.support.bindings.royale.internalmxml.*"
+ initComplete="initCompleteHandler()">
+
+
+ <fx:Script>
+ <![CDATA[
+ import flexUnitTests.binding.support.bindings.bindables.ITaskVO;
+ import flexUnitTests.binding.support.bindings.bindables.TaskVO;
+ import flexUnitTests.binding.support.bindings.bindables.TaskVO_on_top_of_class;
+ import flexUnitTests.binding.support.bindings.bindables.TaskVO_on_top_of_property;
+
+ import org.apache.royale.reflection.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+ return getQualifiedClassName(this);
+ }
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ //do nothing, this test is to get the initial value
+ },
+ 'getVal': function ():* {
+ return testRenderer.checkBoxTarget.text;
+ }
+ },
+ { //test 1
+ 'setVal': function (value:*):void {
+ testRenderer.data = getTestItem(value)
+ },
+ 'getVal': function ():* {
+ return testRenderer.checkBoxTarget.text;
+ }
+ },
+ { //test 1
+ 'setVal': function (value:*):void {
+ var item:ITaskVO = getTestItem(value);
+ testRenderer.data = item;
+ item.tooltip = value;
+ },
+ 'getVal': function ():* {
+ return testRenderer.checkBoxTarget.text;
+ }
+ }
+
+ /*{ //test 0 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ }
+ ,
+ { //test 2 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 3 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 4 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 5 Binding test
+ 'setVal': function (value:*):void {
+ bindable2.bindableOne.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.lowerLevelNumDest;
+ }
+ }*/
+ ]
+ }
+ return _tests;
+ }
+ private var testItems:Array;
+ public function getTestItem(index:int):ITaskVO {
+ if (!testItems) {
+ testItems = [
+ new TaskVO('myTaskVOlabel1', 'mydata1','mytooltip1'),
+ new TaskVO('myTaskVOlabel2', 'mydata2','mytooltip2'),
+ new TaskVO_on_top_of_class('myTaskVOClassToplabel3', 'mydata3','mytooltip3'),
+ new TaskVO_on_top_of_class('myTaskVOClassToplabel4', 'mydata4','mytooltip4'),
+ new TaskVO_on_top_of_property('myTaskVOPropToplabel5', 'mydata5','mytooltip5'),
+ new TaskVO_on_top_of_property('myTaskVOPropToplabel6', 'mydata6','mytooltip6')
+ ];
+
+ }
+
+ return testItems[index];
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ ]]>
+ </fx:Script>
+
+ <!-- <js:beads>
+ <js:ContainerDataBinding/>
+ </js:beads>-->
+
+ <internalmxml:TaskVOItemRenderer id="testRenderer" />
+</js:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsA.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsA.mxml
new file mode 100644
index 0000000..d316f08
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsA.mxml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ initComplete="initCompleteHandler()">
+
+ <fx:Script>
+ <![CDATA[
+
+
+
+ import org.apache.royale.reflection.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ getTests()[internalTestNum]['setVal'](value)
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ return getTests()[internalTestNum]['getVal']()
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ { //test 0
+ 'setVal': function (value:*):void {
+ labelText = value
+ },
+ 'getVal': function ():* {
+ return testLabel.text;
+ }
+ },
+ { //test 1 ('binding with 'this' in it)
+ 'setVal': function (value:*):void {
+ labelText = value
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+ <js:beads>
+ <js:ContainerDataBinding/>
+ </js:beads>
+
+ <js:Label localId="testLabel" text="{labelText}" />
+ <js:Label localId="testLabel2" text="{this.labelText}" />
+</js:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsB.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsB.mxml
new file mode 100644
index 0000000..9f41ce3
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsB.mxml
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ implements="flexUnitTests.binding.support.IBindingTest"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
+ initComplete="initCompleteHandler()">
+
+
+ <fx:Declarations>
+ <bindables:OneLayerBindable id="bindable1" />
+ <fx:Object id="destinationObject"
+ something="true"
+ destString="{bindable1.bindableString}"
+ destNumber="{bindable1.bindableNumber}"
+ destBoolean="{bindable1.bindableBoolean}">
+ <fx:sub>
+ <fx:Object test="test" somelongname="test" lowerLevelNumDest="{bindable1.bindableNumber}"/>
+ </fx:sub>
+ <fx:other>
+ <bindables:OneLayerBindable bindableString="test"/>
+ </fx:other>
+ </fx:Object>
+
+
+ </fx:Declarations>
+ <fx:Script>
+ <![CDATA[
+
+
+ import org.apache.royale.reflection.getQualifiedClassName;
+ //IBindingTest methods
+ public function get testName():String {
+
+ return getQualifiedClassName(this);
+ }
+
+
+ public function get internalTestCount():uint {
+ return getTests().length;
+ }
+
+ public function setInboundValue(value:*, internalTestNum:uint = 0):void {
+ try{
+ getTests()[internalTestNum]['setVal'](value)
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ }
+
+ public function getBindingResultValue(internalTestNum:uint = 0):* {
+ var result:*;
+ try{
+ result = getTests()[internalTestNum]['getVal']()
+ } catch(e:Error) {
+ e.message = "[fail in internal test "+internalTestNum +"]:" +e.message;
+ throw e;
+ }
+ return result;
+ }
+
+ private var _tests:Array;
+ //only one internal test
+ private function getTests():Array {
+ if (!_tests) {
+ _tests = [
+ { //test 0 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableString = value
+ },
+ 'getVal': function ():* {
+ return testLabel1.text;
+ }
+ },
+ { //test 1 String
+ 'setVal': function (value:*):void {
+ bindable1.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destString;
+ }
+ }
+ ,
+ { //test 2 Codegen test only. Testing a compiler-jx fix for fx:Object output for the above definition (also release mode fixes)
+ 'setVal': function (value:*):void {
+ destinationObject.sub.somelongname = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.somelongname;
+ }
+ },
+ { //test 3 Codegen test only. Testing a compiler-jx fix for fx:Object output for the above definition (release mode)
+ 'setVal': function (value:*):void {
+ destinationObject.other.bindableString = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.other.bindableString;
+ }
+ },
+ { //test 4 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 5 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return testLabel2.text;
+ }
+ }
+ ,
+ { //test 6 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.destNumber;
+ }
+ },
+ { //test 7 Binding test
+ 'setVal': function (value:*):void {
+ bindable1.bindableNumber = value
+ },
+ 'getVal': function ():* {
+ return destinationObject.sub.lowerLevelNumDest;
+ }
+ }
+ ]
+ }
+ return _tests;
+ }
+
+
+ private function initCompleteHandler():void {
+ // trace('initCompleteHandler', this);
+ }
+
+ [Bindable]
+ public var labelText:String;
+ ]]>
+ </fx:Script>
+
+ <js:beads>
+ <js:ContainerDataBinding/>
+ </js:beads>
+
+ <js:Label localId="testLabel1" text="{bindable1.bindableString}" />
+ <js:Label localId="testLabel2" text="{bindable1.bindableNumber}" />
+ <js:Label localId="testLabel3" text="{bindable1.bindableBoolean}" />
+
+</js:HGroup>
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/internalmxml/TaskVOItemRenderer.mxml b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/internalmxml/TaskVOItemRenderer.mxml
new file mode 100644
index 0000000..3245be9
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/internalmxml/TaskVOItemRenderer.mxml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<j:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:j="flexUnitTests.binding.support.bindings.royale.internalmxml.support.*"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:html="library://ns.apache.org/royale/html"
+ xmlns="http://www.w3.org/1999/xhtml"
+ >
+ <!--<j:style>
+ <js:AllCSSStyles paddingLeft="0" borderTop="1px solid #CCCCCC"/>
+ </j:style>-->
+ <j:beads>
+ <js:ItemRendererDataBinding />
+ </j:beads>
+
+ <fx:Script>
+ <![CDATA[
+
+ import flexUnitTests.binding.support.bindings.bindables.ITaskVO;
+
+ import org.apache.royale.events.Event;
+
+ [Bindable("dataChange")]
+ public function get partitionTaskVo():ITaskVO
+ {
+ return data as ITaskVO;
+ }
+
+ protected function onSelectionChanged(event:Event):void
+ {
+ data.isSelected = event.target["selected"];
+ }
+
+ ]]>
+ </fx:Script>
+
+ <js:HGroup percentWidth="100">
+ <js:CheckBox id="checkBoxTarget" text="{partitionTaskVo.label + ' - ' + partitionTaskVo.tooltip}" change="onSelectionChanged(event)"
+ percentWidth="100"/>
+ </js:HGroup>
+</j:ListItemRenderer>
\ No newline at end of file
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/internalmxml/support/ListItemRenderer.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/internalmxml/support/ListItemRenderer.as
new file mode 100644
index 0000000..c0cd467
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/support/bindings/royale/internalmxml/support/ListItemRenderer.as
@@ -0,0 +1,147 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding.support.bindings.royale.internalmxml.support
+{
+ COMPILE::JS
+ {
+ import org.apache.royale.core.WrappedHTMLElement;
+ import org.apache.royale.html.util.addElementToWrapper;
+ }
+ import org.apache.royale.core.StyledMXMLItemRenderer;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.html.util.getLabelFromData;
+ /*import org.apache.royale.jewel.beads.controls.TextAlign;
+ import org.apache.royale.jewel.beads.itemRenderers.IAlignItemRenderer;
+ import org.apache.royale.jewel.beads.itemRenderers.ITextItemRenderer;*/
+
+ /**
+ * The ListItemRenderer defines the basic Item Renderer for a Jewel List Component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.4
+ */
+ public class ListItemRenderer extends StyledMXMLItemRenderer /*implements ITextItemRenderer*//*, IAlignItemRenderer*/
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.4
+ */
+ public function ListItemRenderer()
+ {
+ super();
+
+ typeNames = "jewel item";
+
+ if(MXMLDescriptor != null)
+ {
+ addClass("mxmlContent");
+ }
+ }
+
+ private var _text:String = "";
+
+ [Bindable(event="textChange")]
+ /**
+ * The text of the renderer
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.4
+ */
+ public function get text():String
+ {
+ return _text;
+ }
+
+ public function set text(value:String):void
+ {
+ if(value != _text) {
+ _text = value;
+ COMPILE::JS
+ {
+ if(MXMLDescriptor == null)
+ {
+ element.innerHTML = _text;
+ }
+ }
+ dispatchEvent(new Event('textChange'));
+ }
+ }
+
+ // protected var textAlign:TextAlign;
+
+ /**
+ * How text align in the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.4
+ */
+ /*public function get align():String
+ {
+ return textAlign.align;
+ }
+
+ public function set align(value:String):void
+ {
+ if(!textAlign)
+ {
+ textAlign = new TextAlign();
+ addBead(textAlign);
+ }
+ textAlign.align = value;
+ }*/
+
+ /**
+ * Sets the data value and uses the String version of the data for display.
+ *
+ * @param Object data The object being displayed by the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.4
+ */
+ override public function set data(value:Object):void
+ {
+ text = getLabelFromData(this, value);
+ super.data = value;
+ }
+
+ /**
+ * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+ * @royaleignorecoercion Text
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ addElementToWrapper(this, 'li');
+ return element;
+ }
+
+ }
+}
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/utils/BindableTestUtil.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/utils/BindableTestUtil.as
new file mode 100644
index 0000000..5d2abcb
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/utils/BindableTestUtil.as
@@ -0,0 +1,190 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding.utils {
+import testshim.RoyaleUnitTestRunner;
+
+
+COMPILE::Flex{
+ import flash.events.Event;
+ import flash.events.IEventDispatcher;
+ import mx.events.PropertyChangeEvent;
+ import flash.utils.getQualifiedClassName;
+}
+COMPILE::Royale{
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.IEventDispatcher;
+ import org.apache.royale.events.ValueChangeEvent;
+ import org.apache.royale.reflection.getQualifiedClassName;
+}
+
+public class BindableTestUtil {
+
+ COMPILE::Flex
+ public static const VALUE_CHANGE_EVENT:String = "propertyChange";
+
+ COMPILE::Royale
+ public static const VALUE_CHANGE_EVENT:String = "valueChange";
+
+
+ private static function getBaseEventName(event:Event):String{
+ var name:String = getQualifiedClassName(event);
+ name = name.split('::').join('.'); //in flex
+ name = name.split('.').pop();
+ return name;
+ }
+
+ private static function getValueChangeDescription(event:Event):String{
+ var desc:String;
+ COMPILE::Flex{
+ var vce:PropertyChangeEvent = PropertyChangeEvent(event);
+ desc = 'ValueChangeEvent::property('+ vce.property+'), oldVal:('+ vce.oldValue+ "), newValue:("+ vce.newValue+")";
+ }
+ COMPILE::Royale{
+ var vce:ValueChangeEvent = ValueChangeEvent(event);
+ desc = 'ValueChangeEvent::property('+ vce.propertyName+'), oldVal:('+ vce.oldValue+ "), newValue:("+ vce.newValue+")";
+ }
+ return desc;
+ }
+
+ COMPILE::Flex
+ private static const VALUECHANGE_EVENT_CLASS:Class = PropertyChangeEvent;
+ COMPILE::Royale
+ private static const VALUECHANGE_EVENT_CLASS:Class = ValueChangeEvent;
+
+ public static var deactivated:Boolean;
+
+ private static var _unlocked:Boolean;
+ private static var _instance:BindableTestUtil;
+ public static function get instance():BindableTestUtil{
+ if (!_instance) {
+ _unlocked = true;
+ _instance = new BindableTestUtil();
+ _unlocked = false;
+ }
+ return _instance;
+ }
+
+ private var _history:Array= [];
+
+
+ public function BindableTestUtil() {
+ if (!_unlocked) throw new Error("Singleton only, access view BindableTestUtil.instance");
+ }
+
+
+ public function reset():void{
+ _history= [];
+ for (var eventType:String in listening) {
+ var arr:Array = listening[eventType];
+ for (var i:int=0; i<arr.length; i++) {
+ var dispatcher:IEventDispatcher = arr[i];
+ dispatcher.removeEventListener(eventType, addEventItem);
+ }
+ }
+ listening = {};
+ }
+
+ public function getContents():Array{
+ return _history.slice();
+ }
+
+ public function getSequenceString():String{
+ var temp:Array = _history.slice();
+ temp = temp.map(function(val:*, index:int, arr:Array):*{
+ return index + ":" + val;
+ });
+ return temp.join("\n");
+ }
+
+ public function addHistoryItem(...rest):void{
+ if (deactivated) return;
+ var contents:Array = rest;
+ contents = contents.map(
+ function(value:*, index:int, arr:Array):*{
+ if (value === null) return 'null';
+ if (value === undefined) return 'undefined';
+ return (value.toString());
+ }
+ );
+ _history.push("history:" + contents.join(' , '));
+ }
+
+ COMPILE::Royale
+ private function getRoyaleStackTrace(e:Error):String{
+ COMPILE::SWF{
+ return e.getStackTrace();
+ }
+ COMPILE::JS{
+ return e.stack;
+ }
+ }
+
+ public function addStacktrace():void{
+ if (deactivated) return;
+ var stack:String;
+ COMPILE::Flex{
+ stack = new Error().getStackTrace();
+ }
+ COMPILE::Royale{
+ stack = getRoyaleStackTrace(new Error())
+ }
+
+ //remove the first line
+ var contents:Array = stack.split('\n').slice(1);
+ contents[0] = "Execution stack: [";
+ contents.push("]");
+ _history.push(contents.join('\n'));
+ }
+
+ public function addEventItem(event:Event):void{
+ if (deactivated) return;
+ if (event is VALUECHANGE_EVENT_CLASS) {
+ _history.push(getValueChangeDescription(event));
+ } else {
+
+ _history.push(getBaseEventName(event)+'(type="'+event.type+'", bubbles='+event.bubbles+', cancelable='+event.cancelable+')');
+ }
+ }
+
+ private var listening:Object = {};
+ public function listenTo(object:Object, eventType:String):void{
+ if (object is IEventDispatcher) {
+ IEventDispatcher(object).addEventListener(eventType,addEventItem);
+ var listeners:Array = listening[eventType] || (listening[eventType] = []);
+ listeners.push(object);
+ } else {
+ throw new Error("Cannot listen to a non-IEventDispatcher");
+ }
+ }
+
+ public function unListenTo(object:Object, eventType:String):void{
+ if (object is IEventDispatcher) {
+ IEventDispatcher(object).removeEventListener(eventType,addEventItem);
+ var listeners:Array = listening[eventType] || (listening[eventType] = []);
+ var idx:int = listeners.indexOf(object);
+ if (idx != -1) {
+ listeners.splice(idx,1);
+ }
+ } else {
+ throw new Error("Cannot unListen to a non-IEventDispatcher");
+ }
+ }
+
+}
+}
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/utils/BindingTestUtil.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/utils/BindingTestUtil.as
new file mode 100644
index 0000000..9a2a065
--- /dev/null
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/binding/utils/BindingTestUtil.as
@@ -0,0 +1,84 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests.binding.utils
+{
+
+ COMPILE::Flex{
+ import mx.core.IVisualElementContainer;
+ import mx.core.IVisualElement;
+ }
+
+ COMPILE::Royale{
+ import IVisualElementContainer=org.apache.royale.core.IParent;
+ import IVisualElement=org.apache.royale.core.IChild;
+ }
+
+ /**
+ * @royalesuppresspublicvarwarning
+ */
+ public class BindingTestUtil
+ {
+ private static var _testParent:IVisualElementContainer;
+ private static var _testClasses:Array = [];
+ private static var _testInstances:Array = [];
+
+ public static function setTestParent(testParent:IVisualElementContainer):void{
+ _testParent = testParent;
+ }
+
+ public static function createAndAddInstance(instanceClass:Class):IVisualElement{
+ var inst:IVisualElement;
+ if (!_testParent) throw new Error('setTestParent must set a parent before calling createAndAddInstance')
+ if (instanceClass) {
+ if (_testClasses.indexOf(instanceClass) == -1) {
+ _testClasses.push(instanceClass);
+ }
+ inst = new instanceClass() as IVisualElement;
+ if (!inst) {
+ throw new Error('bad mxml instance class');
+ }
+ _testInstances.push(inst);
+ _testParent.addElement(inst);
+ } else {
+ throw new Error('instanceClass must not be null');
+ }
+
+ return inst;
+ }
+
+ public static function removeInstance(instance:Object):void{
+ if (instance is IVisualElement){
+ if (IVisualElement(instance).parent) {
+ IVisualElementContainer(instance.parent).removeElement(instance as IVisualElement);
+ }
+ }
+ if (_testInstances.indexOf(instance) != -1) {
+ _testInstances.splice(_testInstances.indexOf(instance), 1);
+ }
+ }
+
+ public static function reset():void{
+ _testClasses = [];
+ while (_testInstances.length) {
+ removeInstance(_testInstances.pop())
+ }
+ }
+
+ }
+}
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestArraylikeGetSet.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestArraylikeGetSet.as
index 0ee90ee..49d4d16 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestArraylikeGetSet.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestArraylikeGetSet.as
@@ -40,18 +40,19 @@ package flexUnitTests.language
[BeforeClass]
public static function setUpBeforeClass():void
{
-
+ arrayList= new ArrayList(['dog', 'cat','mouse','gerbil']);
}
[AfterClass]
public static function tearDownAfterClass():void
{
+ arrayList = null;
}
[Before]
public function setUp():void
{
- arrayList= new ArrayList(['dog', 'cat','mouse','gerbil']);
+
}
[After]
@@ -62,7 +63,7 @@ package flexUnitTests.language
- public var arrayList:ArrayList;
+ public static var arrayList:ArrayList;
[Test]
public function testImpl():void
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestForEach.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestForEach.as
index 47e64e2..2939be8 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestForEach.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestForEach.as
@@ -40,18 +40,19 @@ package flexUnitTests.language
[BeforeClass]
public static function setUpBeforeClass():void
{
-
+ _myList = new ArrayList(['dog', 'cat','mouse','gerbil'])
}
[AfterClass]
public static function tearDownAfterClass():void
{
+ _myList = null;
}
[Before]
public function setUp():void
{
- _myList = new ArrayList(['dog', 'cat','mouse','gerbil'])
+
}
[After]
@@ -60,7 +61,7 @@ package flexUnitTests.language
}
private var _animal:String;
private var _char:String;
- private var _myList:ArrayList
+ private static var _myList:ArrayList
[Test]
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/mxroyale/SharedObjectTest.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/mxroyale/SharedObjectTest.as
index c05aa56..db83730 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/mxroyale/SharedObjectTest.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/mxroyale/SharedObjectTest.as
@@ -42,7 +42,7 @@ package flexUnitTests.mxroyale
[Before]
public function setUp():void
{
- registerClassAlias('TestClass5', TestClass5);
+
}
[After]
@@ -54,6 +54,7 @@ package flexUnitTests.mxroyale
[BeforeClass]
public static function setUpBeforeClass():void
{
+ registerClassAlias('TestClass5', TestClass5);
}
[AfterClass]
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/network/AMFBinaryDataTesterTest.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/network/AMFBinaryDataTesterTest.as
index 3a30bc0..59eb6f7 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/network/AMFBinaryDataTesterTest.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/network/AMFBinaryDataTesterTest.as
@@ -28,8 +28,10 @@ package flexUnitTests.network
import flexUnitTests.network.support.TestClass4;
import flexUnitTests.network.support.DynamicTestClass;
import flexUnitTests.network.support.TestClass6;
-
- import org.apache.royale.test.asserts.*;
+import flexUnitTests.network.support.TestClass7a;
+import flexUnitTests.network.support.TestClass7b;
+
+import org.apache.royale.test.asserts.*;
import org.apache.royale.net.remoting.amf.AMFBinaryData;
import org.apache.royale.reflection.*;
@@ -544,7 +546,7 @@ package flexUnitTests.network
var test:TestClass6 = new TestClass6();
ba.writeObject(test);
ba.position = 0;
- assertEquals(ba.length, 50, 'unexpected serialized content with custom namespaces')
+ assertEquals(ba.length, 50, 'unexpected serialized content with custom namespaces');
//cover variation in order
const validOptions:Array = [
'0a23010b6d79566172156d794163636573736f7206177075626c69634d79566172061f7075626c6963206163636573736f72',
@@ -558,6 +560,36 @@ package flexUnitTests.network
var json:String = JSON.stringify(restored)
//order may be different... need json object check here for: {"myAccessor":"public accessor","myVar":"publicMyVar"}
}
+
+ [Test]
+ public function testTransientAndBindable():void{
+ var ba:AMFBinaryData = new AMFBinaryData();
+ registerClassAlias('TestClass7a', TestClass7a);
+ registerClassAlias('TestClass7b', TestClass7b);
+ var test1:TestClass7a = new TestClass7a();
+ test1.something = 'whatever';
+ ba.writeObject(test1);
+ RoyaleUnitTestRunner.consoleOut(getBytesOut(ba));
+ ba.position = 0;
+
+ var retrieved:Object = ba.readObject();
+ RoyaleUnitTestRunner.consoleOut(retrieved.something)
+
+ assertTrue(retrieved is TestClass7a, 'unexpected deserialization');
+
+ var test2:TestClass7b = new TestClass7b();
+ test1.something = 'whatever';
+ ba.length = 0;
+ ba.writeObject(test2);
+ RoyaleUnitTestRunner.consoleOut(getBytesOut(ba));
+ ba.position = 0;
+
+ retrieved = ba.readObject();
+ RoyaleUnitTestRunner.consoleOut(retrieved.something)
+
+ assertTrue(retrieved is TestClass7b, 'unexpected deserialization');
+
+ }
private function getBytesOut(bytes:AMFBinaryData):String{
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/network/support/TestClass7a.as
similarity index 56%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/network/support/TestClass7a.as
index 11f141c..db6ec8b 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/network/support/TestClass7a.as
@@ -16,26 +16,36 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.network.support
{
- //test groups
- import flexUnitTests.*;
+
+ import flexUnitTests.network.support.testnamespace;
+
+ /**
+ * @royalesuppresspublicvarwarning
+ */
+ public class TestClass7a
+ {
+ //Note: do not change this test class unless you change the related tests to
+ //support any changes that might appear when testing reflection into it
+
+ public function TestClass7a()
+ {
+
+ }
-
- public class TestClasses
- {
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
- }
+ public var test:String = 'test';
+
+ protected var _something:String;
+ [Transient]
+ public function get something():String{
+ return _something;
+ }
+ public function set something(value:String):void{
+ _something = value;
+ }
+
+ }
+
+
}
diff --git a/manualtests/UnitTests/src/main/royale/TestClasses.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/network/support/TestClass7b.as
similarity index 56%
copy from manualtests/UnitTests/src/main/royale/TestClasses.as
copy to manualtests/UnitTests/src/main/royale/flexUnitTests/network/support/TestClass7b.as
index 11f141c..25f31be 100644
--- a/manualtests/UnitTests/src/main/royale/TestClasses.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/network/support/TestClass7b.as
@@ -16,26 +16,34 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package
+package flexUnitTests.network.support
{
- //test groups
- import flexUnitTests.*;
-
-
- public class TestClasses
- {
-
- public static function get testClasses():Array {
- return [
- LanguageTester
- ,CoreTester
- ,ReflectionTester
- ,ObservedBugsTester
- ,GithubIssuesTester
- ,NetworkTester
- ,XMLTester
- ,MXRoyaleTester
- ];
- }
- }
+
+ import flexUnitTests.network.support.testnamespace;
+
+ /**
+ * @royalesuppresspublicvarwarning
+ */
+ public class TestClass7b extends TestClass7a
+ {
+ //Note: do not change this test class unless you change the related tests to
+ //support any changes that might appear when testing reflection into it
+
+ public function TestClass7b()
+ {
+
+ }
+
+ //private var _something:String;
+ [Bindable]
+ override public function get something():String{
+ return _something;
+ }
+ override public function set something(value:String):void{
+ _something = value;
+ }
+
+ }
+
+
}
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as
index 8b9d74e..a3fec9f 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as
@@ -35,6 +35,7 @@ package flexUnitTests.reflection
public static function setUpBeforeClass():void
{
isJS = COMPILE::JS;
+ ExtraData.addAll();
}
[AfterClass]
@@ -45,7 +46,7 @@ package flexUnitTests.reflection
[Before]
public function setUp():void
{
- ExtraData.addAll();
+
}
[After]
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTest.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTest.as
index d9f78b7..3ba8e7a 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTest.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTest.as
@@ -30,27 +30,13 @@ package flexUnitTests.reflection
public class ReflectionTesterTest
{
- public static var isJS:Boolean;
+ public static var isJS:Boolean = COMPILE::JS;
[BeforeClass]
public static function setUpBeforeClass():void
{
- var js:Boolean = false;
- try
- {
- var check:* = getDefinitionByName("flash.system.Capabilities");
- } catch (e:Error)
- {
- js = true;
- }
- //if this next reference to 'check' is not included, then the above try/catch code
- //appears to be optimized away in js-release mode
- //a separate test has been created for this
- if (check == null)
- {
- js = true;
- }
- isJS = js;
+ TestClass2.testStaticVar = "testStaticVar_val";
+ TestClass2.testStaticWriteOnly = "staticAccessor_initial_value";
}
[AfterClass]
@@ -61,8 +47,7 @@ package flexUnitTests.reflection
[Before]
public function setUp():void
{
- TestClass2.testStaticVar = "testStaticVar_val";
- TestClass2.testStaticWriteOnly = "staticAccessor_initial_value";
+
}
[After]
@@ -159,7 +144,7 @@ package flexUnitTests.reflection
assertEquals( 3, variables.length, "unexpected instance variables length");
//there is a difference based on the EventDispatcher inheritance chain differences between js and swf:
- expected = isJS ? 5 : 7;
+ expected = isJS ? 6 : 7;
var methods:Array = def.methods;
assertEquals( expected, methods.length, "unexpected instance methods length");
@@ -192,7 +177,7 @@ package flexUnitTests.reflection
assertEquals( 3, variables.length, "unexpected instance variables length");
//there is a difference based on the EventDispatcher inheritance chain differences between js and swf:
- expected = isJS ? 5 : 7;
+ expected = isJS ? 6 : 7;
var methods:Array = def.methods;
assertEquals( expected, methods.length, "unexpected instance methods length");
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTestUseCache.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTestUseCache.as
index ff5b36c..50b2508 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTestUseCache.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTestUseCache.as
@@ -51,25 +51,28 @@ package flexUnitTests.reflection
js = true;
}
isJS = js;
+
+ TypeDefinition.useCache = true;
+ TestClass2.testStaticVar = "testStaticVar_val";
+ TestClass2.testStaticWriteOnly = "staticAccessor_initial_value";
}
[AfterClass]
public static function tearDownAfterClass():void
{
+ TypeDefinition.useCache = false;
}
[Before]
public function setUp():void
{
- TypeDefinition.useCache = true;
- TestClass2.testStaticVar = "testStaticVar_val";
- TestClass2.testStaticWriteOnly = "staticAccessor_initial_value";
+
}
[After]
public function tearDown():void
{
- TypeDefinition.useCache = false;
+
}
private static function retrieveItemWithName(collection:Array, name:String):DefinitionBase
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLNamespaceTest.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLNamespaceTest.as
index a18a28f..b7a6d74 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLNamespaceTest.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLNamespaceTest.as
@@ -38,13 +38,25 @@ package flexUnitTests.xml
public static var isJS:Boolean = COMPILE::JS;
- private var settings:Object;
+ private static var settings:Object;
- private var source:String;
+ private static var source:String;
[Before]
public function setUp():void
{
+
+ }
+
+ [After]
+ public function tearDown():void
+ {
+
+ }
+
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
settings = XML.settings();
source = '<xml><?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?>\n' +
'<?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?>\n' +
@@ -73,21 +85,11 @@ package flexUnitTests.xml
'</rss></xml>';
}
- [After]
- public function tearDown():void
- {
- source=null;
- XML.setSettings(settings);
- }
-
- [BeforeClass]
- public static function setUpBeforeClass():void
- {
- }
-
[AfterClass]
public static function tearDownAfterClass():void
{
+ source=null;
+ XML.setSettings(settings);
}
public function getPlayerVersion():Number{
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as
index e5e9986..0c4b921 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as
@@ -31,13 +31,13 @@ package flexUnitTests.xml
{
public static var isJS:Boolean = COMPILE::JS;
- private var xmlStr:String;
+ private static var xmlStr:String;
- private var quotedXML:XML;
+ private static var quotedXML:XML;
- private var xml:XML;
- private var text:String;
- private var xml2:XML;
+ private static var xml:XML;
+ private static var text:String;
+ private static var xml2:XML;
private var settings:Object;
@@ -57,6 +57,20 @@ package flexUnitTests.xml
{
settings = XML.settings();
+
+ }
+
+ [After]
+ public function tearDown():void
+ {
+
+
+ XML.setSettings(settings);
+ }
+
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
xmlStr ='<?xml version="1.0" encoding="UTF-8" ?>' +
'<catalog xmlns:fx="http://ns.adobe.com/mxml/2009"' +
' xmlns:dac="com.printui.view.components.DesignAreaComponents.*">' +
@@ -101,34 +115,22 @@ package flexUnitTests.xml
' </catalog_item>' +
' </product>' +
'</catalog>';
-
+
quotedXML = <root title="That's Entertainment"/>;
xml = new XML(xmlStr);
text = "hi";
xml2 = new XML('<root xmlns:fz="http://ns.adobe.com/mxml/2009"><a><b/></a><a name="fred"/><a>hi<b>yeah!</b></a><a name="frank"/><c/></root>');
-
+
}
- [After]
- public function tearDown():void
+ [AfterClass]
+ public static function tearDownAfterClass():void
{
xmlStr = null;
quotedXML = null;
xml = null;
text = null;
xml2 = null;
-
- XML.setSettings(settings);
- }
-
- [BeforeClass]
- public static function setUpBeforeClass():void
- {
- }
-
- [AfterClass]
- public static function tearDownAfterClass():void
- {
}
diff --git a/manualtests/UnitTests/src/main/royale/testshim/RoyaleUnitTestRunner.as b/manualtests/UnitTests/src/main/royale/testshim/RoyaleUnitTestRunner.as
index 8d99136..55f010d 100644
--- a/manualtests/UnitTests/src/main/royale/testshim/RoyaleUnitTestRunner.as
+++ b/manualtests/UnitTests/src/main/royale/testshim/RoyaleUnitTestRunner.as
@@ -192,21 +192,22 @@ package testshim
{
begin();
var testInstance:Object = new testerClass();
- if (setupFunc != null)
- {
- testInstance[setupFunc.name]();
- }
+
var i:uint = 0, l:uint = testMethods.length;
for (; i < l; i++)
{
+ if (setupFunc != null)
+ {
+ testInstance[setupFunc.name]();
+ }
runRoyaleTest(_testingName, testInstance, testMethods[i] as MethodDefinition, callback);
+ if (tearDownFunc != null)
+ {
+ testInstance[tearDownFunc.name]();
+ }
}
-
- if (tearDownFunc != null)
- {
- testInstance[tearDownFunc.name]();
- }
+
end();
}
diff --git a/manualtests/build.xml b/manualtests/build.xml
index 2921923..db7ce82 100644
--- a/manualtests/build.xml
+++ b/manualtests/build.xml
@@ -75,7 +75,7 @@
<target name="compile" description="Compile Examples" >
<ant dir="${basedir}/BubbleTest"/>
- <ant dir="${basedir}/ContainerTest"/>
+ <!-- @todo needs fixing or removal: <ant dir="${basedir}/ContainerTest"/>-->
<ant dir="${basedir}/CursorTest"/>
<ant dir="${basedir}/DateChooserExample"/>
<ant dir="${basedir}/EffectsExample"/>
@@ -88,7 +88,7 @@
<ant dir="${basedir}/FormExample"/>
<ant dir="${basedir}/ImageTest"/>
<ant dir="${basedir}/LanguageTests"/>
- <ant dir="${basedir}/ListsTest"/>
+ <!-- @todo needs fixing or removal: <ant dir="${basedir}/ListsTest"/>-->
<ant dir="${basedir}/ProxyTest"/>
<ant dir="${basedir}/ReflectionTest"/>
<ant dir="${basedir}/RollEventsTest"/>
diff --git a/manualtests/build_example.xml b/manualtests/build_example.xml
index 7e626cd..e9dd31d 100644
--- a/manualtests/build_example.xml
+++ b/manualtests/build_example.xml
@@ -204,7 +204,7 @@
</fileset>
</copy>
- <antcall target="build_example.compile-js-release"/>
+ <!--<antcall target="build_example.compile-js-release"/>-->
<antcall target="build_example.copy-app-xml" />
</target>
@@ -337,8 +337,8 @@
<arg line="${optional_arg}" />
<arg value="${theme_arg}" />
<arg value="${extlib_arg}" />
- <arg value="-define=COMPILE::SWF,false" />
- <arg value="-define=COMPILE::JS,true" />
+ <arg value="-define+=COMPILE::SWF,false" />
+ <arg value="-define+=COMPILE::JS,true" />
<arg value="-targets=${js.release.target}" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="-js-output=${jsDir}" />