Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MrLurch81 opened this issue Feb 20, 2024 · 1 comment
Open

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

MrLurch81 opened this issue Feb 20, 2024 · 1 comment

Comments

@MrLurch81
Copy link

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

@MrLurch81
Copy link
Author

Example ESB project attached
exampleProject.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant