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.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009;
11 import org.junit.Assert;
12 import org.junit.Test;
14 public class BgpStdCommunityTypeBuilderTest {
17 public void testString() {
18 final BgpStdCommunityType commType = BgpStdCommunityTypeBuilder.getDefaultInstance("72:123");
19 Assert.assertEquals("72:123", commType.getString());
23 public void testUint32() {
24 final BgpStdCommunityType commType = BgpStdCommunityTypeBuilder.getDefaultInstance("123456");
25 Assert.assertEquals(123456L, commType.getUint32().longValue());
28 @Test(expected=IllegalArgumentException.class)
29 public void testInvalid() {
30 BgpStdCommunityTypeBuilder.getDefaultInstance("-1");