Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-8550

JUnit tests in src/test/java folder unable to find classes in src/main/java

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 7.21.0.Final
    • Workbench
    • NEW
    • NEW
    • Hide

      Steps to reproduce

      1. Create new project on Business Central (I named mine "junit-fails")
      2. Add a new "Data Object" asset. (I named mine MyClass).

      3. Git clone the project from Guvnor to a different local folder.
      4. Import local cloned project to any IDE (I used RedHat Code Ready).
      5. Create a JUnit test class within src/test/java in the same Java package, with a test method that uses the "Data Object" meaningfully in some manner. (I instantiated MyClass and performed a simple assertEquals() on a property).
      6. Commit the JUnit class.
      7. Reimport the project back to Business Central, so that the JUnit class shows.
      8. Attempt to build/deploy through Business Central using "Build" or "Deploy" buttons.

      Show
      Steps to reproduce Create new project on Business Central (I named mine "junit-fails") Add a new "Data Object" asset. (I named mine MyClass ). Git clone the project from Guvnor to a different local folder. Import local cloned project to any IDE (I used RedHat Code Ready). Create a JUnit test class within src/test/java in the same Java package, with a test method that uses the "Data Object" meaningfully in some manner. (I instantiated MyClass and performed a simple assertEquals() on a property). Commit the JUnit class. Reimport the project back to Business Central, so that the JUnit class shows. Attempt to build/deploy through Business Central using "Build" or "Deploy" buttons.

      A JUnit class created outside of Business Central within a Maven src/test/java folder location is unable to pick up classes within the same package found within the Maven src/main/java folder location.

      This affects the build and deploy functionalities through business-central.war, particularly the "Build" and "Deploy" buttons.

        1. jbpm-MyClassTest.png
          jbpm-MyClassTest.png
          33 kB
        2. jbpm-MyClassTest.java.png
          jbpm-MyClassTest.java.png
          62 kB
        3. jbpm-MyClass.png
          jbpm-MyClass.png
          35 kB
        4. jbpm-MyClass.java.png
          jbpm-MyClass.java.png
          34 kB
        5. jbpm-Build-fail-for-MyClassTest.png
          jbpm-Build-fail-for-MyClassTest.png
          56 kB

              eignatow Eder Ignatowicz
              andrewlee1982 Andrew Lee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: