Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Tune replication and stabilize tests
[controller.git]
/
opendaylight
/
md-sal
/
sal-distributed-datastore
/
src
/
test
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
datastore
/
ShardTransactionChainTest.java
diff --git
a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java
b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java
index b07cbfd87ce268e3707064d81c2c5596af683af5..b35880a6a501367a4c1155b3cae4ef405352ddb6 100644
(file)
--- a/
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java
+++ b/
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java
@@
-27,30
+27,30
@@
public class ShardTransactionChainTest extends AbstractActorTest {
@Test
public void testOnReceiveCreateTransaction() throws Exception {
new JavaTestKit(getSystem()) {{
@Test
public void testOnReceiveCreateTransaction() throws Exception {
new JavaTestKit(getSystem()) {{
- final Props props = ShardTransactionChain.props(store.createTransactionChain());
+ final Props props = ShardTransactionChain.props(store.createTransactionChain()
, TestModel.createTestContext()
);
final ActorRef subject = getSystem().actorOf(props, "testCreateTransaction");
final ActorRef subject = getSystem().actorOf(props, "testCreateTransaction");
-
new Within(duration("1 seconds")) {
+ new Within(duration("1 seconds")) {
protected void run() {
protected void run() {
- subject.tell(new CreateTransaction("txn-1"), getRef());
+ subject.tell(new CreateTransaction("txn-1"
, TransactionProxy.TransactionType.READ_ONLY.ordinal() ).toSerializable(
), getRef());
- final String out = new ExpectMsg<String>("match hint") {
+ final String out = new ExpectMsg<String>(
duration("1 seconds"),
"match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in
instanceof CreateTransactionReply
) {
- return
((CreateTransactionReply) in).getTransactionPath().toString
();
- }
else
{
+ if (in
.getClass().equals(CreateTransactionReply.SERIALIZABLE_CLASS)
) {
+ return
CreateTransactionReply.fromSerializable(in).getTransactionPath
();
+ }
else
{
throw noMatch();
}
}
}.get(); // this extracts the received message
throw noMatch();
}
}
}.get(); // this extracts the received message
-
assertEquals("Unexpected transaction path " + out,
-
"akka://test/user/testCreateTransaction/shard-txn-1",
-
out);
+ assertEquals("Unexpected transaction path " + out,
+ "akka://test/user/testCreateTransaction/shard-txn-1",
+ out);
-
// Will wait for the rest of the 3 seconds
+ // Will wait for the rest of the 3 seconds
expectNoMsg();
}
expectNoMsg();
}
@@
-62,18
+62,18
@@
public class ShardTransactionChainTest extends AbstractActorTest {
@Test
public void testOnReceiveCloseTransactionChain() throws Exception {
new JavaTestKit(getSystem()) {{
@Test
public void testOnReceiveCloseTransactionChain() throws Exception {
new JavaTestKit(getSystem()) {{
- final Props props = ShardTransactionChain.props(store.createTransactionChain());
+ final Props props = ShardTransactionChain.props(store.createTransactionChain()
, TestModel.createTestContext()
);
final ActorRef subject = getSystem().actorOf(props, "testCloseTransactionChain");
new Within(duration("1 seconds")) {
protected void run() {
final ActorRef subject = getSystem().actorOf(props, "testCloseTransactionChain");
new Within(duration("1 seconds")) {
protected void run() {
- subject.tell(new CloseTransactionChain(), getRef());
+ subject.tell(new CloseTransactionChain()
.toSerializable()
, getRef());
- final String out = new ExpectMsg<String>("match hint") {
+ final String out = new ExpectMsg<String>(
duration("1 seconds"),
"match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in
instanceof CloseTransactionChainReply
) {
+ if (in
.getClass().equals(CloseTransactionChainReply.SERIALIZABLE_CLASS)
) {
return "match";
} else {
throw noMatch();
return "match";
} else {
throw noMatch();