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.BigDecimal;
14 import java.math.BigInteger;
15 import org.junit.Test;
16 import org.opendaylight.mdsal.binding.java.api.generator.BigDecimalRangeGenerator;
18 public class BigDecimalRangeGeneratorTest {
21 public void convertTest() throws Exception {
22 BigDecimalRangeGenerator generator = new BigDecimalRangeGenerator();
23 assertEquals(BigDecimal.valueOf(1L), generator.convert(1L));
24 assertEquals(BigDecimal.valueOf(1), generator.convert(new BigInteger("1")));
25 assertEquals(BigDecimal.valueOf(1), generator.convert(new Byte("1")));
26 assertEquals(BigDecimal.valueOf(1), generator.convert(new Short("1")));
27 assertEquals(BigDecimal.valueOf(1), generator.convert(new Integer("1")));
28 assertNotNull(generator.format(BigDecimal.TEN));