    1   /*
    2    * Copyright 2004-2009 the Seasar Foundation and the Others.
    3    *
    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
    7    *
    8    *     http://www.apache.org/licenses/LICENSE-2.0
    9    *
    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,
    13   * either express or implied. See the License for the specific language
    14   * governing permissions and limitations under the License.
    15   */
    16  package org.seasar.cubby.spi.impl;
    17
    18  import static org.junit.Assert.assertEquals;
    19
    20  import org.junit.Test;
    21
    22  public class CionversionUtilsTest {
    23
    24  	@Test
    25  	public void getWrapperClassIfPrimitive() {
    26  		assertEquals(Character.class, ConversionUtils
    27  				.getWrapperClassIfPrimitive(Character.TYPE));
    28  		assertEquals(Byte.class, ConversionUtils
    29  				.getWrapperClassIfPrimitive(Byte.TYPE));
    30  		assertEquals(Short.class, ConversionUtils
    31  				.getWrapperClassIfPrimitive(Short.TYPE));
    32  		assertEquals(Integer.class, ConversionUtils
    33  				.getWrapperClassIfPrimitive(Integer.TYPE));
    34  		assertEquals(Long.class, ConversionUtils
    35  				.getWrapperClassIfPrimitive(Long.TYPE));
    36  		assertEquals(Double.class, ConversionUtils
    37  				.getWrapperClassIfPrimitive(Double.TYPE));
    38  		assertEquals(Float.class, ConversionUtils
    39  				.getWrapperClassIfPrimitive(Float.TYPE));
    40  		assertEquals(Boolean.class, ConversionUtils
    41  				.getWrapperClassIfPrimitive(Boolean.TYPE));
    42
    43  		assertEquals(Character.class, ConversionUtils
    44  				.getWrapperClassIfPrimitive(Character.class));
    45  		assertEquals(Byte.class, ConversionUtils
    46  				.getWrapperClassIfPrimitive(Byte.class));
    47  		assertEquals(Short.class, ConversionUtils
    48  				.getWrapperClassIfPrimitive(Short.class));
    49  		assertEquals(Integer.class, ConversionUtils
    50  				.getWrapperClassIfPrimitive(Integer.class));
    51  		assertEquals(Long.class, ConversionUtils
    52  				.getWrapperClassIfPrimitive(Long.class));
    53  		assertEquals(Double.class, ConversionUtils
    54  				.getWrapperClassIfPrimitive(Double.class));
    55  		assertEquals(Float.class, ConversionUtils
    56  				.getWrapperClassIfPrimitive(Float.class));
    57  		assertEquals(Boolean.class, ConversionUtils
    58  				.getWrapperClassIfPrimitive(Boolean.class));
    59
    60  		assertEquals(Object.class, ConversionUtils
    61  				.getWrapperClassIfPrimitive(Object.class));
    62  	}
    63
    64  }