Examples of unmarshal()


Examples of net.buffalo.protocal.converters.basic.BooleanConverter.unmarshal()

public class PrimitiveDeserializerTest extends TestCase {
  public void testCanDeserializeBoolean() throws Exception {
    BooleanConverter bd = new BooleanConverter();

    Boolean b = (Boolean)bd.unmarshal(TestUtils.createStreamReader("<boolean>1</boolean>"), null);
    assertTrue(b.booleanValue());
    b = (Boolean)bd.unmarshal(TestUtils.createStreamReader("<boolean>0</boolean>"), null);
    assertFalse(b.booleanValue());
  }
 
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.DateConverter.unmarshal()

    assertEquals("<>&HH", s);
  }
 
  public void testCouldGetDate() throws Exception {
    DateConverter dd = new DateConverter();
    Date d = (Date)dd.unmarshal(TestUtils.createStreamReader("<date>20060803T090127Z</date>"), null);
    Calendar cal = Calendar.getInstance();
    cal.setTime(d);
    assertEquals(2006, cal.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, cal.get(Calendar.MONTH));
    assertEquals(3, cal.get(Calendar.DAY_OF_MONTH));
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.DoubleConverter.unmarshal()

    assertEquals(27, cal.get(Calendar.SECOND));
  }
 
  public void testChouldGetDouble() throws Exception {
    DoubleConverter nd = new DoubleConverter();
    Double d = (Double)nd.unmarshal(TestUtils.createStreamReader("<double>1.1</double>"), null);
    assertEquals(new Double(1.1d), d);
  }
 
  public void testCouldGetInt() throws Exception {
    IntegerConverter id = new IntegerConverter();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.IntegerConverter.unmarshal()

    assertEquals(new Double(1.1d), d);
  }
 
  public void testCouldGetInt() throws Exception {
    IntegerConverter id = new IntegerConverter();
    Integer d = (Integer)id.unmarshal(TestUtils.createStreamReader("<int>1001</int>"), null);
    assertEquals(new Integer(1001), d);
 
  }
 
  public void testCouldGetLong() throws Exception {
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.LongConverter.unmarshal()

 
  }
 
  public void testCouldGetLong() throws Exception {
    LongConverter id = new LongConverter();
    Long d = (Long)id.unmarshal(TestUtils.createStreamReader("<long>710010098</long>"), null);
    assertEquals(new Long(710010098), d);
  }
 
  public void testCouldGetNull() throws Exception {
    NullConverter nd = new NullConverter();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.NullConverter.unmarshal()

    assertEquals(new Long(710010098), d);
  }
 
  public void testCouldGetNull() throws Exception {
    NullConverter nd = new NullConverter();
    assertNull(nd.unmarshal(TestUtils.createStreamReader("<null></null>"), null));
    assertNull(nd.unmarshal(TestUtils.createStreamReader("<null></null>"), null));
  }
 
 
 
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.StringConverter.unmarshal()

    }
  }
 
  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);
  }
 
  public void testShouldReturnTheOrginalStringFromXmlEscaped() throws Exception {
    StringConverter sd = new StringConverter();
View Full Code Here

Examples of org.apache.activemq.openwire.OpenWireFormat.unmarshal()

        PreparedStatement statement = conn.prepareStatement("SELECT ID, MSG FROM ACTIVEMQ_MSGS");   
        ResultSet result = statement.executeQuery();
        LOG.info("Messages left in broker after test");
        while(result.next()) {
            long id = result.getLong(1);
            org.apache.activemq.command.Message message = (org.apache.activemq.command.Message)wireFormat.unmarshal(new ByteSequence(result.getBytes(2)));
            LOG.info("id: " + id + ", message SeqId: " + message.getMessageId().getBrokerSequenceId() + ", MSG: " + message);
        }
        statement.close();
        conn.close();
    }
View Full Code Here

Examples of org.apache.activemq.wireformat.WireFormat.unmarshal()

        PreparedStatement statement = conn.prepareStatement("SELECT ID, MSG FROM ACTIVEMQ_MSGS");   
        ResultSet result = statement.executeQuery();
        LOG.info("Messages left in broker after test");
        while(result.next()) {
            long id = result.getLong(1);
            org.apache.activemq.command.Message message = (org.apache.activemq.command.Message)wireFormat.unmarshal(new ByteSequence(result.getBytes(2)));
            LOG.info("id: " + id + ", message SeqId: " + message.getMessageId().getBrokerSequenceId() + ", MSG: " + message);
        }
        statement.close();
        conn.close();
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.message.databinding.JAXBBlockContext.unmarshal()

        throws XMLStreamException, WebServiceException {
        // Get the JAXBBlockContext. All of the necessry information is recorded on it
        JAXBBlockContext ctx = (JAXBBlockContext) busContext;
       
        try {
            busObject = ctx.unmarshal(reader);
        } catch (JAXBException je) {
            if (DEBUG_ENABLED) {
                try {
                    log.debug("JAXBContext for unmarshal failure:" +
                              ctx.getJAXBContext(ctx.getClassLoader()));
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.