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

Examples of org.apache.wicket.util.convert.converter.FloatConverter.convertToObject()


    // \u00A0 = nbsp
    // \u00A4 = currency symbol (unspecified currency)
    String string = "1\u00A0234,00 \u00A4";

    assertEquals(string, fc.convertToString(Float.valueOf(1234f), Locale.FRENCH));
    assertEquals(Float.valueOf(1234f), fc.convertToObject(string, Locale.FRENCH));
  }

  /**
   * @throws Exception
   *             WICKET-1344 public void testBigDecimalRounding() throws Exception {
View Full Code Here


   */
  @Test
  public void floatConversions()
  {
    FloatConverter converter = new FloatConverter();
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Float(1.1), converter.convertToObject("1.1", Locale.US));
    assertEquals("1.1", converter.convertToString(new Float(1.1), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
View Full Code Here

  @Test
  public void floatConversions()
  {
    FloatConverter converter = new FloatConverter();
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Float(1.1), converter.convertToObject("1.1", Locale.US));
    assertEquals("1.1", converter.convertToString(new Float(1.1), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
View Full Code Here

    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Float(1.1), converter.convertToObject("1.1", Locale.US));
    assertEquals("1.1", converter.convertToString(new Float(1.1), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
View Full Code Here

    {
      // this is correct
    }
    try
    {
      converter.convertToObject("1.1whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
View Full Code Here

   * Test float conversions.
   */
  public void testFloatConversions()
  {
    FloatConverter converter = new FloatConverter();
    assertEquals(new Float(1.1), converter.convertToObject("1.1", Locale.US));
    assertEquals("1.1", converter.convertToString(new Float(1.1), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
View Full Code Here

    FloatConverter converter = new FloatConverter();
    assertEquals(new Float(1.1), converter.convertToObject("1.1", Locale.US));
    assertEquals("1.1", converter.convertToString(new Float(1.1), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
View Full Code Here

    {
      // this is correct
    }
    try
    {
      converter.convertToObject("1.1whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
View Full Code Here

   * Test float conversions.
   */
  public void testFloatConversions()
  {
    FloatConverter converter = new FloatConverter();
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Float(1.1), converter.convertToObject("1.1", Locale.US));
    assertEquals("1.1", converter.convertToString(new Float(1.1), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
View Full Code Here

   */
  public void testFloatConversions()
  {
    FloatConverter converter = new FloatConverter();
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Float(1.1), converter.convertToObject("1.1", Locale.US));
    assertEquals("1.1", converter.convertToString(new Float(1.1), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
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.