Permalink
Browse files

updated robotlegs and signals libraries to current (1.4.0 and 0.7 res…

…pectively). Removed ASUnit as primary unit test framework. Prefer the CI/Ant options with FlexUnit. Moved all of the build dependencies to build/libs and deleted libs.?
  • Loading branch information...
1 parent 9594b40 commit d2f177260b833bbf0f258711b6424a1ecc3cc89a @joelhooks joelhooks committed Nov 7, 2010
View
15 build.properties
@@ -15,6 +15,21 @@ output.dir=${basedir}/bin
docs.dir=${basedir}/docs
output.swc=${output.dir}/${project.name.versioned}.swc
+#build locations
+asdoc.loc=${FLEX_HOME}/bin/asdoc
+main.src.loc=${basedir}/src
+test.src.loc=${basedir}/test
+doc.loc=${basedir}/doc
+lib.loc=${basedir}/build/libs
+bin.loc=${basedir}/bin
+report.loc=${basedir}/report
+dist.loc=${basedir}/dist
+template.loc=${basedir}/build/templates
+
+flex.config=${FLEX_HOME}/frameworks/flex-config.xml
+flex.lib=${FLEX_HOME}/frameworks/libs
+flextask.jar=${FLEX_HOME}/ant/lib/flexTasks.jar
+
# Project links
as3signals.project.link=http://github.com/joelhooks/signals-extensions-CommandSignal
View
55 build.xml
@@ -1,39 +1,70 @@
-<project name="signals-extension-SignalsCommandMap" basedir="." default="swc">
+<project name="signals-extension-SignalsCommandMap" basedir="." default="test">
<!-- Set up a prefix for all environment variables. -->
<property environment="env."/>
<fail unless="env.FLEX_HOME" message="FLEX_HOME needs to be defined as an environment variable or in the Ant build." />
<!-- Copy Flex SDK location from environment variable. This can be set manually instead. -->
<property name="FLEX_HOME" value="${env.FLEX_HOME}" />
<property file="build.properties"/>
+ <taskdef resource="flexUnitTasks.tasks" classpath="${lib.loc}/flexUnitTasks.jar"/>
- <target name="swc" depends="" description="Compile AS3 code into a SWC">
+ <target name="compile" description="Compile AS3 code into a SWC">
<echo>Using Flex SDK at: ${FLEX_HOME}</echo>
-
+
<java jar="${FLEX_HOME}/lib/compc.jar" dir="." fork="true" failonerror="true">
<arg value="+flexlib=${FLEX_HOME}/frameworks" />
<arg value="-incremental=true" />
-
+
<arg value="-source-path+=${src.dir}" />
-
+
<!-- Include all classes in this path. -->
<arg value="-include-sources=${src.dir}/${package.dir}" />
-
+
<!-- Link in classes from swc library (only those used). -->
<arg value="-library-path+=${libs.dir}" />
-
+
<arg value="-output=${output.swc}" />
</java>
-
+
</target>
-
+
<target name="clean-asdoc">
<delete dir="${docs.dir}" failOnError="false" includeEmptyDirs="true"/>
<mkdir dir="${docs.dir}"/>
</target>
-
+
+ <!-- Run Unit Tests -->
+ <target name="test" depends="compile">
+ <echo>[test] Running Unit Tests</echo>
+ <!-- Compile TestRunner.mxml as a SWF -->
+ <java jar="${FLEX_HOME}/lib/mxmlc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true">
+ <arg value="${test.src.loc}/SignalCommandMapTest.mxml"/>
+ <arg value="-source-path=${main.src.loc}"/>
+ <!-- Flash those sweet legs. Blink and you'll miss 'em. -->
+ <arg value="-output=${bin.loc}/TestRunner.swf"/>
+ <arg value="-default-size=200,200"/>
+ <arg value="-default-background-color=0x000000"/>
+ <!-- Include classes from SWCs in this folder, but only the ones we use. -->
+ <arg value="-library-path+=${lib.loc}"/>
+ <!-- So true. -->
+ <arg value="-incremental=true"/>
+ <arg value="-verbose-stacktraces=true"/>
+ <arg value="-headless-server=true"/>
+ </java>
+ <!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
+ <flexunit swf="bin/TestRunner.swf" toDir="${report.loc}" haltonfailure="true" verbose="true" localTrusted="true"/>
+ <!-- Generate readable JUnit-style reports -->
+ <junitreport todir="${report.loc}">
+ <fileset dir="${report.loc}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${report.loc}/html"/>
+ </junitreport>
+ <echo>[test] Finished running Unit Tests</echo>
+ </target>
+
<!-- Build Documentation -->
- <target name="asdoc" depends="swc,clean-asdoc" description="Create API docs for ${project.title}">
+ <target name="asdoc" depends="compile,clean-asdoc" description="Create API docs for ${project.title}">
<echo>Generating ASDOC documentation...</echo>
<tstamp>
<format property="docgen.time" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
@@ -49,5 +80,5 @@
</java>
<echo>ASDOC documentation generated successfully</echo>
</target>
-
+
</project>
View
BIN build/libs/SwiftSuspenders-v1.5.1.swc
Binary file not shown.
View
BIN build/libs/as3-signals-v0.7.swc
Binary file not shown.
View
BIN build/libs/flexUnitTasks.jar
Binary file not shown.
View
BIN build/libs/flexunit-cilistener-4.1.0-beta2.x-sdky.y.y.y.swc
Binary file not shown.
View
BIN build/libs/flexunit-core-flex-4.1.0-beta2.x-sdky.y.y.y.swc
Binary file not shown.
View
BIN build/libs/hamcrest-1.0.2.swc
Binary file not shown.
View
BIN build/libs/robotlegs-framework-v1.4.0.swc
Binary file not shown.
View
BIN libs/as3-signals-v0.6.swc
Binary file not shown.
View
BIN libs/asunit4-alpha.swc
Binary file not shown.
View
BIN libs/robotlegs-framework-v1.1.0b7.swc
Binary file not shown.
View
25 test/SignalCommandMapTest.mxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
+ xmlns:fu="http://www.adobe.com/2009/flexUnitUIRunner"
+ creationComplete="onCreationComplete()"
+ width="200" height="200"
+ backgroundColor="#000000" horizontalScrollPolicy="off" verticalScrollPolicy="off">
+ <mx:Script>
+ <![CDATA[
+ import org.flexunit.internals.TraceListener;
+ import org.flexunit.listeners.CIListener;
+ import org.flexunit.runner.FlexUnitCore;
+ import org.robotlegs.test.suites.SignalCommandMapTestSuite;
+
+ private var core:FlexUnitCore;
+
+ private function onCreationComplete():void
+ {
+ core = new FlexUnitCore();
+ core.addListener(new CIListener());
+ core.addListener(new TraceListener());
+ core.run(SignalCommandMapTestSuite);
+ }
+ ]]>
+ </mx:Script>
+</mx:Application>
View
19 test/SignalCommandMapTestRunner.as
@@ -1,19 +0,0 @@
-package
-{
- import asunit.core.TextCore;
- import org.robotlegs.test.suites.SignalCommandMapTestSuite;
-
- import flash.display.Sprite;
-
- [SWF(width='1000', height='800', backgroundColor='#333333', frameRate='31')]
- public class SignalCommandMapTestRunner extends Sprite
- {
- private var core:TextCore;
-
- public function SignalCommandMapTestRunner()
- {
- core = new TextCore();
- core.start(SignalCommandMapTestSuite, null, this);
- }
- }
-}
View
23 test/org/robotlegs/base/SignalCommandMapTests.as
@@ -1,14 +1,15 @@
package org.robotlegs.base
{
- import asunit.asserts.*;
-
import mx.collections.ArrayCollection;
+
+ import org.flexunit.asserts.assertEquals;
+ import org.flexunit.asserts.assertFalse;
+ import org.flexunit.asserts.assertTrue;
import org.osflash.signals.ISignal;
import org.robotlegs.adapters.SwiftSuspendersInjector;
import org.robotlegs.core.IInjector;
import org.robotlegs.core.ISignalCommandMap;
import org.robotlegs.test.support.*;
- import org.robotlegs.test.support.TestXMLPropertySignal;
public class SignalCommandMapTests
{
@@ -137,7 +138,7 @@ package org.robotlegs.base
var signal:ISignal = signalCommandMap.mapSignalClass(TestCommandPropertySignal, TestNoPropertiesCommand);
var signalTwo:ISignal = injector.instantiate(SignalInjecteeTestClass).signal;
- assertSame(signal, signalTwo);
+ assertEquals(signal, signalTwo);
}
[Test]
@@ -146,7 +147,7 @@ package org.robotlegs.base
var signalOne:ISignal = signalCommandMap.mapSignalClass(TestCommandPropertySignal, TestNoPropertiesCommand);
var signalTwo:ISignal = signalCommandMap.mapSignalClass(TestCommandPropertySignal, TestOnePropertyCommand);
- assertSame(signalOne, signalTwo);
+ assertEquals(signalOne, signalTwo);
}
[Test]
@@ -189,30 +190,30 @@ package org.robotlegs.base
assertTrue(prop.wasExecuted);
}
-
+
[Test]
public function uint_signal_value_properly_injected_into_command():void
{
var prop:TestCommandProperty = new TestCommandProperty();
var i:uint = 3;
var signal:TestUintPropertySignal = new TestUintPropertySignal();
signalCommandMap.mapSignal(signal, TestUintPropertyCommand);
-
+
signal.dispatch(i,prop);
-
+
assertTrue(prop.wasExecuted);
}
-
+
[Test]
public function int_signal_value_properly_injected_into_command():void
{
var prop:TestCommandProperty = new TestCommandProperty();
var i:int = 3;
var signal:TestIntPropertySignal = new TestIntPropertySignal();
signalCommandMap.mapSignal(signal, TestIntPropertyCommand);
-
+
signal.dispatch(i,prop);
-
+
assertTrue(prop.wasExecuted);
}
}
View
3 test/org/robotlegs/mvcs/SignalCommandTests.as
@@ -1,7 +1,6 @@
package org.robotlegs.mvcs
{
- import asunit.asserts.assertTrue;
-
+ import org.flexunit.asserts.assertTrue;
import org.robotlegs.adapters.SwiftSuspendersInjector;
import org.robotlegs.base.SignalCommandMap;
import org.robotlegs.core.IInjector;
View
32 test/org/robotlegs/mvcs/SignalContextTests.as
@@ -1,18 +1,20 @@
package org.robotlegs.mvcs
{
- import flash.display.Sprite;
- import flash.events.Event;
- import asunit.asserts.*;
-import org.robotlegs.core.IInjector;
-import org.robotlegs.core.ISignalCommandMap;
+ import flash.display.Sprite;
+ import flash.events.Event;
+
+ import org.flexunit.asserts.assertEquals;
+ import org.flexunit.asserts.assertTrue;
+ import org.robotlegs.core.IInjector;
+ import org.robotlegs.core.ISignalCommandMap;
import org.robotlegs.core.ISignalContext;
-import org.robotlegs.test.support.SignalContextWithAccessibleInjector;
-import org.robotlegs.test.support.SignalInjecteeTestClass;
-import org.robotlegs.test.support.TestCommandPropertySignal;
-import org.robotlegs.test.support.TestOnePropertyCommand;
+ import org.robotlegs.test.support.SignalContextWithAccessibleInjector;
+ import org.robotlegs.test.support.SignalInjecteeTestClass;
+ import org.robotlegs.test.support.TestCommandPropertySignal;
+ import org.robotlegs.test.support.TestOnePropertyCommand;
-public class SignalContextTests
+ public class SignalContextTests
{
private var signalContext:ISignalContext;
@@ -33,23 +35,23 @@ public class SignalContextTests
{
assertTrue( signalContext.signalCommandMap is ISignalCommandMap );
}
-
+
[Test]
public function contextView_roundtrips_through_constructor():void
{
var contextView:Sprite = new Sprite();
signalContext = new SignalContext(contextView);
-
+
assertEquals(contextView, SignalContext(signalContext).contextView);
}
-
+
[Test]
public function autoStartup_in_constructor_creates_listener_for_ADDED_TO_STAGE_on_contextView():void
{
var contextView:Sprite = new Sprite();
- var autoStartup:Boolean = false;
+ var autoStartup:Boolean = true;
signalContext = new SignalContext(contextView, autoStartup);
-
+
assertTrue(contextView.hasEventListener(Event.ADDED_TO_STAGE));
}
View
1 test/org/robotlegs/test/suites/SignalCommandMapTestSuite.as
@@ -5,6 +5,7 @@ package org.robotlegs.test.suites
import org.robotlegs.mvcs.SignalContextTests;
[Suite]
+ [RunWith("org.flexunit.runners.Suite")]
public class SignalCommandMapTestSuite
{
public var _signalContextTests:SignalContextTests;
View
6 test/org/robotlegs/test/support/SignalContextWithAccessibleInjector.as
@@ -1,9 +1,9 @@
package org.robotlegs.test.support
{
-import org.robotlegs.core.IInjector;
-import org.robotlegs.mvcs.SignalContext;
+ import org.robotlegs.core.IInjector;
+ import org.robotlegs.mvcs.SignalContext;
-public class SignalContextWithAccessibleInjector extends SignalContext
+ public class SignalContextWithAccessibleInjector extends SignalContext
{
public function SignalContextWithAccessibleInjector()
{
View
6 test/org/robotlegs/test/support/TestArrayCollectionPropertySignal.as
@@ -1,10 +1,10 @@
package org.robotlegs.test.support
{
-import mx.collections.ArrayCollection;
+ import mx.collections.ArrayCollection;
-import org.osflash.signals.Signal;
+ import org.osflash.signals.Signal;
-public class TestArrayCollectionPropertySignal extends Signal
+ public class TestArrayCollectionPropertySignal extends Signal
{
public function TestArrayCollectionPropertySignal()
{
View
10 test/org/robotlegs/test/support/TestCommandPropertySignal.as
@@ -1,14 +1,14 @@
package org.robotlegs.test.support
{
- import org.osflash.signals.Signal;
-
- public class TestCommandPropertySignal extends Signal
+ import org.osflash.signals.Signal;
+
+ public class TestCommandPropertySignal extends Signal
{
-
+
public function TestCommandPropertySignal()
{
super(TestCommandProperty);
}
-
+
}
}
View
6 test/org/robotlegs/test/support/TestIntPropertySignal.as
@@ -1,8 +1,8 @@
package org.robotlegs.test.support
{
- import org.osflash.signals.Signal;
-
- public class TestIntPropertySignal extends Signal
+ import org.osflash.signals.Signal;
+
+ public class TestIntPropertySignal extends Signal
{
public function TestIntPropertySignal()
{
View
10 test/org/robotlegs/test/support/TestTwoPropertySignal.as
@@ -1,14 +1,14 @@
package org.robotlegs.test.support
{
- import org.osflash.signals.Signal;
-
- public class TestTwoPropertySignal extends Signal
+ import org.osflash.signals.Signal;
+
+ public class TestTwoPropertySignal extends Signal
{
-
+
public function TestTwoPropertySignal()
{
super(TestCommandProperty, TestCommandProperty2);
}
-
+
}
}
View
6 test/org/robotlegs/test/support/TestUintPropertySignal.as
@@ -1,8 +1,8 @@
package org.robotlegs.test.support
{
- import org.osflash.signals.Signal;
-
- public class TestUintPropertySignal extends Signal
+ import org.osflash.signals.Signal;
+
+ public class TestUintPropertySignal extends Signal
{
public function TestUintPropertySignal()
{

0 comments on commit d2f1772

Please sign in to comment.