incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1370239 [2/2] - in /incubator/flex/trunk/mustella/tests/collections: ./ ArrayCollection/ ArrayCollection/Methods/ ArrayCollection/Properties/ ArrayCollection/SWFs/ ArrayList/ ArrayList/Methods/ ArrayList/Properties/ ArrayList/SWFs/ IViewCu...
Date Tue, 07 Aug 2012 13:14:17 GMT
Added: incubator/flex/trunk/mustella/tests/collections/XMLListCollection/Methods/XMLListCollection_Methods.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/collections/XMLListCollection/Methods/XMLListCollection_Methods.mxml?rev=1370239&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/collections/XMLListCollection/Methods/XMLListCollection_Methods.mxml
(added)
+++ incubator/flex/trunk/mustella/tests/collections/XMLListCollection/Methods/XMLListCollection_Methods.mxml
Tue Aug  7 13:14:16 2012
@@ -0,0 +1,127 @@
+<?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="collections/XMLListCollection/Methods/"  xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="*" testSWF="XmlListCollection_creation.mxml">
+	<mx:Script>
+	<![CDATA[
+	
+	public static function init(o:DisplayObject):void
+	{
+
+	}					
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>	
+
+	
+
+	<mx:Script>
+	<![CDATA[
+	import mx.collections.*;
+	public var col:XMLListCollection;
+	public var colAS:XMLListCollection;
+	public var colXML:XMLListCollection;
+	public var foo:Namespace = new Namespace("http://foo/");
+	
+	
+	
+	]]>
+	</mx:Script>
+  
+    <testCases>
+                <TestCase testID="XMLListCollection_method_getItemAt"  keywords="[XMLListCollection,method,getItemAt]">
+                    <setup>
+ 			<RunCode code="col = new XMLListCollection(application.listAS);" />
+                        
+                    </setup>
+                    <body>
+                    	<AssertMethodValue method="value = (col.getItemAt(0)==application.listAS[0]
)"   value="true" />  
+		        <AssertMethodValue method="value = (col.getItemAt(1)==application.listAS[1]
)"   value="true" />  
+                    </body>
+        	</TestCase>
+                <TestCase testID="XMLListCollection_method_getItemAt_AS"  keywords="[XMLListCollection,method,getItemAt]">
+                    <setup>
+ 			<RunCode code="colAS = new XMLListCollection(application.listAS2.nodes);" />
+                        
+                    </setup>
+                    <body>
+                        <AssertMethodValue method="value = (colAS.getItemAt(0)==application.listAS2.nodes[0]
)"  value="true" />  
+			<AssertMethodValue method="value = (colAS.getItemAt(1)==application.listAS2.nodes[1]
)"  value="true" />  
+              
+                    </body>
+        	</TestCase>
+               <TestCase testID="XMLListCollection_method_getItemAt_XML"  keywords="[XMLListCollection,method,getItemAt]">
+                    <setup>
+ 			<RunCode code="colXML = new XMLListCollection(application.listMXML.nodes);" />
+                        
+                    </setup>
+                    <body>
+                  	 <AssertMethodValue method="value = (colXML.getItemAt(0)==application.listMXML.nodes[0]
)" value="true" />  
+	      		 <AssertMethodValue method="value = (colXML.getItemAt(1)==application.listMXML.nodes[1]
)" value="true" />  
+                  
+                    </body>
+        	</TestCase>  
+            <TestCase testID="XMLListCollection_method_getItemAt_ns"  keywords="[XMLListCollection,method,getItemAt]">
+                    <setup>
+ 			<RunCode code="col = new XMLListCollection(application.listAS_ns);" />
+                        
+                    </setup>
+                    <body>
+                    	<AssertMethodValue method="value = (col.getItemAt(0)==application.listAS_ns[0]
)"   value="true" />  
+		        <AssertMethodValue method="value = (col.getItemAt(1)==application.listAS_ns[1]
)"   value="true" />  
+                    </body>
+        	</TestCase>
+                <TestCase testID="XMLListCollection_method_getItemAtAS_ns"  keywords="[XMLListCollection,method,getItemAt]">
+                    <setup>
+ 			<RunCode code="colAS = new XMLListCollection(application.listAS2_ns.foo::nodes);"
/>
+                        
+                    </setup>
+                    <body>
+                        <AssertMethodValue method="value = (colAS.getItemAt(0)==application.listAS2_ns.foo::nodes[0]
)"  value="true" />  
+			<AssertMethodValue method="value = (colAS.getItemAt(1)==application.listAS2_ns.foo::nodes[1]
)"  value="true" />  
+              
+                    </body>
+        	</TestCase>
+               <TestCase testID="XMLListCollection_method_getItemAtXML_ns"  keywords="[XMLListCollection,method,getItemAt]">
+                    <setup>
+ 			<RunCode code="colXML = new XMLListCollection(application.listMXML_ns.foo::nodes);"
/>
+                        
+                    </setup>
+                    <body>
+                  	 <AssertMethodValue method="value = (colXML.getItemAt(0)==application.listMXML_ns.foo::nodes[0]
)" value="true" />  
+	      		 <AssertMethodValue method="value = (colXML.getItemAt(1)==application.listMXML_ns.foo::nodes[1]
)" value="true" />  
+                  
+                    </body>
+        	</TestCase>    
+         	<TestCase testID="XMLListCollection_method_removeAll"  keywords="[XMLListCollection,method,removeAll]">
+                    <setup>
+ 			<RunCode code="colXML = new XMLListCollection(application.listMXML_ns.foo::nodes);"
/>
+                        
+                    </setup>
+                    <body>
+                  	 <AssertMethodValue method="colXML.removeAll(); value = colXML.length"
value="0" />  
+   		                  
+                    </body>
+        	</TestCase>             	
+   </testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/collections/XMLListCollection/SWFs/XmlListCollection_creation.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/collections/XMLListCollection/SWFs/XmlListCollection_creation.mxml?rev=1370239&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/collections/XMLListCollection/SWFs/XmlListCollection_creation.mxml
(added)
+++ incubator/flex/trunk/mustella/tests/collections/XMLListCollection/SWFs/XmlListCollection_creation.mxml
Tue Aug  7 13:14:16 2012
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+
+  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.
+
+-->
+<mx:Application backgroundColor="0xFFFFFF"  xmlns:mx="http://www.adobe.com/2006/mxml"
>
+
+<mx:Script><![CDATA[
+
+import mx.collections.*;
+
+public var foo:Namespace = new Namespace("http://foo/");
+
+public var colA:XMLListCollection;
+public var colB:XMLListCollection;
+public var colC:XMLListCollection;
+
+public var listAS:XMLList = new XMLList("<nodes label='Mail' data='mail'><nodes
label='Inbox' data='inbox' /></nodes><nodes label='Drafts' data='drafts'><nodes
label='Memos' data='memos' /><nodes label='Faxes' data='faxes' /></nodes>");
+
+public var listAS2:XML =
+    <root>
+        <nodes label="Mail" data="mail">
+            <nodes label="Inbox" data="inbox" />
+        </nodes>
+        <nodes label="Drafts" data="drafts">
+            <nodes label="Memos" data="memos" />
+            <nodes label="Faxes" data="faxes" />
+        </nodes>
+    </root>;
+    
+public var listAS_ns:XMLList = new XMLList("<e:nodes xmlns:e='http://foo/' label='Mail'
data='mail'><e:nodes label='Inbox' data='inbox' /></e:nodes><e:nodes xmlns:e='http://foo/'
label='Drafts' data='drafts'><e:nodes label='Memos' data='memos' /><e:nodes label='Faxes'
data='faxes' /></e:nodes>");
+
+public var listAS2_ns:XML =
+     <e:root xmlns:e="http://foo/">
+        <e:nodes label="Mail" data="mail">
+            <e:nodes label="Inbox" data="inbox" />
+        </e:nodes>
+        <e:nodes label="Drafts" data="drafts">
+            <e:nodes label="Memos" data="memos" />
+            <e:nodes label="Faxes" data="faxes" />
+        </e:nodes>
+    </e:root>;
+
+
+]]></mx:Script>
+
+<mx:XML format="e4x" id="listMXML">
+ <topnode>
+        <nodes label="Mail" data="mail">
+            <nodes label="Inbox" data="inbox" />
+        </nodes>
+         <nodes label="Drafts" data="drafts">
+            <nodes label="Memos" data="memos" />
+            <nodes label="Faxes" data="faxes" />
+        </nodes>
+ </topnode>
+</mx:XML>
+
+<mx:XML format="e4x" id="listMXML_ns">
+   <topnode>
+        <e:nodes xmlns:e="http://foo/" label="Mail" data="mail">
+            <e:nodes label="Inbox" data="inbox" />
+        </e:nodes>
+         <e:nodes xmlns:e="http://foo/" label="Drafts" data="drafts">
+            <e:nodes label="Memos" data="memos" />
+            <e:nodes label="Faxes" data="faxes" />
+        </e:nodes>
+   </topnode>
+</mx:XML>
+
+</mx:Application>
\ No newline at end of file



Mime
View raw message