Flexunit 4.1 compilation problem with locale

mordesku's Avatar

mordesku

02 Jan, 2013 11:25 AM

hello everyone,

i got problem with compilation of flexunit suite.

:builder:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':builder:test'.
> Compilation failed:
  Error: Unable to resolve resource bundle "EditCourse" for locale "en_US".
  
  Error: Unable to resolve resource bundle "EditScene" for locale "en_US".
  
  Error: Unable to resolve resource bundle "ProjectCardParameters" for locale "en_US".
  
  Error: Unable to resolve resource bundle "EditLesson" for locale "en_US".
  
  Error: Unable to resolve resource bundle "ProjectCardParameters" for locale "en_US".
  
  Error: Unable to resolve resource bundle "LessonsList" for locale "en_US".
  
  Error: Unable to resolve resource bundle "EditLesson" for locale "en_US".
  
  Error: Unable to resolve resource bundle "EditScene" for locale "en_US".
  
  Error: Unable to resolve resource bundle "ProjectDetails" for locale "en_US".


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 1.141 secs

air part of my gradle build script:

air {
        keystore = 'certificate/builder.p12'
        storepass = 'xxxxxx'
        srcDirs = ["src/main/flex"]
        testDirs = ["src/test"]
        localeDir = 'locale'
        locales = ["en_US"]
        mainClass = "builder"
        includeFileTrees = [fileTree(dir: 'src/main/resources/')]//[fileTree(dir: 'src/main/flex/', inlcude: 'assets/empty.png')]
        applicationDescriptor = "src/main/flex/builder-app.xml"
} 
flexUnit {
  command = "${flexHome}/bin/adl"
  player = "air"
}

build/package work perfect but test isn't.

  1. Support Staff 1 Posted by Yennick Trevels on 02 Jan, 2013 12:05 PM

    Yennick Trevels's Avatar

    Hi,

    You have too many properties under 'air', some of these should be at the root level like this:

    srcDirs = ["src/main/flex"]
    testDirs = ["src/test"]
    localeDir = 'locale'
    locales = ["en_US"]
    mainClass = "builder"
    
    air {
        keystore = 'certificate/builder.p12'
        storepass = 'xxxxxx'
        includeFileTrees = [fileTree(dir: 'src/main/resources/')]//[fileTree(dir: 'src/main/flex/', inlcude: 'assets/empty.png')]
        applicationDescriptor = "src/main/flex/builder-app.xml"
    } 
    flexUnit {
      command = "${flexHome}/bin/adl"
      player = "air"
    }
    
  2. 2 Posted by mordesku on 02 Jan, 2013 12:29 PM

    mordesku's Avatar

    same errors apears

  3. Support Staff 3 Posted by Yennick Trevels on 02 Jan, 2013 12:54 PM

    Yennick Trevels's Avatar

    mmm, looks like it's a bug. We don't take the locale directory into account when executing the flexunit tests. I've created an issue for this and I'll fix it as fast as possible (after which a snapshot release will be available). https://github.com/GradleFx/GradleFx/issues/70

  4. 4 Posted by mordesku on 02 Jan, 2013 02:16 PM

    mordesku's Avatar

    I look forward, greetings

  5. Support Staff 5 Posted by Yennick Trevels on 02 Jan, 2013 06:39 PM

    Yennick Trevels's Avatar

    I fixed the issue. Please try out the latest snapshot version of GradleFx which can be found in this repository: https://oss.sonatype.org/content/repositories/snapshots/
    The version is 0.6.3-SNAPSHOT

    Let me know if it works.

  6. 6 Posted by mordesku on 02 Jan, 2013 07:33 PM

    mordesku's Avatar

    same error, here is stacktrace

  7. Support Staff 7 Posted by Yennick Trevels on 03 Jan, 2013 12:22 PM

    Yennick Trevels's Avatar

    I don't think you're using the latest snapshot version, because in your trace it passes in the Test class at line 85, which is blank in the newest GradleFx version (but does exist in the old version).
    So make sure the top of your build script looks something like this:

    buildscript {
        repositories {
            mavenRepo name: 'gradlefx-snapshots',   url: "https://oss.sonatype.org/content/repositories/snapshots/"
            mavenCentral()
        }
        dependencies {
            classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.6.3-SNAPSHOT'
        }
    }
    
  8. 8 Posted by mordesku on 03 Jan, 2013 01:46 PM

    mordesku's Avatar

    Top of my file was ok, but "builder" is subproject,. Main project build.gradle has defined old version of gradlefx. Now the suite is compiled and runable, so bug with locale is fixed. Now i got problem with running tests. After about 100 of test suites adl is not responding and i need to kill it. When i am running these tests from flashbuilder everythink is ok.

  9. Support Staff 9 Posted by Yennick Trevels on 03 Jan, 2013 02:02 PM

    Yennick Trevels's Avatar

    The current default timeout is 60 seconds, so it's probably better if we just remove that default and have not timeout at all by convention.

    You can change this timeout by doing this:

    flexUnit {
       timeout = 360000 // 1 hour
    }
    
  10. 10 Posted by mordesku on 04 Jan, 2013 07:36 AM

    mordesku's Avatar

    Timeout isn't problem. Adl stop responding (attached screenshot)and i can wait forever. After adl termination i got test results but not complete:

    [ant:flexunit] Suite: flex.pl.way2learn.events.invoice.InvoiceEventTest
    [ant:flexunit] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
    [ant:flexunit] Suite: flex.pl.way2learn.events.asset.FindAssetsEventTest
    [ant:flexunit] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
    [ant:flexunit] Suite: flex.pl.way2learn.events.asset.AssetEventTest
    [ant:flexunit] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
    [ant:flexunit] Suite: flex.pl.way2learn.events.asset.AssetInstanceEventTest
    [ant:flexunit] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.028 sec
    [ant:flexunit] Suite: flex.pl.way2learn.events.interaction.InteractionEventTest
    [ant:flexunit] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
    [ant:flexunit] Suite: flex.pl.way2learn.events.action.ActionFileFieldUploadEventTest
    [ant:flexunit] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.036 sec
    [ant:flexunit] Suite: flex.pl.way2learn.events.asset.AssetInstancesEventTest
    [ant:flexunit] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
    [ant:flexunit] 
    [ant:flexunit] Results :
    [ant:flexunit] 
    [ant:flexunit] Tests run: 119, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.833 sec
    [ant:flexunit] 
    
    BUILD SUCCESSFUL
    
    Total time: 2 mins 56.578 secs
    jablecznik:builder mordesku$
    
  11. Support Staff 11 Posted by Yennick Trevels on 04 Jan, 2013 07:52 AM

    Yennick Trevels's Avatar

    can you set the flexUnit execution in verbose mode as shown below and send me the output. Hopefully that will give some more information on why it's going wrong. Also run your build with the "--info" option.

    flexUnit {
        verbose = true
    }
    
  12. 12 Posted by mordesku on 04 Jan, 2013 08:30 AM

    mordesku's Avatar

    Here's my output

    that line are interesting:

    [ant:flexunit] '/Users/mordesku/Projects/way2learn/builder/src/test'
    
  13. Support Staff 13 Posted by Yennick Trevels on 04 Jan, 2013 08:53 AM

    Yennick Trevels's Avatar

    Interesting indeed, I'll have a look.

  14. Support Staff 14 Posted by Yennick Trevels on 04 Jan, 2013 11:06 AM

    Yennick Trevels's Avatar

    While this probably won't solve your problem, I just fixed the duplicate test source directory outputs which showed up in your output. The test source directories where added multiple times to the flexunit executor, now it's added only once.
    A new snapshot version has been deployed and since it's a snapshot version you will automatically download it when you run the build again.

  15. Support Staff 15 Posted by Yennick Trevels on 04 Jan, 2013 11:32 AM

    Yennick Trevels's Avatar

    I can now reproduce the issue of a hanging test. Now I'll have to investigate whether this is related to GradleFx or the FlexUnit ant task (which we are using).

  16. 16 Posted by mordesku on 04 Jan, 2013 11:36 AM

    mordesku's Avatar

    Problem with duplicate test source directory is fixed. You have right it doesn't solve my problem. Strange behavior of adl is appears when its launched from gradle. When i run it from cmd line all test go fine. I am launching it from build directory using these command:

    adl flexUnitDescriptor.xml
    

    so maybe problem lies on communication layer.

  17. Support Staff 17 Posted by Yennick Trevels on 06 Jan, 2013 09:44 AM

    Yennick Trevels's Avatar

    I created an ant script (see attachment) which does exactly the same as we use it in GradleFx, and it's giving me the same issue. So I guess it isn't Gradle/GradleFx related but rather something in the FlexUnit ant task.

  18. Support Staff 18 Posted by Yennick Trevels on 06 Jan, 2013 10:03 AM

    Yennick Trevels's Avatar

    I've posted a question on the Adobe FlexUnit forums about it with a test project. Hopefully that will help us. http://forums.adobe.com/thread/1130159

  19. 19 Posted by mordesku on 07 Jan, 2013 01:38 PM

    mordesku's Avatar

    I made some changes in ant task :) now i can display input buffer to console. In my case it look's like error in acionscript hang's up adl:

    [ant:flexunit] [W2L INPUT DUMP]<testcase classname="flex.pl.way2learn.controller.interaction::SaveInteractionsOrderCommandTest" name="shouldCallServiceMethodToSaveInteractionsOrder" time="41" status="error"><error message="Error #1009: Cannot access a property or method of a null object reference." type="flex.pl.way2learn.controller.interaction::SaveInteractionsOrderCommandTest.shouldCallServiceMethodToSaveInteractionsOrder" ><![CDATA[TypeError: Error #1009: Cannot access a property or method of a null object reference.
    [ant:flexunit]  at pl.way2learn.builder.controller.interaction::SaveInteractionsOrderCommand/execute()
    [ant:flexunit]  at flex.pl.way2learn.controller.interaction::SaveInteractionsOrderCommandTest/shouldCallServiceMethodToSaveInteractionsOrder()
    [ant:flexunit]  at Function/http://adobe.com/AS3/2006/builtin::apply()
    [ant:flexunit]  at flex.lang.reflect::Method/apply()
    [ant:flexunit]  at org.flexunit.runners.model::FrameworkMethod/invokeExplosively()
    [ant:flexunit]  at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
    [ant:flexunit]  at org.flexunit.internals.runners.statements::RunBeforesInline/handleSequenceExecuteComplete()
    [ant:flexunit]  at org.flexunit.token::AsyncTestToken/sendResult()
    [ant:flexunit]  at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()
    [ant:flexunit]  at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()
    [ant:flexunit]  at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
    [ant:flexunit]  at org.flexunit.token::AsyncTestToken/sendResult()
    [ant:flexunit]  at org.flexunit.internals.runners.statements::ExpectAsync/sendComplete()
    [ant:flexunit]  at org.flexunit.internals.runners.statements::ExpectAsync/handleAsyncEventFired()
    [ant:flexunit]  at flash.events::EventDispatcher/dispatchEventFunction()
    [ant:flexunit]  at flash.events::EventDispatcher/dispatchEvent()
    [ant:flexunit]  at org.flexunit.async::AsyncHandler/handleEvent()
    [ant:flexunit]  at flash.events::EventDispatcher/dispatchEventFunction()
    [ant:flexunit]  at flash.events::EventDispatcher/dispatchEvent()
    [ant:flexunit]  at Function/http://adobe.com/AS3/2006/builtin::apply()
    [ant:flexunit]  at SetIntervalTimer/onTimer()
    [ant:flexunit]  at flash.utils::Timer/_timerDispatch()
    [ant:flexunit]  at flash.utils::Timer/tick()]]></error></testcase>
    

    I am investigating forward but maybe you find out something to :). I think we can not count on adobe.

  20. Support Staff 20 Posted by Yennick Trevels on 07 Jan, 2013 08:48 PM

    Yennick Trevels's Avatar

    I'm not counting on Adobe, but rather on Michael Labriola (who is the creator of FlexUnit). I know he answered most of the questions on that forum, so fingers crossed :)

  21. Support Staff 21 Posted by Yennick Trevels on 11 Jan, 2013 06:45 PM

    Yennick Trevels's Avatar

    I just came past this: https://github.com/flexunit/flexunit/pull/8
    It's a pull request that hasn't been merged into the flexunit code base. Not sure if this can fix our issue, but maybe it's worth a try to checkout the flexunit code, apply the patch and then build flexunit.

  22. Support Staff 22 Posted by Yennick Trevels on 12 Jan, 2013 11:32 AM

    Yennick Trevels's Avatar

    Compiled FlexUnit myself with the patch applied, but it didn't fix the problem. Michael has responded to my post, so hopefully he can find some time to have a look at this.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac