user562427
user562427

Reputation: 79

IntelliJ with flexunit4

I have a maven project where I am using flexmojos and flexunit and the tests execute fine when building through maven.

However when I try to execute a single test using IntelliJ (right click the on test - run), it creates the _flexunit.swf file and tries to execute it, however there is an exception when it runs:

VerifyError: Error #1014: Class mx.core::Application could not be found.

My knowledge of flexmojos is not great, but I believe it takes care of loading the flex sdk dependencies, however I have tried adding flex sdk dependencies directly in my pom but after that I can't even build in maven, which doesn't happen if I leave those dependencies out:

Unable to locate specified base class 'spark.components.supportClasses.ItemRenderer'

So my question is, what tells IntelliJ to configure the _flexunit.swf not to link the flex sdk? Are there some settings where I have to set these specifically?

Seems like my pom is correctly set up to run the tests (so the TestRunner.swf is fine) but the _flexunit.swf compiled by IntelliJ is missing something...

Upvotes: 1

Views: 617

Answers (1)

Bob
Bob

Reputation: 1625

Sounds to me that you need to do something like this:

<dependency>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-unittest-flexunit4</artifactId>
            <version>4.1-beta</version>
            <type>swc</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.adobe.flex.framework</groupId>
                    <artifactId>playerglobal</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.adobe.flex.framework</groupId>
                    <artifactId>airframework</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Notice the Exclusions Tag.

Upvotes: 0

Related Questions