asproject 0.1.92 → 0.1.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/asclass_arguments.rb +1 -1
- data/lib/asproject.rb +3 -1
- data/lib/asproject/version.rb +1 -1
- data/lib/asproject_arguments.rb +5 -5
- data/lib/path_finder.rb +17 -7
- data/lib/tasks/asunit.rb +8 -0
- data/lib/tasks/flash_log.rb +2 -1
- data/lib/tasks/flash_player.rb +10 -6
- data/lib/tasks/mxmlc.rb +13 -2
- data/lib/tasks/remote_file_loader.rb +144 -0
- data/lib/tasks/remote_file_task.rb +2 -128
- data/lib/tasks/remote_library_task.rb +75 -0
- data/templates/asclass/as2/Class.as +1 -1
- data/templates/asproject/as2/{art → assets}/.crap_file +0 -0
- data/templates/asproject/as2/project/rakefile.rb +3 -2
- data/templates/asproject/as3/{art → assets}/.crap_file +0 -0
- data/templates/asproject/as3/project/rakefile.rb +3 -3
- data/templates/asproject/fdt/project/.as2_classpath +1 -1
- metadata +9 -129
- data/templates/asproject/asunit2/project/lib/asunit/AsUnitUi.swf +0 -0
- data/templates/asproject/asunit2/project/lib/asunit/Sys.as +0 -70
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanel.as +0 -182
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTest.as +0 -84
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTextArea.as +0 -111
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTextAreaTest.as +0 -26
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTitleBar.as +0 -81
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ResizeHandle.as +0 -35
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollArrow.as +0 -34
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollHandle.as +0 -43
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollListener.as +0 -10
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/TextScroller.as +0 -169
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/shapes/Rectangle.as +0 -29
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/shapes/Triangle.as +0 -27
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/AsUnit.as +0 -19
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Assert.as +0 -408
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Assertion.as +0 -27
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Reflection.as +0 -68
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Test.as +0 -3
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestCase.as +0 -191
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestCaseXml.as +0 -31
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestFailure.as +0 -15
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestResult.as +0 -15
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as +0 -41
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestSetup.as +0 -19
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestSuite.as +0 -22
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/Main.as +0 -325
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/RemoteVersion.as +0 -24
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/SuccessMeter.as +0 -32
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/Comparable.as +0 -7
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/EventListener.as +0 -29
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/EventSource.as +0 -89
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnClient.as +0 -42
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnGateway.as +0 -47
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnServer.as +0 -61
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalMessageBroker.as +0 -58
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/Observable.as +0 -11
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/TextFile.as +0 -30
- data/templates/asproject/asunit25/project/lib/asunit/AsUnitTestRunner.as +0 -13
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/AssertionFailedError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/AssertionPassedError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/ClassNotFoundError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/IllegalOperationError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/InstanceNotFoundError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/InvocationTargetError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/UnimplementedFeatureError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/Assert.as +0 -376
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/AssertMock.as +0 -15
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/AssertTest.as +0 -59
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/ITestListener.as +0 -13
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/Test.as +0 -11
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCase.as +0 -278
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseMock.as +0 -23
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseTest.as +0 -29
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseXml.as +0 -38
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestFailure.as +0 -47
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestResult.as +0 -168
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestSuite.as +0 -102
- data/templates/asproject/asunit25/project/lib/asunit/asunit/runner/BaseTestRunner.as +0 -101
- data/templates/asproject/asunit25/project/lib/asunit/asunit/runner/IResultPrinter.as +0 -8
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/ResultPrinter.as +0 -254
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/SuccessBar.as +0 -41
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/TestRunner.as +0 -17
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIterator.as +0 -24
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as +0 -52
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/Iterator.as +0 -5
- data/templates/asproject/asunit3/project/lib/asunit/AsUnitTestRunner.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/AbstractMemberCalledError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/AssertionFailedError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/ClassNotFoundError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/InstanceNotFoundError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/UnimplementedFeatureError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/Assert.as +0 -271
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/AsynchronousTestCase.as +0 -52
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/AsynchronousTestCaseExample.as +0 -71
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/Test.as +0 -15
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestCase.as +0 -354
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestCaseExample.as +0 -73
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestFailure.as +0 -47
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestListener.as +0 -22
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestResult.as +0 -158
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestSuite.as +0 -115
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/BaseTestRunner.as +0 -15
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/TestSuiteLoader.as +0 -9
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/Version.as +0 -11
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexRunner.as +0 -19
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as +0 -55
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/ResultPrinter.as +0 -245
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/TestRunner.as +0 -121
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/ArrayIterator.as +0 -26
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/Iterator.as +0 -9
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/Properties.as +0 -30
@@ -1,59 +0,0 @@
|
|
1
|
-
|
2
|
-
import asunit.framework.Assert;
|
3
|
-
import asunit.framework.TestCase;
|
4
|
-
import asunit.errors.AssertionFailedError;
|
5
|
-
import asunit.framework.AssertMock;
|
6
|
-
import asunit.errors.IllegalOperationError;
|
7
|
-
|
8
|
-
class asunit.framework.AssertTest extends TestCase {
|
9
|
-
private var className:String = "asunit.framework.AssertTest";
|
10
|
-
private var instance:AssertMock;
|
11
|
-
|
12
|
-
public function AssertTest(testMethod:String) {
|
13
|
-
super(testMethod);
|
14
|
-
}
|
15
|
-
|
16
|
-
public function setUp():Void {
|
17
|
-
instance = new AssertMock();
|
18
|
-
}
|
19
|
-
|
20
|
-
public function tearDown():Void {
|
21
|
-
delete instance;
|
22
|
-
}
|
23
|
-
|
24
|
-
public function testAssertTrueFailureA():Void {
|
25
|
-
try {
|
26
|
-
instance.assertTrue(false);
|
27
|
-
fail("assertTrue(false) should throw");
|
28
|
-
}
|
29
|
-
catch(e) {
|
30
|
-
if(!(e instanceof AssertionFailedError)) {
|
31
|
-
fail("assertTrue should have thrown an AssertionFailedError");
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
// instance.assertTrue("faux message", false);
|
37
|
-
|
38
|
-
public function testAssertTrueTooManyArgs():Void {
|
39
|
-
try {
|
40
|
-
instance.assertTrue("faux message", false, false);
|
41
|
-
fail("assertTrue should have failed with too many args");
|
42
|
-
}
|
43
|
-
catch(e) {
|
44
|
-
if(!(e instanceof IllegalOperationError)) {
|
45
|
-
fail(e.toString());
|
46
|
-
}
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
public function testAssertTrueSuccess():Void {
|
51
|
-
try {
|
52
|
-
instance.assertTrue(true);
|
53
|
-
instance.assertTrue("faux message", true);
|
54
|
-
}
|
55
|
-
catch(e) {
|
56
|
-
fail("assertTrue should not have thrown");
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import asunit.errors.AssertionFailedError;
|
2
|
-
import asunit.framework.Test;
|
3
|
-
|
4
|
-
interface asunit.framework.ITestListener {
|
5
|
-
// A test started.
|
6
|
-
public function startTest(test:Test):Void;
|
7
|
-
// An error occurred.
|
8
|
-
public function addError(test:Test, e:Error):Void;
|
9
|
-
// A failure occurred.
|
10
|
-
public function addFailure(test:Test, e:AssertionFailedError):Void;
|
11
|
-
// A test ended.
|
12
|
-
public function endTest(test:Test):Void;
|
13
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import asunit.framework.TestResult;
|
2
|
-
|
3
|
-
interface asunit.framework.Test {
|
4
|
-
|
5
|
-
public function testsComplete():Boolean;
|
6
|
-
public function setResult(result:TestResult):Void;
|
7
|
-
public function setContext(context:MovieClip):Void;
|
8
|
-
public function run():Void;
|
9
|
-
public function countTestCases():Number;
|
10
|
-
public function toString():String;
|
11
|
-
}
|
@@ -1,278 +0,0 @@
|
|
1
|
-
import asunit.framework.Assert;
|
2
|
-
import asunit.framework.Test;
|
3
|
-
import asunit.framework.TestResult;
|
4
|
-
import asunit.errors.AssertionFailedError;
|
5
|
-
import asunit.errors.AssertionPassedError;
|
6
|
-
|
7
|
-
class asunit.framework.TestCase extends Assert implements Test {
|
8
|
-
private var className:String = "[default]";
|
9
|
-
|
10
|
-
private var testMethodsExecuted:Number = 0;
|
11
|
-
private var result:TestResult;
|
12
|
-
private var context:MovieClip;
|
13
|
-
private var currentMethod:String;
|
14
|
-
private var runSingle:Boolean;
|
15
|
-
private var isComplete:Boolean;
|
16
|
-
|
17
|
-
public function TestCase(testMethod:String) {
|
18
|
-
if(testMethod != undefined) {
|
19
|
-
runSingle = true;
|
20
|
-
currentMethod = testMethod;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
/*
|
25
|
-
* You can choose to override this method when implementing
|
26
|
-
* asynchronous test cases.
|
27
|
-
* By default, the TestCaseXml object will call back to this
|
28
|
-
* method and begin execution of the test case.
|
29
|
-
*/
|
30
|
-
public function onXmlLoaded(node:XMLNode):Void {
|
31
|
-
runNow();
|
32
|
-
}
|
33
|
-
|
34
|
-
/*
|
35
|
-
* By default, this method will be triggered from
|
36
|
-
* a TestCaseXml instance. If there is a problem
|
37
|
-
* an error will be shown in the output.
|
38
|
-
*/
|
39
|
-
public function onXmlFailure(node:XML):Void {
|
40
|
-
currentMethod = "onXmlFailure";
|
41
|
-
getResult().addError(this, new Error("TestCaseXml failed to load successfully: " + node.toString()));
|
42
|
-
runNow();
|
43
|
-
}
|
44
|
-
|
45
|
-
public function testsComplete():Boolean {
|
46
|
-
return (getTestMethods().length == testMethodsExecuted);
|
47
|
-
}
|
48
|
-
|
49
|
-
public function countTestCases():Number {
|
50
|
-
return getTestMethods().length;
|
51
|
-
}
|
52
|
-
|
53
|
-
/*
|
54
|
-
* setUp() is called before each method that begins with "test*"
|
55
|
-
* This method should used to instantiate common fixtures
|
56
|
-
*/
|
57
|
-
private function setUp():Void {
|
58
|
-
}
|
59
|
-
|
60
|
-
/*
|
61
|
-
* tearDown() is called after each method that begins with "test*"
|
62
|
-
* This method should be used to destroy any objects created from
|
63
|
-
* the setUp() method call
|
64
|
-
*/
|
65
|
-
private function tearDown():Void {
|
66
|
-
}
|
67
|
-
|
68
|
-
/* cleanUp() is called one time after all test methods have completed
|
69
|
-
* in a single TestCase. This is typically overridden and used to
|
70
|
-
* clean up after an Asynchronous TestCase has completed.
|
71
|
-
*/
|
72
|
-
private function cleanUp():Void {
|
73
|
-
}
|
74
|
-
|
75
|
-
public function setResult(result:TestResult):Void {
|
76
|
-
this.result = result;
|
77
|
-
}
|
78
|
-
|
79
|
-
private function getResult():TestResult {
|
80
|
-
return result;
|
81
|
-
}
|
82
|
-
|
83
|
-
public function setContext(context:MovieClip):Void {
|
84
|
-
this.context = context;
|
85
|
-
}
|
86
|
-
|
87
|
-
public function getContext():MovieClip {
|
88
|
-
return context;
|
89
|
-
}
|
90
|
-
|
91
|
-
public function run():Void {
|
92
|
-
runNow();
|
93
|
-
}
|
94
|
-
|
95
|
-
private function runNow():Void {
|
96
|
-
var result:TestResult = getResult();
|
97
|
-
result.run(this);
|
98
|
-
}
|
99
|
-
|
100
|
-
public function runBare():Void {
|
101
|
-
var methods:Array = getTestMethods();
|
102
|
-
var name:String;
|
103
|
-
try {
|
104
|
-
var len:Number = methods.length;
|
105
|
-
for(var i:Number = 0; i < len; i++) {
|
106
|
-
name = methods[i];
|
107
|
-
try {
|
108
|
-
runMethod(name);
|
109
|
-
}
|
110
|
-
catch(e:Error) {
|
111
|
-
if(e instanceof AssertionFailedError) {
|
112
|
-
result.addFailure(this, AssertionFailedError(e));
|
113
|
-
}
|
114
|
-
else if(!(e instanceof AssertionPassedError)) {
|
115
|
-
result.addError(this, e);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
}
|
119
|
-
}
|
120
|
-
finally {
|
121
|
-
if(!runSingle) {
|
122
|
-
cleanUp();
|
123
|
-
}
|
124
|
-
}
|
125
|
-
|
126
|
-
isComplete = true;
|
127
|
-
}
|
128
|
-
|
129
|
-
private function runMethod(methodName:String):Void {
|
130
|
-
currentMethod = methodName;
|
131
|
-
try {
|
132
|
-
setUp();
|
133
|
-
this[methodName]();
|
134
|
-
}
|
135
|
-
finally {
|
136
|
-
if(!runSingle) {
|
137
|
-
tearDown();
|
138
|
-
}
|
139
|
-
testMethodsExecuted++;
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
private function getTestMethods():Array {
|
144
|
-
if(runSingle) {
|
145
|
-
return new Array(currentMethod);
|
146
|
-
}
|
147
|
-
var methods:Array = new Array();
|
148
|
-
_global.ASSetPropFlags(this.__proto__, null, 6, true);
|
149
|
-
for(var i:String in this) {
|
150
|
-
if(i.indexOf("test") == 0 && this[i] instanceof Function) {
|
151
|
-
methods.push(i);
|
152
|
-
}
|
153
|
-
}
|
154
|
-
_global.ASSetPropFlags(this.__proto__, null, 1, true);
|
155
|
-
methods.reverse();
|
156
|
-
return methods;
|
157
|
-
}
|
158
|
-
|
159
|
-
/**
|
160
|
-
* Returns the name of the currently running test method. This
|
161
|
-
* method is intended for use by the AsUnit framework and should never
|
162
|
-
* have to be called directly.
|
163
|
-
*
|
164
|
-
* @return
|
165
|
-
* A method name. Ex. <code>"testGetValue"</code>.
|
166
|
-
*/
|
167
|
-
public function getCurrentMethod():String {
|
168
|
-
return currentMethod;
|
169
|
-
}
|
170
|
-
|
171
|
-
public function toString():String {
|
172
|
-
return getName() + "." + getCurrentMethod() + "()";
|
173
|
-
}
|
174
|
-
|
175
|
-
public function getName():String {
|
176
|
-
return className;
|
177
|
-
}
|
178
|
-
|
179
|
-
private function createEmptyMovieClip(name:String, depth:Number):MovieClip {
|
180
|
-
return getContext().createEmptyMovieClip(name, depth);
|
181
|
-
}
|
182
|
-
|
183
|
-
private function createTextField(name:String, depth:Number, x:Number, y:Number, width:Number, height:Number):TextField {
|
184
|
-
getContext().createTextField(name, depth, x, y, width, height);
|
185
|
-
return TextField(getContext()[name]);
|
186
|
-
}
|
187
|
-
|
188
|
-
private function getNextHighestDepth():Number {
|
189
|
-
return getContext().getNextHighestDepth();
|
190
|
-
}
|
191
|
-
|
192
|
-
/*
|
193
|
-
* This helper method will support the following method signatures:
|
194
|
-
*
|
195
|
-
* attachMovie(linkageId:String):MovieClip;
|
196
|
-
* attachMovie(linkageId:String, initObject:Object):MovieClip;
|
197
|
-
* attachMovie(linkageId:String, name:String, depth:Number):MovieClip;
|
198
|
-
* attachMovie(linkageId:String, name:String, depth:Number, initObject:Object):MovieClip;
|
199
|
-
*
|
200
|
-
* @return
|
201
|
-
* MovieClip
|
202
|
-
*/
|
203
|
-
private function attachMovie():MovieClip {
|
204
|
-
var linkageId:String = arguments[0];
|
205
|
-
var name:String;
|
206
|
-
var depth:Number;
|
207
|
-
var initObj:Object = new Object();
|
208
|
-
|
209
|
-
switch(arguments.length) {
|
210
|
-
case 1 :
|
211
|
-
case 2 :
|
212
|
-
name = getValidName(getContext(), name);
|
213
|
-
depth = getValidDepth(getContext());
|
214
|
-
initObj = arguments[1];
|
215
|
-
break;
|
216
|
-
case 3 :
|
217
|
-
case 4 :
|
218
|
-
name = arguments[1];
|
219
|
-
depth = arguments[2];
|
220
|
-
initObj = arguments[3];
|
221
|
-
break;
|
222
|
-
}
|
223
|
-
return getContext().attachMovie(linkageId, name, depth, initObj);
|
224
|
-
}
|
225
|
-
|
226
|
-
public function getUpperEmptyDepth(parent:MovieClip, depth:Number):Number {
|
227
|
-
if(depth == undefined || !isValidDepth(parent, depth)) {
|
228
|
-
var high:Number = (depth == undefined) ? 1 : depth;
|
229
|
-
for(var i:String in parent) {
|
230
|
-
if(parent[i] instanceof MovieClip && parent[i].getDepth() != undefined) {
|
231
|
-
high = Math.max(parent[i].getDepth()+1, high);
|
232
|
-
}
|
233
|
-
}
|
234
|
-
return high;
|
235
|
-
}
|
236
|
-
return depth;
|
237
|
-
}
|
238
|
-
|
239
|
-
private function getValidName(parent:MovieClip, nm:Object):String {
|
240
|
-
var incr:Number = 1;
|
241
|
-
|
242
|
-
var name:String = (nm == undefined || nm instanceof Object) ? "item" : nm.toString();
|
243
|
-
var ref:MovieClip = parent[name];
|
244
|
-
|
245
|
-
var name2:String = name;
|
246
|
-
while(ref != undefined && incr < 100) {
|
247
|
-
name2 = name + "-" + (incr++);
|
248
|
-
ref = parent[name2];
|
249
|
-
}
|
250
|
-
return name2;
|
251
|
-
}
|
252
|
-
|
253
|
-
private function isValidDepth(parent:MovieClip, depth:Number):Boolean {
|
254
|
-
var item:MovieClip = getItemByDepth(parent, depth);
|
255
|
-
return (item == null) ? true : false;
|
256
|
-
}
|
257
|
-
|
258
|
-
private function getItemByDepth(parent:MovieClip, depth:Number):MovieClip {
|
259
|
-
for(var i:String in parent) {
|
260
|
-
if(parent[i].getDepth() == depth) {
|
261
|
-
return parent[i];
|
262
|
-
}
|
263
|
-
}
|
264
|
-
return null;
|
265
|
-
}
|
266
|
-
|
267
|
-
private function getValidDepth(mc:MovieClip):Number {
|
268
|
-
var mcDepth:Number;
|
269
|
-
var dp:Number = nextDepth();
|
270
|
-
for(var i:String in mc) {
|
271
|
-
mcDepth = mc[i].getDepth();
|
272
|
-
if(mc[i] instanceof MovieClip && mcDepth < 10000) {
|
273
|
-
dp = Math.max(mcDepth, dp);
|
274
|
-
}
|
275
|
-
}
|
276
|
-
return ++dp;
|
277
|
-
}
|
278
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
|
2
|
-
class asunit.framework.TestCaseMock extends MovieClip {
|
3
|
-
public static var linkageId:String = "__Packages.asunit.framework.TestCaseMock";
|
4
|
-
public static var classRef:Function = TestCaseMock;
|
5
|
-
|
6
|
-
public function TestCaseMock() {
|
7
|
-
draw();
|
8
|
-
}
|
9
|
-
|
10
|
-
public function draw():Void {
|
11
|
-
var w:Number = 100;
|
12
|
-
var h:Number = 100;
|
13
|
-
clear();
|
14
|
-
beginFill(0xFFCC00);
|
15
|
-
lineTo(w, 0);
|
16
|
-
lineTo(w, h);
|
17
|
-
lineTo(0, h);
|
18
|
-
lineTo(0, 0);
|
19
|
-
endFill();
|
20
|
-
}
|
21
|
-
|
22
|
-
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
23
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
|
2
|
-
import asunit.framework.TestCaseMock;
|
3
|
-
import asunit.framework.TestCase;
|
4
|
-
|
5
|
-
class asunit.framework.TestCaseTest extends TestCase {
|
6
|
-
private var className:String = "asunit.framework.TestCaseTest";
|
7
|
-
private var instance:TestCaseMock;
|
8
|
-
|
9
|
-
public function TestCaseTest(testMethod:String) {
|
10
|
-
super(testMethod);
|
11
|
-
}
|
12
|
-
|
13
|
-
public function setUp():Void {
|
14
|
-
var initObj:Object = new Object();
|
15
|
-
instance = TestCaseMock(attachMovie(TestCaseMock.linkageId, initObj));
|
16
|
-
}
|
17
|
-
|
18
|
-
public function tearDown():Void {
|
19
|
-
instance.removeMovieClip();
|
20
|
-
delete instance;
|
21
|
-
}
|
22
|
-
|
23
|
-
public function testInstantiated():Void {
|
24
|
-
assertTrue("TestCaseMock instantiated", instance instanceof TestCaseMock);
|
25
|
-
}
|
26
|
-
|
27
|
-
public function testView():Void {
|
28
|
-
}
|
29
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
import asunit.framework.TestCase;
|
3
|
-
|
4
|
-
class asunit.framework.TestCaseXml extends XML {
|
5
|
-
public static var linkageId:String = "asunit.framework.TestCaseXml";
|
6
|
-
public static var classRef:Function = TestCaseXml;
|
7
|
-
|
8
|
-
private var source:String;
|
9
|
-
private var callback:TestCase;
|
10
|
-
|
11
|
-
public function TestCaseXml(src:String, cb:TestCase) {
|
12
|
-
source = src;
|
13
|
-
callback = cb;
|
14
|
-
ignoreWhite = true;
|
15
|
-
if(src != undefined) {
|
16
|
-
load(source);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
public function onData(data:String):Void {
|
21
|
-
if(data == "" || data == undefined) {
|
22
|
-
callback.onXmlFailure(this);
|
23
|
-
}
|
24
|
-
else {
|
25
|
-
super.onData(data);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
public function onLoad(success:Boolean):Void {
|
30
|
-
if(success) {
|
31
|
-
callback.onXmlLoaded(this.firstChild);
|
32
|
-
} else {
|
33
|
-
callback.onXmlFailure(this);
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
38
|
-
}
|