Package de.scoopgmbh.copper.audit

Examples of de.scoopgmbh.copper.audit.AuditTrailEvent


    try {
      cleanDB(context.getBean(DataSource.class));
      de.scoopgmbh.copper.audit.BatchingAuditTrail auditTrail = context.getBean(de.scoopgmbh.copper.audit.BatchingAuditTrail.class);
      auditTrail.setMessagePostProcessor(new DummyPostProcessor());
      long seqNr = 1;
      auditTrail.synchLog(new AuditTrailEvent(1, new Date(), "4711", dsContext, "4711", "4711", "4711", null, "TEXT", seqNr++));
      auditTrail.synchLog(new AuditTrailEvent(1, new Date(), "4711", dsContext, "4711", "4711", "4711", createTestMessage(500), "TEXT", seqNr++));
      auditTrail.synchLog(new AuditTrailEvent(1, new Date(), "4711", dsContext, "4711", "4711", "4711", createTestMessage(5000), "TEXT", seqNr++));
      auditTrail.synchLog(new AuditTrailEvent(1, new Date(), "4711", dsContext, "4711", "4711", "4711", createTestMessage(50000), "TEXT", seqNr++));
      //check
      new RetryingTransaction<Void>(context.getBean(DataSource.class)) {
        @Override
        protected Void execute() throws Exception {
          Statement stmt = createStatement(getConnection());
View Full Code Here


  }

  private void callFoo() throws InterruptException {
    String cid = getEngine().createUUID();
    // This is running within the current DB transaction
    auditTrail.synchLog(new AuditTrailEvent(1, new Date(), cid, "beforeFoo", getId(), cid, cid, "beforeFoo", "String", null));
   
    mockAdapter.foo(getData(), cid);
   
    // current Txn ends here
    wait(WaitMode.ALL, 10000, TimeUnit.MILLISECONDS, cid);
    // new Txn starts here
   
    Response<?> res = getAndRemoveResponse(cid);
    logger.info(res.toString());

    auditTrail.synchLog(new AuditTrailEvent(1, new Date(), cid, "afterFoo", getId(), cid, cid, "afterFoo - result = "+res.toString(), "String", null));
   
    assertNotNull(res);
    assertFalse(res.isTimeout());
    assertEquals(getData(), res.getResponse());
    assertNull(res.getException());
   
    // This is also running within the current DB transaction
    auditTrail.synchLog(new AuditTrailEvent(1, new Date(), cid, "Assertions checked", getId(), cid, cid, "Assertions checked", "String", null));
  }
View Full Code Here

TOP

Related Classes of de.scoopgmbh.copper.audit.AuditTrailEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.