Examples of TimeLimitBetweenInvocations


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

public class TimeLimitBetweenInvocationsTest {

  @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 );
  }
View Full Code Here

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

  }

  @Test
  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 );
  }
View Full Code Here

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

  }

  @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 );
  }
View Full Code Here

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

  }

  @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.