Skip to content

"synapse-unit-test" fails when default test folder not present #114

@MrLurch81

Description

@MrLurch81

Description:
The latest version of the Integration Studio (8.2.0) creates a folder "build-artifacts", where pom.xml files are generated for all synapse artifacts.
However, by default the synapse-unit-test-maven-plugin is configured to look for a "test" folder in the same location as each pom.xml file (<testCasesFilePath>${project.basedir}/test/${testFile}</testCasesFilePath>).
If that folder does not exist, the build fails with the error:

[ERROR] Failed to execute goal org.wso2.maven:synapse-unit-test-maven-plugin:5.2.42:synapse-unit-test (synapse-unit-test) on project foobar_endpoint: Exception occurred while running test cases: null -> [Help 1]

So a solution would be to let the Eclipse plugins generate empty "test" folders everywhere, but the cleaner and more robust solution is to let the synapse-unit-test-maven-plugin not throw an exception when the test folder is not found.

For the latter I have added a check before trying to list all files in the specified test folder. If the folder does not exist, the plugin now cleanly exits and states "Detect 0 Synapse test case files to execute", just like when the test folder is present but does not contain any tests.

After this change, all projects and generated build-artifacts are built correctly.

Affected Product Version:
Integration Studio 8.2.0

Steps to reproduce:
Create a new ESB project, add an artifact (e.g. endpoint), try to build the project using mvn clean verify.
It will fail when building the build-artifacts folder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions