Hi Group, I'm pretty new to maven so I have some issues using it with
flexmojos. I have a Flex 4 project, wich use swiz and for the
moment use an API to grab mock data. The app works ok, even with a API
class that use a timer to dispatch events to simulate data push


Those are my versions:

Flex 4.0
swiz-framework-1.0.0-RC1

Flex unit(grabbed from project properties show this):
C:/dev/FlashBuilder4/eclipse/plugins/
com.adobe.flexbuilder.flexunit_4.0.0.272416/flexunitframework/libs/
version4libs/Common/flexunit_0.9.swc
C:/dev/FlashBuilder4/eclipse/plugins/
com.adobe.flexbuilder.flexunit_4.0.0.272416/flexunitframework/libs/
version4libs/Common/hamcrest-1.0.2.swc
C:/dev/FlashBuilder4/eclipse/plugins/
com.adobe.flexbuilder.flexunit_4.0.0.272416/flexunitframework/libs/
version4libs/FlexProject/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc
C:/dev/FlashBuilder4/eclipse/plugins/
com.adobe.flexbuilder.flexunit_4.0.0.272416/flexunitframework/libs/
version4libs/FlexProject/flexunitextended.swc
C:/dev/FlashBuilder4/eclipse/plugins/
com.adobe.flexbuilder.flexunit_4.0.0.272416/flexunitframework/locale/
version4locale/FlexUnitTestRunner_rb.swc



I've  created a sample test using swiz autorwiringTestCase and works
perfecly whitin Flash builder, but my problem happen when
I run this test from maven, the error is the one below:



[DEBUG] [RESULT] End test suite
[DEBUG] [RESULT] Recivied data: <testsuite errors="0" failures="1"
name="flexUnitTests.GridTests" tests="1" time="0">
  <testcase name="testControllerActionRequested" time="0">
    <failure message="Timeout Occurred before expected event"
type="flexUnitTests.GridTests">Error: Timeout Occurred before expected
event
    at org.flexunit.internals.runners.statements::ExpectAsync/
handleAsyncTimeOut()[E:\hudson\jobs\FlexUnit4-Flex4\workspace
\FlexUnit4\src\org\flexunit\internals\runners\statements
\ExpectAsync.as:315]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.flexunit.async::AsyncHandler/handleTimeout()[E:\hudson\jobs
\FlexUnit4-Flex4\workspace\FlexUnit4\src\org\flexunit\async
\AsyncHandler.as:175]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.utils::Timer/tick()</failure>
  </testcase>
</testsuite>
[DEBUG] [RESULT] End test suite
[DEBUG] [RESULT] Recivied data: <endOfTestRun/>
[DEBUG] [RESULT] End test run - sending ACK: <endOfTestRunAck/>
[DEBUG] [RESULT] Socket buffer
[DEBUG] [CONTROL] query status
[DEBUG] [CONTROL] received status
[DEBUG] [CONTROL] status is: FINISHED
[DEBUG] [CONTROL] FINISHED received, terminating the thread
[DEBUG] [MOJO] launcher RUNNING
[DEBUG] [MOJO] pinger DONE
[DEBUG] [MOJO] resultHandler DONE
[DEBUG] [MOJO] launcher RUNNING
[DEBUG] [MOJO] pinger DONE
[DEBUG] [MOJO] resultHandler DONE
[DEBUG] [MOJO] launcher RUNNING
[DEBUG] [MOJO] pinger DONE
[DEBUG] [MOJO] resultHandler DONE
[DEBUG] [LAUNCHER] Flashplayer closed
[DEBUG] [LAUNCHER] Flashplayer exit as expected
[DEBUG] [MOJO] launcher DONE
[DEBUG] [MOJO] pinger DONE
[DEBUG] [MOJO] resultHandler DONE
[DEBUG] [MOJO] Test report of flexUnitTests.CheckColumnsMinSizeTest
[DEBUG] <testsuite errors="0" failures="0"
name="flexUnitTests.CheckColumnsMinSizeTest" tests="8" time="0">
  <testcase name="expiryColumnMinWidth" time="0"/>
  <testcase name="sellColumnMinWidth" time="0"/>
  <testcase name="infoColumnMinWidth" time="0"/>
  <testcase name="stateColumnMinWidth" time="0"/>
  <testcase name="marketColumnMinWidth" time="0"/>
  <testcase name="rendererColumnMinWidth" time="0"/>
  <testcase name="buyColumnMinWidth" time="0"/>
  <testcase name="changeColumnMinWidth" time="0"/>
</testsuite>
[DEBUG] [MOJO] Test report of flexUnitTests.GridTests
[DEBUG] <testsuite errors="0" failures="1"
name="flexUnitTests.GridTests" tests="1" time="0">
  <testcase name="testControllerActionRequested" time="0">
    <failure message="Timeout Occurred before expected event"
type="flexUnitTests.GridTests">Error: Timeout Occurred before expected
event
    at org.flexunit.internals.runners.statements::ExpectAsync/
handleAsyncTimeOut()[E:\hudson\jobs\FlexUnit4-Flex4\workspace
\FlexUnit4\src\org\flexunit\internals\runners\statements
\ExpectAsync.as:315]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.flexunit.async::AsyncHandler/handleTimeout()[E:\hudson\jobs
\FlexUnit4-Flex4\workspace\FlexUnit4\src\org\flexunit\async
\AsyncHandler.as:175]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.utils::Timer/tick()</failure>
  </testcase>
</testsuite>
[WARNING] Unit test flexUnitTests.GridTests failed.
[INFO]
------------------------------------------------------------------------
[INFO] Tests run: 9, Failures: 0, Errors: 1, Time Elapsed: 0 sec
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Some tests fail
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Some tests
fail
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
719)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:
556)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
535)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:
387)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:
348)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:
180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:
60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:
315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some tests
fail
    at
org.sonatype.flexmojos.test.FlexUnitMojo.tearDown(FlexUnitMojo.java:
307)
    at
org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:
152)
    at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
490)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
694)
    ... 17 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 52 seconds
[INFO] Finished at: Mon Jul 26 14:27:20 GFT 2010
[INFO] Final Memory: 31M/216M
[INFO]
------------------------------------------------------------------------



My master pom file(partially pasted here) is :


   <properties>
    <flex.version>4.1.0.15646</flex.version>
    <flashplayer.version.major>10.0</flashplayer.version.major>
    <flashplayer.version.minor>0</flashplayer.version.minor>
    <flexunit.version>4.0</flexunit.version> <!--<flexunit.version>4.0|
4.0-rc-1</flexunit.version>-->
    <flexmojos.version>3.6.1</flexmojos.version>   <!--
<flexmojos.version>3.6.1|3.7-SNAPSHOT|3.7|4.0-SNAPSHOT</
flexmojos.version>-->
    <sonar.language>flex</sonar.language>
    <sonar.dynamicAnalysis>false</sonar.dynamicAnalysis>
    <root.basedir>${project.basedir}</root.basedir>
  </properties>


  and project pom file(partially pasted here) is:

  <parent>
    <groupId>MYGROUPID</groupId>
    <artifactId>MASTER_PROJECT_NAME</artifactId>
    <version>0.190-SNAPSHOT</version>
  </parent>

  <artifactId>Components.MarketGrid</artifactId>
  <name>Components.MarketGrid</name>
  <packaging>swc</packaging>

  <properties>
    <root.basedir>${project.parent.basedir}</root.basedir>
  </properties>

  <build>
    <sourceDirectory>src/main</sourceDirectory>
    <testSourceDirectory>src/test</testSourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <executions>
          <execution>
            <id>remove-FlexUnitApplication</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <filesets>
            <fileset>
              <directory>src/main</directory>
              <includes>
                <include>FlexUnitApplication.mxml</include>
                <include>FlexUnitCompilerApplication.mxml</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.sonatype.flexmojos</groupId>
        <artifactId>flexmojos-maven-plugin</artifactId>
        <version>${flexmojos.version}</version>
        <extensions>true</extensions>
        <configuration>
            <moduleFiles>
                <module>com\myCompany\MarketGrid.mxml</module>
            </moduleFiles>
            <includeTestFiles>
                <includeTestFile>*.as</includeTestFile>
            </includeTestFiles>
          <locales>
            <locale>en_US</locale>
          </locales>
          <targetPlayer>${flashplayer.version.major}.$
{flashplayer.version.minor}</targetPlayer>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>com.adobe.flex</groupId>
                <artifactId>compiler</artifactId>
                <version>${flex.version}</version>
                <type>pom</type>
          </dependency>




        </dependencies>
      </plugin>
    </plugins>
  </build>

  <dependencies>

    <dependency>
       <groupId>org.swizframework</groupId>
       <artifactId>swiz-framework</artifactId>
       <version>1.0.0-RC1</version>
       <type>swc</type>
    </dependency>

    <dependency>
       <groupId>MYGROUPID</groupId>
       <artifactId>TradingApiClient.Core</artifactId>
       <!--version>${project.parent.version}</version-->
       <version>0.180-SNAPSHOT</version>
       <type>swc</type>
    </dependency>

    <dependency>
      <groupId>com.adobe.flex.framework</groupId>
      <artifactId>flex-framework</artifactId>
      <version>${flex.version}</version>
      <type>pom</type>
      <exclusions>
        <!-- make sure to exclude the default 'playerglobal'
transitive dependency -->
        <exclusion>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>playerglobal</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>com.adobe.flex.framework</groupId>
      <artifactId>playerglobal</artifactId>
      <version>${flex.version}</version>  <!-- this artifact version
must match the flex SDK version used in this project -->
      <classifier>${flashplayer.version.major}</classifier>  <!-- the
classifier specifies the target flash player major version  -->
      <type>swc</type>
    </dependency>

<dependency>
         <groupId>com.adobe.flexunit</groupId>
         <artifactId>flexunit</artifactId>
         <version>${flexunit.version}</version>
         <type>swc</type>
         <scope>test</scope>
      </dependency>

  </dependencies>





Any help would be awsome, aswell english lessons!

Regards,
ND

-- 
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos

http://flexmojos.sonatype.org/

Reply via email to