You can find the test class here:
http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/standalone/StandaloneWriteTest.java?revision=724940&view=markup


2008/12/10 Anshul Dutta <[EMAIL PROTECTED]>

> Can the same test be used with the latest xfire version of aegis?
> Could you please paste the contents of the test class in the email?
>
> Thanks
>
> -----Original Message-----
> From: Benson Margulies [mailto:[EMAIL PROTECTED]
> Sent: 10 December 2008 00:43
> To: [email protected]
> Subject: Re: Aegis databinding independently of CXF
>
> I just checked in a StandaloneWriteTest which should give you some help. I
> am thinking about how to go about adding a sample to our samples.
>
> On Sun, Dec 7, 2008 at 4:04 PM, Magnus Kvalheim <[EMAIL PROTECTED]>
> wrote:
> > Have attached the sources and debugging into cxf, and found that it
> > was missing the aegistype. (I did initially give it null so thats only
> > fair :-)
> > )
> >
> > Still having a bit of struggle figuring out how it's all connected so
> > yes - a write test would be great.
> >
> > Thanks
> >
> > 2008/12/7 Benson Margulies <[EMAIL PROTECTED]>
> >
> >> I might have forgotten to write one. I'll put some attention into
> >> this in the next few days.
> >>
> >> On Sun, Dec 7, 2008 at 4:33 AM, Magnus Kvalheim <[EMAIL PROTECTED]>
> >> wrote:
> >> > Thanks for your reply Benson,
> >> >
> >> > I must admittedly say that I haden't...
> >> >
> >> > I took a quick look, and can find a read test, but no write :-|
> >> >
> >> > I'll look more into it later tonight.
> >> >
> >> > Thanks,
> >> > Magnus
> >> >
> >> > 2008/12/7 Benson Margulies <[EMAIL PROTECTED]>
> >> >
> >> >> Magnus, have you looked at the unit tests that test standalone Aegis?
> >> >>
> >> >> On Sat, Dec 6, 2008 at 5:15 PM, Magnus Kvalheim
> >> >> <[EMAIL PROTECTED]>
> >> >> wrote:
> >> >> > Hi all,
> >> >> >
> >> >> > I'm interested in trying Aegis over JAXB as a xml<->java mapping
> >> >> solution.
> >> >> >
> >> >> > The user guide, http://cwiki.apache.org/CXF20DOC/aegis-21.html,
> >> >> indicates
> >> >> > this is possible, but I haven't been able to find any examples
> >> >> > of
> >> such.
> >> >> >
> >> >> > I've tried with a simple example:
> >> >> >
> >> >> > public class MappingTest implements Serializable{
> >> >> >
> >> >> >    private static final long serialVersionUID = 1L;
> >> >> >    private String text1;
> >> >> >    private Integer number1;
> >> >> >    private Boolean bool1;
> >> >> >    private int[] intArr1;
> >> >> >    public MappingTest() {
> >> >> >        text1 = "A testing string";
> >> >> >        number1 = 42;
> >> >> >        bool1 = true;
> >> >> >        intArr1 = new int[]{2,5,7,9,23,54};
> >> >> >    }
> >> >> >    public String getText1() {return text1;    }
> >> >> >    public Integer getNumber1() {return number1;}
> >> >> >    public Boolean getBool1() {return bool1;}i
> >> >> >    public int[] getIntArr1() {return intArr1;}
> >> >> >
> >> >> >    public static void main(String[] args) throws Exception {
> >> >> >
> >> >> >        MappingTest test = new MappingTest();
> >> >> >        AegisContext ctx = new AegisContext();
> >> >> >        XMLOutputFactory factory = XMLOutputFactory.newInstance();
> >> >> >        OutputStream out = new FileOutputStream("data.xml");
> >> >> >
> >> >> >        XMLStreamWriter xmlWriter =
> factory.createXMLStreamWriter(out);
> >> >> >        AegisWriter<XMLStreamWriter> aegisWriter =
> >> >> > ctx.createXMLStreamWriter();
> >> >> >        aegisWriter.write(test, new QName("test"), true,
> >> >> > xmlWriter, null);
> >> >> >    }
> >> >> > }
> >> >> > But get a nullpointerexception here:
> >> >> > Exception in thread "main" java.lang.NullPointerException
> >> >> >    at
> >> >> >
> >> >>
> >> org.apache.cxf.aegis.AegisXMLStreamDataWriter.write(AegisXMLStreamDat
> >> aWriter.java:80)
> >> >> >    at
> >> >> >
> >> >>
> >> org.apache.cxf.aegis.AegisXMLStreamDataWriter.write(AegisXMLStreamDat
> >> aWriter.java:33)
> >> >> >    at MappingTest.main(MappingTest.java:38)
> >> >> >
> >> >> >
> >> >> > What is required in order to serialize a bean with simple types?
> >> >> >
> >> >> > Can anyone on the list tell me if I'm on the right track?
> >> >> >
> >> >> > Thanks,
> >> >> > Magnus
> >> >> >
> >> >>
> >> >
> >>
> >
>
> ________________________________________________________________________
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
> ________________________________________________________________________
>
>
> ________________________________________________________________________
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
> ________________________________________________________________________

Reply via email to