5f96b3ddf52eaaa32a9226b79cb7096aee5c07ba
[mdsal.git] / binding / mdsal-binding-java-api-generator / src / test / java / org / opendaylight / mdsal / binding / java / api / generator / Decimal64RangeGeneratorTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.binding.java.api.generator;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
12
13 import java.math.BigInteger;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.common.Decimal64;
16
17 public class Decimal64RangeGeneratorTest {
18     @Test
19     @Deprecated
20     public void convertTest() {
21         Decimal64RangeGenerator generator = new Decimal64RangeGenerator();
22         Decimal64 one = Decimal64.valueOf(1, 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")));
29     }
30 }