1 2 Previous Next 42 Replies Latest reply: Feb 22, 2011 3:25 PM by Michael Labriola RSS

    Trouble Building FlexUnit 4

    mdmave Community Member

      Hi all, I downloaded flexunit 4 from github and am trying to run "ant -v clean package" as it says to do in the build.xml file.

       

      I am getting a failed build I believe with the following error:

       

      BUILD FAILED

      /Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/build.xml:57: The following error occurred while executing this line:

      /Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/FlexUnit4/build.xml:125: taskdef class com.adobe.ac.pmd.ant.FlexPmdAntTask cannot be found

      at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)

      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

      at org.apache.tools.ant.Task.perform(Task.java:348)

      at org.apache.tools.ant.Target.execute(Target.java:357)

      at org.apache.tools.ant.Target.performTasks(Target.java:385)

      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

      at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

      at org.apache.tools.ant.Main.runBuild(Main.java:758)

      at org.apache.tools.ant.Main.startAnt(Main.java:217)

      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

      Caused by: /Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/FlexUnit4/build.xml:125: taskdef class com.adobe.ac.pmd.ant.FlexPmdAntTask cannot be found

      at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:609)

      at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:228)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

      at org.apache.tools.ant.Task.perform(Task.java:348)

      at org.apache.tools.ant.Target.execute(Target.java:357)

      at org.apache.tools.ant.Target.performTasks(Target.java:385)

      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:3 8)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

      ... 16 more

      Caused by: java.lang.ClassNotFoundException: com.adobe.ac.pmd.ant.FlexPmdAntTask

      at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)

      at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)

      at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Class.java:247)

      at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:583)

      ... 29 more

      --- Nested Exception ---

      /Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/FlexUnit4/build.xml:125: taskdef class com.adobe.ac.pmd.ant.FlexPmdAntTask cannot be found

      at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:609)

      at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:228)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

      at org.apache.tools.ant.Task.perform(Task.java:348)

      at org.apache.tools.ant.Target.execute(Target.java:357)

      at org.apache.tools.ant.Target.performTasks(Target.java:385)

      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:3 8)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

      at org.apache.tools.ant.Task.perform(Task.java:348)

      at org.apache.tools.ant.Target.execute(Target.java:357)

      at org.apache.tools.ant.Target.performTasks(Target.java:385)

      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

      at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

      at org.apache.tools.ant.Main.runBuild(Main.java:758)

      at org.apache.tools.ant.Main.startAnt(Main.java:217)

      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

      Caused by: java.lang.ClassNotFoundException: com.adobe.ac.pmd.ant.FlexPmdAntTask

      at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)

      at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)

      at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Class.java:247)

      at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:583)

      ... 29 more

      --- Nested Exception ---

      java.lang.ClassNotFoundException: com.adobe.ac.pmd.ant.FlexPmdAntTask

      at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)

      at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)

      at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Class.java:247)

      at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:583)

      at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:228)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

      at org.apache.tools.ant.Task.perform(Task.java:348)

      at org.apache.tools.ant.Target.execute(Target.java:357)

      at org.apache.tools.ant.Target.performTasks(Target.java:385)

      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:3 8)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

      at org.apache.tools.ant.Task.perform(Task.java:348)

      at org.apache.tools.ant.Target.execute(Target.java:357)

      at org.apache.tools.ant.Target.performTasks(Target.java:385)

      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

      at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

      at org.apache.tools.ant.Main.runBuild(Main.java:758)

      at org.apache.tools.ant.Main.startAnt(Main.java:217)

      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

       

      Total time: 18 seconds

       

      Thanks for any help!

        • 1. Re: Trouble Building FlexUnit 4
          mdmave Community Member

          Seeing this in my flashlog when I try to run the turnkey example (RC1):

           

          Whoa... been asked to send another complete and I already did that

          Also the tests never complete. I get to test 385/396 (case:ThrowsTest, function: doesNotMatchesIfFunctionDoesNotThrowAnyError) and it never gets any further. I am building with an air2 beta2 + flex4.0.0 sdk.
          Thanks!

          • 2. Re: Trouble Building FlexUnit 4
            Michael Labriola Community Member

            i dont know that this has been tested on air two yet. i will try to reproduce.

            • 3. Re: Trouble Building FlexUnit 4
              legrosb Community Member

              @mdmave - The build we use has a dependency on FlexPMD, FlexCPD, and FlexMetrics.  For now we don't bundle it with our build, so if you download the appropriate JARs and add them to your Ant libs directory that should solve the issue (use Ant installation instructions -- http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD).  If you don't want to mess with FlexPMD, then you can go into /FlexUnit4/build.xml project and comment lines 125-139 and it shoudl run w/o the hooks into FlexPMD.  Also a note, if you're attempting to use the Ant task with player="air" and functionality from AIR 2.0 in your test SWF, it may not work as the namespace on the descriptor is for AIR 1.5.  That being said, I'll add another hook to specify the version of the AIR SDK, being used so we can avoid this problem going forward.

               

              -Brian

              • 4. Re: Trouble Building FlexUnit 4
                mdmave Community Member

                Thank you Brian,

                I was looking at that FlexPMD page as well. I downloaded the ant tasks for flexpmd but I am not sure where to put them. THere is a FLEX_HOME/ant/libs dir. Should they go there? There is also /usr/share/ant/lib (I am on OSX). I am just not sure where to put these and how I could bundle them with my app if I wanted to allow the other developers on my project to test without having to go through these steps.

                 

                Thanks!

                • 5. Re: Trouble Building FlexUnit 4
                  legrosb Community Member

                  @mdmave - Just to be clear, to use FlexUnit4, you don't have to build it from source to use and/or distribute it.  http://flexunit.org has the FlexUnit4 library available for download and we have a CI server which offers the latest bleeding edge builds of the library build against almost every Flex 3 and 4 SDK @ http://builds.flexunit.org.  What's your goal in building FlexUnit4 from source?  Do you have a customization you'd like to add to FlexUnit4 requiring a fresh build?

                   

                  As far as getting FlexPMD to work with Ant on your machine with respect to our build, on MacOSX you can place the JARs that came with the zip for the Ant tasks into the /usr/share/ant/lib folder.  Try commenting out the suggested lines in the FlexUnit4/build.xml script first to get the build working and then if you'd like to add FlexPMD reporting for a custom build, give it a shot.  I think you'll find less hurdles that way.

                   

                  -Brian

                  • 6. Re: Trouble Building FlexUnit 4
                    mdmave Community Member

                    Ok I am a bit unclear how to use FlexUnit4 then. I have FlashBuilder4 but it is not the premium version so it doesn't have the FU4 integration enabled.

                     

                    I took a look at the path you just sent (builds.flexunit.org) and it redirected me to digitalprimates.com. I see a flexunit4-flex4 area that I will look into further.

                     

                    Im not sure what I need to download however to get up and running. I don't need to customize FlexUnit4 at all, just wanted to start writing some tests with some classes I have built.

                     

                    Thanks!

                    • 7. Re: Trouble Building FlexUnit 4
                      Michael Labriola Community Member

                      Inside that flexunit4-flex4 area that you found, you should see a zip file named flexunit.zip (no version number)

                       

                      Download that and extract it. There is a jar file, along with a bunch of swcs inside of it. You likely only need to the flexunit-core* and the flexunit-uiListener* from this zip. Take those files and drop them into the libs folder of your Flex project.

                       

                      You will now have access to the FlexUnit framework.

                       

                      The turnkey main main file (http://github.com/flexunit/flexunit/blob/master/FlexUnit4Turnkey/src/FlexUnit4Turnkey.mxml) should give you a good idea of how to run tests. Basically, whatever is passed to run, is introspected and executed.

                       

                      HTH,

                      Mike

                      • 8. Re: Trouble Building FlexUnit 4
                        mdmave Community Member

                        Thanks Michael,

                        I wrote up a quick blog post explaining getting this running with TextMate on a Mac (in case that helps anyone else):

                        http://david.marr.com/blog/?p=33

                         

                        I am however seeing that running the tests in the turnkey project never seem to complete 100%. There is a trace statement that I can't quite figure out:

                        <blockquote>

                        Whoa... been asked to send another complete and I already did that

                        </blockquote>
                        • 9. Re: Trouble Building FlexUnit 4
                          Michael Labriola Community Member

                          any chance you could get me a whole project to look at? i really want to try to debug this one and understand what is happening.

                           

                          mike

                          • 10. Re: Trouble Building FlexUnit 4
                            Michael Labriola Community Member

                            also, once we have this figured out, would you mind making that post into a wiki page on flexunit.org to help others?

                            • 11. Re: Trouble Building FlexUnit 4
                              mdmave Community Member

                              Sure thing Michael. I actually started to add a wiki to Simon Gregory's bundle page on github, but the FlexUnit4 wiki might be more appropriate as the build went smoothly, just running the project isnt producing expected results.

                               

                              I uploaded the project here:

                              http://dl.dropbox.com/u/72459/FlexUnit4Turnkey.zip

                               

                              Basically the only thing that is different about it is that I added the FlexUnit4Turnkey-config.xml file to get it to compile with TextMate.

                               

                              I opened the swf in bin-debug that comes packaged with the app and I am seeing the same thing (tests stop running right around #391). Info in flashlog:

                               

                               

                              Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml.  The 'secure' attribute is only permitted in HTTPS and socket policy files.  See http://www.adobe.com/go/strict_policy_files for details.

                              Whoa... been asked to send another complete and I already did that

                               

                              And from the policyfiles.txt:

                              OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at http://maps.amung.us/geolocs/e1w0862t976i/1273004385000000/c1/2.0e/ by requestor from http://widgets.amung.us/flash/v2map.swf

                              OK: Request for resource at http://maps.amung.us/geolocs/e1w0862t976i/1273004385000000/c1/2.0e/ by requestor from http://widgets.amung.us/flash/v2map.swf is permitted due to policy file at http://maps.amung.us/crossdomain.xml

                              OK: Root-level SWF loaded: file:///Users/dave/Downloads/workspace/FlexUnit4Turnkey/bin/FlexUnit4Turnkey.swf

                              Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml.  The 'secure' attribute is only permitted in HTTPS and socket policy files.  See http://www.adobe.com/go/strict_policy_files for details.

                              OK: Policy file accepted: http://fpdownload.adobe.com/crossdomain.xml

                              OK: Policy file accepted: http://fpdownload.adobe.com/pub/swz/crossdomain.xml

                               

                              Hope to get this running soon!

                               

                              Thanks,

                              Dave

                              • 12. Re: Trouble Building FlexUnit 4
                                mdmave Community Member

                                Also check out this massive stacktrace when trying to run another download of the application:

                                 

                                http://gist.github.com/389942

                                 

                                There is a Stack Overflow at the top. Not sure how to fix that!

                                • 13. Re: Trouble Building FlexUnit 4
                                  Michael Labriola Community Member

                                  Thanks so much.

                                   

                                  That error is a really, really bad one. In FlexUnit 4 we needed to separate the idea of a method closure from a test completion.. meaning that just because a method completes... and perhaps even the entire call stack completes, doesn't mean the test is complete and the framework should go on. There could be something async, or we could just be pausing to let Flash Player advance a frame and not time out.

                                   

                                  This error means that a given portion of the callstack completed and then... later, it was asked to complete again. This can never happen under normal conditions so most likely it means something (let's call it test A) was thought to have failed via timeout or some other method, the framework proceeded and then the test A completed... very bad indeed.

                                   

                                  So, this has my full attention. I will let you know what I find.

                                   

                                  Mike

                                  • 14. Re: Trouble Building FlexUnit 4
                                    Michael Labriola Community Member

                                    that's interesting. You might notice 'C:\Users\dmoore' in the path of the error. dMoore is a developer here at digital primates. That concerns me as it means that particular code was build on his machine. There shouldn't be anything running on your side not built from our build system or your machine, so I need to track out how this is happening,

                                     

                                    I am now guessing we have an incompatible version of a library somewhere in the library path we need to find.

                                     

                                    Mike

                                    • 15. Re: Trouble Building FlexUnit 4
                                      mdmave Community Member

                                      yep. Let me know if you'd like me to package up that project as well. I am not sure why the errors would be different.

                                       

                                      If you'd like to handle this over IM drop me a message and we can swap info.

                                       

                                      Cheers and thanks again for the help.

                                      • 16. Re: Trouble Building FlexUnit 4
                                        mdmave Community Member

                                        Hey, I am trying to use ant to build the FlexUnit4Turnkey project, but currently I get this in the console:

                                         

                                        dave@ares:~/Downloads/workspace$ ant anttasks

                                        Buildfile: build.xml

                                         

                                        anttasks:

                                         

                                        init:

                                         

                                        compile:

                                         

                                        report:

                                          [javadoc] Generating Javadoc

                                          [javadoc] Javadoc execution

                                          [javadoc] Loading source files for package org.flexunit.ant...

                                          [javadoc] Loading source files for package org.flexunit.ant.launcher...

                                          [javadoc] Loading source files for package org.flexunit.ant.launcher.commands...

                                          [javadoc] Loading source files for package org.flexunit.ant.launcher.commands.headless...

                                          [javadoc] Loading source files for package org.flexunit.ant.launcher.commands.player...

                                          [javadoc] Loading source files for package org.flexunit.ant.launcher.platforms...

                                          [javadoc] Loading source files for package org.flexunit.ant.report...

                                          [javadoc] Loading source files for package org.flexunit.ant.tasks...

                                          [javadoc] Constructing Javadoc information...

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/FlexUnitSocketThre ad.java:9: package org.dom4j does not exist

                                          [javadoc] import org.dom4j.Document;

                                          [javadoc]                 ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/FlexUnitSocketThre ad.java:10: package org.dom4j does not exist

                                          [javadoc] import org.dom4j.DocumentException;

                                          [javadoc]                 ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/FlexUnitSocketThre ad.java:11: package org.dom4j does not exist

                                          [javadoc] import org.dom4j.DocumentHelper;

                                          [javadoc]                 ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :14: package org.dom4j does not exist

                                          [javadoc] import org.dom4j.Document;

                                          [javadoc]                 ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :15: package org.dom4j does not exist

                                          [javadoc] import org.dom4j.DocumentHelper;

                                          [javadoc]                 ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :16: package org.dom4j does not exist

                                          [javadoc] import org.dom4j.Element;

                                          [javadoc]                 ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :17: package org.dom4j.io does not exist

                                          [javadoc] import org.dom4j.io.OutputFormat;

                                          [javadoc]                    ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :18: package org.dom4j.io does not exist

                                          [javadoc] import org.dom4j.io.XMLWriter;

                                          [javadoc]                    ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/FlexUnitSocketThre ad.java:128: cannot find symbol

                                          [javadoc] symbol  : class Document

                                          [javadoc] location: class org.flexunit.ant.FlexUnitSocketThread

                                          [javadoc]    private Document parseReport(String report)

                                          [javadoc]            ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :54: cannot find symbol

                                          [javadoc] symbol  : class Document

                                          [javadoc] location: class org.flexunit.ant.report.Report

                                          [javadoc]    private Document document;

                                          [javadoc]            ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :83: cannot find symbol

                                          [javadoc] symbol  : class Document

                                          [javadoc] location: class org.flexunit.ant.report.Report

                                          [javadoc]    public void addTest(Document test)

                                          [javadoc]                        ^

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/report/Report.java :128: cannot find symbol

                                          [javadoc] symbol  : class Document

                                          [javadoc] location: class org.flexunit.ant.report.Report

                                          [javadoc]    private void checkForStatus(Document test)

                                          [javadoc]                                ^

                                          [javadoc] Standard Doclet version 1.6.0_17

                                          [javadoc] Building tree for all the packages and classes...

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/FlexUnitSocketThre ad.java:98: warning - @param argument "report" is not a parameter name.

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/tasks/FlexUnitTask .java:75: warning - @FlexUnitSocketServer is an unknown tag.

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/tasks/FlexUnitTask .java:75: warning - @FlexUnitSocketServer is an unknown tag.

                                          [javadoc] /Users/dave/Downloads/workspace/FlexUnit4AntTasks/src/org/flexunit/ant/tasks/FlexUnitTask .java:75: warning - @FlexUnitSocketServer is an unknown tag.

                                          [javadoc] Building index for all the packages and classes...

                                          [javadoc] Building index for all classes...

                                          [javadoc] Generating /Users/dave/Downloads/workspace/FlexUnit4AntTasks/target/docs/stylesheet.css...

                                          [javadoc] 16 warnings

                                         

                                        package:

                                            [unjar] Expanding: /Users/dave/Downloads/workspace/FlexUnit4AntTasks/lib/dom4j-1.6.1.jar into /Users/dave/Downloads/workspace/FlexUnit4AntTasks/target/bin

                                            [unjar] Expanding: /Users/dave/Downloads/workspace/FlexUnit4AntTasks/lib/jaxen-1.1-beta-6.jar into /Users/dave/Downloads/workspace/FlexUnit4AntTasks/target/bin

                                         

                                        BUILD SUCCESSFUL

                                        Total time: 4 seconds

                                        The build certainly isnt successful, as if I then try to ant core it dies with the following error:
                                        BUILD FAILED
                                        /Users/dave/Downloads/workspace/build.xml:57: The following error occurred while executing this line:
                                        /Users/dave/Downloads/workspace/FlexUnit4/build.xml:125: taskdef class com.adobe.ac.pmd.ant.FlexPmdAntTask cannot be found
                                        halp!

                                        • 17. Re: Trouble Building FlexUnit 4
                                          legrosb Community Member

                                          @mdmave - If you look into the build script you're running, the anttasks goal just builds the FU4 Ant task and nothing else, so the build isn't lying, it's produced a JAR for you in the FlexUnit4AntTask/target directory.  If you want to build the entire library and its supplemental libraries, try running "ant -v clean package" as suggested in the build file.  Please note, that you will need to have FlexPMD, FlexCPD, and FlexMetrics on your Ant library class path to use the build in its current state.  The error you're seeing when running "ant core" is because these libraries are not available to Ant.  If you don't feel like digging into FlexPMD and its cousins, just comment out lines 125-139 in FlexUnit4/build.xml (http://github.com/flexunit/flexunit/blob/master/FlexUnit4/build.xml) and run "ant -v clean package".  In the next release we have a flag that will turn off PMD checks, it is not currently available in the flexunit master branch as of yet.

                                           

                                          Let me know how it goes or if I can help any further.

                                           

                                          -Brian


                                          • 18. Re: Trouble Building FlexUnit 4
                                            Michael Labriola Community Member

                                            Just wanted to let you know I am working on this.... only problem is I have not been able to make it fail.

                                             

                                            Even running the swfs, without rebuilding, right out fo the project you sent, they all succeed.

                                             

                                            Not giving up, jet letting you know,

                                            Mike

                                            • 19. Re: Trouble Building FlexUnit 4
                                              sanggpark

                                              I just wanted to mention that I've also see the "Whoa... been asked to send another complete and I already did that" error message before while running Turnkey project. Whenever I tried to run the unit tests in the Turnkey project, I would see the error messages somewhere in the middle of the execution and then the unit tests would just hang and never finishes. I haven't messed around with the Turnkey project in a while but I figured I should confirm the existence of the issue.

                                              • 20. Re: Trouble Building FlexUnit 4
                                                Michael Labriola Community Member

                                                Were you in builder or ant when you saw this?

                                                • 21. Re: Trouble Building FlexUnit 4
                                                  sanggpark Community Member

                                                  I don't think I was using ant.... yeah I was just trying to run unit test. So I was just clicking on "Execute FlexUnit Tests" to run the tests

                                                  • 22. Re: Trouble Building FlexUnit 4
                                                    sanggpark Community Member

                                                    that's interesting. You might notice 'C:\Users\dmoore' in the path of the error. dMoore is a developer here at digital primates. That concerns me as it means that particular code was build on his machine. There shouldn't be anything running on your side not built from our build system or your machine, so I need to track out how this is happening,

                                                     

                                                    I am now guessing we have an incompatible version of a library somewhere in the library path we need to find.

                                                     

                                                    Mike

                                                     

                                                    So I was writing unit test and looking at stack trace and just realized I also see C:\Users\dmoore\ in several different places. I was using lib file from the Turnkey project and that's probably what was causing that. I switched to the swc file from the website and

                                                     

                                                    at flex.lang.reflect::Method/apply()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\flex\lang\reflect\Method.as:208]

                                                    is now

                                                    at flex.lang.reflect::Method/apply()[E:\hudson\jobs\FlexUnit4-Flex3.5\workspace\FlexUnit4\sr c\flex\lang\reflect\Method.as:208]

                                                     

                                                    so he's probably doing something similar.

                                                    • 23. Re: Trouble Building FlexUnit 4
                                                      Michael Labriola Community Member

                                                      Yep, I am guessing the turnkey project is having a build issue because, try as I may, I have not been able to reproduce this issue on any machine with the actual code base.

                                                       

                                                      I am going to try grabbing the turnkey directly and reproducing this that way just to be sure I can see the issue,

                                                      Mike

                                                      • 24. Re: Trouble Building FlexUnit 4
                                                        mdmave Community Member

                                                        I grabbed the latest source from git, and this project appears to be building/running properly now. I get through all 392 tests without a hitch.

                                                         

                                                        Mike, did you find out what the issue was?

                                                        • 25. Re: Trouble Building FlexUnit 4
                                                          Michael Labriola Community Member

                                                          Yep, a couple of things, which is why it was a pain to diagnose.

                                                           

                                                          First, the libraries in the turnkey project were not being properly updated in all cases, so some were out of sync causing issue #1

                                                           

                                                          Second, we identified an issue in the difference of the split() method of the Array class running on Mac versus PC in some specific circumstances. Still working on this one with Adobe.

                                                           

                                                          We were planning to let you know this was fixed in the next day or so after we heard back on the Array issue, but you beat me to the punch.

                                                           

                                                          Mike

                                                          • 26. Re: Trouble Building FlexUnit 4
                                                            mdmave Community Member

                                                            Awesome, glad you figured it out!

                                                             

                                                            I just pulled down a fresh instance of the repo, and maybe I need to read up more but thought I would ask since you are here:

                                                             

                                                            When I import the FlexUnit4Turnkey project into Flash Builder 4, there is an error off the bat on line 86 of FlexUnit4Turnkey.mxml:

                                                             

                                                             

                                                            <flexUnitUIRunner:TestRunnerBase id="uiListener"

                                                             

                                                             

                                                            The error is

                                                             

                                                             

                                                            Could not resolve <flexUnitUIRunner:TestRunnerBase> to a component implementation. FlexUnit4Turnkey.mxml /FlexUnit4Turnkey/src line 86 Flex Problem

                                                             

                                                            Is this an artifact of trying to build from FB? I see the build.xml inside the root, but FB doesn't let me drag it into the Ant perspective, even though my workspace was created inside the root flexunit directory (parent of all the FU4 projects).
                                                            I'm comfortable enough to use ant from the command line, but maybe you have a solution to building w/ant inside of FB. Also, is ant required to build these projects? I am not sure but how would FB resolve the xmlns: xmlns:flexUnitUIRunner="http://www.adobe.com/2009/flexUnitUIRunner"  to a component implementation?
                                                            Cheers,
                                                            Dave
                                                            • 27. Re: Trouble Building FlexUnit 4
                                                              Michael Labriola Community Member

                                                              If you are going to build in Flash Builder, you will also need to import the UIListener project (and maybe the CIListener) into your workspace, then all should be well.

                                                               

                                                              Mike

                                                              • 28. Re: Trouble Building FlexUnit 4
                                                                mdmave Community Member

                                                                Lets see, I added the FlexUnit4CIListener, FlexUnit4UIListener, and FlexUnit4 projects to my workspace but still no love.

                                                                 

                                                                I also tried 'ant test' from command line and see this:

                                                                 

                                                                https://gist.github.com/bde641e488775364e632

                                                                 

                                                                I appreciate the help!

                                                                • 29. Re: Trouble Building FlexUnit 4
                                                                  mdmave Community Member

                                                                  Also, the errors from 'ant -v clean package':

                                                                   

                                                                  https://gist.github.com/4fa84e6fcb279e6794c5

                                                                  • 30. Re: Trouble Building FlexUnit 4
                                                                    Michael Labriola Community Member

                                                                    The error with the ant script is the one Brian mentioned earlier in the thread, it is looking for flex pmd, which you likely don't have.

                                                                     

                                                                    Regarding FB resolving this to a component, it looks at the namespace and then finds a matching library which uses that namespace, in this case the UIListener... is there any more information in your Flash Builder error you can provide. This is how I build every day for dev so I know it works.,.. I jut need to understand what is different about your environment.

                                                                     

                                                                    Are you Flex Builder or Flash Builder, version?

                                                                    Mac or PC?

                                                                     

                                                                    Mike

                                                                    • 31. Re: Trouble Building FlexUnit 4
                                                                      legrosb Community Member

                                                                      @mdmave - Try running:

                                                                       

                                                                      ant -v -DskipPmd=true clean package

                                                                       

                                                                      I will try to make skipping PMD a default in future updates.

                                                                       

                                                                      This will produce the flexunit.zip file in the working directory from which the ant script was run.  Inside the zip is the turnkey project with the libraries built into it.  We've also included the sample CI project for those interested in playing with it.  You should be able to open the turnkey project with Flex/Flash Builder and have things work correctly.  Let me know if they do not so I can update the build.

                                                                       

                                                                      -Brian

                                                                      • 32. Re: Trouble Building FlexUnit 4
                                                                        mdmave Community Member

                                                                        Mac, Flash Builder 4 (non-beta)

                                                                         

                                                                        The errors I see when building from FB:

                                                                         

                                                                        Could not resolve <flexUnitUIRunner:TestRunnerBase> to a component implementation. FlexUnit4Turnkey.mxml /FlexUnit4Turnkey/src line 86 Flex Problem

                                                                        The style 'borderSides' is only supported by type 'mx.containers.HBox' with the theme(s) 'halo'. TestCasesTree.mxml /FlexUnit4UIListener/src/org/flexunit/flexui/controls/left line 142 Flex Problem

                                                                        The style 'borderThickness' is only supported by type 'mx.containers.HBox' with the theme(s) 'halo'. TestCasesTree.mxml /FlexUnit4UIListener/src/org/flexunit/flexui/controls/left line 142 Flex Problem

                                                                        • 33. Re: Trouble Building FlexUnit 4
                                                                          mdmave Community Member

                                                                          Thanks, but this is the output when i try to skip pmd:

                                                                           

                                                                          https://gist.github.com/ff3868d48248bfc76990

                                                                          • 34. Re: Trouble Building FlexUnit 4
                                                                            Michael Labriola Community Member

                                                                            Thanks. You are building the Flex UI as a Flex 4 project. However, it is actually a Flex 3 project.

                                                                             

                                                                            Between those versions, the UI was the big change. So, even if the remainder of your project is Flex 4 (which is not a problem) you need to build the UI in Flex 3 and all will be well.

                                                                             

                                                                            Mike

                                                                            • 35. Re: Trouble Building FlexUnit 4
                                                                              mdmave Community Member

                                                                              Ok thanks! I changed FlexUnit4Turnkey and FlexUnit4UIListener to compile with the 3.5 SDK. That fixed the build issue, but only after I added the FlexUnit4 and FlexUnit4UIListener library projects to the FlexUnit4Turnkey project's library path. I did this in FB by right click | project properties | build path | add project.

                                                                               

                                                                              I wonder if there is a way to bundle the entire workspace into the root of this repo. That way users could just import the entire thing and have the projects already imported. Also saving the .actionscriptProperties file for the turnkey project with the library project references could be a big help.

                                                                               

                                                                              I am also curious about how to get the ant build working.

                                                                              • 36. Re: Trouble Building FlexUnit 4
                                                                                legrosb Community Member

                                                                                @mdmave - If you're using Mike's 4.1 branch, you won't find the latest build updates.  simb's and my fork have the build changes.  I haven't had a chance to pull in all of Mike's latest changes however.  Maybe we can get some pull requests into Sim between Mike and I and get an integraiton build out there for everyone.  I'll try to get the ball rolling.

                                                                                 

                                                                                -Brian

                                                                                • 37. Re: Trouble Building FlexUnit 4
                                                                                  legrosb Community Member

                                                                                  Hmm, nm, looks like the main master was updated a few days, guess you're running that.  I probably just need to catch up then.

                                                                                   

                                                                                  -Brian

                                                                                  • 38. Re: Trouble Building FlexUnit 4
                                                                                    mdmave Community Member

                                                                                    Hey, me again.. I've come back to attempting to use flexunit and again failing miserably. I have the latest from git (origin http://github.com/flexunit/flexunit.git) and I imported the FlexUnit4Turnkey into Flash Builder.

                                                                                     

                                                                                    I get this error:

                                                                                     

                                                                                    Could not resolve <flexUnitUIRunner:TestRunnerBase> to a component implementation. FlexUnit4Turnkey.mxml /FlexUnit4Turnkey/src line 86

                                                                                    Whats the dealy-o?

                                                                                    • 39. Re: Trouble Building FlexUnit 4
                                                                                      Simeon Bateman Community Member

                                                                                      Are you using the Flex 3 or 4 release?

                                                                                       

                                                                                      I'd appreciate if you could download our 4.1 RC2 development release and see if you have the same issue.  The Flex 4 version can be found here

                                                                                       

                                                                                      http://www.flexunit.org/releases/flexunit-4.1.0_RC2-4-4.1.0.16076.zip

                                                                                       

                                                                                      Thanks,

                                                                                       

                                                                                      Simeon Bateman

                                                                                       

                                                                                      Principal Instigator

                                                                                      PNW Rain LLC

                                                                                      simeon@pnwrain.com

                                                                                      503-616-4405

                                                                                      1 2 Previous Next