Package jodd.typeconverter

Source Code of jodd.typeconverter.StringConverterTest

// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.typeconverter;

import jodd.typeconverter.impl.StringConverter;
import org.junit.Test;

import static jodd.typeconverter.TypeConverterTestHelper.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

public class StringConverterTest {

  @Test
  public void testStringConverter() {
    StringConverter stringConverter = new StringConverter();

    assertNull(stringConverter.convert(null));

    assertEquals("123", stringConverter.convert("123"));
    assertEquals("65,66", stringConverter.convert(arrb(65, 66)));
    assertEquals("Ab", stringConverter.convert(arrc('A', 'b')));
    assertEquals("One,two", stringConverter.convert(arrs("One", "two")));
    assertEquals("123", stringConverter.convert(Integer.valueOf(123)));
    assertEquals("java.lang.String", stringConverter.convert(String.class));
  }
}
TOP

Related Classes of jodd.typeconverter.StringConverterTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.