How to Test a custom spark component

4 views
Skip to first unread message

DL

unread,
Mar 29, 2010, 6:32:35 PM3/29/10
to Fluint Discussions
Hi,

I'm hoping someone might how the best way to do this. I have a custom
spark component, extended from SkinableComponent, which consists of
an .as class and a .mxml skin. The component has several states, and
each state contains different set of composite components depending on
the state. For example, the initial state is a place holder label,
but in a different state, the label is swapped out with a bitmap
object.

The problem I'm having is when I change the state of the component,
then call ValidateNow(), the child components in the next state are
not instantiated.

I suspect that Fluint's addChild() method for the TestCase is adding
my spark component to an mx Container. I'm not sure if mx containers
can support spark skinable components.

Please advise,

Thanks,
David

Michael Labriola

unread,
Mar 29, 2010, 6:38:45 PM3/29/10
to Fluint Discussions

Hi David,

You are correct about the container. However, mx container can support
skinnable components. Unfortunately, the order in which things are
created and the length of time it takes appears to be a bit different.

Hoping to produce some best practices for spark components within the
week,
Mike

DL

unread,
Apr 1, 2010, 1:18:49 AM4/1/10
to Fluint Discussions

Thanks. I really appreciate it. I was really scratching my head
trying to figure out how I can force the component lifecycle to run.

-David

dmarr

unread,
May 20, 2010, 6:56:47 PM5/20/10
to Fluint Discussions
Hey David,
Im not sure if you are still looking for a solution to this but the
flexunit4 in 360 seconds had this little snippet:

[Before(async,ui)]
public function setUp():void {
//Create a textInput, add it to the testEnvironment. Wait until it
is created, then run tests on it
textInput = new TextInput();
Async.proceedOnEvent( this, textInput, FlexEvent.CREATION_COMPLETE,
200 );
UIImpersonator.addChild( textInput );
}

I haven't been able to build fluint yet, so im not sure if the
UIImpersonator exists there or not.
--
You received this message because you are subscribed to the Google Groups "Fluint Discussions" group.
To post to this group, send email to fluint-di...@googlegroups.com.
To unsubscribe from this group, send email to fluint-discussi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluint-discussions?hl=en.

Reply all
Reply to author
Forward
0 new messages