2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.protocol.pcep.testtool;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
14 import org.junit.Test;
15 import org.opendaylight.protocol.pcep.message.PCEPKeepAliveMessage;
17 public class PCEPTestingToolTest {
20 public void testSimpleSessionListener() {
21 final SimpleSessionListener ssl = new SimpleSessionListener();
22 assertEquals(0, ssl.messages.size());
23 ssl.onMessage(null, new PCEPKeepAliveMessage());
24 assertEquals(1, ssl.messages.size());
25 assertTrue(ssl.messages.get(0) instanceof PCEPKeepAliveMessage);
27 ssl.onSessionUp(null);
29 ssl.onSessionDown(null, null);
34 public void testSessionListenerFactory() {
35 assertTrue(new SessionListenerFactory().getSessionListener() instanceof SimpleSessionListener);