Package org.jboss.xb.binding.sunday.marshalling

Examples of org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshal()


     
      MarshallerImpl marshaller = new MarshallerImpl();
     
      try
      {
         marshaller.marshal(SCHEMA, null, root, writer);
         fail("required attribute is missing");
      }
      catch(JBossXBRuntimeException e)
      {
         // expected
View Full Code Here


   {     
      E root = new E();
      root.unqualified = "1";
      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.marshal(SCHEMA, null, root, writer);
     
      String xml = "<root xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='testns' unqualified='1'/>";
      assertXmlEqual(xml, writer.getBuffer().toString());
   }
View Full Code Here

      top.string = new ArrayList();
      top.string.add(" ");
      top.string.add("\n      newline, 6 spaces, newline, 3 spaces\n   ");
      MarshallerImpl marshaller = new MarshallerImpl();
      StringWriter writer = new StringWriter();
      marshaller.marshal(schema, null, top, writer);
     
      // TODO: the xml diff trims whitespaces...
      //assertXmlFileContent("IgnorableWhitespaceContent.xml", writer.getBuffer().toString());
      //System.out.println(writer.getBuffer().toString());
     
View Full Code Here

   public void testMarshallingSunday() throws Exception
   {
      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      marshaller.marshal(SCHEMA, null, E.INSTANCE, writer);
      String xml = writer.getBuffer().toString();
      assertXmlEqual(XML, xml);
   }

   // Inner
View Full Code Here

      binding.value4 = new Binding.Value4("val4");
      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      String file = getPath("xml/jbxb/characters/schema1.xsd").getFile();
      marshaller.marshal(new FileReader(file), new MappingObjectModelProvider(), binding, writer);
      String xml = writer.getBuffer().toString();
      assertEquals(XML_VALUE4, xml);
   }

   // Private
View Full Code Here

   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      StringWriter writer = new StringWriter();
      marshaller.marshal(schema, null, GLOBAL_SIMPLE, writer);
      String marshalled = writer.getBuffer().toString();
      assertXmlEqual(XML_SIMPLE, marshalled);
   }

   public void testSimpleMarshallingXerces() throws Exception
View Full Code Here

      assertEquals(firstName, person.getFirstName());
      assertEquals(lastName, person.getLastName());

      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.marshal(schema, null, person, writer);
      String marshalled = writer.getBuffer().toString();
      assertXmlEqual(xml, marshalled);
   }

   public void testImmutableXerces() throws Exception
View Full Code Here

   public void testMarshalStringArraySunday() throws Exception
   {
      MarshallerImpl marshaller = new MarshallerImpl();
      StringWriter writer = new StringWriter();
      marshaller.marshal(SCHEMA, null, ArrayWrapper.STRING_ARR_INSTANCE, writer);
      assertXmlEqual(XML, writer.getBuffer().toString());
   }

   public void testMarshalStringArrayXerces() throws Exception
   {
View Full Code Here

   public void testMarshalStringArrayArraySunday() throws Exception
   {
      MarshallerImpl marshaller = new MarshallerImpl();
      StringWriter writer = new StringWriter();
      marshaller.marshal(SCHEMA, null, ArrayWrapper.STRING_ARR_ARR_INSTANCE, writer);
      assertXmlEqual(XML_STRING_ARR_ARR, writer.getBuffer().toString());
   }

   public void testMarshalStringArrayArrayXerces() throws Exception
   {
View Full Code Here

      SchemaBinding schema = getSchema();
      MarshallerImpl marshaller = getMarshaller();
      StringWriter writer = new StringWriter();
      GlobalElement global = new GlobalElement();
      global.stringType = GlobalElement.STRING_TYPE;
      marshaller.marshal(schema, null, global, writer);
      assertXmlEqual(XML_STRING_TYPE, writer.getBuffer().toString());
   }

   public void testTermAfterUnmarshallingHandler_stringType() throws Exception
   {
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.