Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.Marshaller.marshal()


       
        assertEquals(999, proxy.getAttribute().intValue());
        assertEquals("element of 999", proxy.getElement());
        assertNull(proxy.getReference());
       
        marshaller.marshal(proxy);
       
        String output = out.toString();

        String expected
            = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
View Full Code Here


       
        assertEquals(100, refererProxy.getAttribute().intValue());
        assertEquals("element of 100", refererProxy.getElement());
        assertNotNull(refererProxy.getReference());

        marshaller.marshal(refererProxy);
       
        String output = out.toString();
       
        String expected
            = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
View Full Code Here

       
        StringWriter out = new StringWriter();
        Marshaller marshaller = new Marshaller (out);
        marshaller.setValidation(true);
        try {
            marshaller.marshal(entity);
            // fail ("ValidationException expected");
        }
        catch (ValidationException e) {
            // nothing to check
        }
View Full Code Here

       
        StringWriter out = new StringWriter();
        Marshaller marshaller = new Marshaller (out);
        marshaller.setValidation(true);
        try {
            marshaller.marshal(entity);
            // fail ("ValidationException expected");
        }
        catch (ValidationException e) {
            // nothing to check
        }
View Full Code Here

        marshaller.setWriter(out);
       
        Entity entity = new Entity();
        entity.setId(new Integer(100));
        entity.setName("entity 100");
        marshaller.marshal(entity);
       
        System.out.println(out.toString());
    }
   
    private XMLContext getXMLContext() {
View Full Code Here

       
        Entity entity = new Entity();
        entity.setId(new Integer(100));
        entity.setName("entity 100");
       
        marshaller.marshal(entity);
       
        System.out.println(out.toString());
    }
   
    private XMLContext getXMLContext() {
View Full Code Here

            assignmentNotification[0].getPartyReference().setHref(entity.getPartyOne());
           
            StringWriter out = new StringWriter();
            Marshaller marshaller = new Marshaller (out);
            marshaller.setValidation(true);
            marshaller.marshal(entity);
           
            // assertTrue(out.toString().indexOf("<assignmentNotification><partyReference href=\"ID000000\"/>")>-1);
           
        }
        catch (Exception e) {
View Full Code Here

            assignmentNotification[0].getPartyReference().setHref(partyTwo);
           
            StringWriter out = new StringWriter();
            Marshaller marshaller = new Marshaller (out);
            marshaller.setValidation(true);
            marshaller.marshal(entity);
           
            // fail ("Nested ValidationException expected.");
        }
        catch (Exception e) {
            // assertTrue(e.getCause() instanceof ValidationException);
View Full Code Here

            assignmentNotification[0].getPartyReference().setHref(null);
           
            StringWriter out = new StringWriter();
            Marshaller marshaller = new Marshaller (out);
            marshaller.setValidation(true);
            marshaller.marshal(entity);
           
            // fail ("MarshalException expected, because partyReference/@href is use=\"required\"");
        }
        catch (Exception e) {
            // assertTrue(e instanceof ValidationException);
View Full Code Here

            assignmentNotification[0].getPartyReference().setHref("bla");
           
            StringWriter out = new StringWriter();
            Marshaller marshaller = new Marshaller (out);
            marshaller.setValidation(true);
            marshaller.marshal(entity);
           
            // fail ("Nested ValidationException expected.");
        }
        catch (Exception e) {
            // assertTrue(e.getCause() instanceof ValidationException);
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.