Examples of reportPolicyViolations()


Examples of no.kommune.bergen.soa.svarut.util.InvocationRecord.reportPolicyViolations()

    ir.recordException( "Shit happens!" );
    assertEquals( "", ir.reportPolicyViolations() );
    ir.recordException( "Shit happens!" );
    assertTrue( ir.reportPolicyViolations().indexOf( "failed more than" ) > -1 );
    ir.recordSuccess();
    assertEquals( "", ir.reportPolicyViolations() );
    ir.recordException( "Shit happens!" );
    assertEquals( "", ir.reportPolicyViolations() );
  }
}
View Full Code Here

Examples of no.kommune.bergen.soa.svarut.util.InvocationRecord.reportPolicyViolations()

    ir.recordException( "Shit happens!" );
    assertTrue( ir.reportPolicyViolations().indexOf( "failed more than" ) > -1 );
    ir.recordSuccess();
    assertEquals( "", ir.reportPolicyViolations() );
    ir.recordException( "Shit happens!" );
    assertEquals( "", ir.reportPolicyViolations() );
  }
}
View Full Code Here

Examples of no.kommune.bergen.soa.svarut.util.InvocationRecord.reportPolicyViolations()

  @Test
  public void violateLimitNotInvokedSinceBoot() throws InterruptedException {
    InvocationRecord ir = new InvocationRecord( "testA" );
    ir.addPolicy( new TimeLimitBetweenInvocations( 1 ) );
    Thread.sleep( 10 );
    String report = ir.reportPolicyViolations();
    assertTrue( report.indexOf( "since boot" ) > -1 );
  }

  @Test
  public void violateNotInvokedForTooLong() throws InterruptedException {
View Full Code Here

Examples of no.kommune.bergen.soa.svarut.util.InvocationRecord.reportPolicyViolations()

  public void violateNotInvokedForTooLong() throws InterruptedException {
    InvocationRecord ir = new InvocationRecord( "testA" );
    ir.addPolicy( new TimeLimitBetweenInvocations( 1 ) );
    ir.recordSuccess();
    Thread.sleep( 10 );
    String report = ir.reportPolicyViolations();
    assertTrue( report.indexOf( "too long" ) > -1 );
  }

  @Test
  public void notViolatedLimitNotInvokedSinceBoot() throws InterruptedException {
View Full Code Here

Examples of no.kommune.bergen.soa.svarut.util.InvocationRecord.reportPolicyViolations()

  @Test
  public void notViolatedLimitNotInvokedSinceBoot() throws InterruptedException {
    InvocationRecord ir = new InvocationRecord( "testA" );
    ir.addPolicy( new TimeLimitBetweenInvocations( 1000 * 60 * 60 * 3 ) );
    String report = ir.reportPolicyViolations();
    assertEquals( "", report );
  }

  @Test
  public void notViolated() throws InterruptedException {
View Full Code Here

Examples of no.kommune.bergen.soa.svarut.util.InvocationRecord.reportPolicyViolations()

  @Test
  public void notViolated() throws InterruptedException {
    InvocationRecord ir = new InvocationRecord( "testA" );
    ir.addPolicy( new TimeLimitBetweenInvocations( 1000 * 60 * 60 * 3 ) );
    ir.recordSuccess();
    String report = ir.reportPolicyViolations();
    assertEquals( "", report );
  }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.