return shardManager;
}
- private void waitForShardInitialized(ActorRef shardManager, String shardName, JavaTestKit kit) {
+ private static void waitForShardInitialized(ActorRef shardManager, String shardName, JavaTestKit kit) {
AssertionError last = null;
Stopwatch sw = Stopwatch.createStarted();
while(sw.elapsed(TimeUnit.SECONDS) <= 5) {
throw last;
}
- private <T> T expectMsgClassOrFailure(Class<T> msgClass, JavaTestKit kit, String msg) {
+ private static <T> T expectMsgClassOrFailure(Class<T> msgClass, JavaTestKit kit, String msg) {
Object reply = kit.expectMsgAnyClassOf(JavaTestKit.duration("5 sec"), msgClass, Failure.class);
if(reply instanceof Failure) {
throw new AssertionError(msg + " failed", ((Failure)reply).cause());
boolean canIntercept(Object message);
}
- private MessageInterceptor newFindPrimaryInterceptor(final ActorRef primaryActor) {
+ private static MessageInterceptor newFindPrimaryInterceptor(final ActorRef primaryActor) {
return new MessageInterceptor(){
@Override
public Object apply(Object message) {
service.close();
}
- private void verifyDatastoreSnapshot(String type, DatastoreSnapshot datastoreSnapshot, String... expShardNames) {
+ private static void verifyDatastoreSnapshot(String type, DatastoreSnapshot datastoreSnapshot, String... expShardNames) {
assertNotNull("Missing DatastoreSnapshot for type " + type, datastoreSnapshot);
Set<String> shardNames = new HashSet<>();
for(DatastoreSnapshot.ShardSnapshot s: datastoreSnapshot.getShardSnapshots()) {
service.close();
}
- private NormalizedNode<?, ?> writeCarsNodeAndVerify(DistributedDataStore writeToStore,
+ private static NormalizedNode<?, ?> writeCarsNodeAndVerify(DistributedDataStore writeToStore,
DistributedDataStore readFromStore) throws Exception {
DOMStoreWriteTransaction writeTx = writeToStore.newWriteOnlyTransaction();
NormalizedNode<?, ?> carsNode = CarsModel.create();
return carsNode;
}
- private void readCarsNodeAndVerify(DistributedDataStore readFromStore,
+ private static void readCarsNodeAndVerify(DistributedDataStore readFromStore,
NormalizedNode<?, ?> expCarsNode) throws Exception {
Optional<NormalizedNode<?, ?>> optional = readFromStore.newReadOnlyTransaction().
read(CarsModel.BASE_PATH).get(15, TimeUnit.SECONDS);
assertEquals("Data node", expCarsNode, optional.get());
}
- private void doAddShardReplica(MemberNode memberNode, String shardName, String... peerMemberNames)
+ private static void doAddShardReplica(MemberNode memberNode, String shardName, String... peerMemberNames)
throws Exception {
memberNode.waitForMembersUp(peerMemberNames);
service.close();
}
- private <T> T verifySuccessfulRpcResult(RpcResult<T> rpcResult) {
+ private static <T> T verifySuccessfulRpcResult(RpcResult<T> rpcResult) {
if(!rpcResult.isSuccessful()) {
if(rpcResult.getErrors().size() > 0) {
RpcError error = Iterables.getFirst(rpcResult.getErrors(), null);
return rpcResult.getResult();
}
- private void verifyFailedRpcResult(RpcResult<Void> rpcResult) {
+ private static void verifyFailedRpcResult(RpcResult<Void> rpcResult) {
assertEquals("RpcResult", false, rpcResult.isSuccessful());
assertEquals("RpcResult errors size", 1, rpcResult.getErrors().size());
RpcError error = Iterables.getFirst(rpcResult.getErrors(), null);
// TODO implement
}
- private void verifyShardResults(List<ShardResult> shardResults, ShardResult... expShardResults) {
+ private static void verifyShardResults(List<ShardResult> shardResults, ShardResult... expShardResults) {
Map<String, ShardResult> expResultsMap = new HashMap<>();
for(ShardResult r: expShardResults) {
expResultsMap.put(r.getShardName() + "-" + r.getDataStoreType(), r);
}
}
- private ShardResult successShardResult(String shardName, DataStoreType type) {
+ private static ShardResult successShardResult(String shardName, DataStoreType type) {
return new ShardResultBuilder().setDataStoreType(type).setShardName(shardName).setSucceeded(true).build();
}
- private ShardResult failedShardResult(String shardName, DataStoreType type) {
+ private static ShardResult failedShardResult(String shardName, DataStoreType type) {
return new ShardResultBuilder().setDataStoreType(type).setShardName(shardName).setSucceeded(false).build();
}
}
return argThat(matcher);
}
- private ShardTransactionMessages.CreateTransactionReply legacyCreateTransactionReply(ActorRef actorRef,
+ private static ShardTransactionMessages.CreateTransactionReply legacyCreateTransactionReply(ActorRef actorRef,
int transactionVersion){
return ShardTransactionMessages.CreateTransactionReply.newBuilder()
.setTransactionActorPath(actorRef.path().toString())
.build();
}
- private ReadData eqLegacySerializedReadData(final YangInstanceIdentifier path) {
+ private static ReadData eqLegacySerializedReadData(final YangInstanceIdentifier path) {
ArgumentMatcher<ReadData> matcher = new ArgumentMatcher<ReadData>() {
@Override
public boolean matches(Object argument) {
return argThat(matcher);
}
- private DataExists eqLegacySerializedDataExists() {
+ private static DataExists eqLegacySerializedDataExists() {
ArgumentMatcher<DataExists> matcher = new ArgumentMatcher<DataExists>() {
@Override
public boolean matches(Object argument) {