Sha256: aa648993dbb8e02447c76f1657f30de04402f08260455cf8d840e30e70a0fa4c

Contents?: true

Size: 971 Bytes

Versions: 28

Compression:

Stored size: 971 Bytes

Contents

import com.asunit.framework.*;
import com.asunit.util.*;

class com.asunit.framework.TestRunner extends Array {
	public static var localConn:LocalConnClient;
	private var intervalId:Number;
	private var interval:Number = 10;
	private var tests:Array;

	private static function getLocalConn():LocalConnClient {
		if(localConn == null) {
			localConn = LocalConnGateway.createClient("_AsUnitTestRunner");
			localConn["clearTestDisplay"]();
		}
		return localConn;
	}

	public function TestRunner() {
		tests = new Array();
	}

	public function push(item:Object):Number {
		var num:Number = tests.push(item);
		clearInterval(intervalId);

		if(num > 100) {
			renderTests();
		} else {
			intervalId = setInterval(this, "renderTests", interval);
		}
		return num;
	}

	public function renderTests():Void {
		clearInterval(intervalId);
		var lc:LocalConnClient = getLocalConn();
		lc["addTests"](tests);
		tests = new Array();
	}
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
asproject-0.1.69 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as
asproject-0.1.75 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as
asproject-0.1.74 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as
asproject-0.1.71 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as
asproject-0.1.84 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as
asproject-0.1.80 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as
asproject-0.1.89 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as
asproject-0.1.92 templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as