Package jodd.typeconverter.impl

Examples of jodd.typeconverter.impl.StringArrayConverter.convert()


  @Test
  public void testConversion() {
    StringArrayConverter stringArrayConverter = (StringArrayConverter) TypeConverterManager.lookup(String[].class);

    assertNull(stringArrayConverter.convert(null));

    assertEq(arrs(Double.class.getName()), stringArrayConverter.convert(Double.class));
    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
View Full Code Here


  public void testConversion() {
    StringArrayConverter stringArrayConverter = (StringArrayConverter) TypeConverterManager.lookup(String[].class);

    assertNull(stringArrayConverter.convert(null));

    assertEq(arrs(Double.class.getName()), stringArrayConverter.convert(Double.class));
    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
View Full Code Here

    StringArrayConverter stringArrayConverter = (StringArrayConverter) TypeConverterManager.lookup(String[].class);

    assertNull(stringArrayConverter.convert(null));

    assertEq(arrs(Double.class.getName()), stringArrayConverter.convert(Double.class));
    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
View Full Code Here

    assertNull(stringArrayConverter.convert(null));

    assertEq(arrs(Double.class.getName()), stringArrayConverter.convert(Double.class));
    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrd(1, 7, 3)));
View Full Code Here

    assertNull(stringArrayConverter.convert(null));

    assertEq(arrs(Double.class.getName()), stringArrayConverter.convert(Double.class));
    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrd(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrf(1, 7, 3)));
View Full Code Here

    assertEq(arrs(Double.class.getName()), stringArrayConverter.convert(Double.class));
    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrd(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrf(1, 7, 3)));
    assertEq(arrs("173", "true"), stringArrayConverter.convert(arro("173", Boolean.TRUE)));
View Full Code Here

    assertEq(arrs(Double.class.getName()), stringArrayConverter.convert(Double.class));
    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrd(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrf(1, 7, 3)));
    assertEq(arrs("173", "true"), stringArrayConverter.convert(arro("173", Boolean.TRUE)));
    assertEq(arrs("173", "java.lang.String"), stringArrayConverter.convert(arro("173", String.class)));
View Full Code Here

    assertEq(arrs("173"), stringArrayConverter.convert("173"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrd(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrf(1, 7, 3)));
    assertEq(arrs("173", "true"), stringArrayConverter.convert(arro("173", Boolean.TRUE)));
    assertEq(arrs("173", "java.lang.String"), stringArrayConverter.convert(arro("173", String.class)));
  }
View Full Code Here

    assertEq(arrs("173", "1022"), stringArrayConverter.convert("173,1022"));
    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrd(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrf(1, 7, 3)));
    assertEq(arrs("173", "true"), stringArrayConverter.convert(arro("173", Boolean.TRUE)));
    assertEq(arrs("173", "java.lang.String"), stringArrayConverter.convert(arro("173", String.class)));
  }
View Full Code Here

    assertEq(arrs("173", " 1022"), stringArrayConverter.convert("173, 1022"));
    assertEq(arrs("173", "1022"), stringArrayConverter.convert(arrs("173", "1022")));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arri(1, 7, 3)));
    assertEq(arrs("1", "7", "3"), stringArrayConverter.convert(arrl(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrd(1, 7, 3)));
    assertEq(arrs("1.0", "7.0", "3.0"), stringArrayConverter.convert(arrf(1, 7, 3)));
    assertEq(arrs("173", "true"), stringArrayConverter.convert(arro("173", Boolean.TRUE)));
    assertEq(arrs("173", "java.lang.String"), stringArrayConverter.convert(arro("173", String.class)));
  }

  private void assertEq(String[] arr1, String[] arr2) {
View Full Code Here

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.