2 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.or.any;
19 import static org.junit.Assert.assertEquals;
20 import static org.junit.Assert.assertNull;
22 import org.junit.Test;
24 public class Dot1qTagVlanIdBuilderTest {
27 public void testGetDefaultInstanceEnumeration() {
28 final Dot1qTag.VlanId any = Dot1qTagVlanIdBuilder.getDefaultInstance("any");
29 assertEquals(Dot1qTag.VlanId.Enumeration.Any, any.getEnumeration());
30 assertNull(any.getDot1qVlanId());
34 public void testGetDefaultInstanceVlanId() {
35 final Dot1qTag.VlanId any = Dot1qTagVlanIdBuilder.getDefaultInstance("123");
36 assertEquals(Integer.valueOf(123), any.getDot1qVlanId().getValue());
37 assertNull(any.getEnumeration());
40 @Test(expected = NumberFormatException.class)
41 public void testGetDefaultInstanceFailed() {
42 final Dot1qTag.VlanId any = Dot1qTagVlanIdBuilder.getDefaultInstance("anny");