import akka.actor.Status.Failure;
import akka.actor.Terminated;
import akka.dispatch.Dispatchers;
-import akka.testkit.JavaTestKit;
import akka.testkit.TestActorRef;
+import akka.testkit.javadsl.TestKit;
import com.google.common.base.Throwables;
import java.util.concurrent.TimeUnit;
import org.junit.Before;
@Test
public void testOnReceiveReadData() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
testOnReceiveReadData(newTransactionActor(RO, readOnlyTransaction(), "testReadDataRO"));
@Test
public void testOnReceiveReadDataWhenDataNotFound() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
testOnReceiveReadDataWhenDataNotFound(
newTransactionActor(RO, readOnlyTransaction(), "testReadDataWhenDataNotFoundRO"));
@Test
public void testOnReceiveDataExistsPositive() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
testOnReceiveDataExistsPositive(
newTransactionActor(RO, readOnlyTransaction(), "testDataExistsPositiveRO"));
@Test
public void testOnReceiveDataExistsNegative() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
testOnReceiveDataExistsNegative(
newTransactionActor(RO, readOnlyTransaction(), "testDataExistsNegativeRO"));
@Test
public void testOnReceiveBatchedModifications() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ShardDataTreeTransactionParent parent = Mockito.mock(ShardDataTreeTransactionParent.class);
DataTreeModification mockModification = Mockito.mock(DataTreeModification.class);
@Test
public void testOnReceiveBatchedModificationsReadyWithoutImmediateCommit() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(),
"testOnReceiveBatchedModificationsReadyWithoutImmediateCommit");
- JavaTestKit watcher = new JavaTestKit(getSystem());
+ TestKit watcher = new TestKit(getSystem());
watcher.watch(transaction);
YangInstanceIdentifier writePath = TestModel.TEST_PATH;
@Test
public void testOnReceiveBatchedModificationsReadyWithImmediateCommit() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(),
"testOnReceiveBatchedModificationsReadyWithImmediateCommit");
- JavaTestKit watcher = new JavaTestKit(getSystem());
+ TestKit watcher = new TestKit(getSystem());
watcher.watch(transaction);
YangInstanceIdentifier writePath = TestModel.TEST_PATH;
@Test(expected = TestException.class)
public void testOnReceiveBatchedModificationsFailure() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ShardDataTreeTransactionParent parent = Mockito.mock(ShardDataTreeTransactionParent.class);
final ActorRef transaction = newTransactionActor(RW, mockWriteTx,
"testOnReceiveBatchedModificationsFailure");
- JavaTestKit watcher = new JavaTestKit(getSystem());
+ TestKit watcher = new TestKit(getSystem());
watcher.watch(transaction);
YangInstanceIdentifier path = TestModel.TEST_PATH;
@Test(expected = IllegalStateException.class)
public void testOnReceiveBatchedModificationsReadyWithIncorrectTotalMessageCount() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(),
"testOnReceiveBatchedModificationsReadyWithIncorrectTotalMessageCount");
- JavaTestKit watcher = new JavaTestKit(getSystem());
+ TestKit watcher = new TestKit(getSystem());
watcher.watch(transaction);
BatchedModifications batched = new BatchedModifications(nextTransactionId(),
@Test
public void testReadWriteTxOnReceiveCloseTransaction() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
final ActorRef transaction = newTransactionActor(RW, readWriteTransaction(),
"testReadWriteTxOnReceiveCloseTransaction");
@Test
public void testWriteOnlyTxOnReceiveCloseTransaction() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(),
"testWriteTxOnReceiveCloseTransaction");
@Test
public void testReadOnlyTxOnReceiveCloseTransaction() throws Exception {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
final ActorRef transaction = newTransactionActor(TransactionType.READ_ONLY, readOnlyTransaction(),
"testReadOnlyTxOnReceiveCloseTransaction");
datastoreContext = DatastoreContext.newBuilder().shardTransactionIdleTimeout(
500, TimeUnit.MILLISECONDS).build();
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
final ActorRef transaction = newTransactionActor(RW, readWriteTransaction(),
"testShardTransactionInactivity");