Package net.buffalo.protocal.converters.basic

Examples of net.buffalo.protocal.converters.basic.StringConverter


  protected void registerDefaultConverters() {
    BooleanConverter booleanConverter = new BooleanConverter();
    DoubleConverter doubleConverter = new DoubleConverter();
    IntegerConverter integerConverter = new IntegerConverter();
    LongConverter longConverter = new LongConverter();
    StringConverter stringConverter = new StringConverter();
    DateConverter dateConverter = new DateConverter();
    CollectionConverter collectionConverter = new CollectionConverter();
    MapConverter mapConverter = new MapConverter();
    ArrayConverter arrayConverter = new ArrayConverter();
    SqlDateConverter sqlDateConverter = new SqlDateConverter();
View Full Code Here


      assertTrue(e.toString().indexOf("boolean") > -1);
    }
  }
 
  public void testShouldGetString() throws Exception {
    StringConverter sd = new StringConverter();
    String s = (String)sd.unmarshal(TestUtils.createStreamReader("<string>hello, world</string>"), null);
    assertEquals("hello, world", s);
  }
View Full Code Here

    String s = (String)sd.unmarshal(TestUtils.createStreamReader("<string>hello, world</string>"), null);
    assertEquals("hello, world", s);
  }
 
  public void testShouldReturnTheOrginalStringFromXmlEscaped() throws Exception {
    StringConverter sd = new StringConverter();
    String s = (String)sd.unmarshal(TestUtils.createStreamReader("<string>&lt;&gt;&amp;HH</string>"), null);
    assertEquals("<>&HH", s);
  }
View Full Code Here

    assertTrue(serializer.canConvert(null));
    assertFalse(serializer.canConvert(ArrayList.class));
  }
 
  public void testShouldOutputString() {
    StringConverter serializer = new StringConverter();
    assertEquals("<string>hello, world</string>", marshal(serializer, "hello, world"));
    assertTrue(serializer.canConvert(String.class));
    assertFalse(serializer.canConvert(null));
  }
View Full Code Here

    assertTrue(serializer.canConvert(String.class));
    assertFalse(serializer.canConvert(null));
  }
 
  public void testShouldEscapeXmlString() {
    StringConverter serializer = new StringConverter();
    assertEquals("<string>a&gt;b; c&lt;d; &amp;this</string>", marshal(serializer, "a>b; c<d; &this"));
    assertTrue(serializer.canConvert(String.class));
    assertFalse(serializer.canConvert(null));
  }
View Full Code Here

    assertTrue(serializer.canConvert(String.class));
    assertFalse(serializer.canConvert(null));
  }
 
  public void testShouldOutputCharacterAsString() throws Exception {
    StringConverter serializer = new StringConverter();
    Character character = new Character('c');
    assertTrue(serializer.canConvert(Character.class));
    assertEquals("<string>c</string>", marshal(serializer, character));
  }
View Full Code Here

TOP

Related Classes of net.buffalo.protocal.converters.basic.StringConverter

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.