Package com.bansheeproject.xmlbuilder

Examples of com.bansheeproject.xmlbuilder.Parser


    FieldMapSimple simple = new FieldMapSimple();
    simple.setSimpleStringContent("simpleStringContent");
    fieldMapComplex.setContent(simple);
   
   
    Parser parser =new Parser();
    String xml = parser.encode(fieldMapComplex);
   
   
    GregorianCalendar gregorianCalendar = (GregorianCalendar)GregorianCalendar.getInstance();
    gregorianCalendar.setTime(date);
    XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
View Full Code Here


    PathFieldSimple simple = new PathFieldSimple();
    simple.setSimpleStringContent("simpleStringContent");
    fieldMapComplex.setContent(simple);
   
   
    Parser parser =new Parser();
    String xml = parser.encode(fieldMapComplex);
   
   
    GregorianCalendar gregorianCalendar = (GregorianCalendar)GregorianCalendar.getInstance();
    gregorianCalendar.setTime(date);
    XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
View Full Code Here

   
    SubClassMapped subClassMapped = new SubClassMapped();
    subClassMapped.superValue = "superValue";
    subClassMapped.subValue = "subValue";
   
    Parser parser = new Parser();
    String xml = parser.encode(subClassMapped);
   
    Assert.assertEquals("<subClass><superValue>superValue</superValue><subValue>subValue</subValue></subClass>", xml);
   
  }
View Full Code Here

 
  @Test(expectedExceptions={ConverterException.class})
  public void testIgnoredEntity() {
    IgnoredEntity ignoredEntity = new IgnoredEntity();
   
    Parser parser = new Parser();
   
    parser.encode(ignoredEntity);
   
  }
View Full Code Here

 
  @Test
  public void testEmptyEntity() {
    Complex complex = new Complex();
   
    Parser parser = new Parser();
    String xml = parser.encode(complex);
    Assert.assertEquals("", xml);
  }
View Full Code Here

 
  @Test
  public void testEmptyEntityWithPath() {
    ComplexWithPath complex = new ComplexWithPath();
   
    Parser parser = new Parser();
    String xml = parser.encode(complex);
    Assert.assertEquals("<complex/>", xml);
   
  }
View Full Code Here

 
  @Test
  public void testEmptyEntityWithPath2() {
    ComplexWithPath complex = new ComplexWithPath();
    complex.test = "new";
    Parser parser = new Parser();
    String xml = parser.encode(complex);
    Assert.assertEquals("<complex><test>new</test></complex>", xml);
   
  }
View Full Code Here

 
  @Test
  public void sanityTest() {
   
    Parser parser = new Parser();
    Simple simple = new Simple();
   
   
   
    simple.stringValue = "stringValueContent";
   
    String xml = parser.encode(simple);
   
    Assert.assertEquals("<stringValue>stringValueContent</stringValue>", xml);
   
  }
View Full Code Here

  }
 
 
  @Test
  public void sanityTest2() {
    Parser parser = new Parser();
    Complex complex = new Complex();
   
    complex.simple = new Simple();
    complex.simple.stringValue = "stringValueContent";
   
    String xml = parser.encode(complex);
   
    Assert.assertEquals("<stringValue>stringValueContent</stringValue>", xml);
   
  }
View Full Code Here

  }
 
  @Test
  public void testNull() {
   
    Parser parser = new Parser();
   
    String xml = parser.encode(null);
    Assert.assertNull(xml);
   
  }
View Full Code Here

TOP

Related Classes of com.bansheeproject.xmlbuilder.Parser

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.