Package net.buffalo.protocal.converters

Examples of net.buffalo.protocal.converters.DefaultConverterLookup


  private static BuffaloProtocal instance = null;
 
  private BuffaloProtocal() {
    marshallingStrategy = new DefaultMarshallingStrategy();
    converterLookup = new DefaultConverterLookup();
  }
View Full Code Here


  protected void setUp() throws Exception {
    super.setUp();
    stringWriter = new StringWriter();
    streamWriter = new FastStreamWriter(stringWriter);
    converterLookup = new DefaultConverterLookup();
    marshallingContext = new DefaultMarshallingContext(converterLookup, streamWriter);
   
  }
View Full Code Here

  public void testUnmarshallingBigDecimal() throws Exception {
    StringReader reader = new StringReader("<buffalo-call><map><type>java.math.BigDecimal</type>" +
        "<string>value</string>" +
        "<string>123.456</string></map></buffalo-call>");
    StreamReader streamReader = new FastStreamReader(reader);
    unmarshallingContext = new DefaultUnmarshallingContext(new DefaultConverterLookup(), streamReader);
    BigDecimal number = (BigDecimal) unmarshallingContext.convertAnother();
    assertEquals(new BigDecimal("123.456"), number);
  }
View Full Code Here

  public void testUnmarshallingBigInteger() throws Exception {
    StringReader reader = new StringReader("<buffalo-call><map><type>java.math.BigInteger</type>" +
        "<string>value</string>" +
        "<string>123</string></map></buffalo-call>");
    StreamReader streamReader = new FastStreamReader(reader);
    unmarshallingContext = new DefaultUnmarshallingContext(new DefaultConverterLookup(), streamReader);
    BigInteger number = (BigInteger) unmarshallingContext.convertAnother();
    assertEquals(new BigInteger("123"), number);
  }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();
    converter = new MapConverter();
    stringWriter = new StringWriter();
    streamWriter = new FastStreamWriter(stringWriter);
    converterLookup = new DefaultConverterLookup();
    mashallingContext = new DefaultMarshallingContext(converterLookup, streamWriter);
  }
View Full Code Here

    user.setInterests(interests);
    user.setRoles(new String[]{"SA", "Architect"});
   
    StringWriter stringWriter = new StringWriter();
    StreamWriter streamWriter = new FastStreamWriter(stringWriter);
    MarshallingContext context = new DefaultMarshallingContext(new DefaultConverterLookup(), streamWriter);
    converter.marshal(user, context, streamWriter);
    assertEquals("<map><type>net.buffalo.protocal.User</type><string>username</string><string>Michael</string>" +
        "<string>password</string><string>password</string><string>gendor</string><string>girl</string>" +
        "<string>interests</string><list><type>java.util.ArrayList</type><length>3</length>" +
        "<string>Football</string><string>Music</string><string>Cook</string></list><string>roles</string>" +
View Full Code Here

  private DefaultConverterLookup converterLookup; 
  UnmarshallingContext unmarshallingContext;
  protected void setUp() throws Exception {
    super.setUp();
    cd = new CollectionConverter();
    converterLookup = new DefaultConverterLookup();
  }
View Full Code Here

public class DeserializerTest extends TestCase {
 
  public void testShouldGetCorrectType() throws Exception {
    StreamReader streamReader = TestUtils.createStreamReader("<buffalo-call><string>hi</string></buffalo-call>");
    UnmarshallingContext des = new DefaultUnmarshallingContext(new DefaultConverterLookup(), streamReader);
    Object o = des.convertAnother();
    assertEquals("hi", o);
  }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();

    stringWriter = new StringWriter();
    streamWriter = new FastStreamWriter(stringWriter);
    context = new DefaultMarshallingContext(new DefaultConverterLookup(), streamWriter);
  }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();
    stringWriter = new StringWriter();
    streamWriter = new FastStreamWriter(stringWriter);
    mashallingContext = new DefaultMarshallingContext(new DefaultConverterLookup(), streamWriter);
  }
View Full Code Here

TOP

Related Classes of net.buffalo.protocal.converters.DefaultConverterLookup

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.