import akka.actor.Props;
import akka.event.Logging;
import akka.testkit.JavaTestKit;
-import junit.framework.Assert;
import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier;
import org.opendaylight.controller.cluster.datastore.messages.CommitTransaction;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChain;
import java.util.Collections;
import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
public class BasicIntegrationTest extends AbstractActorTest {
new JavaTestKit(getSystem()) {{
- final Props props = Shard.props("config", Collections.EMPTY_MAP);
+ final ShardIdentifier identifier =
+ ShardIdentifier.builder().memberName("member-1")
+ .shardName("inventory").type("config").build();
+
+ final Props props = Shard.props(identifier, Collections.EMPTY_MAP);
final ActorRef shard = getSystem().actorOf(props);
new Within(duration("5 seconds")) {
}
}.get(); // this extracts the received message
- Assert.assertNotNull(transactionChain);
+ assertNotNull(transactionChain);
System.out.println("Successfully created transaction chain");
}
}.get(); // this extracts the received message
- Assert.assertNotNull(transaction);
+ assertNotNull(transaction);
System.out.println("Successfully created transaction");
}
}.get(); // this extracts the received message
- Assert.assertTrue(writeDone);
+ assertTrue(writeDone);
System.out.println("Successfully wrote data");
}
}.get(); // this extracts the received message
- Assert.assertNotNull(cohort);
+ assertNotNull(cohort);
System.out.println("Successfully readied the transaction");
}
}.get(); // this extracts the received message
- Assert.assertTrue(preCommitDone);
+ assertTrue(preCommitDone);
System.out.println("Successfully pre-committed the transaction");