TIBCOSoftware / bw6-plugin-maven

Plug-in Code for Apache Maven and TIBCO ActiveMatrix BusinessWorks™
Other
65 stars 78 forks source link

Maven test not working when using xpath dependencies #487

Open dmassimi opened 4 years ago

dmassimi commented 4 years ago

Maven Plugin version:2.6.0 Maven version:3.6.1 Product : TIBCO Businessworks Container edition Product version: 2.5.2 Component: Maven build plugin

Steps to reproduce the issue:

  1. Import projects attached (bw module, bw application, bw parent, bw camunda xpath dependency)

  2. Export fragments plugin bw.core_transco_camunda.xpath

  3. Configure module property /Services/mc-timer-genapp/MCI/Order-esb-in/folderDmnSinistre to point to bw.mc-genapp\Resources\sinistre\GestionSinistre.dmn

  4. Run mvn test goal from Studio

Additional environment details if any:

Describe the results you received: Test doesn't start and console shows this log

[INFO] ----BW Engine Logs Start--------------------------------------------------------------------------------------------------------------------------------------------------- [INFO] ...16:35:38.380 INFO [main] com.tibco.thor.frwk - TIBCO BusinessWorks version 2.5.2, build V67, 2020-03-05 ...!SESSION 2020-08-10 16:35:34.446 ----------------------------------------------- eclipse.buildId=unknown java.version=1.8.0_221 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86_64 -consoleLog -clean 16:35:51.445 INFO [Framework Event Dispatcher: Equinox Container: 90cb46c0-16db-001a-1b92-d7394d41b804] com.tibco.thor.frwk.Deployer - TIBCO-THOR-FRWK-300001: Started OSGi Framework of AppNode [BWEclipseAppNode] in AppSpace [BWEclipseAppSpace] of Domain [BWEclipseDomain] 16:35:51.767 INFO [Framework Event Dispatcher: Equinox Container: 90cb46c0-16db-001a-1b92-d7394d41b804] com.tibco.thor.frwk.Application - TIBCO-THOR-FRWK-300018: Deploying BW Application [bw.mc-genapp.application:1.0]. ...16:35:56.428 INFO [EventAdminThread #15] com.tibco.thor.frwk.Application - TIBCO-THOR-FRWK-300019: BW Application [bw.mc-genapp.application:1.0] is impaired. 16:35:56.431 INFO [Framework Event Dispatcher: Equinox Container: 90cb46c0-16db-001a-1b92-d7394d41b804] com.tibco.thor.frwk.Application - Started by BusinessStudio, ignoring .enabled settings.

!ENTRY org.eclipse.osgi 4 0 2020-08-10 16:35:56.442 !MESSAGE Bundle initial@reference:file:../../../../../../../git/tbwce-sample-timer/bw.mc-genapp/ was not resolved. .........

The same application (same POMs) without using dependencies (deleting dependencies in application POM and in Module Descriptor/Dependencies BW project) it works. Why when I use dependencies it doesn't work?

Attached project with dependencies and without dependencies. proj-with-dependencies.zip proj-without-dependencies.zip bw.core_transco_camunda.xpath.zip Describe the results you expected: Test working for both projects

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

dmassimi commented 4 years ago

Hi, any news on this? It's a very important topic for my client. I just tested another application importing a shared module empty and it doesn't work. I've still the same error:

!ENTRY org.eclipse.osgi 4 0 2020-08-13 08:29:26.167 !MESSAGE Bundle initial@reference:file:../../../../../../../../../Users/tibco/workspace/bw.mc-genapp/ was not resolved.

Attached the projects.

proj-with-empty-sharedmodule.zip

vpawar-tibco commented 4 years ago

Hi @dmassimi The maven plugin does not have full support for building custom xpath functions yet. So I am marking this issue as an enhancement. However, based on the code shared by you I have few suggestions -

image

Lets discuss on slack\zoom if you need additional help. Thanks.

dmassimi commented 4 years ago

Hi @vpawar-ai ok for the xpath, but why this happens when I add an empty shared module too (check projects into proj-with-empty-sharedmodule.zip)? Mvn test goal can be run just on an application not using dependencies ?

Regards

vpawar-tibco commented 4 years ago

Hi @dmassimi

Please change "maven.mc-genapp.parent->pom.xml" to include "test-sm" module.

<modules>
    <module>../test-sm</module>
    <module>../bw.mc-genapp</module>
    <module>../bw.mc-genapp.application</module>
</modules>

Or you could also do the same by re-generating application pom files using the wizard. Thanks.

dmassimi commented 4 years ago

Hi, ok with this modification it works but is that required for all shared module included in application? If an application has 10 dependencies to common libs, and some of them have dependencies to other 5 common libs, do we need to have access to the code of all common libs (15) to run the tests ?

As user I would like to use the same pom (parent) to build application and run the test, and when I build the application I don't need to build dependencies because they are downloaded from repository (Nexus).

Why for build ear the module and application are enough, and for test we have to add the dependencies in parent pom?

Regards

vpawar-tibco commented 4 years ago

The difference is between how the shared module is being used.

dmassimi commented 4 years ago

Hi, do you know when the maven tests for application including xpath custom plugin will be supported and will work correctly? I've a client that needs to run unit tests .

vpawar-tibco commented 3 years ago

Hi @dmassimi, Please have a look at - https://github.com/TIBCOSoftware/bw6-plugin-maven/wiki/Custom-XPath-Function-with-Maven Please let us know if it helps resolve your issue.

dmassimi commented 3 years ago

Hi, sorry but this is too much complicated to put in place in a customer environment where all workstations used by developers can be different. And also as said before dependencies should not be added in parent pom as "module" because developers should not rebuild everything each time (the shared modules they used are delivered by another team and they just need to use that as dependencies).

If I add custom plugin xpath (or another shared module) in parent pom as module, during "mvn install" of application they will need to rebuild the shared module too, sot his approach is not good.

The target is :

Without these requirements the UT are impossible in our customers.

Attached an application using 2 custom plugin xpath (and another shared module) not included as module in parent pom because they are part of framework. The target is to run the tests without modify the poms.

sample.zip