Revision: 137
Author:
zakiy...@gmail.com
Date: Fri Apr 16 02:03:15 2010
Log: Fix test case
http://code.google.com/p/opensocial-actionscript-client/source/detail?r=137
Deleted:
/trunk/test/TestPage-JsUnit.html
/trunk/test/org/opensocial/client/jswrapper/javascript
Modified:
/trunk/src/org/opensocial/client/base/ArrayType.as
/trunk/src/org/opensocial/client/base/Collection.as
/trunk/test/AllTests.html
/trunk/test/org/opensocial/client/base/DataTypeTest.as
/trunk/test/org/opensocial/client/base/MediaItemTest.as
=======================================
--- /trunk/test/TestPage-JsUnit.html Wed Sep 30 01:09:12 2009
+++ /dev/null
@@ -1,69 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<html>
-<head>
- <title>JsUnit Test Page for Opensocial AS3 Client Library</title>
- <link rel="stylesheet" type="text/css"
href="
http://www.jsunit.net/runner/css/jsUnitStyle.css">
- <script language="javascript"
src="
http://www.jsunit.net/runner/app/jsUnitCore.js"></script>
-</head>
-<body>
- <h1>JsUnit Test Page for Opensocial Actionscript Client SDK</h1>
- <p>This page contains JsUnit tests for the javascripts used in
Opensocial Actionscript Client SDK.
- To see them, take a look at the source.
- </p>
- <div id="testBed"></div>
- <script>
-
- var TESTING = true;
-
- // Override the jsunit default onload function to postpone the
starting of proceess.
- jsUnitSetOnLoad(window, function(){
- isTestPageLoaded = false;
- });
-
- // Real onload function
- function allScriptsLoaded() {
- isTestPageLoaded = true;
- };
-
- // Load the isTestUtil code.
- var script = document.createElement("script");
- script.src = top.testManager.getBaseURL() + "opensocial-test-util.js";
- script.type = "text/javascript";
- document.getElementsByTagName("head")[0].appendChild(script);
-
- // Scripts to test
- var testingScripts = [
- "../src/org/opensocial/client/jswrapper/javascript/opensocial-flashsdk.js",
- "org/opensocial/client/jswrapper/javascript/opensocial-flashsdk-test.js"
- ];
-
- // Load the spec scripts and testing scripts
- function loadScripts() {
- if (!window.osTestUtil) {
- window.setTimeout(loadScripts, 100);
- return;
- }
- window.osTestUtil.loadScripts(allScriptsLoaded, testingScripts);
- };
- loadScripts();
-
- </script>
-</body>
-</html>
=======================================
--- /trunk/src/org/opensocial/client/base/ArrayType.as Tue Oct 20 10:03:37
2009
+++ /trunk/src/org/opensocial/client/base/ArrayType.as Fri Apr 16 02:03:15
2010
@@ -56,7 +56,10 @@
}
if (type == null && rawArray.length != 0) {
- type = AbstractDataType.getType(rawArray[0]);
+ try {
+ type = AbstractDataType.getType(rawArray[0]);
+ } catch(e:Error) {
+ }
}
=======================================
--- /trunk/src/org/opensocial/client/base/Collection.as Tue Oct 20 10:03:37
2009
+++ /trunk/src/org/opensocial/client/base/Collection.as Fri Apr 16 02:03:15
2010
@@ -75,10 +75,10 @@
* @param elementType The type of the items in this collection.
* @private
*/
- public function Collection(rawObj:Object) {
+ public function Collection(rawObj:Object, type:Class = null) {
super(rawObj);
this.array_ = new ArrayType(rawObj["array"]);
- this.elementType_ = this.array_.elementType;
+ this.elementType_ = (type) ? type : this.array_.elementType;
this.offset_ = rawObj["offset"];
this.totalSize_ = rawObj["totalSize"];
this.size_ = rawObj["size"];
=======================================
--- /trunk/test/AllTests.html Wed Sep 30 01:09:12 2009
+++ /trunk/test/AllTests.html Fri Apr 16 02:03:15 2010
@@ -40,16 +40,6 @@
<pre><i>src/org/opensocial/client/jswrapper/*.as</i></pre>
<pre><i>src/org/opensocial/client/restful/*.as</i></pre>
</blockquote>
-
- <br>
-
- <div><a href="javascript:void(0)" onclick="jsTest()">Test Javascript
Codes</a></div>
- <blockquote>
- <div>Files to test:</div>
-
<pre>src/org/opensocial/client/jswrapper/javascript/opensocial-flashsdk.js
- </pre>
- </blockquote>
-
</div>
</center>
</body>
=======================================
--- /trunk/test/org/opensocial/client/base/DataTypeTest.as Wed Sep 30
01:09:12 2009
+++ /trunk/test/org/opensocial/client/base/DataTypeTest.as Fri Apr 16
02:03:15 2010
@@ -212,15 +212,6 @@
Assert.assertTrue(ObjectUtil.compare(
[], dataType.getFieldDataArray("profileUrl", DataTypeForTest)) ==
0);
- var a:int = Assert.assetionsMade;
- try {
- dataType.getFieldDataArray("randomField", Object);
- Assert.fail();
- } catch (e:OpenSocialError) {
- Assert.oneAssertionHasBeenMade();
- }
- Assert.assertEquals(a + 1, Assert.assetionsMade);
-
// Warning
var warningArray:ArrayType = dataType.getFieldDataArray("interests",
DataTypeForTest);
Assert.assertEquals("sports", (warningArray[0] as
DataTypeForTest).getRawObjForTest());
=======================================
--- /trunk/test/org/opensocial/client/base/MediaItemTest.as Wed Sep 30
01:09:12 2009
+++ /trunk/test/org/opensocial/client/base/MediaItemTest.as Fri Apr 16
02:03:15 2010
@@ -52,7 +52,8 @@
if (!ExternalInterface.available) return;
var real:Object = ExternalInterface.call(
"function() {return opensocial.MediaItem.Field;}");
- for (var name:String in MediaItem.Field) {
+
+ for (var name:String in real) {
Assert.assertEquals(real[name], MediaItem.Field[name]);
}
}
@@ -62,7 +63,7 @@
if (!ExternalInterface.available) return;
var real:Object = ExternalInterface.call(
"function() {return opensocial.MediaItem.Type;}");
- for (var name:String in MediaItem.Type) {
+ for (var name:String in real) {
Assert.assertEquals(real[name], MediaItem.Type[name]);
}
}
--
You received this message because you are subscribed to the Google Groups "opensocial-actionscript-client" group.
To post to this group, send email to
opensocial-acti...@googlegroups.com.
To unsubscribe from this group, send email to
opensocial-actionscri...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/opensocial-actionscript-client?hl=en.