cancel
Showing results for 
Search instead for 
Did you mean: 

Junit shows me old result

tomi87
Champ in-the-making
Champ in-the-making
Hello,
I don't know why my Junit shows me the whole tome the same error message. I removed or changed the most stuff from my test (with the mistake), but Junit shows me still the old error message.
I'm using in my code:

   

      TaskService taskService = activitiRule.getTaskService();
      Task task = taskService.createTaskQuery().singleResult();
      FormService formService = activitiRule.getFormService();

List<HistoricDetail> historyVariables = activitiRule.getHistoryService()
                   .createHistoricDetailQuery()
                   .variableUpdates()
                   .orderByVariableName()
                   .asc()
                   .list();
         
            assertNotNull(historyVariables);

            assertEquals(2, historyVariables.size());
            HistoricVariableUpdate abc= ((HistoricVariableUpdate) historyVariables.get(1));

3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
This is not something activiti-specific, but JUnit/Eclipse related… Try google

tomi87
Champ in-the-making
Champ in-the-making
I had this kind of stuff before.
But I don't know how I fixed this. But it was activiti specific.

This is my code:

public class CreateIdNumberTest {

@Rule
public ActivitiRule activitiRule = new ActivitiRule("activiti.cfg-mem-fullhistory.xml");

@Test
// deploys process with form properties
@Deployment(resources = { "part2Arrival/createIdNumber.bpmn20.xml" })
public void testCreateIdNumber() {

 
  Map<String, Object> variables = new HashMap<String, Object>();
  Stappi stI = new Stappi();
     variables.put("stappi", stI);

     RuntimeService runtimeService = activitiRule.getRuntimeService();
  runtimeService.startProcessInstanceByKey("part2CreateIdNumber", variables);
 
  Map<String, String> formProperties = new HashMap<String, String>();
  formProperties.put("IdNumber", "123456789");
 
  TaskService taskService = activitiRule.getTaskService();
  Task task = taskService.createTaskQuery().singleResult();
  FormService formService = activitiRule.getFormService();
 
  formService.submitTaskFormData(task.getId(), formProperties);
 

  // view history query for form properties
    List<HistoricDetail> historyVariables = activitiRule.getHistoryService()
         .createHistoricDetailQuery()
         .variableUpdates()
         .orderByVariableName()
         .asc()
         .list();

  
    assertNotNull(historyVariables);

    assertEquals(2, historyVariables.size());
    HistoricVariableUpdate stAppup= ((HistoricVariableUpdate) historyVariables.get(1));

  
    assertEquals("studentAppInfo", stAppup.getVariableName());
    Stappi saii = (Stappi) stAppup.getValue();

    assertEquals("123456789", saii.getIdNumber());
  
  System.out.println("CreateIdNumberTest was successful");
}
}

frederikherema1
Star Contributor
Star Contributor
But I don't know how I fixed this. But it was activiti specific.

If you don't know how you fixed it, how can you know it's Activiti is causing JUnit to use old version of test-classes? Please don't just assume because you're using activiti, it's the cause of all issues you encounter, especially one JUnit related…