Package hudson.util

Examples of hudson.util.XStream2.toXML()


            try {
                ServletFileUpload f = new ServletFileUpload(new DiskFileItemFactory());
                List<?> v = f.parseRequest(req);
                assertEquals(1,v.size());
                XStream2 xs = new XStream2();
                System.out.println(xs.toXML(v.get(0)));
            } catch (FileUploadException e) {
                throw new ServletException(e);
            }
        }
    }
View Full Code Here


        XStream2 xs = new XStream2();

        PasswordProtectedAdapterCargo adapter = (PasswordProtectedAdapterCargo)xs.fromXML(oldXml);
        Assert.assertEquals(plainPassword, adapter.getPassword());
       
        String newXml = xs.toXML(adapter);
        Assert.assertThat("Password should be scrambled", newXml, CoreMatchers.not(JUnitMatchers.containsString(plainPassword)));
    }
}
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private static <T> T reserialize(T object) {
        XStream2 xs = new XStream2();
        String xml = xs.toXML(object);
        System.out.println(xml);
        return (T) xs.fromXML(xml);
    }

    private static class Thing {
View Full Code Here

        TestMarshalClass t = new TestMarshalClass(context, "Bobby", new TestMarshalClass(context, "SomeoneElse"));

        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        String xml = xStream.toXML(t);

        TestMarshalClass readT = (TestMarshalClass)xStream.fromXML(xml);

        assertNotNull(readT.getEntity());
        assertNotNull(readT.getEntity().getEvent());
View Full Code Here

        TestMarshalClass t = new TestMarshalClass(context, "Bobby", new TestMarshalClass(context, "SomeoneElse"));

        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        String xml = xStream.toXML(t);

        TestMarshalClass readT = (TestMarshalClass)xStream.fromXML(xml);

        assertNotNull(readT.getEntity());
        assertNotNull(readT.getEntity().getEvent());
View Full Code Here

        TestMarshalClass t = new TestMarshalClass(context, "Bobby", new TestMarshalClass(context, "SomeoneElse"));

        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        String xml = xStream.toXML(t);

        TestMarshalClass readT = (TestMarshalClass)xStream.fromXML(xml);

        assertNotNull(readT.getEntity());
        assertNotNull(readT.getEntity().getEvent());
View Full Code Here

        TestMarshalClass t = new TestMarshalClass(context, "Bobby", new TestMarshalClass(context, "SomeoneElse"));

        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        String xml = xStream.toXML(t);

        TestMarshalClass readT = (TestMarshalClass)xStream.fromXML(xml);

        assertNotNull(readT.getEntity());
        assertNotNull(readT.getEntity().getEvent());
View Full Code Here

        TestMarshalClass t = new TestMarshalClass(context, "Bobby", new TestMarshalClass(context, "SomeoneElse"));

        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        String xml = xStream.toXML(t);

        TestMarshalClass readT = (TestMarshalClass)xStream.fromXML(xml);

        assertNotNull(readT.getEntity());
        assertNotNull(readT.getEntity().getEvent());
View Full Code Here

        TestMarshalClass t = new TestMarshalClass(context, "Bobby", new TestMarshalClass(context, "SomeoneElse"));

        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        String xml = xStream.toXML(t);

        TestMarshalClass readT = (TestMarshalClass)xStream.fromXML(xml);

        assertNotNull(readT.getEntity());
        assertNotNull(readT.getEntity().getEvent());
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.