Package no.kommune.bergen.soa.svarut.util

Examples of no.kommune.bergen.soa.svarut.util.MaxAcceptableFailureRate


public class MaxAcceptableFailureRateTest {

  @Test
  public void violateMoreExceptionsThanSuccesses() throws InterruptedException {
    InvocationRecord ir = new InvocationRecord( "testA" );
    ir.addPolicy( new MaxAcceptableFailureRate( .01 ) );
    assertEquals( "", ir.reportPolicyViolations() );
    ir.recordSuccess();
    assertEquals( "", ir.reportPolicyViolations() );
    ir.recordException( "EXCEPTION" );
    assertEquals( "", ir.reportPolicyViolations() );
View Full Code Here


  }

  @Test
  public void violateExceptionRate() throws InterruptedException {
    InvocationRecord ir = new InvocationRecord( "testA" );
    ir.addPolicy( new MaxAcceptableFailureRate( .01 ) );
    for (int i = 0; i < 98; i++) {
      ir.recordSuccess();
    }
    assertEquals( "", ir.reportPolicyViolations() );
    ir.recordException( "EXCEPTION" );
View Full Code Here

TOP

Related Classes of no.kommune.bergen.soa.svarut.util.MaxAcceptableFailureRate

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.