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 260b48f  Oops. files got removed and then not added back in git.
260b48f is described below

commit 260b48f0bc9a4b804436ee4958cdb82af154a278
Author: greg-dove <[email protected]>
AuthorDate: Fri Mar 6 20:32:38 2020 +1300

    Oops. files got removed and then not added back in git.
---
 .../flexUnitTests/binding/support/IBindingTest.as  |  28 +++
 .../BaseWithAccesorVariantsBindableClass.as        |  93 ++++++++++
 .../bindables/BaseWithBindableAndUnbindableVars.as |  29 ++++
 .../support/bindables/BaseWithBindableClass.as     |  27 +++
 .../support/bindables/BaseWithBindableGetter.as    |  69 ++++++++
 .../support/bindables/BaseWithBindableVar.as       |  28 +++
 .../bindables/BaseWithGetterBindableClass.as       |  42 +++++
 .../binding/support/bindables/BindableMxmlTest.as  |  33 ++++
 .../binding/support/bindables/BindableSetterVO.as  |  38 +++++
 .../binding/support/bindables/BindableSubVO1.as    |  33 ++++
 .../binding/support/bindables/BindableSubVO2.as    |  33 ++++
 .../binding/support/bindables/BindableSubVO3.as    |  33 ++++
 .../bindables/BindableWithConstructorInit.as       |  46 +++++
 .../binding/support/bindables/UnbindableBase.as    |  31 ++++
 .../support/bindables/UnbindableIntermediateVO.as  |  31 ++++
 .../support/bindings/bindables/OneLayerBindable.as |  40 +++++
 .../support/bindings/bindables/TwoLayerBindable.as |  29 ++++
 .../binding/utils/BindableTestUtil.as              | 190 +++++++++++++++++++++
 .../flexUnitTests/binding/utils/BindingTestUtil.as |  84 +++++++++
 19 files changed, 937 insertions(+)

diff --git 
a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/IBindingTest.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/IBindingTest.as
new file mode 100644
index 0000000..26dd829
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/IBindingTest.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 {
+    public interface IBindingTest {
+
+        function get testName():String;
+        function get internalTestCount():uint;
+        function setInboundValue(value:*, internalTestNum:uint=0):void
+        function getBindingResultValue(internalTestNum:uint=0):*;
+
+    }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..46bcba3
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithAccesorVariantsBindableClass.as
@@ -0,0 +1,93 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.binding.support.bindables
+{
+       import flexUnitTests.binding.utils.BindableTestUtil;
+       import org.apache.royale.events.Event;
+       import org.apache.royale.events.IEventDispatcher;
+
+       [Bindable]
+       public class BaseWithAccesorVariantsBindableClass
+       {
+               private var 
_accessorOfBaseWithAccesorVariantsBindableClass:String = 
"BaseWithAccessorVariantsBindableClass_value";
+               private var _alternate:String = 'alternate_value';
+
+               public function get 
accessorOfBaseWithAccesorVariantsBindableClass():String
+               {
+                       BindableTestUtil.instance.addHistoryItem('accessing 
value from original getter', _accessorOfBaseWithAccesorVariantsBindableClass);
+                       return _accessorOfBaseWithAccesorVariantsBindableClass;
+               }
+               
+               public function set 
accessorOfBaseWithAccesorVariantsBindableClass(value:String):void
+               {
+                       BindableTestUtil.instance.addHistoryItem('assigning 
value in original setter', value);
+                       _accessorOfBaseWithAccesorVariantsBindableClass = value;
+               }
+               
+               private var _setterOnly:String;
+               public function set setterOnly(value:String):void{
+                       BindableTestUtil.instance.addHistoryItem('setting non 
bindable setterOnly', value);
+                       _setterOnly = value;
+               }
+
+
+               public function get getterOnly():String{
+                       BindableTestUtil.instance.addHistoryItem('getting non 
bindable getterOnly', 'getterOnly');
+                       return 'getterOnly';
+               }
+               
+               [Bindable('alternateChanged')]
+               public function get alternate():String{
+                       BindableTestUtil.instance.addHistoryItem('getting 
alternate value with explicit Bindable event', _alternate);
+                       return _alternate
+               }
+
+               public function set alternate(value:String):void{
+                       BindableTestUtil.instance.addHistoryItem('setting 
alternate value with explicit Bindable event', value);
+                       var dispatch:Boolean = value != _alternate;
+                       _alternate = value;
+                       if (dispatch) {
+                               (this as IEventDispatcher).dispatchEvent(new 
Event('alternateChanged'));
+                       }
+               }
+
+
+               private var _alternate2:String = 'alternate2_value';
+               [Bindable]
+               public function get alternate2():String{
+                       BindableTestUtil.instance.addHistoryItem('getting 
alternate2 value with both types of Bindable event', _alternate2);
+                       return _alternate2
+               }
+
+               [Bindable('alternate2Changed')]
+               public function set alternate2(value:String):void{
+                       BindableTestUtil.instance.addHistoryItem('setting 
alternate2 value with both types of Bindable event', value);
+                       var dispatch:Boolean = value != _alternate2;
+                       _alternate2 = value;
+                       if (dispatch) {
+                               (this as IEventDispatcher).dispatchEvent(new 
Event('alternate2Changed'));
+                       }
+               }
+
+               //this should get normal [Bindable] treatment from the class 
[Bindable] meta (because it is a variable):
+               [Bindable('somethingChanged')]
+               public var something:String;
+               
+       }
+}
diff --git 
a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
new file mode 100644
index 0000000..f3b5066
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableAndUnbindableVars.as
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 BaseWithBindableAndUnbindableVars
+       {
+                       [Bindable]
+                       public var 
bindableVarOfBaseWithBindableAndUnbindableVars:String = 
"bindableVarOfBaseWithBindableAndUnbindableVars_value";
+
+                       public var 
unbindableVarOfBaseWithBindableAndUnbindableVars:String = 
"unbindableVarOfBaseWithBindableAndUnbindableVars_value";
+       }
+}
diff --git 
a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
new file mode 100644
index 0000000..4ebb202
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableClass.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 BaseWithBindableClass
+       {
+               public var varOfBaseWithBindableClass:String = 
"varOfBaseWithBindableClass_value";
+       }
+}
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
new file mode 100644
index 0000000..bd4bc1b
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableGetter.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.binding.support.bindables
+{
+       import flexUnitTests.binding.utils.BindableTestUtil;
+       
+       import org.apache.royale.events.Event;
+       import org.apache.royale.events.IEventDispatcher;
+
+       public class BaseWithBindableGetter
+       {
+               private var _accessorOfBaseWithBindableGetter:String = 
"accessorOfBaseWithBindableGetter_value";
+               
+               [Bindable]
+               public function get accessorOfBaseWithBindableGetter():String
+               {
+                       BindableTestUtil.instance.addHistoryItem('accessing 
value from original getter', _accessorOfBaseWithBindableGetter);
+                       return _accessorOfBaseWithBindableGetter;
+               }
+               
+               public function set 
accessorOfBaseWithBindableGetter(value:String):void
+               {
+                       BindableTestUtil.instance.addHistoryItem('assigning 
value in original setter', value);
+                       _accessorOfBaseWithBindableGetter = value;
+               }
+
+               private var _accessorOfBaseWithBindableGetter2:String = 
'_accessorOfBaseWithBindableGetter2_value';
+
+               //this has at least one [Bindable] so should code-gen Bindable 
code
+               [Bindable]
+               [Bindable(event='testEvent')]
+               public function get accessorOfBaseWithBindableGetter2():String
+               {
+                       BindableTestUtil.instance.addHistoryItem('accessing 
value from original getter', _accessorOfBaseWithBindableGetter2);
+                       return _accessorOfBaseWithBindableGetter2;
+               }
+
+               public function set 
accessorOfBaseWithBindableGetter2(value:String):void
+               {
+                       BindableTestUtil.instance.addHistoryItem('assigning 
value in original setter', value);
+                       if (value != _accessorOfBaseWithBindableGetter2) {
+                               _accessorOfBaseWithBindableGetter2 = value;
+                               IEventDispatcher(this).dispatchEvent(new 
Event('testEvent'));
+                       }
+
+               }
+
+               //this should be ignored, because this class itself is not 
marked [Bindable]
+               [Bindable('somethingChanged')]
+               public var something:String;
+
+       }
+}
diff --git 
a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
new file mode 100644
index 0000000..ad7823b
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithBindableVar.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 BaseWithBindableVar
+       {
+                       [Bindable]
+                       public var bindableVarOfBaseWithBindableVar:String = 
"bindableVarOfBaseWithBindableVar_value";
+
+       }
+}
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
new file mode 100644
index 0000000..a692780
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BaseWithGetterBindableClass.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
new file mode 100644
index 0000000..d2e24b7
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableMxmlTest.as
@@ -0,0 +1,33 @@
+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/BindableSetterVO.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
new file mode 100644
index 0000000..f931a77
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSetterVO.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 BindableSetterVO
+       {
+               private var _fieldOfBindableSetterVO:String = 
"fieldOfBindableSetterVO_value";
+               
+               public function get fieldOfBindableSetterVO():String
+               {
+                       return _fieldOfBindableSetterVO;
+               }
+               
+               [Bindable]
+               public function set fieldOfBindableSetterVO(value:String):void
+               {
+                       _fieldOfBindableSetterVO = 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
new file mode 100644
index 0000000..d289fd1
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO1.as
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 0000000..4ba6685
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO2.as
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 0000000..13db540
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableSubVO3.as
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 0000000..2438b20
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/BindableWithConstructorInit.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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/bindables/UnbindableBase.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as
new file mode 100644
index 0000000..be38204
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableBase.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 UnbindableBase
+       {
+                       
+
+                       
+                       public var fieldOfUnbindableBaseVO:String = 
"fieldOfUnbindableBaseVO_value";
+                       
+
+       }
+}
diff --git 
a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
new file mode 100644
index 0000000..33e13e6
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindables/UnbindableIntermediateVO.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 UnbindableIntermediateVO extends BaseWithBindableVar
+       {
+                       
+
+                       
+                       public var fieldOfUnbindableIntermediateVO:String = 
"fieldOfUnbindableIntermediateVO_value";
+                       
+
+       }
+}
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/OneLayerBindable.as
new file mode 100644
index 0000000..2812fb4
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/OneLayerBindable.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.binding.support.bindings.bindables
+{
+
+[Bindable]
+public class OneLayerBindable
+{
+    public var bindableString:String;
+
+    public var bindableNumber:Number;
+
+    public var bindableBoolean:Boolean;
+
+    public function getSomething():String{
+        return bindableBoolean ? 'Internally true' : 'Internally false';
+    }
+
+    public function getSomethingBasedOn(something:Boolean):String{
+        return bindableBoolean && something ? "Both are true" : 
(bindableBoolean ? "Local only" : "Inbound only");
+    }
+
+}
+}
\ 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/TwoLayerBindable.as
new file mode 100644
index 0000000..ab7ee35
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/support/bindings/bindables/TwoLayerBindable.as
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.binding.support.bindings.bindables
+{
+
+[Bindable]
+public class TwoLayerBindable
+{
+    public var bindableOne:OneLayerBindable;
+
+    public var toggle:Boolean;
+}
+}
\ 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
new file mode 100644
index 0000000..5d2abcb
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindableTestUtil.as
@@ -0,0 +1,190 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.binding.utils {
+import testshim.RoyaleUnitTestRunner;
+
+
+COMPILE::Flex{
+    import flash.events.Event;
+    import flash.events.IEventDispatcher;
+    import mx.events.PropertyChangeEvent;
+    import flash.utils.getQualifiedClassName;
+}
+COMPILE::Royale{
+    import org.apache.royale.events.Event;
+    import org.apache.royale.events.IEventDispatcher;
+    import org.apache.royale.events.ValueChangeEvent;
+    import org.apache.royale.reflection.getQualifiedClassName;
+}
+
+public class BindableTestUtil {
+
+    COMPILE::Flex
+    public static const VALUE_CHANGE_EVENT:String = "propertyChange";
+
+    COMPILE::Royale
+    public static const VALUE_CHANGE_EVENT:String = "valueChange";
+
+
+    private static function getBaseEventName(event:Event):String{
+        var name:String = getQualifiedClassName(event);
+        name = name.split('::').join('.'); //in flex
+        name = name.split('.').pop();
+        return name;
+    }
+
+    private static function getValueChangeDescription(event:Event):String{
+        var desc:String;
+        COMPILE::Flex{
+            var vce:PropertyChangeEvent = PropertyChangeEvent(event);
+            desc = 'ValueChangeEvent::property('+ vce.property+'), oldVal:('+ 
vce.oldValue+ "), newValue:("+ vce.newValue+")";
+        }
+        COMPILE::Royale{
+            var vce:ValueChangeEvent = ValueChangeEvent(event);
+            desc = 'ValueChangeEvent::property('+ vce.propertyName+'), 
oldVal:('+ vce.oldValue+ "), newValue:("+ vce.newValue+")";
+        }
+        return desc;
+    }
+
+    COMPILE::Flex
+    private static const VALUECHANGE_EVENT_CLASS:Class = PropertyChangeEvent;
+    COMPILE::Royale
+    private static const VALUECHANGE_EVENT_CLASS:Class = ValueChangeEvent;
+
+    public static var deactivated:Boolean;
+
+    private static var _unlocked:Boolean;
+    private static var _instance:BindableTestUtil;
+    public static function get instance():BindableTestUtil{
+        if (!_instance) {
+            _unlocked = true;
+            _instance = new BindableTestUtil();
+            _unlocked = false;
+        }
+        return _instance;
+    }
+
+    private var _history:Array= [];
+
+
+    public function BindableTestUtil() {
+        if (!_unlocked) throw new Error("Singleton only, access view 
BindableTestUtil.instance");
+    }
+
+
+    public function reset():void{
+        _history= [];
+        for (var eventType:String in listening) {
+            var arr:Array = listening[eventType];
+            for (var i:int=0; i<arr.length; i++) {
+                var dispatcher:IEventDispatcher = arr[i];
+                dispatcher.removeEventListener(eventType, addEventItem);
+            }
+        }
+        listening = {};
+    }
+
+    public function getContents():Array{
+        return _history.slice();
+    }
+
+    public function getSequenceString():String{
+        var temp:Array = _history.slice();
+        temp = temp.map(function(val:*, index:int, arr:Array):*{
+            return index + ":" + val;
+        });
+        return temp.join("\n");
+    }
+
+    public function addHistoryItem(...rest):void{
+        if (deactivated) return;
+        var contents:Array = rest;
+        contents = contents.map(
+                function(value:*, index:int, arr:Array):*{
+                    if (value === null) return 'null';
+                    if (value === undefined) return 'undefined';
+                    return (value.toString());
+                }
+        );
+        _history.push("history:" + contents.join(' , '));
+    }
+
+    COMPILE::Royale
+    private function getRoyaleStackTrace(e:Error):String{
+        COMPILE::SWF{
+            return e.getStackTrace();
+        }
+        COMPILE::JS{
+            return e.stack;
+        }
+    }
+
+    public function addStacktrace():void{
+        if (deactivated) return;
+        var stack:String;
+        COMPILE::Flex{
+            stack = new Error().getStackTrace();
+        }
+        COMPILE::Royale{
+            stack = getRoyaleStackTrace(new Error())
+        }
+
+        //remove the first line
+        var contents:Array = stack.split('\n').slice(1);
+        contents[0] = "Execution stack: [";
+        contents.push("]");
+        _history.push(contents.join('\n'));
+    }
+
+    public function addEventItem(event:Event):void{
+        if (deactivated) return;
+        if (event is VALUECHANGE_EVENT_CLASS) {
+            _history.push(getValueChangeDescription(event));
+        } else {
+
+            _history.push(getBaseEventName(event)+'(type="'+event.type+'", 
bubbles='+event.bubbles+', cancelable='+event.cancelable+')');
+        }
+    }
+
+    private var listening:Object  = {};
+    public function listenTo(object:Object, eventType:String):void{
+        if (object is IEventDispatcher) {
+            IEventDispatcher(object).addEventListener(eventType,addEventItem);
+            var listeners:Array = listening[eventType] || 
(listening[eventType] = []);
+            listeners.push(object);
+        } else {
+            throw new Error("Cannot listen to a non-IEventDispatcher");
+        }
+    }
+
+    public function unListenTo(object:Object, eventType:String):void{
+        if (object is IEventDispatcher) {
+            
IEventDispatcher(object).removeEventListener(eventType,addEventItem);
+            var listeners:Array = listening[eventType] || 
(listening[eventType] = []);
+            var idx:int = listeners.indexOf(object);
+            if (idx != -1) {
+                listeners.splice(idx,1);
+            }
+        } else {
+            throw new Error("Cannot unListen to a non-IEventDispatcher");
+        }
+    }
+
+}
+}
diff --git 
a/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindingTestUtil.as
 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindingTestUtil.as
new file mode 100644
index 0000000..9a2a065
--- /dev/null
+++ 
b/frameworks/projects/Binding/src/test/royale/flexUnitTests/binding/utils/BindingTestUtil.as
@@ -0,0 +1,84 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.binding.utils
+{
+
+    COMPILE::Flex{
+        import mx.core.IVisualElementContainer;
+        import mx.core.IVisualElement;
+    }
+
+    COMPILE::Royale{
+        import IVisualElementContainer=org.apache.royale.core.IParent;
+        import IVisualElement=org.apache.royale.core.IChild;
+    }
+    
+    /**
+     * @royalesuppresspublicvarwarning
+     */
+    public class BindingTestUtil
+    {
+        private static var _testParent:IVisualElementContainer;
+        private static var _testClasses:Array = [];
+        private static var _testInstances:Array = [];
+        
+        public static function 
setTestParent(testParent:IVisualElementContainer):void{
+            _testParent = testParent;
+        }
+        
+        public static function 
createAndAddInstance(instanceClass:Class):IVisualElement{
+            var inst:IVisualElement;
+            if (!_testParent) throw new Error('setTestParent must set a parent 
before calling createAndAddInstance')
+            if (instanceClass) {
+                if (_testClasses.indexOf(instanceClass) == -1) {
+                    _testClasses.push(instanceClass);
+                }
+                inst = new instanceClass() as IVisualElement;
+                if (!inst) {
+                    throw new Error('bad mxml instance class');
+                }
+                _testInstances.push(inst);
+                _testParent.addElement(inst);
+            } else {
+                throw new Error('instanceClass must not be null');
+            }
+            
+            return inst;
+        }
+        
+        public static function removeInstance(instance:Object):void{
+            if (instance is IVisualElement){
+                if (IVisualElement(instance).parent) {
+                    
IVisualElementContainer(instance.parent).removeElement(instance as 
IVisualElement);
+                }
+            }
+            if (_testInstances.indexOf(instance) != -1) {
+                _testInstances.splice(_testInstances.indexOf(instance), 1);
+            }
+        }
+
+        public static function reset():void{
+            _testClasses = [];
+            while (_testInstances.length) {
+                removeInstance(_testInstances.pop())
+            }
+        }
+        
+    }
+}

Reply via email to