Package net.buffalo.protocal.converters

Examples of net.buffalo.protocal.converters.DefaultConverterLookup


    assertFalse(converter.canConvert(java.util.Date.class));
   
    StringWriter stringWriter = new StringWriter();
    StreamWriter streamWriter = new FastStreamWriter(stringWriter);
   
    DefaultConverterLookup defaultConverterLookup = new DefaultConverterLookup();
    MarshallingContext context = new DefaultMarshallingContext(defaultConverterLookup, streamWriter);
    converter.marshal(sdate, context, streamWriter);
   
    String string = "<map><type>java.sql.Date</type><string>value</string><date>20061101T000000Z</date></map>";
    assertEquals(string,
View Full Code Here


        stringWriter.getBuffer().toString());
   
  }
 
  public void testConverterLookupContainsSqlDateConverter() throws Exception {
    DefaultConverterLookup converterLookup = new DefaultConverterLookup();
    assertEquals(SqlDateConverter.class, converterLookup.lookupConverterForType(java.sql.Date.class).getClass());
   
  }
View Full Code Here

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

  public void testList() throws Exception {
    long[] lvalues = new long[] { 1001 };
    StringWriter stringWriter2 = new StringWriter();
    FastStreamWriter SimpleStreamWriter = new FastStreamWriter(stringWriter2);
    new ArrayConverter().marshal(lvalues,
        new DefaultMarshallingContext(new DefaultConverterLookup(), SimpleStreamWriter),
        SimpleStreamWriter);
    assertEquals("<list><type>[long</type><length>1</length><long>1001</long></list>",
        stringWriter2.getBuffer().toString());
  }
View Full Code Here

    List people = new ArrayList();
    people.add(p1);
    people.add(p2);
   
    StringWriter stringWriter = new StringWriter();
    DefaultMarshallingContext marshallingContext = new DefaultMarshallingContext(new DefaultConverterLookup(), new FastStreamWriter(stringWriter));
    marshallingContext.convertAnother(people);
  }
View Full Code Here

        "<string>friend</string><ref>1</ref></map></map>" +
        "<ref>2</ref>" +
        "</list></buffalo-call>";
   
    StreamReader streamReader = TestUtils.createStreamReader(string);
    unmashallingContext = new DefaultUnmarshallingContext(new DefaultConverterLookup(), streamReader);
    List list = (List) unmashallingContext.convertAnother();
    assertEquals(2, list.size());
    People p1 = (People) list.get(0);
    People p2 = (People) list.get(1);
    assertEquals(p1, p2.getFriend());
View Full Code Here

        "<string>sex</string><boolean>0</boolean>" +
        "<string>friend</string><ref>0</ref></map></map>" +
        "</buffalo-call>";
   
    StreamReader streamReader = TestUtils.createStreamReader(string);
    unmashallingContext = new DefaultUnmarshallingContext(new DefaultConverterLookup(), streamReader);
    People p1 = (People) unmashallingContext.convertAnother();
    People p2 = p1.getFriend();
    assertNotNull(p2);
    assertEquals(p1, p2.getFriend());
    assertEquals(p2, p1.getFriend());
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

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.