@Test
  public void historyLogListTest() throws Exception {
    JaxbHistoryLogList resp = new JaxbHistoryLogList();

    testRoundTrip(resp);

    // vLog
    org.jbpm.process.audit.VariableInstanceLog vLog =
        new org.jbpm.process.audit.VariableInstanceLog(
            23, "process", "varInst", "var", "two", "one");
    vLog.setExternalId("domain");
    Field dateField = org.jbpm.process.audit.VariableInstanceLog.class.getDeclaredField("date");
    dateField.setAccessible(true);
    dateField.set(vLog, new Date());
    Field idField = org.jbpm.process.audit.VariableInstanceLog.class.getDeclaredField("id");
    idField.setAccessible(true);
    idField.set(vLog, 32l);
    resp.getHistoryLogList().add(new JaxbVariableInstanceLog(vLog));

    // pLog
    org.jbpm.process.audit.ProcessInstanceLog pLog =
        new org.jbpm.process.audit.ProcessInstanceLog(23, "process");
    pLog.setDuration(2000l);
    pLog.setEnd(new Date());
    pLog.setExternalId("domain");
    pLog.setIdentity("id");
    pLog.setOutcome("error");
    pLog.setParentProcessInstanceId(42);
    pLog.setProcessName("name");
    pLog.setProcessVersion("1-SNAP");
    pLog.setStatus(2);
    idField = org.jbpm.process.audit.ProcessInstanceLog.class.getDeclaredField("id");
    idField.setAccessible(true);
    idField.set(pLog, 32l);
    resp.getHistoryLogList().add(new JaxbProcessInstanceLog(pLog));

    // nLog
    org.jbpm.process.audit.NodeInstanceLog nLog =
        new org.jbpm.process.audit.NodeInstanceLog(0, 23, "process", "nodeInst", "node", "wally");
    idField = org.jbpm.process.audit.NodeInstanceLog.class.getDeclaredField("id");
    idField.setAccessible(true);
    idField.set(nLog, 32l);
    dateField = org.jbpm.process.audit.NodeInstanceLog.class.getDeclaredField("date");
    dateField.setAccessible(true);
    dateField.set(nLog, new Date());
    nLog.setNodeType("type");
    nLog.setWorkItemId(88l);
    nLog.setConnection("connex");
    nLog.setExternalId("domain");
    resp.getHistoryLogList().add(new JaxbNodeInstanceLog(nLog));

    testRoundTrip(resp);
  }
  @Test
  public void processInstanceLogTest() throws Exception {
    Assume.assumeFalse(getType().equals(TestType.YAML));

    org.jbpm.process.audit.ProcessInstanceLog origLog =
        new org.jbpm.process.audit.ProcessInstanceLog(54, "org.hospital.patient.triage");
    origLog.setDuration(65l);
    origLog.setDuration(234l);
    origLog.setEnd(new Date((new Date()).getTime() + 1000));
    origLog.setExternalId("testDomainId");
    origLog.setIdentity("identityNotMemory");
    origLog.setProcessInstanceDescription("What a process, say!");

    // nullable
    origLog.setStatus(2);
    origLog.setOutcome("descriptiveErrorCodeOfAnError");
    origLog.setParentProcessInstanceId(65l);

    origLog.setProcessName("org.process.not.technical");
    origLog.setProcessVersion("v3.14");

    JaxbProcessInstanceLog xmlLog = new JaxbProcessInstanceLog(origLog);
    xmlLog.setCommandName("test-cmd");
    xmlLog.setIndex(2);
    JaxbProcessInstanceLog newXmlLog = testRoundTrip(xmlLog);
    ComparePair.compareObjectsViaFields(xmlLog, newXmlLog, "id");

    ProcessInstanceLog newLog = newXmlLog.getResult();
    ProcessInstanceLog origCmpLog = origLog;
    assertEquals(origLog.getExternalId(), newLog.getExternalId());
    assertEquals(origCmpLog.getIdentity(), newLog.getIdentity());
    assertEquals(origCmpLog.getOutcome(), newLog.getOutcome());
    assertEquals(origCmpLog.getProcessId(), newLog.getProcessId());
    assertEquals(origCmpLog.getProcessName(), newLog.getProcessName());
    assertEquals(origCmpLog.getProcessVersion(), newLog.getProcessVersion());
    assertEquals(origCmpLog.getDuration(), newLog.getDuration());
    assertEquals(origCmpLog.getEnd(), newLog.getEnd());
    assertEquals(origCmpLog.getParentProcessInstanceId(), newLog.getParentProcessInstanceId());
    assertEquals(origCmpLog.getProcessInstanceId(), newLog.getProcessInstanceId());
    assertEquals(origCmpLog.getStart(), newLog.getStart());
    assertEquals(origCmpLog.getStatus(), newLog.getStatus());
  }
  @Test
  public void processInstanceLogNillable() throws Exception {
    Assume.assumeFalse(getType().equals(TestType.YAML));

    org.jbpm.process.audit.ProcessInstanceLog origLog =
        new org.jbpm.process.audit.ProcessInstanceLog(54, "org.hospital.patient.triage");
    origLog.setDuration(65l);
    origLog.setEnd(new Date((new Date()).getTime() + 1000));
    origLog.setExternalId("testDomainId");
    origLog.setIdentity("identityNotMemory");

    // nullable/nillable
    // origLog.setStatus(2);
    // origLog.setOutcome("descriptiveErrorCodeOfAnError");
    // origLog.setParentProcessInstanceId(65l);

    origLog.setProcessName("org.process.not.technical");
    origLog.setProcessVersion("v3.14");

    JaxbProcessInstanceLog xmlLog = new JaxbProcessInstanceLog(origLog);
    JaxbProcessInstanceLog newXmlLog = testRoundTrip(xmlLog);

    assertEquals(xmlLog.getProcessInstanceId(), newXmlLog.getProcessInstanceId());
    assertEquals(xmlLog.getProcessId(), newXmlLog.getProcessId());

    assertEquals(xmlLog.getDuration(), newXmlLog.getDuration());
    assertEquals(xmlLog.getEnd(), newXmlLog.getEnd());
    assertEquals(xmlLog.getExternalId(), newXmlLog.getExternalId());
    assertEquals(xmlLog.getIdentity(), newXmlLog.getIdentity());

    assertEquals(xmlLog.getStatus(), newXmlLog.getStatus());
    assertEquals(xmlLog.getOutcome(), newXmlLog.getOutcome());
    assertEquals(xmlLog.getParentProcessInstanceId(), newXmlLog.getParentProcessInstanceId());

    assertEquals(xmlLog.getProcessName(), newXmlLog.getProcessName());
    assertEquals(xmlLog.getProcessVersion(), newXmlLog.getProcessVersion());
  }