Examples of AllTypesElement


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

  /** <p>Tests marshalling of a simple element.</p>
   */
  public void testMarshalSimpleElements() throws Exception {
    JMMarshallerImpl m = (JMMarshallerImpl) getFactory().createMarshaller();
    StringWriter sw = new StringWriter();
    AllTypesElement element = getAllTypesElement();
    m.setXmlDeclaration(false);
    m.setEncoding("US-ASCII");
    m.marshal(element, sw);
    String expected = getAllTypesElementString(false, true);
    assertEquals(expected, sw.toString());
View Full Code Here

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

   * {@link Marshaller#JAXB_SCHEMA_LOCATION}.</p>
   */
  public void testSchemaLocation() throws Exception {
    String s = getAllTypesElementString(true, false);
    JAXBContext context = getFactory();
    AllTypesElement e = (AllTypesElement) context.createUnmarshaller().unmarshal(new InputSource(new StringReader(s)));
    StringWriter sw = new StringWriter();
    Marshaller marshaller = context.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "foo.xsd");
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE);
    marshaller.setProperty(Marshaller.JAXB_ENCODING, "ASCII");
View Full Code Here

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

    element.setBooleanElem(true);
    return element;
  }

  protected AllTypesElement getAllTypesElement() throws JAXBException {
    AllTypesElement element = (AllTypesElement) getFactory().getManager(AllTypesElement.class).getElementJ();
    element.setAllSimpleTypesElement(getAllSimpleTypesElement());
    List list = element.getListTypeElement();
    list.add(new BigInteger("7"));
    list.add(new BigInteger("-3"));
    list.add(new BigInteger("0"));
    element.setUnionTypeElement(getDateTime());
    return element;
  }
View Full Code Here

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

    /** <p>Tests unmarshalling of a simple element.</p>
     */
    public void testUnmarshalSimpleElements() throws Exception {
    String s = getAllTypesElementString(false, false);
      StringReader sr = new StringReader(s);
    AllTypesElement e = (AllTypesElement) getFactory().createUnmarshaller().unmarshal(new InputSource(sr));
    verifyAllSimpleTypesElement(e.getAllSimpleTypesElement());
  }
View Full Code Here

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

      throws Exception {
    JAXBContext myFactory = getFactory();
    Unmarshaller unmarshaller = myFactory.createUnmarshaller();
    String s = getAllTypesElementString(pSchemaLocation, true);
    StringReader sr = new StringReader(s);
    AllTypesElement result = (AllTypesElement) unmarshaller.unmarshal(new InputSource(sr));
    verifyAllTypesElement(result);
    result = (AllTypesElement) myFactory.createUnmarshaller().unmarshal(new StreamSource(new StringReader(s)));
    verifyAllTypesElement(result);
  }
View Full Code Here

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

  /** <p>Tests marshalling of a simple element.</p>
   */
  public void testMarshalSimpleElements() throws Exception {
    JMMarshallerImpl m = (JMMarshallerImpl) getFactory().createMarshaller();
    StringWriter sw = new StringWriter();
    AllTypesElement element = getAllTypesElement();
    m.setXmlDeclaration(false);
    m.setEncoding("US-ASCII");
    m.marshal(element, sw);
    String expected = getAllTypesElementString(false, true);
    assertEquals(expected, sw.toString());
View Full Code Here

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

   * {@link Marshaller#JAXB_SCHEMA_LOCATION}.</p>
   */
  public void testSchemaLocation() throws Exception {
    String s = getAllTypesElementString(true, false);
    JAXBContext context = getFactory();
    AllTypesElement e = (AllTypesElement) context.createUnmarshaller().unmarshal(new InputSource(new StringReader(s)));
    StringWriter sw = new StringWriter();
    Marshaller marshaller = context.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "foo.xsd");
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE);
    marshaller.setProperty(Marshaller.JAXB_ENCODING, "ASCII");
View Full Code Here

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

    element.setBooleanElem(true);
    return element;
  }

  protected AllTypesElement getAllTypesElement() throws JAXBException {
    AllTypesElement element = (AllTypesElement) getFactory().getManager(AllTypesElement.class).getElementJ();
    element.setAllSimpleTypesElement(getAllSimpleTypesElement());
    List list = element.getListTypeElement();
    list.add(new BigInteger("7"));
    list.add(new BigInteger("-3"));
    list.add(new BigInteger("0"));
    element.setUnionTypeElement(getDateTime());
    return element;
  }
View Full Code Here

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

    /** <p>Tests unmarshalling of a simple element.</p>
     */
    public void testUnmarshalSimpleElements() throws Exception {
    String s = getAllTypesElementString(false, false);
      StringReader sr = new StringReader(s);
    AllTypesElement e = (AllTypesElement) getFactory().createUnmarshaller().unmarshal(new InputSource(sr));
    verifyAllSimpleTypesElement(e.getAllSimpleTypesElement());
  }
View Full Code Here

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

      throws Exception {
    JAXBContext myFactory = getFactory();
    Unmarshaller unmarshaller = myFactory.createUnmarshaller();
    String s = getAllTypesElementString(pSchemaLocation, true);
    StringReader sr = new StringReader(s);
    AllTypesElement result = (AllTypesElement) unmarshaller.unmarshal(new InputSource(sr));
    verifyAllTypesElement(result);
    result = (AllTypesElement) myFactory.createUnmarshaller().unmarshal(new StreamSource(new StringReader(s)));
    verifyAllTypesElement(result);
  }
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.