1

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...

user562427
  • 79
  • 5
  • What IntelliJ IDEA version? What flexmojos version? I'll be able to help if you attach your pom.xml. You'd better start a thread in IntelliJ IDEA forum: http://devnet.jetbrains.net/community/idea/ideacommunity – Alexander Doroshko May 28 '13 at 13:41
  • IntelliJ 11.1.2, flexmojos 4.2-beta - though I don't think they are the problem as the flexunit turnkey project works fine on it's own. Was more curious where I could potentially tweak the configuration of the _flexunit.swf IntelliJ generates – user562427 May 28 '13 at 13:49
  • found something which suspiciously sounds the same http://youtrack.jetbrains.com/issue/IDEA-70155?projectKey=IDEA will need to investigate, hopefully can nail this one down! – user562427 May 28 '13 at 14:06
  • That issue is fixed long ago. I need your pom.xml to give you any answer. – Alexander Doroshko May 28 '13 at 14:31
  • Working a lot with both, I think is is purely a miss configuration in Intellij, if the tests run fine with mvn, there's nothing wrong with the pom. – bitoiu Sep 12 '13 at 18:46

1 Answers1

0

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.

Bob
  • 1,605
  • 2
  • 18
  • 33