13 Replies Latest reply on Sep 1, 2015 1:21 AM by kevinprendergast

    Problem integrating JbpmJUnitBaseTestCase in 6.2

    kevinprendergast

      Getting going with jbpm6.2 installer. A basic project working OK between JBPM Console and Eclipse via git repo. Using JDK1.7

       

      Problem: when introducing a test class to the jbpm project using the helper JbpmJUnitBaseTestCase I introduce the maven dependency to jbpm-test in the project's pom.

       

      <dependency>

        <groupId>org.jbpm</groupId>

        <artifactId>jbpm-test</artifactId>

        <version>6.2.0.Final</version>

      </dependency>

       

      The test case works fine under Eclipse, but across in the Console there are a bunch of compile errors in the Project Editor...

      Verification of class org.eclipse.jdt.core.BuildJarIndex failed and will not be available for authoring. Please check the necessary external dependencies for this project are configured correctly

      Verification of class org.eclipse.jdt.core.CheckDebugAttributes failed and will not be available for authoring. Please check the necessary external dependencies for this project are configured correctly.

      Verification of class org.eclipse.jdt.core.JDTCompilerAdapter$1 failed and will not be available for authoring. Please check the necessary external dependencies for this project are configured correctly.

      + more

       

      When I look in the server log file I deduce that the JBPM builder isn't resolving the dependencies of jbpm-test.

      I would summarise the  error log ...

       

      WARN  [org.jboss.modules] (EJB default - 4) Failed to define class org.eclipse.jdt.core.BuildJarIndex in Module "io.undertow.jsp:main" from local module loader @2b29f6e7 (finder: local module finder @5010cdd4 (roots: C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules,C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules\system\layers\base)): java.lang.LinkageError: Failed to link org/eclipse/jdt/core/BuildJarIndex (Module "io.undertow.jsp:main" from local module loader @2b29f6e7 (finder: local module finder @5010cdd4 (roots: C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules,C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules\system\layers\base)))

      Caused by: java.lang.NoClassDefFoundError: org/apache/tools/ant/Task

      Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Task from [Module "io.undertow.jsp:main" from local module loader @2b29f6e7 (finder: local module finder @5010cdd4 (roots: C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules,C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules\system\layers\base))]

       

      ... and more ...

      Caused by: java.lang.NoClassDefFoundError: javax/swing/tree/TreeModel

      Caused by: java.lang.ClassNotFoundException: javax.swing.tree.TreeModel from [Module "org.antlr:main" from local module loader @2b29f6e7 (finder: local module finder @5010cdd4 (roots: C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules,C:\java_fun\jbpm-6.2.0.Final-installer-full\jbpm-installer\wildfly-8.1.0.Final\modules\system\layers\base))]

       

      I know I've done something stupid - but I'm proving too stupid to spot it.

       

      Help appreciated.

       

      KP

        • 1. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
          swiderski.maciej

          what workbench does is scan all classes from dependencies and verifies if they can be used in authoring thus you see bunch of verification errors in logs. That means all classes reported in there are not available for authoring tools like rules editors where you could simply use discovered classes as facts.

           

          Moreover for jbpm-test (that comes with huge dependency tree to support almost any kind of testing) you should always declare it with test scope to avoid it being used by workbench when being deployed to runtime environment.

           

          HTH

          • 2. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
            kevinprendergast

            Thanks for reply. I had already tried setting scope to test without success.

             

            So to explore this more I have created a new un-managed repo with a simple project, with a simple script task process inside.

            This will deploy and run no problems, but when I add jbpm-test to the POM file...

             

            <dependencies>

                  <dependency>

                      <groupId>org.jbpm</groupId>

                      <artifactId>jbpm-test</artifactId>

                      <version>6.2.0.Final</version>

                      <scope>test</scope>

                 </dependency>

            </dependencies>

             

            then the console refuses to compile with this error...

            org.kie.scanner.embedder.MavenEmbedderException: Failed to read artifact descriptor for org.jbpm:jbpm-test:jar:6.2.0.Final

             

            So the test scope just doesn't appear to be taking affect.

             

            ...thoughts...?

             

            KP

            • 3. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
              kevinprendergast

              Can I bump this query. Distracted by stupid spam response.


              Anyway why would my jbpm console attempt to find dependancies of jbpm-test which has been assigned test scope?

               

              What have I done wrong?

               

              KP

              • 4. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                kevinprendergast

                Maciej - I believe I am experiencing the same effect described in the jira 4713 https://issues.jboss.org/browse/JBPM-4713

                 

                The Console manage project dependencies properly during the build.

                 

                KP

                • 5. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                  swiderski.maciej

                  it turned out to be one missing part that was done as part of this jira DROOLS-820 and will be released with 6.3.0.Final

                   

                  HTH

                  • 6. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                    kevinprendergast

                    Awesome.

                     

                    KP

                    • 7. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                      sanjay05222

                      Hi Kevin ,

                       

                      So finally do you think that test scope worked or you are waiting for the 6.3.0 Final version. What option you have chose at this moment for writing these JBPMNTest ?

                      Maciej did suggested me the test scope solution I didnt had time to test that solution and got caught up in the other tasks.

                       

                      Please do let me know Kevin what meanwhile strategy you have adopted to write the test case , off course I can create separate project or module to just do that and keep it out of the deploy able artifact/project.

                      any suggestion would be highly appreciated.

                       

                      thanks

                      Sanjay Gautam

                      • 8. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                        kevinprendergast

                        Sanjay, setting the jbpm-test dependancy to test scope did not solve my problem in 6.2.0.Final.

                        From Maciej's advice I see that the JIRA DROOLS-820 is fixed in 6.3 CR1 - so this morning I will repeat the test with this configuration and report observations.

                         

                        To answer your question; As a work around, in eclipse, I created an additional module taskTest which has a dependency on my original project taskMain.

                        I dragged the test classes and related bobbins from taskMain across to taskTest and successfully ran the JUnit tests in the eclipse environment.

                         

                        I have not yet verified that this arrangement will work back in the JBPM Console. My expectation is that the console will ignore taskTest because it has no kmodule.xml or deployment descriptor - and so shouldn't go worrying about it's dependencies.

                        But this is to be confirmed. If this is not the case then I will remove taskTest from the parent pom - but this put the tests outside the jbpm repository.

                         

                        ...however I was getting some strange behavior yesterday from my installation and it's general handling of dependencies... so I've done a fresh install and I shall start again from scratch.

                         

                        Be warned I might come troubling you for advice / reality check if I'm stuck.

                         

                        KP

                        • 9. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                          kevinprendergast

                          Investigating Maciej's association to DROOLS-820 - I'd expected to find 6.3 CR1 to retest with, but this doesn't appear to be available yet by following the obvious routes. So I'm a bit stuck for now.

                           

                          Sanjay, can you confirm the same observation of introducing this dependency to a simple project in jbpm workbench causes org.kie.scanner.embedder.MavenEmbedderException: Failed to read artifact descriptor for org.jbpm:jbpm-test:jar:6.2.0.Final

                           

                          <dependencies>

                                <dependency>

                                    <groupId>org.jbpm</groupId>

                                    <artifactId>jbpm-test</artifactId>

                                    <version>6.2.0.Final</version>

                                    <scope>test</scope>

                               </dependency>

                          </dependencies>

                           

                          ...am I going mad here? I fear I have missed something too obvious.

                           

                          KP

                          • 10. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                            sanjay05222

                            Hi Kevin ,

                             

                            thanks for sharing your experience with the Unit testing , I will be conducting the test and will post you this weekend and let you know what happens at my end. please wait for details from my side.

                             

                            thanks

                            Sanjay Gautam

                            • 11. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                              sanjay05222

                              Hi Kevin ,

                               

                              Sorry for delayed response , I did tested the advice of Maciej and of putting the test scope , I can say it totally does not work with 6.2.0.Final version , I would now try it on the 6.3 CR1 let see how it works ,

                              feel free to contact me , I will try my best to help if I am able to.

                               

                              For the above problem I also created a JIRA to track the issue.

                               

                               

                              Thanks

                              Sanjay Gautam

                              • 12. Re: Problem integrating JbpmJUnitBaseTestCase in 6.2
                                kevinprendergast

                                Thanks Sanjay. I had to take a break from it to clear my head and progress another aspect.

                                I confess the dependency scanner behaviour was driving me nuts.

                                 

                                I will have to come back to this though.

                                 

                                KP