Running fluint tests from the IDE using AIR?

3 views
Skip to first unread message

sasperilla

unread,
Jun 25, 2009, 9:18:33 AM6/25/09
to Fluint Discussions
I'm trying to setup my project to use Fluint for unit testing, and
I've read the documentation. I'm doing an AIR app so followed the
AIRTestModule.mxml. But how do I get that running in FlexBuilder?
I've defined my module and I see in bin-debug my module's swf. So how
do I run my tests in my IDE for quick turn around? Can I easily setup
some run/debug configuration to fire off my unit tests? Is there
something in the fluint swc that I configure as another Application?

I tried running my tests from the command line using:

/Applications/FluintAIRTestRunner.app/Contents/MacOS/
FluintAIRTestRunner -reportDir='tests/reports' -fileSet='bin-debug/
MyModule.swf'

But, it flashes on the screen and doesn't running anything, and
nothing it written out to tests/reports either.

Charlie

Scott Langeberg

unread,
Jun 25, 2009, 11:46:57 PM6/25/09
to fluint-di...@googlegroups.com
Take code (test harness setup) from your Module class and copy it to an mxml Application file. I just create a shared class to aggregate test suites, like:

TestHelper.getUnitTestSuite();

Calling it from both sections.

sasperilla

unread,
Jun 26, 2009, 8:49:41 AM6/26/09
to Fluint Discussions
I'm not sure how that answers my question. In all fairness I had two
questions so sorry for not being more clear.

The first one was how can I run these tests in my IDE. Since my tests
are testing AIR functionality, say Files, sqlite database, etc. How
will putting them in a mxml Application class work? What you
described sounded like a way where you could run them in Flex and AIR
while sharing the test harness setup code. I'm not interested in
doing that.

I just want to know how I might setup another AIR application using
the same code in FluintAirTestRunner to load my module so I can run my
tests in a debugger and in my IDE.

My other question was why I can't seem to run the AIR test runner from
the command line. Everytime I run it the app flashes on the screen
and immediately exits. I've verified I don't have another instance of
the app running. And I took all of my tests out of the app to see if
it was something failing to setup. Either way, it dies. Maybe I
should start another thread for that.

Charlie

On Jun 25, 11:46 pm, Scott Langeberg <slangeb...@gmail.com> wrote:
> Take code (test harness setup) from your Module class and copy it to an mxml
> Application file. I just create a shared class to aggregate test suites,
> like:
>
> TestHelper.getUnitTestSuite();
>
> Calling it from both sections.
>

Scott Langeberg

unread,
Jun 26, 2009, 9:45:55 AM6/26/09
to fluint-di...@googlegroups.com
Yeah, i didn't let your post fully sink in.

Can you explain:


how can I run these tests in my IDE

You want the IDE to run a test harness within it's own thread? There's no JUnit style runner for within the eclipse / flexbuilder IDE, if you're referring to something like that.

Re: cmd line launch / run:
http://blogs.adobe.com/simplicity/2008/11/how_to_launch_an_air_app_from_the_command_line.html

Gotta run!

Glenn Goodrich

unread,
Jun 26, 2009, 11:23:34 AM6/26/09
to fluint-di...@googlegroups.com
I think I understand the question...have you looked at the
FlexTestRunner.mxml in the source? It's an MXML Application with teh
following code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:fluint="http://www.digitalprimates.net/2008/fluint"
layout="absolute"
creationComplete="startTestProcess(event)"
width="100%" height="100%">

<mx:Script>
<![CDATA[
import net.digitalprimates.fluint.monitor.TestMonitor;
import net.digitalprimates.fluint.unitTests.frameworkSuite.FrameworkSuite;

protected function startTestProcess( event:Event ) : void {
var suiteArray:Array = new Array();
suiteArray.push( new FrameworkSuite() );

testRunner.startTests( suiteArray );
}

]]>
</mx:Script>

<fluint:TestResultDisplay testMonitor="{testRunner.testMonitor}"
width="100%" height="100%" />
<fluint:TestEnvironment id="testEnvironment"/>
<fluint:TestRunner id="testRunner" testEnvironment="{testEnvironment}"/>
</mx:Application>

If you add your TestSuites to the array in starrTestProcess() and run
the app, you should be able to debug your tests.

Again, sorry if I misunderstand what you are asking....hope this helps.

G

sasperilla

unread,
Jun 27, 2009, 12:01:47 AM6/27/09
to Fluint Discussions
Yes. That did help. I don't know why I didn't realize I could take
the guts from flex there and drop it in a WindowedApplication and have
it work. Now my tests are running like they should, and I have a lot
of red to fix. :-)

Thanks
Charlie
> On Fri, Jun 26, 2009 at 9:45 AM, Scott Langeberg<slangeb...@gmail.com> wrote:
> > Yeah, i didn't let your post fully sink in.
>
> > Can you explain:
>
> >> how can I run these tests in my IDE
>
> > You want the IDE to run a test harness within it's own thread? There's no
> > JUnit style runner for within the eclipse / flexbuilder IDE, if you're
> > referring to something like that.
>
> > Re: cmd line launch / run:
> >http://blogs.adobe.com/simplicity/2008/11/how_to_launch_an_air_app_fr...
>
> > Gotta run!
>
> > On Fri, Jun 26, 2009 at 7:49 AM, sasperilla <charlie.hubb...@gmail.com>
Reply all
Reply to author
Forward
0 new messages