2 * Copyright (c) 2015 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
9 package org.opendaylight.protocol.bgp.parser.spi.extended.community;
11 import static org.junit.Assert.assertEquals;
13 import java.lang.reflect.Constructor;
14 import java.lang.reflect.InvocationTargetException;
15 import org.junit.Assert;
16 import org.junit.Test;
18 public class ExtendedCommunityUtilTest {
20 @Test(expected = UnsupportedOperationException.class)
21 public void testPrivateConstructor() throws Throwable {
22 final Constructor<ExtendedCommunityUtil> c = ExtendedCommunityUtil.class.getDeclaredConstructor();
23 c.setAccessible(true);
26 } catch (final InvocationTargetException e) {
32 public void testGetType() {
33 assertEquals(1, ExtendedCommunityUtil.setTransitivity(1, true));
34 assertEquals(65, ExtendedCommunityUtil.setTransitivity(1, false));
38 public void testIsTransitiveType() {
39 Assert.assertTrue(ExtendedCommunityUtil.isTransitive(2));
40 Assert.assertFalse(ExtendedCommunityUtil.isTransitive(66));