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/06 05:51:55 UTC
[royale-asjs] branch develop updated: This is easier: The same
bindings unit test code can now be run in Flex via Flexunit and in Royale
via RoyaleUnit. (Needs a local Flex app setup with Flexunit) Reverted one
change for function bindings to match Flex behaviour. Added consistency to
Swf default Label to match js and Flex (mx:Label)
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
The following commit(s) were added to refs/heads/develop by this push:
new 92e1055 This is easier: The same bindings unit test code can now be run in Flex via Flexunit and in Royale via RoyaleUnit. (Needs a local Flex app setup with Flexunit) Reverted one change for function bindings to match Flex behaviour. Added consistency to Swf default Label to match js and Flex (mx:Label)
92e1055 is described below
commit 92e1055c8bcd7ad96ff22d2d446de9b692361481
Author: greg-dove <gr...@gmail.com>
AuthorDate: Fri Mar 6 18:51:20 2020 +1300
This is easier: The same bindings unit test code can now be run in Flex via Flexunit and in Royale via RoyaleUnit. (Needs a local Flex app setup with Flexunit)
Reverted one change for function bindings to match Flex behaviour. Added consistency to Swf default Label to match js and Flex (mx:Label)
---
.../projects/BindingJS/src/test/royale/build.xml | 2 +-
.../projects/Basic/src/main/resources/defaults.css | 2 +-
.../apache/royale/html/beads/models/TextModel.as | 2 -
.../org/apache/royale/binding/PropertyWatcher.as | 18 +-
.../royale/FlexUnitRoyaleApplication-config.xml | 10 +
.../flexUnitTests/binding/BindableCoreTests.as | 295 ---------------------
.../flexUnitTests/binding/BindingCoreTests.as | 240 -----------------
.../BaseWithAccesorVariantsBindableClass.as | 93 -------
.../support/bindables/BaseWithBindableGetter.as | 69 -----
.../bindables/BaseWithGetterBindableClass.as | 42 ---
.../binding/support/bindables/BindableMxmlTest.as | 33 ---
.../binding/support/bindables/BindableSubVO1.as | 33 ---
.../binding/support/bindables/BindableSubVO2.as | 33 ---
.../binding/support/bindables/BindableSubVO3.as | 33 ---
.../bindables/BindableWithConstructorInit.as | 46 ----
.../bindables/ITaskVO.as} | 26 +-
.../bindables/{OneLayerBindable.as => TaskVO.as} | 64 ++++-
...oLayerBindable.as => TaskVO_on_top_of_class.as} | 59 ++++-
...yerBindable.as => TaskVO_on_top_of_property.as} | 68 ++++-
.../support/bindings/{ => flex}/DeepBindingsA.mxml | 23 +-
.../bindings/{ => flex}/FunctionBindingsA.mxml | 24 +-
.../bindings/{ => flex}/RendereBindingTestA.mxml | 19 +-
.../bindings/{ => flex}/SimpleBindingsA.mxml | 19 +-
.../bindings/{ => flex}/SimpleBindingsB.mxml | 22 +-
.../bindings/{ => royale}/DeepBindingsA.mxml | 0
.../bindings/{ => royale}/FunctionBindingsA.mxml | 1 +
.../FunctionBindingsA2.mxml} | 136 ++++------
.../bindings/{ => royale}/RendereBindingTestA.mxml | 5 +-
.../bindings/{ => royale}/SimpleBindingsA.mxml | 2 +
.../bindings/{ => royale}/SimpleBindingsB.mxml | 1 +
.../bindings/royale/TaskVOItemRenderer.mxml | 59 +++++
.../binding/utils/BindableTestUtil.as | 138 ----------
.../flexUnitTests/binding/utils/BindingTestUtil.as | 78 ------
.../flexunitcompatible/asserts/assertEquals.as} | 26 +-
.../flexunitcompatible/asserts/assertFalse.as} | 17 +-
.../flexunitcompatible/asserts/assertNotNull.as} | 18 +-
.../flexunitcompatible/asserts/assertNull.as} | 20 +-
.../asserts/assertStrictlyEquals.as} | 25 +-
.../flexunitcompatible/asserts/assertTrue.as} | 17 +-
.../flexunitcompatible/asserts/fail.as} | 18 +-
40 files changed, 430 insertions(+), 1406 deletions(-)
diff --git a/frameworks/js/projects/BindingJS/src/test/royale/build.xml b/frameworks/js/projects/BindingJS/src/test/royale/build.xml
index fece394..22221f6 100644
--- a/frameworks/js/projects/BindingJS/src/test/royale/build.xml
+++ b/frameworks/js/projects/BindingJS/src/test/royale/build.xml
@@ -135,7 +135,7 @@
into the file bundles.properties in this directory.
-->
<mxmlc fork="true"
- file="${basedir}/../../../../../../projects/Collections/src/test/royale/FlexUnitRoyaleApplication.mxml">
+ file="${basedir}/../../../../../../projects/Binding/src/test/royale/FlexUnitRoyaleApplication.mxml">
<jvmarg line="${mxmlc.jvm.args}"/>
<!--
<jvmarg value="-Xdebug" />
diff --git a/frameworks/projects/Basic/src/main/resources/defaults.css b/frameworks/projects/Basic/src/main/resources/defaults.css
index d3000f7..9903b7d 100644
--- a/frameworks/projects/Basic/src/main/resources/defaults.css
+++ b/frameworks/projects/Basic/src/main/resources/defaults.css
@@ -995,7 +995,7 @@ global
Label
{
- IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
+ IBeadModel: ClassReference("org.apache.royale.html.beads.models.NonNullTextModel");
IBeadView: ClassReference("org.apache.royale.html.beads.TextFieldView");
iMeasurementBead: ClassReference("org.apache.royale.html.beads.TextFieldLabelMeasurementBead");
}
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/TextModel.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/TextModel.as
index c2ccfb7..02ab36b 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/TextModel.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/TextModel.as
@@ -87,8 +87,6 @@ package org.apache.royale.html.beads.models
*/
public function set text(value:String):void
{
- if (value == null)
- value = "";
if (value != _text)
{
_text = value;
diff --git a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as
index 15c9a0d..e00536c 100644
--- a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as
+++ b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as
@@ -150,19 +150,17 @@ package org.apache.royale.binding
*/
protected function changeHandler(event:Event):void
{
- if (propertyName) {
- if (event is ValueChangeEvent)
- { //normally it is 'generic' ValueChangeEvent.VALUE_CHANGE, but it can be other types, eg. "currentStateChange", so check here:
- if (event.type == ValueChangeEvent.VALUE_CHANGE) {
- var propName:String = ValueChangeEvent(event).propertyName;
-
- if (propName != propertyName) {
- return;
- }
+ if (event is ValueChangeEvent)
+ { //normally it is 'generic' ValueChangeEvent.VALUE_CHANGE, but it can be other types, eg. "currentStateChange", so check here:
+ if (event.type == ValueChangeEvent.VALUE_CHANGE) {
+ var propName:String = ValueChangeEvent(event).propertyName;
+ if (propName != propertyName) {
+ return;
}
- //@todo investigate possible optimization here. We can assume we already know the new Value and old Value via the event.
+
}
+ //@todo investigate possible optimization here. We can assume we already know the new Value and old Value via the event.
}
wrapUpdate(updateProperty);
diff --git a/frameworks/projects/Binding/src/test/royale/FlexUnitRoyaleApplication-config.xml b/frameworks/projects/Binding/src/test/royale/FlexUnitRoyaleApplication-config.xml
index 6d2a736..e21baec 100644
--- a/frameworks/projects/Binding/src/test/royale/FlexUnitRoyaleApplication-config.xml
+++ b/frameworks/projects/Binding/src/test/royale/FlexUnitRoyaleApplication-config.xml
@@ -19,6 +19,16 @@
<royale-config>
<compiler>
+ <!-- these tests are designed to also work in Flex 4 with flexunit for comparisons/validation -->
+ <define append="true">
+ <name>COMPILE::Flex</name>
+ <value>false</value>
+ </define>
+ <define append="true">
+ <name>COMPILE::Royale</name>
+ <value>true</value>
+ </define>
+
<accessible>false</accessible>
<targets>
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/BindableCoreTests.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/BindableCoreTests.as
deleted file mode 100644
index 2c3a2ea..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/BindableCoreTests.as
+++ /dev/null
@@ -1,295 +0,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.
-// 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
-{
-
- import org.apache.royale.test.asserts.*;
- import flexUnitTests.binding.support.bindables.*;
- import flexUnitTests.binding.utils.BindableTestUtil;
-
- import org.apache.royale.events.IEventDispatcher;
- import org.apache.royale.events.ValueChangeEvent;
-
- /**
- * @royalesuppresspublicvarwarning
- */
- public class BindableCoreTests
- {
-
- public static var isJS:Boolean = COMPILE::JS;
-
- 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, ValueChangeEvent.VALUE_CHANGE);
-
- 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, ValueChangeEvent.VALUE_CHANGE);
-
- 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, ValueChangeEvent.VALUE_CHANGE);
-
- 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, ValueChangeEvent.VALUE_CHANGE);
-
- 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, ValueChangeEvent.VALUE_CHANGE);
- 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:org.apache.royale.events.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:org.apache.royale.events.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, ValueChangeEvent.VALUE_CHANGE);
-
- 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, ValueChangeEvent.VALUE_CHANGE);
- 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:org.apache.royale.events.Event(type="alternateChanged", bubbles=false, cancelable=false)\n' +
- '10:history:setting alternate value with explicit Bindable event , another new value for alternate\n' +
- '11:org.apache.royale.events.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:org.apache.royale.events.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:org.apache.royale.events.Event(type="alternate2Changed", bubbles=false, cancelable=false)';
-
-
-
- assertEquals(testUtil.getSequenceString(), expected, 'Unexpected results from changes to a "bindable"');
-
- testUtil.reset();
- }
-
- }
-}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/BindingCoreTests.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/BindingCoreTests.as
deleted file mode 100644
index 639c610..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/BindingCoreTests.as
+++ /dev/null
@@ -1,240 +0,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.
-// 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
-{
-
- import flexUnitTests.binding.support.bindings.SimpleBindingsA;
- import flexUnitTests.binding.support.bindings.SimpleBindingsB;
- import flexUnitTests.binding.support.bindings.FunctionBindingsA;
- import flexUnitTests.binding.support.bindings.DeepBindingsA;
-
- import flexUnitTests.binding.support.IBindingTest;
- import flexUnitTests.binding.utils.BindingTestUtil;
-
- import org.apache.royale.test.asserts.*;
- import flexUnitTests.binding.support.*;
- import org.apache.royale.html.Group;
-
-
- /**
- * @royalesuppresspublicvarwarning
- */
- public class BindingCoreTests
- {
-
- public static var isJS:Boolean = COMPILE::JS;
-
- [BeforeClass]
- public static function setUpBeforeClass():void
- {
- var testParent:Group = FlexUnitRoyaleApplication.getInstance().bindingsTestParent;
- BindingTestUtil.setTestParent(testParent)
- }
-
- [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 textfield
- 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);
- //this was failing in js before a change in Basic Label
- assertEquals(simpleBindings.getBindingResultValue(0), '', 'Bad null inbound value in simple text binding');
-
- simpleBindings.setInboundValue(undefined, 0);
- //this was failing in js before a change in Basic Label
- assertEquals(simpleBindings.getBindingResultValue(0), '', 'Bad null inbound value in simple text 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);
- assertEquals(funcBindings.getBindingResultValue(8), 'Internally true', 'Bad binding text value in function binding');
- assertEquals(funcBindings.getBindingResultValue(9), 'Internally true', '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 true', 'Bad binding text value in function binding');
- funcBindings.setInboundValue(true,13);
- assertEquals(funcBindings.getBindingResultValue(13), 'Internally true', '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 true', '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 true', '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), "Both are true", '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');
-
-
- }
-
-
- }
-}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithAccesorVariantsBindableClass.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithAccesorVariantsBindableClass.as
deleted file mode 100644
index 46bcba3..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithAccesorVariantsBindableClass.as
+++ /dev/null
@@ -1,93 +0,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.
-// 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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableGetter.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableGetter.as
deleted file mode 100644
index bd4bc1b..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableGetter.as
+++ /dev/null
@@ -1,69 +0,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.
-// 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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithGetterBindableClass.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithGetterBindableClass.as
deleted file mode 100644
index 8eedfae..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithGetterBindableClass.as
+++ /dev/null
@@ -1,42 +0,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.
-// 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;
-
- [Bindable]
- public class BaseWithGetterBindableClass
- {
- private var _accessorOfBaseWithGetterBindableClass:String = "accessorOfBaseWithGetterBindableClass_value";
-
-
- 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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableMxmlTest.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableMxmlTest.as
deleted file mode 100644
index d2e24b7..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableMxmlTest.as
+++ /dev/null
@@ -1,33 +0,0 @@
-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.
-// 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
-{
-
- public class BindableMxmlTest
- {
-
-
-
- [Bindable]
- public var fieldofBindableMxmlTest:String = "fieldofBindableMxmlTest_value";
-
-
-
- }
-}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO1.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO1.as
deleted file mode 100644
index d289fd1..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO1.as
+++ /dev/null
@@ -1,33 +0,0 @@
-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.
-// 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
-{
-
- public class BindableSubVO1 extends BaseWithBindableVar
- {
-
-
-
- [Bindable]
- public var fieldOfBindableSubVO1:String = "fieldOfBindableSubVO1_value";
-
-
-
- }
-}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO2.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO2.as
deleted file mode 100644
index 4ba6685..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO2.as
+++ /dev/null
@@ -1,33 +0,0 @@
-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.
-// 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
-{
-
- public class BindableSubVO2 extends UnbindableBase
- {
-
-
-
- [Bindable]
- public var fieldofBindableSubVO2:String = "fieldofBindableSubVO2_value";
-
-
-
- }
-}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO3.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO3.as
deleted file mode 100644
index 13db540..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO3.as
+++ /dev/null
@@ -1,33 +0,0 @@
-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.
-// 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
-{
-
- public class BindableSubVO3 extends UnbindableIntermediateVO
- {
-
-
-
- [Bindable]
- public var fieldofBindableSubVO3:String = "fieldofBindableSubVO3_value";
-
- [Bindable]
- public var rangeEnd:Object;
- }
-}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableWithConstructorInit.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableWithConstructorInit.as
deleted file mode 100644
index 2438b20..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableWithConstructorInit.as
+++ /dev/null
@@ -1,46 +0,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.
-// 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
-{
-
-
- [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 function equals( other:BindableWithConstructorInit ):Boolean
- {
- return ( this.ordinal == other.ordinal && this.value == other.value );
- }
- }
-
-}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/IBindingTest.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/ITaskVO.as
similarity index 67%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/IBindingTest.as
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/ITaskVO.as
index 26dd829..49ffd0b 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/IBindingTest.as
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/ITaskVO.as
@@ -16,13 +16,25 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support {
- public interface IBindingTest {
+package flexUnitTests.binding.support.bindings.bindables {
- function get testName():String;
- function get internalTestCount():uint;
- function setInboundValue(value:*, internalTestNum:uint=0):void
- function getBindingResultValue(internalTestNum:uint=0):*;
+ 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;
}
-}
\ No newline at end of file
+
+}
+
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO.as
similarity index 52%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
copy to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO.as
index 2812fb4..4b62a48 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO.as
@@ -18,23 +18,59 @@
////////////////////////////////////////////////////////////////////////////////
package flexUnitTests.binding.support.bindings.bindables
{
+ [Bindable]
+ public class TaskVO implements ITaskVO
+ {
+ public function TaskVO(label:String = null, data:String = null, tooltip:String = null)
+ {
-[Bindable]
-public class OneLayerBindable
-{
- public var bindableString:String;
-
- public var bindableNumber:Number;
+ 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 var bindableBoolean:Boolean;
+ private var _data:String;
- public function getSomething():String{
- return bindableBoolean ? 'Internally true' : 'Internally false';
- }
+ public function get data():String
+ {
+ return _data;
+ }
+
+ public function set data(value:String):void
+ {
+ _data = value;
+ }
+
+ private var _tooltip:String;
- public function getSomethingBasedOn(something:Boolean):String{
- return bindableBoolean && something ? "Both are true" : (bindableBoolean ? "Local only" : "Inbound only");
- }
+ 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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TwoLayerBindable.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_class.as
similarity index 51%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TwoLayerBindable.as
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_class.as
index ab7ee35..abb8002 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TwoLayerBindable.as
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_class.as
@@ -18,12 +18,59 @@
////////////////////////////////////////////////////////////////////////////////
package flexUnitTests.binding.support.bindings.bindables
{
+ [Bindable]
+ public class TaskVO_on_top_of_class implements ITaskVO
+ {
+ public function DominoPartitionTaskVO(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;
+ }
-[Bindable]
-public class TwoLayerBindable
-{
- public var bindableOne:OneLayerBindable;
+ 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;
+ }
- public var toggle:Boolean;
-}
+ 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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_property.as
similarity index 50%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_property.as
index 2812fb4..5ae4327 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TaskVO_on_top_of_property.as
@@ -18,23 +18,63 @@
////////////////////////////////////////////////////////////////////////////////
package flexUnitTests.binding.support.bindings.bindables
{
+ public class TaskVO_on_top_of_property implements ITaskVO
+ {
+ public function DominoPartitionTaskVO(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;
+ }
-[Bindable]
-public class OneLayerBindable
-{
- public var bindableString:String;
-
- public var bindableNumber:Number;
+ private var _data:String;
- public var bindableBoolean:Boolean;
+ [Bindable]
+ public function get data():String
+ {
+ return _data;
+ }
+
+ public function set data(value:String):void
+ {
+ _data = value;
+ }
+
+ private var _tooltip:String;
- public function getSomething():String{
- return bindableBoolean ? 'Internally true' : 'Internally false';
- }
+ [Bindable]
+ public function get tooltip():String
+ {
+ return _tooltip;
+ }
+
+ public function set tooltip(value:String):void
+ {
+ _tooltip = value;
+ }
- public function getSomethingBasedOn(something:Boolean):String{
- return bindableBoolean && something ? "Both are true" : (bindableBoolean ? "Local only" : "Inbound only");
- }
-}
+ 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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/DeepBindingsA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/DeepBindingsA.mxml
similarity index 90%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/DeepBindingsA.mxml
copy to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/DeepBindingsA.mxml
index 408ab2d..cfc54c6 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/DeepBindingsA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/DeepBindingsA.mxml
@@ -17,11 +17,12 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
implements="flexUnitTests.binding.support.IBindingTest"
- xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
- initComplete="initCompleteHandler()">
+ initialize="initCompleteHandler()">
<fx:Declarations>
@@ -39,14 +40,12 @@ limitations under the License.
<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;
+ import flash.utils.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
@@ -148,12 +147,10 @@ limitations under the License.
]]>
</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>
+ <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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/FunctionBindingsA.mxml
similarity index 93%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml
copy to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/FunctionBindingsA.mxml
index ddf3652..79e379b 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/FunctionBindingsA.mxml
@@ -17,11 +17,12 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
implements="flexUnitTests.binding.support.IBindingTest"
- xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
- initComplete="initCompleteHandler()">
+ initialize="initCompleteHandler()">
<fx:Declarations>
@@ -49,11 +50,9 @@ limitations under the License.
<fx:Script>
<![CDATA[
+ import flash.utils.getQualifiedClassName;
-
-
- import org.apache.royale.reflection.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
@@ -273,12 +272,9 @@ limitations under the License.
]]>
</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>
+ <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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/RendereBindingTestA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/RendereBindingTestA.mxml
similarity index 89%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/RendereBindingTestA.mxml
copy to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/RendereBindingTestA.mxml
index 1527480..f870fc5 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/RendereBindingTestA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/RendereBindingTestA.mxml
@@ -17,17 +17,16 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+<s: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.*"
- xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
- initComplete="initCompleteHandler()">
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ initialize="initCompleteHandler()">
<fx:Script>
<![CDATA[
- import org.apache.royale.reflection.getQualifiedClassName;
+ import flash.utils.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
@@ -127,9 +126,7 @@ limitations under the License.
]]>
</fx:Script>
- <js:beads>
- <js:ContainerDataBinding/>
- </js:beads>
- <bindings:PartiionRequestTaskItemRenderer locald="'testRenderer" />
-</js:HGroup>
+
+ <!--<bindings:PartiionRequestTaskItemRenderer locald="'testRenderer" />-->
+</s:HGroup>
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsA.mxml
similarity index 83%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsA.mxml
copy to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsA.mxml
index 7b0b3a9..d5f1e04 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsA.mxml
@@ -17,15 +17,16 @@ 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()">
+<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 org.apache.royale.reflection.getQualifiedClassName;
+ import flash.utils.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
@@ -73,10 +74,8 @@ limitations under the License.
]]>
</fx:Script>
- <js:beads>
- <js:ContainerDataBinding/>
- </js:beads>
- <js:Label localId="testLabel" text="{labelText}" />
-</js:HGroup>
+ <mx:Label id="testLabel" text="{labelText}" />
+
+</s:HGroup>
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsB.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsB.mxml
similarity index 92%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsB.mxml
copy to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsB.mxml
index 021d9d6..a3ab5df 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsB.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/flex/SimpleBindingsB.mxml
@@ -17,12 +17,12 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<js:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
+<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:js="library://ns.apache.org/royale/basic"
xmlns:bindables="flexUnitTests.binding.support.bindings.bindables.*"
- initComplete="initCompleteHandler()">
-
+ initialize="initCompleteHandler()">
<fx:Declarations>
<bindables:OneLayerBindable id="bindable1" />
@@ -44,7 +44,7 @@ limitations under the License.
<fx:Script>
<![CDATA[
- import org.apache.royale.reflection.getQualifiedClassName;
+ import flash.utils.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
@@ -162,12 +162,8 @@ limitations under the License.
]]>
</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}" />
+ <mx:Label id="testLabel1" text="{bindable1.bindableString}" />
+ <mx:Label id="testLabel2" text="{bindable1.bindableNumber}" />
+ <mx:Label id="testLabel3" text="{bindable1.bindableBoolean}" />
-</js:HGroup>
+</s:HGroup>
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/DeepBindingsA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/DeepBindingsA.mxml
similarity index 100%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/DeepBindingsA.mxml
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/DeepBindingsA.mxml
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA.mxml
similarity index 99%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml
copy to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA.mxml
index ddf3652..9148b04 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA.mxml
@@ -60,6 +60,7 @@ limitations under the License.
return getQualifiedClassName(this);
}
+
public function get internalTestCount():uint {
return getTests().length;
}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA2.mxml
similarity index 64%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA2.mxml
index ddf3652..4e9b107 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/FunctionBindingsA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/FunctionBindingsA2.mxml
@@ -33,15 +33,15 @@ limitations under the License.
</bindables:TwoLayerBindable>
<fx:Object id="destinationObject"
something="true"
- destString="{bindable1.getSomething()}"
- altString="{bindable1.getSomethingBasedOn(bindable2.toggle)}"
+
+
>
- <fx:sub>
+ <!--<fx:sub>
<fx:Object deepLowerLevelString0="{bindable1.getSomething()}"
deepLowerLevelString1="{bindable2.bindableOne.getSomething()}"
- deepLowerLevelString2="{bindable2.bindableOne.getSomethingBasedOn(bindable2.toggle)}"
+
/>
- </fx:sub>
+ </fx:sub>-->
</fx:Object>
@@ -51,15 +51,21 @@ limitations under the License.
-
-
- import org.apache.royale.reflection.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
-
- return getQualifiedClassName(this);
+ //import org.apache.royale.reflection.getQualifiedClassName;
+ //return getQualifiedClassName(this);
+ COMPILE::SWF{
+ import flash.utils.qetQualifiedClassName;
+ return qetQualifiedClassName(this).split("::").join(".");
+ }
+ COMPILE::JS{
+ import flash.utils.qetQualifiedClassName;
+ return this.ROYALE_CLASS_INFO.names[0].qName;
+ }
}
+
public function get internalTestCount():uint {
return getTests().length;
}
@@ -84,20 +90,6 @@ limitations under the License.
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 {
@@ -152,9 +144,8 @@ limitations under the License.
'getVal': function ():* {
return destinationObject.sub.deepLowerLevelString1
}
- }
- ,
- { //test 6String
+ },
+ { //test 6 String
'setVal': function (value:*):void {
//do nothing
},
@@ -164,100 +155,65 @@ limitations under the License.
},
{ //test 7 String
'setVal': function (value:*):void {
- bindable1.bindableBoolean = value;
+ bindable1.bindableBoolean = true;
},
'getVal': function ():* {
return destinationObject.sub.deepLowerLevelString2
}
- },
-//now actually do some change based testing
- { //test 8 String
+ }
+
+
+
+ /* ,
+ { //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 {
- bindable1.bindableBoolean = value;
+ destinationObject.sub.somelongname = value
},
'getVal': function ():* {
- return destinationObject.destString;
+ return destinationObject.sub.somelongname;
}
},
- { //test 9 String
+ { //test 3 Codegen test only. Testing a compiler-jx fix for fx:Object output for the above definition (release mode)
'setVal': function (value:*):void {
- bindable1.bindableBoolean = value;
+ destinationObject.other.bindableString = value
},
'getVal': function ():* {
- return testLabel1.text;
+ return destinationObject.other.bindableString;
}
},
- { //test 10 String
+ { //test 4 Binding test
'setVal': function (value:*):void {
- bindable2.toggle = value;
+ bindable1.bindableNumber = value
},
'getVal': function ():* {
- return destinationObject.altString;
+ return destinationObject.destNumber;
}
},
- { //test 11 String
+ { //test 5 Binding test
'setVal': function (value:*):void {
- bindable2.toggle = value;
+ bindable1.bindableNumber = 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
+ { //test 5 Binding test
'setVal': function (value:*):void {
- bindable2.bindableOne.bindableBoolean = value;
- bindable2.toggle = value;
+ bindable1.bindableNumber = value
},
'getVal': function ():* {
- return destinationObject.sub.deepLowerLevelString2
+ return destinationObject.destNumber;
}
},
- { //test 17 String
+ { //test 6 Binding test
'setVal': function (value:*):void {
- bindable2.bindableOne.bindableBoolean = value;
- bindable2.toggle = value;
+ bindable1.bindableNumber = value
},
'getVal': function ():* {
- return testLabel4.text;
+ return destinationObject.sub.lowerLevelNumDest;
}
- }
-
-
+ }*/
]
}
return _tests;
@@ -277,8 +233,8 @@ limitations under the License.
<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:Label localId="testLabel1" text="" />
+ <js:Label localId="testLabel2" text="" />
+ <!--<js:Label localId="testLabel3" text="{bindable2.bindableOne.getSomething()}" />
+ <js:Label localId="testLabel4" text="{bindable2.bindableOne.getSomething()}" />-->
</js:HGroup>
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/RendereBindingTestA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/RendereBindingTestA.mxml
similarity index 99%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/RendereBindingTestA.mxml
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/RendereBindingTestA.mxml
index 1527480..68115c5 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/RendereBindingTestA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/RendereBindingTestA.mxml
@@ -27,14 +27,15 @@ limitations under the License.
<fx:Script>
<![CDATA[
- import org.apache.royale.reflection.getQualifiedClassName;
+
+ import org.apache.royale.reflection.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
+
return getQualifiedClassName(this);
}
-
public function get internalTestCount():uint {
return getTests().length;
}
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsA.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsA.mxml
similarity index 99%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsA.mxml
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsA.mxml
index 7b0b3a9..e0ade61 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsA.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsA.mxml
@@ -25,6 +25,8 @@ limitations under the License.
<fx:Script>
<![CDATA[
+
+
import org.apache.royale.reflection.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsB.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsB.mxml
similarity index 99%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsB.mxml
rename to frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsB.mxml
index 021d9d6..9f41ce3 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/SimpleBindingsB.mxml
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/SimpleBindingsB.mxml
@@ -44,6 +44,7 @@ limitations under the License.
<fx:Script>
<![CDATA[
+
import org.apache.royale.reflection.getQualifiedClassName;
//IBindingTest methods
public function get testName():String {
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/TaskVOItemRenderer.mxml b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/TaskVOItemRenderer.mxml
new file mode 100644
index 0000000..33374a1
--- /dev/null
+++ b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/royale/TaskVOItemRenderer.mxml
@@ -0,0 +1,59 @@
+<?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:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:j="library://ns.apache.org/royale/jewel"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:html="library://ns.apache.org/royale/html"
+ xmlns="http://www.w3.org/1999/xhtml"
+ selectable="false" hoverable="false">
+ <js:style>
+ <js:AllCSSStyles paddingLeft="0" borderTop="1px solid #CCCCCC"/>
+ </js:style>
+ <js:beads>
+ <js:ItemRendererDataBinding />
+ </js: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"
+ itemsVerticalAlign="itemsCentered" itemsExpand="true" gap="2">
+ <js:CheckBox text="{partitionTaskVo.label + ' - ' + partitionTaskVo.tooltip}" change="onSelectionChanged(event)"
+ percentWidth="100"/>
+ </js:HGroup>
+</js:ListItemRenderer>
\ No newline at end of file
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindableTestUtil.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindableTestUtil.as
deleted file mode 100644
index d222414..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindableTestUtil.as
+++ /dev/null
@@ -1,138 +0,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.
-// 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 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 {
-
- 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(' , '));
- }
-
- public function addStacktrace():void{
- if (deactivated) return;
- var stack:String;
- COMPILE::SWF{
- stack = new Error().getStackTrace();
-
- }
- COMPILE::JS{
- stack = new Error().stack;
- }
- //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 ValueChangeEvent) {
- var vce:ValueChangeEvent = ValueChangeEvent(event);
- _history.push('ValueChangeEvent::property('+ vce.propertyName+'), oldVal:('+ vce.oldValue+ "), newValue:("+ vce.newValue+")");
- } else {
-
- _history.push(getQualifiedClassName(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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindingTestUtil.as b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindingTestUtil.as
deleted file mode 100644
index ccf7702..0000000
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindingTestUtil.as
+++ /dev/null
@@ -1,78 +0,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.
-// 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 org.apache.royale.core.UIBase;
-
- /**
- * @royalesuppresspublicvarwarning
- */
- public class BindingTestUtil
- {
- private static var _testParent:UIBase;
- private static var _testClasses:Array = [];
- private static var _testInstances:Array = [];
-
- public static function setTestParent(testParent:UIBase):void{
- _testParent = testParent;
- }
-
- public static function createAndAddInstance(instanceClass:Class):UIBase{
- var inst:UIBase;
- 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 UIBase;
- if (!inst) {
- throw new Error('bad mxml instance class');
- }
- _testInstances.push(inst);
- _testParent.addElement(inst);
- /*} else {
- throw new Error('duplicate test class');
- }*/
- } else {
- throw new Error('instanceClass must not be null');
- }
-
- return inst;
- }
-
- public static function removeInstance(instance:Object):void{
- if (instance is UIBase){
- if (UIBase(instance).parent) {
- UIBase(instance.parent).removeElement(instance as UIBase);
- }
- }
- 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/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertEquals.as
similarity index 70%
copy from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
copy to frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertEquals.as
index f931a77..5ec2650 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
+++ b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertEquals.as
@@ -16,23 +16,19 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support.bindables
+package royale.flexunitcompatible.asserts
{
+ import org.flexunit.Assert;
- public class BindableSetterVO
+ /**
+ * Flexunit for Flex4 support for running the same tests in Flex
+ * Alias for org.apache.royale.test.Assert assertEquals method
+ */
+ public function assertEquals(actual:*, expected:*, message:String = null):void
{
- private var _fieldOfBindableSetterVO:String = "fieldOfBindableSetterVO_value";
-
- public function get fieldOfBindableSetterVO():String
- {
- return _fieldOfBindableSetterVO;
+ if (message) {
+ Assert.assertEquals(message, actual, expected);
}
-
- [Bindable]
- public function set fieldOfBindableSetterVO(value:String):void
- {
- _fieldOfBindableSetterVO = value;
- }
-
+ else Assert.assertEquals(actual, expected);
}
-}
+}
\ No newline at end of file
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertFalse.as
similarity index 72%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
rename to frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertFalse.as
index ad7823b..52730f8 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
+++ b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertFalse.as
@@ -16,13 +16,18 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support.bindables
+package royale.flexunitcompatible.asserts
{
+ import org.flexunit.Assert;
- public class BaseWithBindableVar
+ /**
+ * Flexunit for Flex4 support for running the same tests in Flex
+ * Alias for org.apache.royale.test.Assert assertFalse method
+ */
+ public function assertFalse(condition:*, message:String = null):void
{
- [Bindable]
- public var bindableVarOfBaseWithBindableVar:String = "bindableVarOfBaseWithBindableVar_value";
-
+ if (message)
+ Assert.assertFalse(message, condition );
+ else Assert.assertFalse( condition );
}
-}
+}
\ No newline at end of file
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertNotNull.as
similarity index 72%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
rename to frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertNotNull.as
index f3b5066..ea34acc 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
+++ b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertNotNull.as
@@ -16,14 +16,18 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support.bindables
+package royale.flexunitcompatible.asserts
{
+ import org.flexunit.Assert;
- public class BaseWithBindableAndUnbindableVars
+ /**
+ * Flexunit for Flex4 support for running the same tests in Flex
+ * Alias for org.apache.royale.test.Assert assertNotNull method
+ */
+ public function assertNotNull(value:*, message:String = null):void
{
- [Bindable]
- public var bindableVarOfBaseWithBindableAndUnbindableVars:String = "bindableVarOfBaseWithBindableAndUnbindableVars_value";
-
- public var unbindableVarOfBaseWithBindableAndUnbindableVars:String = "unbindableVarOfBaseWithBindableAndUnbindableVars_value";
+ if (message)
+ Assert.assertNotNull(message, value );
+ else Assert.assertNotNull( value );
}
-}
+}
\ No newline at end of file
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertNull.as
similarity index 73%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as
rename to frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertNull.as
index be38204..040be81 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as
+++ b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertNull.as
@@ -16,16 +16,18 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support.bindables
+package royale.flexunitcompatible.asserts
{
+ import org.flexunit.Assert;
- public class UnbindableBase
+ /**
+ * Flexunit for Flex4 support for running the same tests in Flex
+ * Alias for org.apache.royale.test.Assert assertNull method
+ */
+ public function assertNull(value:*, message:String = null):void
{
-
-
-
- public var fieldOfUnbindableBaseVO:String = "fieldOfUnbindableBaseVO_value";
-
-
+ if (message)
+ Assert.assertNull(message, value );
+ else Assert.assertNull( value );
}
-}
+}
\ No newline at end of file
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertStrictlyEquals.as
similarity index 69%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
rename to frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertStrictlyEquals.as
index f931a77..72d3d98 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
+++ b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertStrictlyEquals.as
@@ -16,23 +16,20 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support.bindables
+package royale.flexunitcompatible.asserts
{
+ import org.flexunit.Assert;
- public class BindableSetterVO
+ /**
+ * Flexunit for Flex4 support for running the same tests in Flex
+ * Alias for org.apache.royale.test.Assert assertStrictlyEquals method
+ */
+ public function assertStrictlyEquals(actual:*, expected:*, message:String = null):void
{
- private var _fieldOfBindableSetterVO:String = "fieldOfBindableSetterVO_value";
-
- public function get fieldOfBindableSetterVO():String
- {
- return _fieldOfBindableSetterVO;
- }
-
- [Bindable]
- public function set fieldOfBindableSetterVO(value:String):void
- {
- _fieldOfBindableSetterVO = value;
+ if (message) {
+ Assert.assertStrictlyEquals(message, actual, expected);
}
+ else Assert.assertStrictlyEquals(actual, expected);
}
-}
+}
\ No newline at end of file
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertTrue.as
similarity index 72%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
rename to frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertTrue.as
index 4ebb202..fe2b2c0 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
+++ b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/assertTrue.as
@@ -16,12 +16,19 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support.bindables
+package royale.flexunitcompatible.asserts
{
+import org.flexunit.Assert;
- [Bindable]
- public class BaseWithBindableClass
+ /**
+ * Flexunit for Flex4 support for running the same tests in Flex
+ * Alias for org.apache.royale.test.Assert assertTrue method
+ */
+ public function assertTrue(condition:*, message:String = null):void
{
- public var varOfBaseWithBindableClass:String = "varOfBaseWithBindableClass_value";
+ if (message) {
+ Assert.assertTrue(message,condition);
+ }
+ else Assert.assertTrue(condition);
}
-}
+}
\ No newline at end of file
diff --git a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/fail.as
similarity index 77%
rename from frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
rename to frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/fail.as
index 33e13e6..f62129a 100644
--- a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
+++ b/frameworks/projects/Binding/src/test/royale/royale/flexunitcompatible/asserts/fail.as
@@ -16,16 +16,16 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests.binding.support.bindables
+package royale.flexunitcompatible.asserts
{
+ import org.flexunit.Assert;
- public class UnbindableIntermediateVO extends BaseWithBindableVar
+ /**
+ * Flexunit for Flex4 support for running the same tests in Flex
+ * Alias for org.apache.royale.test.Assert fail method
+ */
+ public function fail(message:String = null):void
{
-
-
-
- public var fieldOfUnbindableIntermediateVO:String = "fieldOfUnbindableIntermediateVO_value";
-
-
+ Assert.fail(message);
}
-}
+}
\ No newline at end of file