The mxml file initalizes what I need the tests to do. The Flexmojos does create the TestRunner.swf like the FlexBuilder application. In FlexBuilder we define the default application for the project TestRunner.mxml. Flexmojos creates the TestRunner.swf like the FlexBuilder. But the TestRunner.swf created by the mojos does not seem to be running the creationComplete(..) method to do the loading of the xml.
Is Flexmojos ignoring what is in the mxml file and just using reflection to find the test classes and running them independently? How can we define the entry point for starting the test classes to be after the creationComplete(..) method is run for all classes? Muz On Nov 17, 6:21 pm, Marvin Froeder <[email protected]> wrote: > Well, if you never invoke your application flexmojos won't.... > > Your tests must initialize whatever you need to. > > VELO > > On Tue, Nov 17, 2009 at 3:59 PM, muz <[email protected]> wrote: > > The mxml file is not driving the swf so it never loads the xml file > > from the file system to feed it. > > I have a actionscript class I have implements IApplicationContextAware > > so it will pick up the context when loaded in the durring spring post > > processing. > > I have tried including the module in the build section of the > > flexmojos-maven-plugin as below where TestRunner.mxml is in the src/ > > main/flex directory. This does not work either. > > <moduleFiles> > > <module>TestRunner.mxml</module> > > </moduleFiles> > > > On Nov 16, 7:33 pm, Marvin Froeder <[email protected]> wrote: > > > Can't you embed this xml onto test? > > > > VELO > > > > On Mon, Nov 16, 2009 at 5:28 PM, muz <[email protected]> wrote: > > > > Flex version: 3.2.0.3958 > > > > Flex mojos version : 2.3.0, 3.3.0, 3.4.0, 3.4.2 > > > > The flex unit tests run in the FlexBuilder 3. > > > > > I have been trying to get flex unit tests running from the command > > > > line for CI purposes. > > > > I can get some of my flex unit tests to run on the command line but if > > > > it tries to get the Spring context it null pointers out. > > > > > XMLApplicationContext is called in the onCreationComplete() method to > > > > load the xml file. The xml file is located in the same directory as > > > > the SWF created for the testRunner. > > > > > I always get a null pointer exception 1009 . This is followed by a > > > > Socket error 2004 as below. > > > > I have tried adding a timer into the test mxml to ensure it is loaded > > > > and still get the same result. > > > > Do I have to tell the <build> section where the local files are to > > > > load? I saw there is a <testRunner> section but I have not looked at > > > > the documentation for this section. > > > > > Here is the snippet of the pom.xml > > > > > <dependency> > > > > <groupId>org.springextensions.actionscript</groupId> > > > > <artifactId>spring-actionscript-cairngorm</artifactId> > > > > <version>0.8.1</version> > > > > <type>swc</type> > > > > </dependency> > > > > <dependency> > > > > <groupId>org.springextensions.actionscript</groupId> > > > > <artifactId>spring-actionscript-core</artifactId> > > > > <version>0.8.1</version> > > > > <type>swc</type> > > > > </dependency> > > > > <dependency> > > > > <groupId>org.as3commons</groupId> > > > > <artifactId>as3commons-project</artifactId> > > > > <version>1.0.0</version> > > > > <type>pom</type> > > > > </dependency> > > > > <dependency> > > > > <groupId>org.as3commons</groupId> > > > > <artifactId>as3commons-reflect</artifactId> > > > > <version>1.0.0</version> > > > > <type>swc</type> > > > > </dependency> > > > > <dependency> > > > > <groupId>org.as3commons</groupId> > > > > <artifactId>as3commons-lang</artifactId> > > > > <version>0.1</version> > > > > <type>swc</type> > > > > </dependency> > > > > <dependency> > > > > <groupId>org.springframework</groupId> > > > > <artifactId>spring-actionscript</artifactId> > > > > <version>0.7.1</version> > > > > <type>swc</type> > > > > </dependency> > > > > <dependency> > > > > <groupId>com.adobe.flex.framework</groupId> > > > > <artifactId>flex-framework</artifactId> > > > > <version>3.2.0.3958</version> > > > > <type>pom</type> > > > > </dependency> > > > > <dependency> > > > > <groupId>granite</groupId> > > > > <artifactId>granite</artifactId> > > > > <version>2.0.0</version> > > > > <type>swc</type> > > > > <scope>compile</scope> > > > > </dependency> > > > > <dependency> > > > > <groupId>org.sonatype.flexmojos</groupId> > > > > <artifactId>flexmojos-unittest-support</artifactId> > > > > <version>3.3.0</version> > > > > <scope>test</scope> > > > > <type>swc</type> > > > > </dependency> > > > > ............ > > > > <build> > > > > <testSourceDirectory>src/test/flex</testSourceDirectory> > > > > <sourceDirectory>src/main/flex</sourceDirectory> > > > > <plugins> > > > > <plugin> > > > > <groupId>org.sonatype.flexmojos</groupId> > > > > <artifactId>flexmojos-maven-plugin</artifactId> > > > > <version>3.3.0</version> > > > > <extensions>true</extensions> > > > > <configuration> > > > > <pluginArtifacts> > > > > <artifact>test-application-context.xml</ > > > > artifact> > > > > </pluginArtifacts> > > > > <includeSources> > > > > <sources>src/main/flex</sources> > > > > <sources>src/test/flex</sources> > > > > </includeSources> > > > > <licenses> > > > > <flexbuilder3>xxxx-xxxx-xxxx-xxxx-xxxx-xxxx</ > > > > flexbuilder3> > > > > </licenses> > > > > </configuration> > > > > <dependencies> > > > > <dependency> > > > > <groupId>com.adobe.flex</groupId> > > > > <artifactId>license</artifactId> > > > > <version>3.2.0.3958</version> > > > > </dependency> > > > > </dependencies> > > > > </plugin> > > > > </plugins> > > > > </build> > > > > > Here is the error > > > > > TypeError: Error #1009: Cannot access a property or method of a null > > > > object reference. > > > > ### My actionscript class trying to connect to the Spring context > > > > at org.sonatype.flexmojos.unitestingsupport.flexunit::FlexUnitListener > > > > $/run()[/home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/ > > > > flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/ > > > > unitestingsupport/flexunit/FlexUnitListener.as:29] > > > > at > > > > org.sonatype.flexmojos.unitestingsupport::SocketReporter/runTests() > > > > [/home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/ > > > > flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/ > > > > unitestingsupport/SocketReporter.as:201] > > > > at > > > > org.sonatype.flexmojos.unitestingsupport::TestApplication/runTests > > > > ()[/home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/ > > > > flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/ > > > > unitestingsupport/TestApplication.as:40] > > > > at flash.events::EventDispatcher/dispatchEventFunction() > > > > at flash.events::EventDispatcher/dispatchEvent() > > > > at > > > > mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks > > > > \projects\framework\src\mx\core\UIComponent.as:9298] > > > > at mx.core::UIComponent/set initialized()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] > > > > at > > mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as: > > > > 718] > > > > at > > > > Function/http://adobe.com/AS3/2006/builtin::apply()<http://adobe.com/AS3/2006/builtin::apply%28%29> > > > > at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] > > > > at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] > > > > > Error #2044: Unhandled IOErrorEvent:. text=Error #2031: Socket Error. > > > > at > > > > org.sonatype.flexmojos.unitestingsupport::ControlSocket/connect()[/ > > > > home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/flexmojos- > > > > unittest-support/src/main/flex/org/sonatype/flexmojos/ > > > > unitestingsupport/ControlSocket.as:33] > > > > at > > > > org.sonatype.flexmojos.unitestingsupport::TestApplication/runTests > > > > ()[/home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/ > > > > flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/ > > > > unitestingsupport/TestApplication.as:39] > > > > at flash.events::EventDispatcher/dispatchEventFunction() > > > > at flash.events::EventDispatcher/dispatchEvent() > > > > at > > > > mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks > > > > \projects\framework\src\mx\core\UIComponent.as:9298] > > > > at mx.core::UIComponent/set initialized()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] > > > > at > > mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as: > > > > 718] > > > > at > > > > Function/http://adobe.com/AS3/2006/builtin::apply()<http://adobe.com/AS3/2006/builtin::apply%28%29> > > > > at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] > > > > at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild > > > > \3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] > > > > > -- > > > > 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]<flex-mojos%[email protected]> > > ... > > read more » -- 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?hl=en?hl=en http://blog.flex-mojos.info/
