Package net.buffalo.protocal.converters.collection

Examples of net.buffalo.protocal.converters.collection.CollectionConverter


    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();
    BigNumberConverter bigNumberConverter = new BigNumberConverter();
    ExceptionConverter exceptionConverter = new ExceptionConverter();
View Full Code Here


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

    streamWriter = new FastStreamWriter(stringWriter);
    context = new DefaultMarshallingContext(new DefaultConverterLookup(), streamWriter);
  }
 
  public void testCanApplyList() throws Exception {
    CollectionConverter s = new CollectionConverter();
    assertTrue(s.canConvert(ArrayList.class));
    assertTrue(s.canConvert(LinkedList.class));   
    assertFalse(s.canConvert(String.class));   
  }
View Full Code Here

  public void testStringList() throws Exception {
    List list = new ArrayList();
    list.add("string1");
    list.add("string2");
   
    CollectionConverter s = new CollectionConverter();
    s.marshal(list, context, streamWriter);
    assertEquals("<list>" +
        "<type>java.util.ArrayList</type>" +
        "<length>2</length>" +
        "<string>string1</string>" +
        "<string>string2</string>" +
View Full Code Here

  public void testIntegerList() throws Exception {
    List list = new LinkedList();
    list.add(new Integer(100));
    list.add(new Integer(101));
   
    CollectionConverter s = new CollectionConverter();
    s.marshal(list, context, streamWriter);
    assertEquals("<list>" +
        "<type>java.util.LinkedList</type>" +
        "<length>2</length>" +
        "<int>100</int>" +
        "<int>101</int>" +
View Full Code Here

        "</list>", stringWriter.getBuffer().toString());
  }

 
  public void testComplextList() throws Exception {
    CollectionConverter s = new CollectionConverter();
   
    List list = new ArrayList();
    list.add("abdedefg");
    list.add(Boolean.TRUE);
    list.add(new Integer(100));
    list.add(new Double(9.09));
    s.marshal(list, context, streamWriter);
    assertEquals("<list>" +
        "<type>java.util.ArrayList</type>" +
        "<length>4</length>" +
        "<string>abdedefg</string>" +
        "<boolean>1</boolean>" +
View Full Code Here

        "<double>9.09</double>" +
        "</list>", stringWriter.getBuffer().toString());
  }
 
  public void testNestedList() throws Exception {
    CollectionConverter s = new CollectionConverter();
    List list2 = new ArrayList();
    list2.add(new Integer(100));
    List list1 = new ArrayList();
    list1.add("man");
    list1.add(list2);
    s.marshal(list1, context, streamWriter);
    assertEquals("<list>" +
        "<type>java.util.ArrayList</type>" +
        "<length>2</length>" +
        "<string>man</string>" +
        "<list>" +
View Full Code Here

TOP

Related Classes of net.buffalo.protocal.converters.collection.CollectionConverter

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.