Package org.apache.ws.jaxme.test.misc.types

Examples of org.apache.ws.jaxme.test.misc.types.Author


    marshaller.marshal(getAllTypesElement(), sw);
    assertEquals(input.toString(), sw.toString());
  }

  protected String getMarshalledAuthor() throws JAXBException {
      Author author = new ObjectFactory().createAuthor();
      author.setRating(2);
      author.setValue("This is a test.");
      StringWriter sw = new StringWriter();
      getFactory().createMarshaller().marshal(author, sw);
      return sw.toString();
  }
View Full Code Here


  }

  /** <p>Tests unmarshalling of a complex element with simple content.</p>
   */
  public void testUnmarshalSimpleContent() throws Exception {
      Author author = (Author) getFactory().createUnmarshaller().unmarshal(new InputSource(new StringReader(getMarshalledAuthor())));
      assertEquals(2, author.getRating());
      assertEquals("This is a test.", author.getValue());
  }
View Full Code Here

    marshaller.marshal(getAllTypesElement(), sw);
    assertEquals(input.toString(), sw.toString());
  }

  protected String getMarshalledAuthor() throws JAXBException {
      Author author = new ObjectFactory().createAuthor();
      author.setRating(2);
      author.setValue("This is a test.");
      StringWriter sw = new StringWriter();
      Marshaller m = getFactory().createMarshaller();
      m.setProperty(JMMarshallerImpl.JAXME_XML_DECLARATION, Boolean.FALSE);
      m.marshal(author, sw);
      return sw.toString();
View Full Code Here

  /** <p>Tests, whether elements with simple content can be unmarshalled.</p>
   */
  public void testUnmarshalSimpleContent() throws Exception {
      String s = getMarshalledAuthor();
      Author author = (Author) getFactory().createUnmarshaller().unmarshal(new InputSource(new StringReader(s)));
      verifyUnmarshalledAuthor(author);
      author = (Author) getFactory().createUnmarshaller().unmarshal(new StreamSource(new StringReader(s)));
      verifyUnmarshalledAuthor(author);
  }
View Full Code Here

    marshaller.marshal(getAllTypesElement(), sw);
    assertEquals(input.toString(), sw.toString());
  }

  protected String getMarshalledAuthor() throws JAXBException {
      Author author = new ObjectFactory().createAuthor();
      author.setRating(2);
      author.setValue("This is a test.");
      StringWriter sw = new StringWriter();
      Marshaller m = getFactory().createMarshaller();
      m.setProperty(JMMarshallerImpl.JAXME_XML_DECLARATION, Boolean.FALSE);
      m.marshal(author, sw);
      return sw.toString();
View Full Code Here

  /** <p>Tests, whether elements with simple content can be unmarshalled.</p>
   */
  public void testUnmarshalSimpleContent() throws Exception {
      String s = getMarshalledAuthor();
      Author author = (Author) getFactory().createUnmarshaller().unmarshal(new InputSource(new StringReader(s)));
      verifyUnmarshalledAuthor(author);
      author = (Author) getFactory().createUnmarshaller().unmarshal(new StreamSource(new StringReader(s)));
      verifyUnmarshalledAuthor(author);
  }
View Full Code Here

    marshaller.marshal(getAllTypesElement(), sw);
    assertEquals(input.toString(), sw.toString());
  }

  protected String getMarshalledAuthor() throws JAXBException {
      Author author = new ObjectFactory().createAuthor();
      author.setRating(2);
      author.setValue("This is a test.");
      StringWriter sw = new StringWriter();
      Marshaller m = getFactory().createMarshaller();
      m.setProperty(JMMarshallerImpl.JAXME_XML_DECLARATION, Boolean.FALSE);
      m.marshal(author, sw);
      return sw.toString();
View Full Code Here

  /** <p>Tests, whether elements with simple content can be unmarshalled.</p>
   */
  public void testUnmarshalSimpleContent() throws Exception {
      String s = getMarshalledAuthor();
      Author author = (Author) getFactory().createUnmarshaller().unmarshal(new InputSource(new StringReader(s)));
      verifyUnmarshalledAuthor(author);
      author = (Author) getFactory().createUnmarshaller().unmarshal(new StreamSource(new StringReader(s)));
      verifyUnmarshalledAuthor(author);
  }
View Full Code Here

    marshaller.marshal(getAllTypesElement(), sw);
    assertStringEquals(input.toString(), sw.toString());
  }

  protected String getMarshalledAuthor() throws JAXBException {
      Author author = new ObjectFactory().createAuthor();
      author.setRating(2);
      author.setValue("This is a test.");
      StringWriter sw = new StringWriter();
      getFactory().createMarshaller().marshal(author, sw);
      return sw.toString();
  }
View Full Code Here

      String got = getMarshalledAuthor();
      assertStringEquals(expect, got);
  }

  public void testUnmarshalSimpleContent() throws Exception {
      Author author = (Author) getFactory().createUnmarshaller().unmarshal(new InputSource(new StringReader(getMarshalledAuthor())));
      assertEquals(2, author.getRating());
      assertEquals("This is a test.", author.getValue());
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.test.misc.types.Author

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.