2 Replies Latest reply on Jul 6, 2015 11:13 AM by Abhijit Humbe

    JBPM Unit Test: Unable to get LastModified for ClasspathResource

    Sam Amer Newbie

      I am unable to get past this error when creating and running jUnit tests in JBoss Developer Studio:

      Unable to get LastModified for ClasspathResource

      Caused by: java.io.FileNotFoundException: 'sample.bpmn' cannot be opened because it does not exist.

       

      I tried several paths but nothing worked and I am reaching out to the group for guidance. Here are the steps and the references:

      1. I am using JBoss Developer Studio Version: 8.1.0.GA configured with BRMS and BPM Suites from this url: https://devstudio.jboss.com/updates/8.0/integration-stack/

      2. Create a new sample project as jBPM project (Maven). This auto generates a process "sample.bpmn" that has two human tasks.

      3. Right click on this process and select "Generate jBPM JUnit Tests". This creates a new package "org.jbpm" under src/main/java with an auto generated public class Hello_WorldJUnitTest extends JbpmJUnitTestCase.

      4. If you run this test without change, you will get the above referenced error.


      I know that JbpmJUnitTestCase has been deprecated and replaced by JbpmJUnitBaseTestCase, but this had no effect on this error. I also tried moving the test class to different locations within the project structure. And I tried to use the absolute path of the "sample.bpmn". Here is the sample @Test code that I am trying to get to pass:

       

          @Test

          public void testImplicit() {

              KieSession ksession = createKnowledgeSession("sample2.bpmn");

              TaskService taskService = getTaskService();

              ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn");

              assertProcessInstanceActive(processInstance.getId(), ksession);

          }

       

      Changing it to the code shown in the Development_Guide still gives the same error:

        public void testProcess() {

              createRuntimeManager("sample2.bpmn");

              RuntimeEngine runtimeEngine = getRuntimeEngine();

              KieSession ksession = runtimeEngine.getKieSession();

              ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn");

              assertProcessInstanceActive(processInstance.getId(), ksession);

        }

       

      The full error trace is attached.