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

RELATIVE_PREVIOUS breaks tests on Multi Maven Projects #51

Open
MTocchettoP opened this issue Jan 28, 2020 · 0 comments
Open

RELATIVE_PREVIOUS breaks tests on Multi Maven Projects #51

MTocchettoP opened this issue Jan 28, 2020 · 0 comments

Comments

@MTocchettoP
Copy link

Problem Class:
https://github.com/wso2/maven-tools/blob/master/wso2-synapse-unit-test-plugin/src/main/java/org/wso2/synapse/unittest/SynapseTestCaseFileReader.java

Problem Code:
Line 126:

testArtifactFileAsString = FileUtils.readFileToString(
                    new File(RELATIVE_PREVIOUS + File.separator +  testArtifactFilePath));

Problem:
When executing a unit test the xml being tested is not found because the path is wrong. The addition of RELATIVE_PREVIOUS to the artifact path makes the path unusable.

Here is my project structure:
-WSO2HelloWorldPipeline
--pom.xml (parent)
--HelloWorld
---pom.xml
--HelloWorldCompositeApplication
---pom.xml

The following is the artifact path as exposed by String testArtifactFilePath = testArtifactFileNode.getText();

\HelloWorld\src\main\synapse-config\api\helloWorld.xml

When line 126 adds the ..\ to it, as you can see from the structure above, the path becomes invalid.

I am not sure what's the point of having that relative marker in the code, in a multi maven project any build command will be running from the parent anyway. I think I can work around the issue by using a maven-exec and moving folders before the test fires up but that's a workaround and this feels like a bug.

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