Gradlefx + Flexunit

afrischk's Avatar

afrischk

27 Feb, 2014 10:35 AM

Hi,

I'm new in using gradle + gradlefx + flex unit. I've some issues getting everything to work. I followed the flex unit example in github and tried to get it to work in my project. My project is a multi project with java and flex. My configs are:
The libraries are from the github and are deployed in my repository with different versions.

dependencies{
         test group: 'org.hamcrest', name: 'hamcrest-as3', version: "1.1.3", ext: 'swc'
         test group: 'org.flexunit', name: 'flexunittasks', version: '4.1', ext:'jar'
         test group: 'org.flexunit', name: 'flexunit', version: '4.1', ext:'swc'
         test group: 'org.flexunit', name: 'flexunitcilistener', version: '4.1', ext:'swc'
         test group: 'org.flexunit', name: 'flexunituilistener', version: '4.1', ext:'swc'
}
flexUnit{
    template = 'src/test/resources/TemplateFlexUnitRunner.mxml'
}
testDirs = ['src/test/actionscript']
testResourceDirs = ['src/test/resources']
When I'm trying to execute "gradle test" I get an error "TestRunnerBase : Could not resolve to a component implementation.". Can you help me with this?
 at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 43 more
Caused by: java.lang.Exception: mxmlc execution failed: Konfigurationsdatei /Users/user/.gradle/gradleFx/sdks/dd3c86f780716dfbb45ac80db3732ee47e7f4c1d/frameworks/flex-config.xml wird geladen
/Users/user/workspace/Project/flexclient/build/reports/FlexUnitRunner.mxml(43): Fehler: <flexUnitUIRunner:TestRunnerBase> konnte nicht zu einer Komponentenimplementierung aufgelöst werden.
    <flexUnitUIRunner:TestRunnerBase id="uiListener" width="100%" height="100%" />
    at org.gradlefx.cli.CommandLineInstruction.handleError(CommandLineInstruction.groovy:233)
    at org.gradlefx.cli.CommandLineInstruction.execute(CommandLineInstruction.groovy:213)
    at org.gradlefx.cli.CommandLineInstruction$execute.call(Unknown Source)
    at org.gradlefx.tasks.Test.runFlexUnit(Test.groovy:61)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
TIA!
  1. Support Staff 1 Posted by Yennick Trevels on 28 Feb, 2014 07:51 AM

    Yennick Trevels's Avatar

    Hi,

    Have you used the exact same Runner template as in this sample project?
    https://github.com/GradleFx/GradleFx-Examples/blob/master/flexunit-...

    Other than that I can't see anything wrong. You've correctly defined the uilistener and cilistener dependencies, so normally it should find that class.

  2. 2 Posted by afrischk on 28 Feb, 2014 08:07 AM

    afrischk's Avatar

    Hi,
    yes. It's exactly the same. I 've tried to comment out the TestRunnerBase tag. Then the imported packages can't be found and resolved. There seem's to be a problem with the library paths. But I have no clue what it could be.

  3. Support Staff 3 Posted by Yennick Trevels on 28 Feb, 2014 08:16 AM

    Yennick Trevels's Avatar

    Maybe a stupid question, but are you sure you haven't uploaded the cilistener swc twice by accident, so that the uilistener dependency is actually the cilistener swc?
    Just want to make sure this isn't the case, since they can be easily mixed because of their similar name :)

  4. 4 Posted by afrischk on 28 Feb, 2014 08:24 AM

    afrischk's Avatar

    There are no stupid questions ;-) I've looked it up and I didn't mixed them up.

  5. 5 Posted by afrischk on 28 Feb, 2014 08:39 AM

    afrischk's Avatar

    Hey,

    I' ve just made out that including the files with

        test files(
               project.file('external_libs/hamcrest-as3-flex-1.1.3.swc').absolutePath,
               project.file('external_libs/flexunit.swc').absolutePath,
               project.file('external_libs/flexunitcilistener.swc').absolutePath,
               project.file('external_libs/flexunituilistener.swc').absolutePath,
               project.file('external_libs/flexunitasks.jar').absolutePath)
    

    works to get the dependencies resolved. But now I get this error:

    09:34:01.545 [ERROR] [org.gradle.BuildExceptionReporter] > Problem: failed to create task or type flexunit
    09:34:01.546 [ERROR] [org.gradle.BuildExceptionReporter]   Cause: The name is undefined.
    09:34:01.547 [ERROR] [org.gradle.BuildExceptionReporter]   Action: Check the spelling.
    09:34:01.547 [ERROR] [org.gradle.BuildExceptionReporter]   Action: Check that any custom tasks/types have been declared.
    09:34:01.548 [ERROR] [org.gradle.BuildExceptionReporter]   Action: Check that any <presetdef>/<macrodef> declarations have taken place.
    
  6. 6 Posted by afrischk on 28 Feb, 2014 08:56 AM

    afrischk's Avatar

    Now I got it to work. I renamed the files exactly how you have named them in the GitHub examples because It seems the Ant tasks require these names. After that I have provided the flash player exe in the command property.

    Next thing I want to try is to put the libs in my repository again.

    Done.
    :-)

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