|
From: Sam <sa...@th...> - 2006-05-18 15:30:24
|
Chris,
Thanks alot, your proccess works great. I was just about to give up
on the whole thing, so thanks again.
On May 17, 2006, at 9:33 AM, Chris Allen wrote:
> I have a variation on this that I can share with you soon. Sorry that
> I can't do so now, I'm rushing off to a meeting. Will email later.
>
> -Chris
>
> On 5/17/06, Jan Harmsen <za...@ar...> wrote:
>>
>> Hi Sam,
>>
>> I've been following this thread and remember that I struggled
>> myself quite
>> a bit when trying to get unit testing to work under OSX....
>> I don't have too much time currently, but here's at least a short
>> description how to use Asunit with mtasc under OSX:
>>
>>
>> 1. For displaying the results of the testcases / Sys.println
>> statements use
>> the
>> 'AsUnit Ui.swf' which can be found in the AsUnit-src.zip (or if you
>> installed Asunit,
>> it's under
>> '$HOME/Library/Application Support/Macromedia/Flash
>> 8/en/Configuration/WindowSWF/AsUnit Ui.swf'
>> )
>>
>> Fire this up in a browser window and click the 'Show Sys.println'
>> in the
>> lower
>> left corner, then you'll see the output of any Sys.println
>> statements used
>> in
>> your code. (Make sure Sys.as from the Asunit package is in your
>> classpath)
>>
>>
>> 2. Create a Main class for your unit tests like this one:
>> --------------- SNIP -----------------------------------
>> class MainUnitTests {
>>
>> public static function runUnitTests():Void {
>>
>> var st:SelectedTests = new SelectedTests();
>>
>> }
>> }
>> ---------------- SNAP ---------------------------------
>>
>>
>> 3. Create SelectedTests classes for EACH of your packages
>> Example source folder: src
>> Example package structure: org
>>
>> SelectedTests class in ./src:
>> --------------- SNIP -----------------------------------
>> import com.asunit.framework.*;
>>
>> class SelectedTests extends TestSuite {
>> private var className:String = "SelectedTests";
>>
>> public function SelectedTests() {
>> super();
>> addTest(new org.SelectedTests());
>> }
>> }
>>
>> ---------------- SNAP ---------------------------------
>>
>>
>> SelectedTests class in ./src/org:
>> --------------- SNIP -----------------------------------
>> import com.asunit.framework.*;
>>
>> class org.SelectedTests extends TestSuite {
>> private var className:String = "org.SelectedTests";
>>
>> public function SelectedTests() {
>> super();
>> addTest(new org.MyClassOneTest());
>> //addTest(new org.MyClassTwoTest());
>> }
>> }
>> ---------------- SNAP ---------------------------------
>>
>> where MyClassOneTest and MyClassTwoTest are the Asunit Test Classes
>> containing the unit tests for your classes.
>>
>>
>> 4. In your .swf have the following ActionScript code on a frame
>> AFTER the
>> frame where your classes get imported:
>>
>> --------------- SNIP -----------------------------------
>> import MainUnitTests;
>>
>> MainUnitTests.runUnitTests();
>> ---------------- SNAP ---------------------------------
>>
>> 5. Now compile using mtasc:
>>
>> --------------- SNIP -----------------------------------
>> /usr/local/bin/mtasc -strict -keep -frame 6 -cp /path/to/your/
>> classes -swf
>> to/your/swfFile.swf MainUnitTests
>> ---------------- SNAP ---------------------------------
>>
>> This assumes that your classes get imported at frame 6 of
>> your .swf, you
>> need to set this to the frame
>> where your classes should get imported (after the preloader code).
>>
>>
>> 6. Run your .swf and see the results + Sys.println output in
>> 'AsUnit UI.swf'
>>
>> 7. By commenting / uncommenting the statements in SelectedTests
>> you can
>> quickly exclude / include
>> the TestClasses you want to get executed. Just recompile and run,
>> this will
>> execute the tests.
>>
>>
>> Hope this helps you to get started.....
>> I switched from Flash 8 to Eclipse + FDT (http://
>> fdt.powerflasher.com/)
>> which works really well for me.
>>
>> Best regards,
>>
>> Jan Harmsen
>>
>>
>>
>>
>> On 17-Mai-2006, at 03:19, Sam wrote:
>>
>> Hi Chris,
>>
>> Thanks for your input, I have exhausted trying to figure out the
>> XUL stuff.
>> I would be interested in knowing the process you use when making
>> the test
>> cases by hand. Not specifics on unit testing or anything like
>> that, but
>> after you've built the test how do you run them. The documentation
>> on using
>> just the framework seems, well, non-existant.
>> I am using textmate and the mtasc compiler. Actually I'm using a
>> development
>> process I found here:
>> http://www.unfitforprint.com/articles/2006/01/02/howto-develop-
>> flash-on-mac-osx-with-rake-mtasc-swfmill-and-textmate
>> and I'd love to add testing to the process.
>>
>> Thanks much, any suggestions or tips are appreciated.
>> -Sam
>>
>>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
> security?
> Get stuff done quickly with pre-integrated technology to make your
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?
> cmd_______________________________________________
> Asunit-users mailing list
> Asu...@li...
> https://lists.sourceforge.net/lists/listinfo/asunit-users
>
>
|