use of akka.testkit.TestProbe in project controller by opendaylight.
the class ActorBehaviorTest method setUp.
@Before
public void setUp() throws Exception {
initialBehavior = createInitialBehaviorMock();
system = ActorSystem.apply("system1");
final ActorRef storeRef = system.registerExtension(Persistence.lookup()).snapshotStoreFor(null);
probe = new TestProbe(system);
storeRef.tell(probe.ref(), ActorRef.noSender());
final MemberName name = MemberName.forName("member-1");
id = FrontendIdentifier.create(name, FrontendType.forName("type-1"));
mockedActor = system.actorOf(MockedActor.props(id, initialBehavior));
// handle initial actor recovery
saveRequest = handleRecovery(null);
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class ClientActorContextTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
system = ActorSystem.apply();
probe = new TestProbe(system);
ctx = new ClientActorContext(probe.ref(), PERSISTENCE_ID, system, CLIENT_ID, AccessClientUtil.newMockClientActorConfig());
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class AbstractClientConnectionTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
system = ActorSystem.apply();
backendProbe = new TestProbe(system);
contextProbe = new TestProbe(system);
context = new ClientActorContext(contextProbe.ref(), PERSISTENCE_ID, system, CLIENT_ID, AccessClientUtil.newMockClientActorConfig());
replyToProbe = new TestProbe(system);
connection = createConnection();
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class RequestEnvelopeTest method createEnvelope.
@Override
protected RequestEnvelope createEnvelope() {
replyToProbe = new TestProbe(system);
replyTo = replyToProbe.ref();
final TransactionPurgeRequest message = new TransactionPurgeRequest(OBJECT, 2L, replyTo);
return new RequestEnvelope(message, 1L, 2L);
}
use of akka.testkit.TestProbe in project controller by opendaylight.
the class AbstractDataStoreClientBehaviorTest method testOnCommand.
@Test
public void testOnCommand() throws Exception {
final TestProbe probe = new TestProbe(system);
final GetClientRequest request = new GetClientRequest(probe.ref());
final AbstractDataStoreClientBehavior nextBehavior = behavior.onCommand(request);
final Status.Success success = probe.expectMsgClass(Status.Success.class);
Assert.assertEquals(behavior, success.status());
Assert.assertSame(behavior, nextBehavior);
}
Aggregations