2 * Copyright (c) 2014 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.yangtools.yang.model.util;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNull;
12 import static org.junit.Assert.assertSame;
14 import java.util.Optional;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
17 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
19 public class Int8Test {
22 public void testInt8() {
23 IntegerTypeDefinition int8 = BaseTypes.int8Type();
24 IntegerTypeDefinition int8Second = BaseTypes.int8Type();
25 assertSame("The method 'getInstance()' has to return the same instance", int8, int8Second);
26 assertNull("The method 'getBaseType()' is returning incorrect value", int8.getBaseType());
27 assertEquals("The method 'getDefaultType()' is returning incorrect value", Optional.empty(),
28 int8.getDefaultValue());