Package hudson.util

Examples of hudson.util.XStream2$MapperInjectionPoint


        otherBuilds.add(new TriggeredItemEntity(12, "projectZ"));
        context.setOthers(otherBuilds);

        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());
        assertTrue(readT.getEntity().getEvent() instanceof PatchsetCreated);
        assertNotNull(readT.getEntity().getThisBuild());
View Full Code Here


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

        XStream xStream = null;
        String xml = null;
        try {
            xStream = new XStream2();
            xStream.registerConverter(new TriggerContextConverter());
            xml = xStream.toXML(t);
        } catch (Exception e) {
            AssertionError error = new AssertionError("This should work, but did not. " + e.getMessage());
            error.initCause(e);
View Full Code Here

        otherBuilds.add(new TriggeredItemEntity(12, "projectZ"));
        context.setOthers(otherBuilds);

        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());
        assertTrue(readT.getEntity().getEvent() instanceof ChangeAbandoned);
        assertNotNull(readT.getEntity().getThisBuild());
View Full Code Here

        otherBuilds.add(new TriggeredItemEntity(12, "projectZ"));
        context.setOthers(otherBuilds);

        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());
        assertTrue(readT.getEntity().getEvent() instanceof ChangeMerged);
        assertNotNull(readT.getEntity().getThisBuild());
View Full Code Here

        otherBuilds.add(new TriggeredItemEntity(12, "projectZ"));
        context.setOthers(otherBuilds);

        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());
        assertTrue(readT.getEntity().getEvent() instanceof ChangeRestored);
        assertNotNull(readT.getEntity().getThisBuild());
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testUnmarshalOldData1() throws Exception {
        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        Object obj = xStream.fromXML(getClass().getResourceAsStream("retriggerAction_oldData.xml"));
        assertTrue(obj instanceof RetriggerAction);
        RetriggerAction action = (RetriggerAction)obj;
        TriggerContext context = Whitebox.getInternalState(action, "context");
        assertNotNull(context.getEvent());
        assertThat("Event is not a ChangeBasedEvent", context.getEvent(), instanceOf(ChangeBasedEvent.class));
View Full Code Here

        otherBuilds.add(new TriggeredItemEntity(12, "projectZ"));
        context.setOthers(otherBuilds);

        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());
        assertTrue(readT.getEntity().getEvent() instanceof DraftPublished);
        assertNotNull(readT.getEntity().getThisBuild());
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testUnmarshalOldData2() throws Exception {
        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        Object obj = xStream.fromXML(getClass().getResourceAsStream("retriggerAction_oldData2.xml"));
        assertTrue(obj instanceof RetriggerAction);
        RetriggerAction action = (RetriggerAction)obj;
        TriggerContext context = Whitebox.getInternalState(action, "context");
        assertNotNull(context.getEvent());
        assertThat("Event is not a ChangeBasedEvent", context.getEvent(), instanceOf(ChangeBasedEvent.class));
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testUnmarshalOldMatrixBuild() throws Exception {
        XStream xStream = new XStream2();
        xStream.registerConverter(new TriggerContextConverter());
        xStream.alias("matrix-run", MatrixRun.class);
        Object obj = xStream.fromXML(getClass().getResourceAsStream("matrix_build.xml"));
        assertTrue(obj instanceof MatrixRun);
        MatrixRun run = (MatrixRun)obj;

        Cause.UpstreamCause upCause = run.getCause(Cause.UpstreamCause.class);
        List upstreamCauses = Whitebox.getInternalState(upCause, "upstreamCauses");
View Full Code Here

TOP

Related Classes of hudson.util.XStream2$MapperInjectionPoint

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.