Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit d2f177260b833bbf0f258711b6424a1ecc3cc89a 1 parent 9594b40
Joel Hooks joelhooks authored

Showing 24 changed files with 136 additions and 81 deletions. Show diff stats Hide diff stats

  1. +15 0 build.properties
  2. +43 12 build.xml
  3. BIN  build/libs/SwiftSuspenders-v1.5.1.swc
  4. BIN  build/libs/as3-signals-v0.7.swc
  5. BIN  build/libs/flexUnitTasks.jar
  6. BIN  build/libs/flexunit-cilistener-4.1.0-beta2.x-sdky.y.y.y.swc
  7. BIN  build/libs/flexunit-core-flex-4.1.0-beta2.x-sdky.y.y.y.swc
  8. BIN  build/libs/hamcrest-1.0.2.swc
  9. BIN  build/libs/robotlegs-framework-v1.4.0.swc
  10. BIN  libs/as3-signals-v0.6.swc
  11. BIN  libs/asunit4-alpha.swc
  12. BIN  libs/robotlegs-framework-v1.1.0b7.swc
  13. +25 0 test/SignalCommandMapTest.mxml
  14. +0 19 test/SignalCommandMapTestRunner.as
  15. +12 11 test/org/robotlegs/base/SignalCommandMapTests.as
  16. +1 2  test/org/robotlegs/mvcs/SignalCommandTests.as
  17. +17 15 test/org/robotlegs/mvcs/SignalContextTests.as
  18. +1 0  test/org/robotlegs/test/suites/SignalCommandMapTestSuite.as
  19. +3 3 test/org/robotlegs/test/support/SignalContextWithAccessibleInjector.as
  20. +3 3 test/org/robotlegs/test/support/TestArrayCollectionPropertySignal.as
  21. +5 5 test/org/robotlegs/test/support/TestCommandPropertySignal.as
  22. +3 3 test/org/robotlegs/test/support/TestIntPropertySignal.as
  23. +5 5 test/org/robotlegs/test/support/TestTwoPropertySignal.as
  24. +3 3 test/org/robotlegs/test/support/TestUintPropertySignal.as
15 build.properties
@@ -15,6 +15,21 @@ output.dir=${basedir}/bin
15 15 docs.dir=${basedir}/docs
16 16 output.swc=${output.dir}/${project.name.versioned}.swc
17 17
  18 +#build locations
  19 +asdoc.loc=${FLEX_HOME}/bin/asdoc
  20 +main.src.loc=${basedir}/src
  21 +test.src.loc=${basedir}/test
  22 +doc.loc=${basedir}/doc
  23 +lib.loc=${basedir}/build/libs
  24 +bin.loc=${basedir}/bin
  25 +report.loc=${basedir}/report
  26 +dist.loc=${basedir}/dist
  27 +template.loc=${basedir}/build/templates
  28 +
  29 +flex.config=${FLEX_HOME}/frameworks/flex-config.xml
  30 +flex.lib=${FLEX_HOME}/frameworks/libs
  31 +flextask.jar=${FLEX_HOME}/ant/lib/flexTasks.jar
  32 +
18 33 # Project links
19 34 as3signals.project.link=http://github.com/joelhooks/signals-extensions-CommandSignal
20 35
55 build.xml
... ... @@ -1,4 +1,4 @@
1   -<project name="signals-extension-SignalsCommandMap" basedir="." default="swc">
  1 +<project name="signals-extension-SignalsCommandMap" basedir="." default="test">
2 2
3 3 <!-- Set up a prefix for all environment variables. -->
4 4 <property environment="env."/>
@@ -6,34 +6,65 @@
6 6 <!-- Copy Flex SDK location from environment variable. This can be set manually instead. -->
7 7 <property name="FLEX_HOME" value="${env.FLEX_HOME}" />
8 8 <property file="build.properties"/>
  9 + <taskdef resource="flexUnitTasks.tasks" classpath="${lib.loc}/flexUnitTasks.jar"/>
9 10
10   - <target name="swc" depends="" description="Compile AS3 code into a SWC">
  11 + <target name="compile" description="Compile AS3 code into a SWC">
11 12 <echo>Using Flex SDK at: ${FLEX_HOME}</echo>
12   -
  13 +
13 14 <java jar="${FLEX_HOME}/lib/compc.jar" dir="." fork="true" failonerror="true">
14 15 <arg value="+flexlib=${FLEX_HOME}/frameworks" />
15 16 <arg value="-incremental=true" />
16   -
  17 +
17 18 <arg value="-source-path+=${src.dir}" />
18   -
  19 +
19 20 <!-- Include all classes in this path. -->
20 21 <arg value="-include-sources=${src.dir}/${package.dir}" />
21   -
  22 +
22 23 <!-- Link in classes from swc library (only those used). -->
23 24 <arg value="-library-path+=${libs.dir}" />
24   -
  25 +
25 26 <arg value="-output=${output.swc}" />
26 27 </java>
27   -
  28 +
28 29 </target>
29   -
  30 +
30 31 <target name="clean-asdoc">
31 32 <delete dir="${docs.dir}" failOnError="false" includeEmptyDirs="true"/>
32 33 <mkdir dir="${docs.dir}"/>
33 34 </target>
34   -
  35 +
  36 + <!-- Run Unit Tests -->
  37 + <target name="test" depends="compile">
  38 + <echo>[test] Running Unit Tests</echo>
  39 + <!-- Compile TestRunner.mxml as a SWF -->
  40 + <java jar="${FLEX_HOME}/lib/mxmlc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true">
  41 + <arg value="${test.src.loc}/SignalCommandMapTest.mxml"/>
  42 + <arg value="-source-path=${main.src.loc}"/>
  43 + <!-- Flash those sweet legs. Blink and you'll miss 'em. -->
  44 + <arg value="-output=${bin.loc}/TestRunner.swf"/>
  45 + <arg value="-default-size=200,200"/>
  46 + <arg value="-default-background-color=0x000000"/>
  47 + <!-- Include classes from SWCs in this folder, but only the ones we use. -->
  48 + <arg value="-library-path+=${lib.loc}"/>
  49 + <!-- So true. -->
  50 + <arg value="-incremental=true"/>
  51 + <arg value="-verbose-stacktraces=true"/>
  52 + <arg value="-headless-server=true"/>
  53 + </java>
  54 + <!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
  55 + <flexunit swf="bin/TestRunner.swf" toDir="${report.loc}" haltonfailure="true" verbose="true" localTrusted="true"/>
  56 + <!-- Generate readable JUnit-style reports -->
  57 + <junitreport todir="${report.loc}">
  58 + <fileset dir="${report.loc}">
  59 + <include name="TEST-*.xml"/>
  60 + </fileset>
  61 + <report format="frames" todir="${report.loc}/html"/>
  62 + </junitreport>
  63 + <echo>[test] Finished running Unit Tests</echo>
  64 + </target>
  65 +
35 66 <!-- Build Documentation -->
36   - <target name="asdoc" depends="swc,clean-asdoc" description="Create API docs for ${project.title}">
  67 + <target name="asdoc" depends="compile,clean-asdoc" description="Create API docs for ${project.title}">
37 68 <echo>Generating ASDOC documentation...</echo>
38 69 <tstamp>
39 70 <format property="docgen.time" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
@@ -49,5 +80,5 @@
49 80 </java>
50 81 <echo>ASDOC documentation generated successfully</echo>
51 82 </target>
52   -
  83 +
53 84 </project>
BIN  build/libs/SwiftSuspenders-v1.5.1.swc
Binary file not shown
BIN  build/libs/as3-signals-v0.7.swc
Binary file not shown
BIN  build/libs/flexUnitTasks.jar
Binary file not shown
BIN  build/libs/flexunit-cilistener-4.1.0-beta2.x-sdky.y.y.y.swc
Binary file not shown
BIN  build/libs/flexunit-core-flex-4.1.0-beta2.x-sdky.y.y.y.swc
Binary file not shown
BIN  build/libs/hamcrest-1.0.2.swc
Binary file not shown
BIN  build/libs/robotlegs-framework-v1.4.0.swc
Binary file not shown
BIN  libs/as3-signals-v0.6.swc
Binary file not shown
BIN  libs/asunit4-alpha.swc
Binary file not shown
BIN  libs/robotlegs-framework-v1.1.0b7.swc
Binary file not shown
25 test/SignalCommandMapTest.mxml
... ... @@ -0,0 +1,25 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3 + xmlns:fu="http://www.adobe.com/2009/flexUnitUIRunner"
  4 + creationComplete="onCreationComplete()"
  5 + width="200" height="200"
  6 + backgroundColor="#000000" horizontalScrollPolicy="off" verticalScrollPolicy="off">
  7 + <mx:Script>
  8 + <![CDATA[
  9 + import org.flexunit.internals.TraceListener;
  10 + import org.flexunit.listeners.CIListener;
  11 + import org.flexunit.runner.FlexUnitCore;
  12 + import org.robotlegs.test.suites.SignalCommandMapTestSuite;
  13 +
  14 + private var core:FlexUnitCore;
  15 +
  16 + private function onCreationComplete():void
  17 + {
  18 + core = new FlexUnitCore();
  19 + core.addListener(new CIListener());
  20 + core.addListener(new TraceListener());
  21 + core.run(SignalCommandMapTestSuite);
  22 + }
  23 + ]]>
  24 + </mx:Script>
  25 +</mx:Application>
19 test/SignalCommandMapTestRunner.as
... ... @@ -1,19 +0,0 @@
1   -package
2   -{
3   - import asunit.core.TextCore;
4   - import org.robotlegs.test.suites.SignalCommandMapTestSuite;
5   -
6   - import flash.display.Sprite;
7   -
8   - [SWF(width='1000', height='800', backgroundColor='#333333', frameRate='31')]
9   - public class SignalCommandMapTestRunner extends Sprite
10   - {
11   - private var core:TextCore;
12   -
13   - public function SignalCommandMapTestRunner()
14   - {
15   - core = new TextCore();
16   - core.start(SignalCommandMapTestSuite, null, this);
17   - }
18   - }
19   -}
23 test/org/robotlegs/base/SignalCommandMapTests.as
... ... @@ -1,14 +1,15 @@
1 1 package org.robotlegs.base
2 2 {
3   - import asunit.asserts.*;
4   -
5 3 import mx.collections.ArrayCollection;
  4 +
  5 + import org.flexunit.asserts.assertEquals;
  6 + import org.flexunit.asserts.assertFalse;
  7 + import org.flexunit.asserts.assertTrue;
6 8 import org.osflash.signals.ISignal;
7 9 import org.robotlegs.adapters.SwiftSuspendersInjector;
8 10 import org.robotlegs.core.IInjector;
9 11 import org.robotlegs.core.ISignalCommandMap;
10 12 import org.robotlegs.test.support.*;
11   - import org.robotlegs.test.support.TestXMLPropertySignal;
12 13
13 14 public class SignalCommandMapTests
14 15 {
@@ -137,7 +138,7 @@ package org.robotlegs.base
137 138 var signal:ISignal = signalCommandMap.mapSignalClass(TestCommandPropertySignal, TestNoPropertiesCommand);
138 139 var signalTwo:ISignal = injector.instantiate(SignalInjecteeTestClass).signal;
139 140
140   - assertSame(signal, signalTwo);
  141 + assertEquals(signal, signalTwo);
141 142 }
142 143
143 144 [Test]
@@ -146,7 +147,7 @@ package org.robotlegs.base
146 147 var signalOne:ISignal = signalCommandMap.mapSignalClass(TestCommandPropertySignal, TestNoPropertiesCommand);
147 148 var signalTwo:ISignal = signalCommandMap.mapSignalClass(TestCommandPropertySignal, TestOnePropertyCommand);
148 149
149   - assertSame(signalOne, signalTwo);
  150 + assertEquals(signalOne, signalTwo);
150 151 }
151 152
152 153 [Test]
@@ -189,7 +190,7 @@ package org.robotlegs.base
189 190
190 191 assertTrue(prop.wasExecuted);
191 192 }
192   -
  193 +
193 194 [Test]
194 195 public function uint_signal_value_properly_injected_into_command():void
195 196 {
@@ -197,12 +198,12 @@ package org.robotlegs.base
197 198 var i:uint = 3;
198 199 var signal:TestUintPropertySignal = new TestUintPropertySignal();
199 200 signalCommandMap.mapSignal(signal, TestUintPropertyCommand);
200   -
  201 +
201 202 signal.dispatch(i,prop);
202   -
  203 +
203 204 assertTrue(prop.wasExecuted);
204 205 }
205   -
  206 +
206 207 [Test]
207 208 public function int_signal_value_properly_injected_into_command():void
208 209 {
@@ -210,9 +211,9 @@ package org.robotlegs.base
210 211 var i:int = 3;
211 212 var signal:TestIntPropertySignal = new TestIntPropertySignal();
212 213 signalCommandMap.mapSignal(signal, TestIntPropertyCommand);
213   -
  214 +
214 215 signal.dispatch(i,prop);
215   -
  216 +
216 217 assertTrue(prop.wasExecuted);
217 218 }
218 219 }
3  test/org/robotlegs/mvcs/SignalCommandTests.as
... ... @@ -1,7 +1,6 @@
1 1 package org.robotlegs.mvcs
2 2 {
3   - import asunit.asserts.assertTrue;
4   -
  3 + import org.flexunit.asserts.assertTrue;
5 4 import org.robotlegs.adapters.SwiftSuspendersInjector;
6 5 import org.robotlegs.base.SignalCommandMap;
7 6 import org.robotlegs.core.IInjector;
32 test/org/robotlegs/mvcs/SignalContextTests.as
... ... @@ -1,18 +1,20 @@
1 1 package org.robotlegs.mvcs
2 2 {
3   - import flash.display.Sprite;
4   - import flash.events.Event;
5   - import asunit.asserts.*;
6 3
7   -import org.robotlegs.core.IInjector;
8   -import org.robotlegs.core.ISignalCommandMap;
  4 + import flash.display.Sprite;
  5 + import flash.events.Event;
  6 +
  7 + import org.flexunit.asserts.assertEquals;
  8 + import org.flexunit.asserts.assertTrue;
  9 + import org.robotlegs.core.IInjector;
  10 + import org.robotlegs.core.ISignalCommandMap;
9 11 import org.robotlegs.core.ISignalContext;
10   -import org.robotlegs.test.support.SignalContextWithAccessibleInjector;
11   -import org.robotlegs.test.support.SignalInjecteeTestClass;
12   -import org.robotlegs.test.support.TestCommandPropertySignal;
13   -import org.robotlegs.test.support.TestOnePropertyCommand;
  12 + import org.robotlegs.test.support.SignalContextWithAccessibleInjector;
  13 + import org.robotlegs.test.support.SignalInjecteeTestClass;
  14 + import org.robotlegs.test.support.TestCommandPropertySignal;
  15 + import org.robotlegs.test.support.TestOnePropertyCommand;
14 16
15   -public class SignalContextTests
  17 + public class SignalContextTests
16 18 {
17 19 private var signalContext:ISignalContext;
18 20
@@ -33,23 +35,23 @@ public class SignalContextTests
33 35 {
34 36 assertTrue( signalContext.signalCommandMap is ISignalCommandMap );
35 37 }
36   -
  38 +
37 39 [Test]
38 40 public function contextView_roundtrips_through_constructor():void
39 41 {
40 42 var contextView:Sprite = new Sprite();
41 43 signalContext = new SignalContext(contextView);
42   -
  44 +
43 45 assertEquals(contextView, SignalContext(signalContext).contextView);
44 46 }
45   -
  47 +
46 48 [Test]
47 49 public function autoStartup_in_constructor_creates_listener_for_ADDED_TO_STAGE_on_contextView():void
48 50 {
49 51 var contextView:Sprite = new Sprite();
50   - var autoStartup:Boolean = false;
  52 + var autoStartup:Boolean = true;
51 53 signalContext = new SignalContext(contextView, autoStartup);
52   -
  54 +
53 55 assertTrue(contextView.hasEventListener(Event.ADDED_TO_STAGE));
54 56 }
55 57
1  test/org/robotlegs/test/suites/SignalCommandMapTestSuite.as
@@ -5,6 +5,7 @@ package org.robotlegs.test.suites
5 5 import org.robotlegs.mvcs.SignalContextTests;
6 6
7 7 [Suite]
  8 + [RunWith("org.flexunit.runners.Suite")]
8 9 public class SignalCommandMapTestSuite
9 10 {
10 11 public var _signalContextTests:SignalContextTests;
6 test/org/robotlegs/test/support/SignalContextWithAccessibleInjector.as
... ... @@ -1,9 +1,9 @@
1 1 package org.robotlegs.test.support
2 2 {
3   -import org.robotlegs.core.IInjector;
4   -import org.robotlegs.mvcs.SignalContext;
  3 + import org.robotlegs.core.IInjector;
  4 + import org.robotlegs.mvcs.SignalContext;
5 5
6   -public class SignalContextWithAccessibleInjector extends SignalContext
  6 + public class SignalContextWithAccessibleInjector extends SignalContext
7 7 {
8 8 public function SignalContextWithAccessibleInjector()
9 9 {
6 test/org/robotlegs/test/support/TestArrayCollectionPropertySignal.as
... ... @@ -1,10 +1,10 @@
1 1 package org.robotlegs.test.support
2 2 {
3   -import mx.collections.ArrayCollection;
  3 + import mx.collections.ArrayCollection;
4 4
5   -import org.osflash.signals.Signal;
  5 + import org.osflash.signals.Signal;
6 6
7   -public class TestArrayCollectionPropertySignal extends Signal
  7 + public class TestArrayCollectionPropertySignal extends Signal
8 8 {
9 9 public function TestArrayCollectionPropertySignal()
10 10 {
10 test/org/robotlegs/test/support/TestCommandPropertySignal.as
... ... @@ -1,14 +1,14 @@
1 1 package org.robotlegs.test.support
2 2 {
3   - import org.osflash.signals.Signal;
4   -
5   - public class TestCommandPropertySignal extends Signal
  3 + import org.osflash.signals.Signal;
  4 +
  5 + public class TestCommandPropertySignal extends Signal
6 6 {
7   -
  7 +
8 8 public function TestCommandPropertySignal()
9 9 {
10 10 super(TestCommandProperty);
11 11 }
12   -
  12 +
13 13 }
14 14 }
6 test/org/robotlegs/test/support/TestIntPropertySignal.as
... ... @@ -1,8 +1,8 @@
1 1 package org.robotlegs.test.support
2 2 {
3   - import org.osflash.signals.Signal;
4   -
5   - public class TestIntPropertySignal extends Signal
  3 + import org.osflash.signals.Signal;
  4 +
  5 + public class TestIntPropertySignal extends Signal
6 6 {
7 7 public function TestIntPropertySignal()
8 8 {
10 test/org/robotlegs/test/support/TestTwoPropertySignal.as
... ... @@ -1,14 +1,14 @@
1 1 package org.robotlegs.test.support
2 2 {
3   - import org.osflash.signals.Signal;
4   -
5   - public class TestTwoPropertySignal extends Signal
  3 + import org.osflash.signals.Signal;
  4 +
  5 + public class TestTwoPropertySignal extends Signal
6 6 {
7   -
  7 +
8 8 public function TestTwoPropertySignal()
9 9 {
10 10 super(TestCommandProperty, TestCommandProperty2);
11 11 }
12   -
  12 +
13 13 }
14 14 }
6 test/org/robotlegs/test/support/TestUintPropertySignal.as
... ... @@ -1,8 +1,8 @@
1 1 package org.robotlegs.test.support
2 2 {
3   - import org.osflash.signals.Signal;
4   -
5   - public class TestUintPropertySignal extends Signal
  3 + import org.osflash.signals.Signal;
  4 +
  5 + public class TestUintPropertySignal extends Signal
6 6 {
7 7 public function TestUintPropertySignal()
8 8 {

0 comments on commit d2f1772

Please sign in to comment.
Something went wrong with that request. Please try again.