2 * Copyright (c) 2016 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.mdsal.binding.java.api.generator;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
13 import java.math.BigInteger;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.common.Decimal64;
17 public class Decimal64RangeGeneratorTest {
20 public void convertTest() {
21 Decimal64RangeGenerator generator = new Decimal64RangeGenerator();
22 Decimal64 one = Decimal64.valueOf(1);
23 assertEquals(one, generator.convert(1L));
24 assertEquals(one, generator.convert(new BigInteger("1")));
25 assertEquals(one, generator.convert(Byte.valueOf("1")));
26 assertEquals(one, generator.convert(Short.valueOf("1")));
27 assertEquals(one, generator.convert(Integer.valueOf("1")));
28 assertNotNull(generator.format(Decimal64.valueOf("10")));