for (final Reports r : rpt.getReports()) {
final Lsp lsp = r.getLsp();
- if (lsp.isSync() && !this.synced) {
+ if (!lsp.isSync() && !this.synced) {
// Update synchronization flag
this.synced = true;
this.topologyAugmentBuilder.setPathComputationClient(this.pccBuilder.setStateSync(PccSyncState.Synchronized).build());
trans.putOperationalData(this.topologyAugment, this.topologyAugmentBuilder.build());
LOG.debug("Session {} achieved synchronized state", session);
+ return;
}
final Srp srp = r.getSrp();
@Override
public RpcResult<TransactionStatus> get(final long timeout, final TimeUnit unit) throws InterruptedException,
- ExecutionException, TimeoutException {
+ ExecutionException, TimeoutException {
return null;
}
}).when(this.mockedTransaction).commit();
}).when(this.mockedTransaction).putOperationalData(Matchers.any(InstanceIdentifier.class), Matchers.any(DataObject.class));
- manager = new ServerSessionManager(this.providerService, InstanceIdentifier.builder(
- NetworkTopology.class).child(Topology.class, new TopologyKey(new TopologyId("testtopo"))).toInstance());
- final DefaultPCEPSessionNegotiator neg = new DefaultPCEPSessionNegotiator(new HashedWheelTimer(), mock(Promise.class), this.clientListener, manager.getSessionListener(), (short) 1, 5, this.localPrefs);
+ this.manager = new ServerSessionManager(this.providerService, InstanceIdentifier.builder(NetworkTopology.class).child(
+ Topology.class, new TopologyKey(new TopologyId("testtopo"))).toInstance());
+ final DefaultPCEPSessionNegotiator neg = new DefaultPCEPSessionNegotiator(new HashedWheelTimer(), mock(Promise.class), this.clientListener, this.manager.getSessionListener(), (short) 1, 5, this.localPrefs);
this.session = neg.createSession(new HashedWheelTimer(), this.clientListener, this.localPrefs, this.localPrefs);
final List<Reports> reports = Lists.newArrayList(new ReportsBuilder().setLsp(
@After
public void tearDown() throws InterruptedException, ExecutionException {
- manager.close();
+ this.manager.close();
}
@Test
this.session.handleMessage(this.rptmsg);
Mockito.verify(this.mockedTransaction, Mockito.times(4)).putOperationalData(Matchers.any(InstanceIdentifier.class),
Matchers.any(DataObject.class));
- Mockito.verify(this.mockedTransaction, Mockito.times(3)).commit();
+ Mockito.verify(this.mockedTransaction, Mockito.times(2)).commit();
}
}