Examples of executeAsync()


Examples of test.CommandQueue.executeAsync()

    assertEquals(0, cancelCount.get());
    assertEquals(1, commands.getSize());

    // Execute the command
    // And wait until the other thread is waiting
    Future<?> future = commands.executeAsync();
    latch1.await();
    assertEquals(Status.EVALUATING, ((AsyncProcess)ctx.getProcess()).getStatus());
    assertEquals(0, cancelCount.get());

    //
View Full Code Here

Examples of test.CommandQueue.executeAsync()

    //
    ctx.getProcess().cancel();
    assertEquals(Status.CANCELED, ((AsyncProcess)ctx.getProcess()).getStatus());

    // Execute the command
    Future<?> future = commands.executeAsync();
    future.get();

    // Test we get terminated status and the callback was done
    assertEquals(Status.TERMINATED, ((AsyncProcess)ctx.getProcess()).getStatus());
    assertEquals(ShellResponse.Cancelled.class, ctx.getResponse().getClass());
View Full Code Here

Examples of test.CommandQueue.executeAsync()

    CommandQueue commands = new CommandQueue();
    AsyncShell  asyncShell = new AsyncShell(commands, shell);

    //
    BaseProcessContext ctx = BaseProcessContext.create(asyncShell, "foo").execute();
    Future<?> future = commands.executeAsync();
    latch1.await();
    assertEquals(Status.EVALUATING, ((AsyncProcess)ctx.getProcess()).getStatus());

    //
    asyncShell.close();
View Full Code Here

Examples of test.CommandQueue.executeAsync()

    assertEquals(0, cancelCount.get());
    assertEquals(1, commands.getSize());

    // Execute the command
    // And wait until the other thread is waiting
    Future<?> future = commands.executeAsync();
    future.get();

    //
    assertEquals(ShellResponse.Error.class, ctx.getResponse().getClass());
  }
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.