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.bgp.parser.impl;
10 import static org.junit.Assert.assertArrayEquals;
11 import static org.junit.Assert.assertEquals;
13 import org.junit.Before;
14 import org.junit.Test;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.route.target.extended.community._case.RouteTargetExtendedCommunity;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.route.target.extended.community._case.RouteTargetExtendedCommunityBuilder;
19 public class RouteTargetCommunityTest {
21 private RouteTargetExtendedCommunity community;
25 final AsNumber globalAdmin = new AsNumber(429496729800L);
26 final byte[] localAdmin = new byte[] { 10, 0, 0, 1 };
27 this.community = new RouteTargetExtendedCommunityBuilder().setGlobalAdministrator(globalAdmin).setLocalAdministrator(localAdmin).build();
31 public void testGetGlobalAdmin() {
32 final AsNumber testAsn = new AsNumber(429496729800L);
33 assertEquals(this.community.getGlobalAdministrator(), testAsn);
37 public void testGetLocalAdmin() {
38 assertArrayEquals(new byte[] { 10, 0, 0, 1 }, this.community.getLocalAdministrator());