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

Unit Test Framework Implementation with SharedModules #473

Closed
rj-777 opened this issue Jul 9, 2020 · 8 comments
Closed

Unit Test Framework Implementation with SharedModules #473

rj-777 opened this issue Jul 9, 2020 · 8 comments

Comments

@rj-777
Copy link

rj-777 commented Jul 9, 2020

Hi,

Please confirm if unit testing framework would work with shared modules. included in an application module. I have a shared module with one process that sets the value of a variable. This process in shared module is called through the activator process in application module. I have another process in application module where I retrieve the variable and have added an assertion(primitive) on the value obtained(in a mapper) from the shared variable. I don't see maven test producing the expected results and hence I need to know if the issue is because of the project having shared module.


BUG REPORT INFORMATION

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
-->
Maven Plugin version: 2.7.0

Maven version: 3.6.3

Product : TIBCO Businessworks Container edition

Product version: 2.5.2

Component:

Steps to reproduce the issue:

  1. Explained in Issue description

Additional environment details if any:

Describe the results you received:
[ERROR] Failed to execute goal com.tibco.plugins:bw6-maven-plugin:2.7.0:bwtest (default-bwtest) on project MainModule.application: An Exception occurred -> [Help 1]

Describe the results you expected:
Test to be completed successfully

Additional information you deem important (e.g. issue happens only occasionally):

@awagle
Copy link
Contributor

awagle commented Jul 14, 2020

Please share a reproducible case via Github or an SR. Unit testing for direct sub processes is supported in shared modules.

@rj-777
Copy link
Author

rj-777 commented Jul 14, 2020

UTF_SM.zip
Please find the project attached.

@rj-777
Copy link
Author

rj-777 commented Jul 17, 2020

Can I have an update on this please?

@rj-777
Copy link
Author

rj-777 commented Jul 29, 2020

Can I ask for an update on this request? This has been pending for more than a fortnight. Also, please be informed that this is an urgent issue and the implementation of unit testing framework in our project is dependent on identifying a resolution to this issue.

@vpawar-tibco
Copy link
Collaborator

Hi @rj-777

  • The unit test framework will not execute a subprocess unless a test file is associated with it and some assertion or mocking is defined for an activity within the subprocess. In your case, the setValue.bwp subprocess has no tests defined.

  • In general, we recommend use of mock output feature for external dependencies and such scenarios.

  • We have identified an issue with unit tests from shared module and it will be fixed in 2.7.1.

@rj-777
Copy link
Author

rj-777 commented Jul 31, 2020

The unit test is defined on a sub-process in application module and not on shared module. The sub-process in the application module where an assertion is defined is dependent on get shared variable, which is set through activator process. Please look into this process in application module. mainmodule.subProcess and Mapper activity. Also, do a Maven Test and look into the error reported originally.

@vpawar-tibco
Copy link
Collaborator

Hi @rj-777, We are aware about the error -
Caused by: java.lang.NullPointerException at com.tibco.bw.maven.plugin.test.rest.BWTestRunner.printFailureDetails(BWTestRunner.java:391) at com.tibco.bw.maven.plugin.test.rest.BWTestRunner.printTestResults(BWTestRunner.java:254) at com.tibco.bw.maven.plugin.test.rest.BWTestRunner.runTestsPerModule(BWTestRunner.java:133) at com.tibco.bw.maven.plugin.test.rest.BWTestRunner.runTests(BWTestRunner.java:95) at com.tibco.bw.maven.plugin.test.setuplocal.BWTestExecutor.runTests(BWTestExecutor.java:128) at com.tibco.bw.maven.plugin.test.setuplocal.BWTestExecutor.execute(BWTestExecutor.java:39) at com.tibco.bw.maven.plugin.test.BWTestMojo.execute(BWTestMojo.java:72) ... 22 more

It will be fixed in 2.7.1.

@vpawar-tibco
Copy link
Collaborator

Hi @rj-777, The issue is fixed in Maven plugin version 2.7.1. You will still need to define test for setValue.bwp process. Attaching code for your reference. Thanks
FixedCode.zip
logs.txt

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

3 participants