flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1370370 [9/43] - in /incubator/flex/trunk/mustella/tests/mx: ./ binding/ binding/utils/ binding/utils/BindingUtils/ binding/utils/BindingUtils/SWFs/ binding/utils/BindingUtils/SWFs/assets/ binding/utils/BindingUtils/method/ binding/utils/C...
Date Tue, 07 Aug 2012 17:13:35 GMT
Added: incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_setItemAt.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_setItemAt.mxml?rev=1370370&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_setItemAt.mxml (added)
+++ incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_setItemAt.mxml Tue Aug  7 17:13:06 2012
@@ -0,0 +1,500 @@
+<?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.
+
+-->
+<UnitTester 
+	testDir="mx/collections/AsyncListView/methods/"
+	xmlns:mx="http://www.adobe.com/2006/mxml" 
+	xmlns="*" 
+	xmlns:assets="assets.*"
+	testSWF="AsyncListView_App1.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+
+		import assets.*;
+		import mx.collections.*;
+		import mx.core.FlexGlobals;
+		
+		private var storedItem:Object;
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+<!--
+For these tests, call setItemAt() for the AsyncListView, then verify by checking with the simulator (server)
+that things on the server side are still OK.  Also be sure to check the returned object, which should be the
+item which was replaced.
+
+public function setup( responseDelay:int = 500,
+						numItems:int = 100,
+						numPreloadedPages:int = 0,
+						pageSize:int = 1,
+						mode:String = 'manual',
+						failureProbability:int = 0,
+						createPendingItemFunction:Boolean = true,
+						createFailedItemFunction:Boolean = true):void{
+-->
+<TestCase testID="setItemAt_none_vlist_test1" keywords="[AsyncListView,setItemAt]" description="0 items, 0." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,0)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+		<AssertMethodValue method="try { FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, -1); } catch ( e:Error ) { value = e.message; }" value="Index '-1' specified is out of bounds." />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_vlist_test1" keywords="[AsyncListView,setItemAt]" description="Out of bounds, -1." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<AssertMethodValue method="try { FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, -1); } catch ( e:Error ) { value = e.message; }" value="Index '-1' specified is out of bounds." />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).info + ' ' + FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).status" value="item 0 pending pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).info + ' ' + FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).status" value="item 1 pending pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[0].info + ' ' + FlexGlobals.topLevelApplication.obj1.items.source[0].status" value="item 0 present present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[1].info + ' ' + FlexGlobals.topLevelApplication.obj1.items.source[1].status" value="item 1 present present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_vlist_test2" keywords="[AsyncListView,setItemAt]" description="Out of bounds, too high." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = null" />
+		<AssertMethodValue method="try { FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 2) } catch(e:Error) { value = e.message; }" value="Index '2' specified is out of bounds." />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_vlist_test3" keywords="[AsyncListView,setItemAt]" description="2 pending items, 0." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 0)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).info" value="item 1 pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[0].info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[1].info" value="item 1 present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_vlist_test4" keywords="[AsyncListView,setItemAt]" description="2 pending items, 1." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 1)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).info" value="item 0 pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[0].info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[1].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_failed_vlist_test1" keywords="[AsyncListView,setItemAt]" description="2 failed items, 0." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2,0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 0)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).info" value="item 1 failed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[0].info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[1].info" value="item 1 present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_failed_vlist_test2" keywords="[AsyncListView,setItemAt]" description="2 failed items, 1." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2,0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 1)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).info" value="item 0 failed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[0].info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[1].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_success_vlist_test1" keywords="[AsyncListView,setItemAt]" description="2 successful items, 0." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2,0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 0)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).info" value="item 1 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[0].info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[1].info" value="item 1 present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_success_vlist_test2" keywords="[AsyncListView,setItemAt]" description="2 successful items, 1." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,2,0,2)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 1)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0).info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[0].info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[1].info" value="new item" />
+	</body>
+</TestCase>
+
+<!--  These are tests for calling setItemAt() for positions not in view.  -->
+
+<TestCase testID="setItemAt_outOfView_vlist_test1" keywords="[AsyncListView,setItemAt]" description="Replace pending item not in view." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,20)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 19)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifyItems(0, 18, 'pending', FlexGlobals.topLevelApplication.obj1.alv)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19))" value="19" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="20" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifySimulatorItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj1.items)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[19].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_outOfView_vlist_test2" keywords="[AsyncListView,setItemAt]" description="Replace failed item not in view." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,20,0,20)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0,19,FlexGlobals.topLevelApplication.obj1.alv)" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete"/>
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 19)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifyItems(0, 18, 'failed', FlexGlobals.topLevelApplication.obj1.alv)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19))" value="19" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="20" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifySimulatorItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj1.items)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[19].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_outOfView_vlist_test3" keywords="[AsyncListView,setItemAt]" description="Replace present item not in view." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,20,0,20)" waitTarget="obj1.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.setItemAt({info: 'new item', status: 'present'}, 19)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifyItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj1.alv)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.alv.getItemIndex(FlexGlobals.topLevelApplication.obj1.alv.getItemAt(19))" value="19" />
+		<AssertPropertyValue target="obj1.alv" propertyName="length" value="20" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifySimulatorItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj1.items)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.items.source[19].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_vlist_test4" keywords="[AsyncListView,setItemAt]" description="Call it when the AsyncListView has no list.">
+	<body>
+		<Pause timeout="1" />
+		<AssertMethodValue method="value = new AsyncListView().setItemAt({info:'added item', status:'present'},0)" value="null" />
+		<Pause timeout="1" />		
+	</body>
+</TestCase>
+
+
+
+<TestCase testID="setItemAt_none_nonvlist_test1" keywords="[AsyncListView,setItemAt]" description="0 items, 0." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,0)" waitTarget="obj8.theList" waitEvent="updateComplete" />
+		<AssertMethodValue method="try { FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, -1); } catch ( e:Error ) { value = e.message; }" value="Index '-1' specified is out of bounds." />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_nonvlist_test1" keywords="[AsyncListView,setItemAt]" description="Out of bounds, -1." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<AssertMethodValue method="try { FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, -1); } catch ( e:Error ) { value = e.message; }" value="Index '-1' specified is out of bounds." />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).info + ' ' + FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).status" value="item 0 pending pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).info + ' ' + FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).status" value="item 1 pending pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].info + ' ' + FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].status" value="item 0 present present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].info + ' ' + FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].status" value="item 1 present present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_nonvlist_test2" keywords="[AsyncListView,setItemAt]" description="Out of bounds, too high." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = null" />
+		<AssertMethodValue method="try { FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 2) } catch(e:Error) { value = e.message; }" value="Index '2' specified is out of bounds." />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_nonvlist_test3" keywords="[AsyncListView,setItemAt]" description="2 pending items, 0." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 0)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).info" value="item 1 pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].info" value="item 1 present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_pending_nonvlist_test4" keywords="[AsyncListView,setItemAt]" description="2 pending items, 1." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 1)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).info" value="item 0 pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_failed_nonvlist_test1" keywords="[AsyncListView,setItemAt]" description="2 failed items, 0." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2,0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.failPage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 0)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).info" value="item 1 failed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].info" value="item 1 present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_failed_nonvlist_test2" keywords="[AsyncListView,setItemAt]" description="2 failed items, 1." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2,0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.failPage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 1)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).info" value="item 0 failed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_success_nonvlist_test1" keywords="[AsyncListView,setItemAt]" description="2 successful items, 0." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2,0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.receivePage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 0)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).info" value="item 1 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].info" value="item 1 present" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_success_nonvlist_test2" keywords="[AsyncListView,setItemAt]" description="2 successful items, 1." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,2,0,2)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.receivePage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 1)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0).info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(0))" value="0" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(1))" value="1" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="2" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[0].info" value="item 0 present" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[1].info" value="new item" />
+	</body>
+</TestCase>
+
+<!--  These are tests for calling setItemAt() for positions not in view.  -->
+
+<TestCase testID="setItemAt_outOfView_nonvlist_test1" keywords="[AsyncListView,setItemAt]" description="Replace pending item not in view." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,20)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 19)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifyItems(0, 18, 'pending', FlexGlobals.topLevelApplication.obj8.alv)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19))" value="19" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="20" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifySimulatorItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj8.theSimulator)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[19].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_outOfView_nonvlist_test2" keywords="[AsyncListView,setItemAt]" description="Replace failed item not in view." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,20,0,20)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0,19,FlexGlobals.topLevelApplication.obj8.alv)" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.failPage()" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete"/>
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 19)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifyItems(0, 18, 'failed', FlexGlobals.topLevelApplication.obj8.alv)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19))" value="19" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="20" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifySimulatorItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj8.theSimulator)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[19].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_outOfView_nonvlist_test3" keywords="[AsyncListView,setItemAt]" description="Replace present item not in view." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,20,0,20)" waitTarget="obj8.theList" waitEvent="updateComplete" />		
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.receivePage()" />
+		<RunCode code="storedItem = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19)" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.setItemAt({info: 'new item', status: 'present'}, 19)" valueExpression="value = storedItem" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifyItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj8.alv)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19).info" value="new item" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.alv.getItemIndex(FlexGlobals.topLevelApplication.obj8.alv.getItemAt(19))" value="19" />
+		<AssertPropertyValue target="obj8.alv" propertyName="length" value="20" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.verifySimulatorItems(0, 18, 'present', FlexGlobals.topLevelApplication.obj8.theSimulator)" value="pass" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj8.theSimulator.source[19].info" value="new item" />
+	</body>
+</TestCase>
+
+<TestCase testID="setItemAt_nonvlist_test4" keywords="[AsyncListView,setItemAt]" description="Call it when the AsyncListView has no list.">
+	<body>
+		<Pause timeout="1" />
+		<AssertMethodValue method="value = new AsyncListView().setItemAt({info:'added item', status:'present'},0)" value="null" />
+		<Pause timeout="1" />		
+	</body>
+</TestCase>
+
+</testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toArray.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toArray.mxml?rev=1370370&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toArray.mxml (added)
+++ incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toArray.mxml Tue Aug  7 17:13:06 2012
@@ -0,0 +1,272 @@
+<?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.
+
+-->
+<UnitTester 
+	testDir="mx/collections/AsyncListView/methods/"
+	xmlns:mx="http://www.adobe.com/2006/mxml" 
+	xmlns="*" 
+	xmlns:assets="assets.*"
+	testSWF="AsyncListView_App1.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+
+		import assets.*;
+		import mx.collections.*;
+		import mx.core.FlexGlobals;
+	
+		public var theArray:Array;
+		
+		// Call getItemAt() on the first numItems items.
+		// This will make sure we have a bunch of pending items 
+		// in our AsyncListView.
+		public function callGetItemAt(numItems:int):void{
+			var i:int;
+			
+			for(i = 0; i < numItems; ++i){
+				FlexGlobals.topLevelApplication.obj1.alv.getItemAt(i);
+			}
+		}
+		
+		// Verify that there are numItems items with the correct status.
+		public function verifyItems(numItems:int, status:String):String{
+			var ret:String = "pass";
+			var expectedString:String;
+			var actualString:String;
+			var i:int;
+			
+			if(theArray.length == numItems){
+				for(i = 0; i < theArray.length; ++i){
+					
+					expectedString = "item " + i.toString() + " " + status + " " + status;
+					actualString = theArray[i].info + " " + theArray[i].status;
+					
+					if( expectedString != actualString ){
+						ret = "expected: " + expectedString + " got: " + actualString;
+						break;
+					}
+				}
+			}else{
+				ret = "Array length was " + theArray.length.toString() + ", expected " + numItems.toString();
+			}
+			
+			return ret;
+		}
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+<!--
+public function setup( responseDelay:int = 500,
+						numItems:int = 100,
+						numPreloadedPages:int = 0,
+						pageSize:int = 1,
+						mode:String = 'manual',
+						failureProbability:int = 0,
+						createPendingItemFunction:Boolean = true,
+						createFailedItemFunction:Boolean = true
+						assignToList:Boolean = true):void
+-->
+
+<TestCase testID="toArray_headless_test1" keywords="[AsyncListView,toArray]" description="An AsyncListView should get populated with pending items when toArray() is called." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,1,'manual',0,true,true,false)" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'pending')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_headless_test2" keywords="[AsyncListView,toArray]" description="Call when there are all items are already pending." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,1,'manual',0,true,true,false)" />
+	</setup>
+	<body>
+		<RunCode code="callGetItemAt(30)" />
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'pending')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_headless_test3" keywords="[AsyncListView,toArray]" description="Call when there are all failed items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30,'manual',0,true,true,false)" />
+	</setup>
+	<body>
+		<RunCode code="callGetItemAt(30)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'failed')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_headless_test4" keywords="[AsyncListView,toArray]" description="Call when there are all present items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30,'manual',0,true,true,false)" />
+	</setup>
+	<body>
+		<RunCode code="callGetItemAt(30)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'present')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_headless_test5" keywords="[AsyncListView,toArray]" description="Call when there are no items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,0,0,1,'manual',0,true,true,false)" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertPropertyValue target="script:theArray" propertyName="length" value="0" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_headless_test6" keywords="[AsyncListView,toArray]" description="Call it when the AsyncListView has no list.">
+	<body>
+		<Pause timeout="1" />
+		<AssertMethodValue method="value = new AsyncListView().toArray()" value="" />
+		<Pause timeout="1" />		
+	</body>
+</TestCase>
+
+
+
+
+<TestCase testID="toArray_inVirtualizedList_test1" keywords="[AsyncListView,toArray]" description="Call when there are all pending items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30)" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'pending')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_inVirtualizedList_test2" keywords="[AsyncListView,toArray]" description="Call when there are all failed items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30)" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'failed')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_inVirtualizedList_test3" keywords="[AsyncListView,toArray]" description="Call when there are all present items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30)" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'present')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_inVirtualizedList_test4" keywords="[AsyncListView,toArray]" description="Call when there are no items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,0)" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj1.alv.toArray()" />
+		<AssertPropertyValue target="script:theArray" propertyName="length" value="0" />
+	</body>
+</TestCase>
+
+
+
+
+<TestCase testID="toArray_inNonvirtualizedList_test1" keywords="[AsyncListView,toArray]" description="Call when there are all pending items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,30)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj8.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'pending')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_inNonvirtualizedList_test2" keywords="[AsyncListView,toArray]" description="Call when there are all failed items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,30,0,30)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.failPage()" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj8.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'failed')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_inNonvirtualizedList_test3" keywords="[AsyncListView,toArray]" description="Call when there are all present items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,30,0,30)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.receivePage()" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj8.alv.toArray()" />
+		<AssertMethodValue method="value = verifyItems(30, 'present')" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toArray_inNonvirtualizedList_test4" keywords="[AsyncListView,toArray]" description="Call when there are no items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,0)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="theArray = FlexGlobals.topLevelApplication.obj8.alv.toArray()" />
+		<AssertPropertyValue target="script:theArray" propertyName="length" value="0" />
+	</body>
+</TestCase>
+
+
+</testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toString.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toString.mxml?rev=1370370&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toString.mxml (added)
+++ incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/methods/AsyncListView_toString.mxml Tue Aug  7 17:13:06 2012
@@ -0,0 +1,286 @@
+<?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.
+
+-->
+<UnitTester 
+	testDir="mx/collections/AsyncListView/methods/"
+	xmlns:mx="http://www.adobe.com/2006/mxml" 
+	xmlns="*" 
+	xmlns:assets="assets.*"
+	testSWF="AsyncListView_App1.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+
+		import assets.*;
+		import mx.collections.*;
+		import mx.core.FlexGlobals;
+
+		public var theString:String;
+		
+		// Verify that there are numItems items with the correct status.
+		public function verifyString(length:int, pendingReqs:int):String{
+			var ret:String = "pass";
+			var expectedString:String = "mx.collections::AsyncListView length=" + length.toString() + ", " + pendingReqs.toString() + " pending requests";
+
+			if( expectedString != theString ){
+				ret = "expected: " + expectedString + " got: " + theString;
+			}
+
+			return ret;
+		}
+
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+<!--
+Reminder:
+public function setup( responseDelay:int = 500,
+						numItems:int = 100,
+						numPreloadedPages:int = 0,
+						pageSize:int = 1,
+						mode:String = 'manual',
+						failureProbability:int = 0,
+						createPendingItemFunction:Boolean = true,
+						createFailedItemFunction:Boolean = true,
+						assignToList:Boolean = true):void{
+-->
+
+<TestCase testID="toString_noList" keywords="[AsyncListView,toString]" description="No list." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<AssertMethodValue method="value = new AsyncListView().toString()" value="mx.collections::AsyncListView no list" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_headless_test1" keywords="[AsyncListView,toString]" description="Pending items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30,'manual',0,true,true,false)" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 30)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_headless_test2" keywords="[AsyncListView,toString]" description="Failed items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30,'manual',0,true,true,false)" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_headless_test3" keywords="[AsyncListView,toString]" description="Received items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30,'manual',0,true,true,false)" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_headless_test4" keywords="[AsyncListView,toString]" description="No items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,0,0,0,'manual',0,true,true,false)" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(0, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_headless_test5" keywords="[AsyncListView,toString]" description="Mixed items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,5,'manual',0,true,true,false)" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 20)" value="pass" />
+	</body>
+</TestCase>
+
+
+
+
+<TestCase testID="toString_vlist_test1" keywords="[AsyncListView,toString]" description="Pending items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30)" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 30)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_vlist_test2" keywords="[AsyncListView,toString]" description="Failed items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30)" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_vlist_test3" keywords="[AsyncListView,toString]" description="Received items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,30)" waitTarget="obj1.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_vlist_test4" keywords="[AsyncListView,toString]" description="No items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,0)" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(0, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_vlist_test5" keywords="[AsyncListView,toString]" description="Mixed items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(0,30,0,5)" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj1.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.receivePage()" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj1.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 20)" value="pass" />
+	</body>
+</TestCase>
+
+
+
+<TestCase testID="toString_nonvlist_test1" keywords="[AsyncListView,toString]" description="Pending items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,30,0,30)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj8.alv)" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj8.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 30)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_nonvlist_test2" keywords="[AsyncListView,toString]" description="Failed items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,30,0,30)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj8.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.failPage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj8.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_nonvlist_test3" keywords="[AsyncListView,toString]" description="Received items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,30,0,30)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj8.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.receivePage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj8.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_nonvlist_test4" keywords="[AsyncListView,toString]" description="No items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,0)" waitTarget="obj8.theList.dataGroup" waitEvent="updateComplete" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj8.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(0, 0)" value="pass" />
+	</body>
+</TestCase>
+
+<TestCase testID="toString_nonvlist_test5" keywords="[AsyncListView,toString]" description="Mixed items." >
+	<setup>
+		<ResetComponent target="obj8" className="assets.PagedDataComp8" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.setup(0,30,0,5)" />
+		<RunCode code="FlexGlobals.topLevelApplication.callGetItemAtFor(0, 29, FlexGlobals.topLevelApplication.obj8.alv)" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.receivePage()" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj8.theSimulator.failPage()" />
+		<RunCode code="theString = FlexGlobals.topLevelApplication.obj8.alv.toString()" />
+		<AssertMethodValue method="value = verifyString(30, 20)" value="pass" />
+	</body>
+</TestCase>
+
+
+</testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createFailedItemFunction.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createFailedItemFunction.mxml?rev=1370370&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createFailedItemFunction.mxml (added)
+++ incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createFailedItemFunction.mxml Tue Aug  7 17:13:06 2012
@@ -0,0 +1,163 @@
+<?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.
+
+-->
+<UnitTester
+	testDir="mx/collections/AsyncListView/properties/"
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns="*"
+	xmlns:assets="assets.*"
+	testSWF="AsyncListView_App1.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+
+		import assets.*;
+		import mx.core.FlexGlobals;
+
+		public var savedItem:Object;
+
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+<!--
+A reminder:
+
+public function setup( responseDelay:int = 500,
+						numItems:int = 100,
+						numPreloadedPages:int = 0,
+						pageSize:int = 1,
+						mode:String = 'manual',
+						failureProbability:int = 0,
+						createPendingItemFunction:Boolean = true,
+						createFailedItemFunction:Boolean = true):void{
+-->
+
+<TestCase testID="createFailedItemFunction_test1" keywords="[AsyncListView,createFailedItemFunction]" description="Default function, which returns a null object." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,true,false)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" />
+		<AssertEvent target="obj1.alv" eventName="collectionChange" eventClass="mx.events::CollectionEvent" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0)" value="null" />
+	</body>
+</TestCase>
+
+
+
+<TestCase testID="createFailedItemFunction_test3" keywords="[AsyncListView,createFailedItemFunction]" description="Set the createFailedItemFunction, then get failed items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,true,true)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitEvent="updateComplete" waitTarget="obj1.theList.dataGroup" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitEvent="updateComplete" waitTarget="obj1.theList.dataGroup" />
+		<AssertEvent target="obj1.alv" eventName="collectionChange" eventClass="mx.events::CollectionEvent" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0).info + FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0).status" value="item 0 failedfailed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(0).nameLabel.text" value="item 0 failed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(1).info + FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(1).status" value="item 1 failedfailed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(1).nameLabel.text" value="item 1 failed" />
+	</body>
+</TestCase>
+
+<TestCase testID="createFailedItemFunction_test4" keywords="[AsyncListView,createFailedItemFunction]" description="Set the createFailedItemFunction, get failed items, change the createFailedItemFunction, then get more items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,true,true)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitEvent="updateComplete" waitTarget="obj1.theList.dataGroup" />
+		<SetProperty target="obj1.alv" propertyName="createFailedItemFunction" valueExpression="value = FlexGlobals.topLevelApplication.obj1.errorFunction2" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitEvent="updateComplete" waitTarget="obj1.theList.dataGroup" />
+		<AssertEvent target="obj1.alv" eventName="collectionChange" eventClass="mx.events::CollectionEvent" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0).info + FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0).status" value="item 0 failedfailed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(0).nameLabel.text" value="item 0 failed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(1).info + FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(1).status" value="item 1 totally failedfailed" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(1).nameLabel.text" value="item 1 totally failed" />
+	</body>
+</TestCase>
+
+<TestCase testID="createFailedItemFunction_test5" keywords="[AsyncListView,createFailedItemFunction]" description="Set a createFailedItemFunction which has no parameters." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,true,false)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<SetProperty target="obj1.alv" propertyName="createFailedItemFunction" valueExpression="value = FlexGlobals.topLevelApplication.obj1.errorFunction3" />
+		<AssertMethodValue method="try{ FlexGlobals.topLevelApplication.obj1.items.failPage(); } catch(e:Error) { value = e.message; }" value="Error #1063: Argument count mismatch on assets::PagedDataComp1/errorFunction3(). Expected 0, got 2." />
+	</body>
+</TestCase>
+
+<TestCase testID="createFailedItemFunction_test6" keywords="[AsyncListView,createFailedItemFunction]" description="Set a createFailedItemFunction which has one parameter." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,true,false)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<SetProperty target="obj1.alv" propertyName="createFailedItemFunction" valueExpression="value = FlexGlobals.topLevelApplication.obj1.errorFunction4" />
+		<AssertMethodValue method="try{ FlexGlobals.topLevelApplication.obj1.items.failPage(); } catch(e:Error) { value = e.message; }" value="Error #1063: Argument count mismatch on assets::PagedDataComp1/errorFunction4(). Expected 1, got 2." />
+	</body>
+</TestCase>
+
+<TestCase testID="createFailedItemFunction_test7" keywords="[AsyncListView,createFailedItemFunction]" description="Set a createFailedItemFunction which has two mismatched parameters." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,true,false)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<SetProperty target="obj1.alv" propertyName="createFailedItemFunction" valueExpression="value = FlexGlobals.topLevelApplication.obj1.errorFunction5" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitEvent="updateComplete" waitTarget="obj1.theList.dataGroup" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(0).nameLabel.text" value="0 null" />
+	</body>
+</TestCase>
+
+<!-- Non-usecase
+<TestCase testID="createFailedItemFunction_test8" keywords="[AsyncListView,createFailedItemFunction]" description="Set a createFailedItemFunction which has no return value." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,true,false)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<SetProperty target="obj1.alv" propertyName="createFailedItemFunction" valueExpression="value = FlexGlobals.topLevelApplication.obj1.errorFunction6" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.items.failPage()" waitEvent="updateComplete" waitTarget="obj1.theList.dataGroup" />
+		<Pause timeout="2000" />
+	</body>
+</TestCase>
+ -->
+</testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createPendingItemFunction.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createPendingItemFunction.mxml?rev=1370370&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createPendingItemFunction.mxml (added)
+++ incubator/flex/trunk/mustella/tests/mx/collections/AsyncListView/properties/AsyncListView_createPendingItemFunction.mxml Tue Aug  7 17:13:06 2012
@@ -0,0 +1,158 @@
+<?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.
+
+-->
+<UnitTester 
+	testDir="mx/collections/AsyncListView/properties/"
+	xmlns:mx="http://www.adobe.com/2006/mxml" 
+	xmlns="*" 
+	xmlns:assets="assets.*"
+	testSWF="AsyncListView_App1.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+
+		import assets.*;
+		import mx.core.FlexGlobals;
+
+		public var savedItem:Object;
+
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+<!--
+A reminder:
+
+public function setup( responseDelay:int = 500,
+						numItems:int = 100,
+						numPreloadedPages:int = 0,
+						pageSize:int = 1,
+						mode:String = 'manual',
+						failureProbability:int = 0,
+						createPendingItemFunction:Boolean = true,
+						createFailedItemFunction:Boolean = true):void{
+
+setup2: Replaces the booleans with functions.
+-->
+
+<TestCase testID="createPendingItemFunction_test1" keywords="[AsyncListView,createPendingItemFunction]" description="Verify properties of the ipe param.  This is sent by the server...in this case, the simulator" >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup2(1,10,0,1,'manual',1,FlexGlobals.topLevelApplication.obj1.pendingFunctionWhichSavesTheIPE)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.ipe" value="Error: Items: 9 through 9 must be resolved by calling receivePage" />
+	</body>
+</TestCase>
+
+<TestCase testID="createPendingItemFunction_test2" keywords="[AsyncListView,createPendingItemFunction]" description="Default function, which returns a null object." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,10,0,1,'manual',1,false,false)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0)" value="null" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(0).nameLabel.text" value="null" />
+	</body>
+</TestCase>
+
+<TestCase testID="createPendingItemFunction_test3" keywords="[AsyncListView,createPendingItemFunction]" description="Set the function to null." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup2(1,10,0,1,'manual',1,null)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0)" value="null" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(0).nameLabel.text" value="null" />
+	</body>
+</TestCase>
+
+<TestCase testID="createPendingItemFunction_test4" keywords="[AsyncListView,createPendingItemFunction]" description="Change the function after it has been used for some items." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup(1,30)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<SetProperty target="obj1.alv" propertyName="createPendingItemFunction" valueExpression="value = FlexGlobals.topLevelApplication.obj1.pendingFunction2" />
+		<RunCode code="trace(FlexGlobals.topLevelApplication.obj1)" />
+		<RunCode code="trace(FlexGlobals.topLevelApplication.obj1.theList)" />
+		<RunCode code="trace(FlexGlobals.topLevelApplication.obj1.theList.scroller)" />
+		<RunCode code="trace(FlexGlobals.topLevelApplication.obj1.theList.scroller.viewport)" />
+		<SetProperty target="obj1.theList.scroller.viewport" propertyName="verticalScrollPosition" value="30" waitEvent="updateComplete" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(12).info" value="item 12 really pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(12).status" value="pending" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataGroup.getElementAt(12).nameLabel.text" value="item 12 really pending" />
+	</body>
+</TestCase>
+
+<!--
+	It's impossible to catch these in Mustella.
+
+<TestCase testID="createPendingItemFunction_test5" keywords="[AsyncListView,createPendingItemFunction]" description="Set a createPendingItemFunction which has no parameters." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<AssertMethodValue method="try{ FlexGlobals.topLevelApplication.obj1.setup2(1,10,0,1,'manual',1,FlexGlobals.topLevelApplication.obj1.pendingFunction3) } catch(e:Error) { value = e.message; }" value="Error #1063: Argument count mismatch on assets::PagedDataComp1/pendingFunction3(). Expected 0, got 2." />
+	</body>
+</TestCase>
+
+<TestCase testID="createPendingItemFunction_test6" keywords="[AsyncListView,createPendingItemFunction]" description="Set a createPendingItemFunction which has one parameter." >
+
+-->
+
+<TestCase testID="createPendingItemFunction_test7" keywords="[AsyncListView,createPendingItemFunction]" description="Set a createPendingItemFunction which has two mismatched parameters." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup2(1,10,0,1,'manual',1,FlexGlobals.topLevelApplication.obj1.pendingFunction5)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0).info" value="0 Error: Items: 0 through 0 must be resolved by calling receivePage" />
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0).status" value="pending" />
+	</body>
+</TestCase>
+
+<TestCase testID="createPendingItemFunction_test8" keywords="[AsyncListView,createPendingItemFunction]" description="Set a createPendingItemFunction which has no return value." >
+	<setup>
+		<ResetComponent target="obj1" className="assets.PagedDataComp1" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.obj1.setup2(1,10,0,1,'manual',1,FlexGlobals.topLevelApplication.obj1.pendingFunction6)" waitTarget="obj1.theList" waitEvent="updateComplete" />
+	</setup>
+	<body>
+		<AssertMethodValue method="value = FlexGlobals.topLevelApplication.obj1.theList.dataProvider.getItemAt(0)" value="null" />
+	</body>
+</TestCase>
+
+</testCases>
+</UnitTester>



Mime
View raw message