Use new Uint* constants
[bgpcep.git] / pcep / pcc-mock / src / test / java / org / opendaylight / protocol / pcep / pcc / mock / PCCSyncAvoidanceProcedureTest.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.pcep.pcc.mock;
9
10 import static org.junit.Assert.assertNotNull;
11
12 import io.netty.channel.Channel;
13 import java.util.ArrayList;
14 import java.util.List;
15 import java.util.Optional;
16 import org.junit.Test;
17 import org.opendaylight.protocol.pcep.PCEPCapability;
18 import org.opendaylight.protocol.pcep.PCEPSession;
19 import org.opendaylight.protocol.pcep.ietf.stateful07.PCEPStatefulCapability;
20 import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal;
21 import org.opendaylight.yangtools.yang.common.Uint64;
22
23 public class PCCSyncAvoidanceProcedureTest extends PCCMockCommon {
24     @Test
25     public void testSessionAvoidanceDesynchronizedEstablishment() throws Exception {
26         final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
27
28         final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
29         final PCEPSession session = createPCCSession(Uint64.TEN).get();
30         assertNotNull(session);
31         final TestingSessionListener pceSessionListener = getListener(factory);
32         assertNotNull(pceSessionListener);
33         assertNotNull(pceSessionListener.getSession());
34         checkResyncSession(Optional.empty(), 11, 11, null, Uint64.TEN, pceSessionListener);
35         channel.close().get();
36     }
37
38     @Override
39     protected List<PCEPCapability> getCapabilities() {
40         final List<PCEPCapability> caps = new ArrayList<>();
41         caps.add(new PCEPStatefulCapability(true, true, true, false,
42             false, false, true));
43         return caps;
44     }
45 }