Package org.jboss.test.xml.jbxb.characters

Examples of org.jboss.test.xml.jbxb.characters.Binding


   public void testMainUnmarshalling() throws Exception
   {
      String res = getPath("xml/jbxb/characters/testSchema1.xml").getFile();
      FileReader xmlReader = new FileReader(res);

      Binding binding = unmarshal(xmlReader);

      assertEquals("Binding.name = root ", "root", binding.getName());
      assertEquals("Binding.text = value1 ", "value1", binding.getText());
   }
View Full Code Here


         "   name='root'>" +
         "   <value2>value2</value2>" +
         "</binding>"
      );

      Binding binding = unmarshal(xmlReader);

      assertEquals("Binding.name = root ", "root", binding.getName());
      Binding.Value2 value2 = binding.getValue2();
      assertNotNull(value2);
      assertEquals("Binding.text2 = value2 ", "value2", value2.text);
   }
View Full Code Here

         "   name='root'>" +
         "   <value3 attr='attr'>value3</value3>" +
         "</binding>"
      );

      Binding binding = unmarshal(xmlReader);

      assertEquals("Binding.name = root ", "root", binding.getName());
      Binding.Value3 value3 = binding.getValue3();
      assertNotNull(value3);
      assertEquals("value3", value3.chars);
      assertEquals("attr", value3.attr);
   }
View Full Code Here

      assertEquals("attr", value3.attr);
   }

   public void testValue4Unmarshalling() throws Exception
   {
      Binding binding = unmarshal(new StringReader(XML_VALUE4));
      assertEquals("Binding.name = root ", "root", binding.getName());
      Binding.Value4 value4 = binding.value4;
      assertNotNull(value4);
      assertEquals("val4", value4.value);

   }
View Full Code Here

   }

   public void testValue4MarshallingXerces() throws Exception
   {
      Binding binding = new Binding();
      binding.setName("root");
      binding.value4 = new Binding.Value4("val4");
      StringWriter writer = new StringWriter();
      XercesXsMarshaller marshaller = new XercesXsMarshaller();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      String file = getPath("xml/jbxb/characters/schema1.xsd").getFile();
View Full Code Here

      assertEquals(XML_VALUE4, xml);
   }

   public void testValue4MarshallingSunday() throws Exception
   {
      Binding binding = new Binding();
      binding.setName("root");
      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();
View Full Code Here

      String url = getPath("xml/jbxb/characters/schema1.xsd").toExternalForm();
      SchemaBinding schemaBinding = XsdBinder.bind(url);
      schemaBinding.setIgnoreUnresolvedFieldOrClass(true);

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Binding binding = (Binding)unmarshaller.unmarshal(xmlReader, schemaBinding);
      return binding;
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.xml.jbxb.characters.Binding

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.