+act #15284 Add throws TimeoutException to Inbox.receive
(cherry picked from commit ab19cc8a527f1a01a8180c2b199affcb47e5b1d2)
This commit is contained in:
parent
d225149a96
commit
3a94510869
3 changed files with 40 additions and 2 deletions
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.actor;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import akka.testkit.AkkaJUnitActorSystemResource;
|
||||
import akka.testkit.AkkaSpec;
|
||||
import scala.concurrent.duration.FiniteDuration;
|
||||
|
||||
public class InboxJavaAPITest {
|
||||
|
||||
@ClassRule
|
||||
public static AkkaJUnitActorSystemResource actorSystemResource = new AkkaJUnitActorSystemResource("InboxJavaAPITest",
|
||||
AkkaSpec.testConf());
|
||||
|
||||
private final ActorSystem system = actorSystemResource.getSystem();
|
||||
|
||||
@Test(expected = TimeoutException.class)
|
||||
public void mustBeAbleToThrowTimeoutException() throws TimeoutException {
|
||||
Inbox inbox = Inbox.create(system);
|
||||
inbox.receive(new FiniteDuration(10, TimeUnit.MILLISECONDS));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue