Examples of convert()


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

  @Test
  public void testConversion() {
    ShortArrayConverter shortArrayConverter = (ShortArrayConverter) TypeConverterManager.lookup(short[].class);

    assertNull(shortArrayConverter.convert(null));

    assertEq(arrs(1), shortArrayConverter.convert(Double.valueOf(1)));
    assertEq(arrs(1, 7, 3), shortArrayConverter.convert(arrs(1, 7, 3)));
    assertEq(arrs(1, 7, 3), shortArrayConverter.convert(arrb(1, 7, 3)));
    assertEq(arrs(1, 7, 3), shortArrayConverter.convert(arri(1, 7, 3)));
View Full Code Here

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

  @Test
  public void testConversion() {
    ShortConverter shortConverter = new ShortConverter();

    assertNull(shortConverter.convert(null));

    assertEquals(Short.valueOf((short) 1), shortConverter.convert(Short.valueOf((short) 1)));
    assertEquals(Short.valueOf((short) 1), shortConverter.convert(Integer.valueOf(1)));
    assertEquals(Short.valueOf((short) 1), shortConverter.convert(Double.valueOf(1.0D)));
    assertEquals(Short.valueOf((short) 1), shortConverter.convert("1"));
View Full Code Here

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

    java.sql.Date sd = new java.sql.Date(123, 4, 5);
    jdt = Convert.toJDateTime(sd);
    assertEquals("2023-05-05 00:00:00.000", jdt.toString());
    java.sql.Date sd2 = new java.sql.Date(1, 2, 3);
    SqlDateConverter sqlDateConverter = new SqlDateConverter();
    sd2 = sqlDateConverter.convert(jdt);
    assertEquals(123, sd2.getYear());
    assertEquals(4, sd2.getMonth());
    assertEquals(5, sd2.getDate());

View Full Code Here

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

    Timestamp st = new Timestamp(123, 4, 5, 6, 7, 8, 500000000);
    jdt = Convert.toJDateTime(st);
    assertEquals("2023-05-05 06:07:08.500", jdt.toString());
    SqlTimestampConverter sqlTimestampConverter = new SqlTimestampConverter();
    Timestamp st2 = sqlTimestampConverter.convert(jdt);
    assertEquals(123, st2.getYear());
    assertEquals(4, st2.getMonth());
    assertEquals(5, st2.getDate());
    assertEquals(6, st2.getHours());
    assertEquals(7, st2.getMinutes());
View Full Code Here

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

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

  @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")));
View Full Code Here

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

  @Test
  public void testConversion() {
    URIConverter uriConverter = new URIConverter();

    File f = new File("/folder/file.ext");
    URI uri = uriConverter.convert(f);
    assertNotNull(uri);
  }

}
View Full Code Here

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

  @Test
  public void testConversion() {
    URLConverter urlConverter = new URLConverter();

    File f = new File("/folder/file.ext");
    URL url = urlConverter.convert(f);
    assertNotNull(url);
  }
}
View Full Code Here

Examples of joptsimple.util.DateConverter.convert()

    @Test
    public void shouldConvertValuesToDatesUsingADateFormat() {
        ValueConverter<Date> converter = new DateConverter( monthDayYear );

        assertEquals( new LocalDate( 2009, 1, 24 ).toDate(), converter.convert( "01/24/2009" ) );
    }

    @Test
    public void rejectsNonParsableValues() {
        thrown.expect( ValueConversionException.class );
View Full Code Here

Examples of mapss.dif.psdf.PSDFGraphReader.convert()

                    + "was \"" + vectorizationName
                    + "\". Try changing the name of " + "director.");
        }

        PSDFGraphReader graphReader = new PSDFGraphReader();
        PSDFGraph graph = (PSDFGraph) graphReader.convert(model);
        _debug("PSDF graph = \n" + graph.toString());

        if (_debugFlag) {
            graph.printEdgeRateExpressions();
        }
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.