Package pt.ul.armus

Examples of pt.ul.armus.DeadlockInfo


    inOrder.verify(listener).afterAwait();
  }

  @Test
  public void cyclicBarrierAwaitException() throws InterruptedException, BrokenBarrierException {
    DeadlockInfo deadlock = mock(DeadlockInfo.class);
    doThrow(new DeadlockIdentifiedException(deadlock)).when(listener).beforeAwait(barrier);
    try {
      barrier.await();
      fail();
    } catch (DeadlockIdentifiedException e) {
View Full Code Here


    inOrder.verify(jarmus).afterAwait();
  }

  @Test
  public void countDownLatchAwaitException() throws InterruptedException {
    DeadlockInfo deadlock = mock(DeadlockInfo.class);
    doThrow(new DeadlockIdentifiedException(deadlock)).when(jarmus).beforeAwait(latch);
    JArmus.register(latch);
    try {
      latch.await();
      fail();
View Full Code Here

    inOrder.verify(jarmus).afterLock(lock);
  }
 
  @Test
  public void lockFails() {
    DeadlockInfo deadlock = mock(DeadlockInfo.class);
    DeadlockIdentifiedException error = new DeadlockIdentifiedException(deadlock);
    doThrow(error).when(jarmus).beforeLock(lock);
    try {
      lock.lock();
      fail();
View Full Code Here

    inOrder.verify(jarmus).afterAwaitAdvance();
  }

  @Test
  public void phaserAwaitAdvanceException() {
    DeadlockInfo deadlock = mock(DeadlockInfo.class);
    doThrow(new DeadlockIdentifiedException(deadlock)).when(jarmus).beforeAwaitAdvance(phaser, 0);
    JArmus.register(phaser);
    phaser.arrive();
    try {
      phaser.awaitAdvance(0);
View Full Code Here

TOP

Related Classes of pt.ul.armus.DeadlockInfo

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.