Package org.apache.wicket.util.convert.converter

Examples of org.apache.wicket.util.convert.converter.ByteConverter


   * Test byte conversions.
   */
  @Test
  public void byteConversions()
  {
    ByteConverter converter = new ByteConverter();
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Byte((byte)10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString((byte)10, Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("256", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here


  /**
   * Test byte conversions.
   */
  public void testByteConversions()
  {
    ByteConverter converter = new ByteConverter();
    assertEquals(new Byte((byte)10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString((byte) 10, Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("256", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

  /**
   * Test byte conversions.
   */
  public void testByteConversions()
  {
    ByteConverter converter = new ByteConverter();
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Byte((byte)10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString((byte)10, Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("256", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

  /**
   * Test byte conversions.
   */
  public void testByteConversions()
  {
    ByteConverter converter = new ByteConverter();
    assertEquals(new Byte((byte)10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString(new Byte((byte)10), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("256", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

  /**
   * Test byte conversions.
   */
  public void testByteConversions()
  {
    ByteConverter converter = new ByteConverter();
    assertEquals(new Byte((byte)10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString((byte)10, Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("256", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

   * Test byte conversions.
   */
  @Test
  public void byteConversions()
  {
    ByteConverter converter = new ByteConverter();
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Byte((byte)10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString((byte)10, Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("256", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.convert.converter.ByteConverter

Copyright © 2018 www.massapicom. 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.