Package com.thoughtworks.xstream

Examples of com.thoughtworks.xstream.XStream.fromXML()


            } else {
                throw new IllegalArgumentException("Unable to set ClassLoader on " + executor);
            }
            xstream.setClassLoader(cl);
            executionNodeContext.setClassLoader(cl);
            payload = xstream.fromXML( ((String) object) );
            context.getProperties().put("xstream-instance", xstream);
            this.context = context;
        } catch (Exception e) {
            handleException(this, object, e);
        }
View Full Code Here


    /** {@inheritDoc} */
    public void execute() throws MojoExecutionException {
        try {
            InputStream stream = findTemplateSuiteDescriptor();
            XStream xstream = new XStream(new Sun14ReflectionProvider());
            TemplateSuite suite = (TemplateSuite) xstream.fromXML(stream);
            stream.close();

            Properties props = new Properties();
            InputStream propsStream = getClass().getResourceAsStream("/org/apache/tiles/autotag/velocity.properties");
            props.load(propsStream);
View Full Code Here

        replay(mavenProject);
        mojo.execute();
        InputStream sis = new FileInputStream(new File(temp, "META-INF/template-suite.xml"));
        XStream xstream = new XStream(new Sun14ReflectionProvider());
        TemplateSuite suite = (TemplateSuite) xstream.fromXML(sis);
        sis.close();
        assertEquals("test", suite.getName());
        assertEquals("This are the docs", suite.getDocumentation());
        assertEquals(3, suite.getTemplateClasses().size());
View Full Code Here

                                              String.class );

        ClassLoader cl = ((InternalRuleBase) ((StatefulKnowledgeSessionImpl) ksession).getRuleBase()).getRootClassLoader();
        XStream xstream = BatchExecutionHelper.newXStreamMarshaller();
        xstream.setClassLoader( cl );
        FactHandle factHandle = (FactHandle) ((ExecutionResults) xstream.fromXML( outXml )).getFactHandle( "outStilton" );

        String expectedXml = "";
        expectedXml += "<execution-results>\n";
        expectedXml += "  <result identifier=\"outStilton\">\n";
        expectedXml += "    <org.foo.Whee>\n";
View Full Code Here

        return false;
    }

  public Object readValue(String value) {
    XStream xstream = new XStream();
    return xstream.fromXML(value);
  }

  public String writeValue(Object value) {
    XStream xstream = new XStream();
    return xstream.toXML(value);
View Full Code Here

            freader = new FileReader(file);
            in = new BufferedReader(freader);
            reader = new XStream(new StaxDriver());
            reader.setClassLoader(WorkflowSaver.class
                .getClassLoader());
            WorkflowSaver saver = (WorkflowSaver) reader
                .fromXML(in);
            // print all the VALUES
            WorkflowManager mgr = WorkflowManager.getInstance();
            List<Workflow> list = new ArrayList<Workflow>();
View Full Code Here

                           name );
        }

        final XStream xstream = new XStream();

        final RuleBase goodRuleBase = (RuleBase) xstream.fromXML( getClass().getResourceAsStream( name ) );

        nodesEquals( ((ReteooRuleBase) goodRuleBase).getRete(),
                     (ruleBase).getRete() );
    }
View Full Code Here

        XStream xstream = new XStream(new DomDriver());
        TestBean bean = new TestBean();

        assertTrue("Expected [<TestBean>].  Got [" + xml + "]", xml.startsWith("<TestBean>"));
        xstream.alias("TestBean", TestBean.class);
        xstream.fromXML(xml, bean);
       
        assertEquals("Tom", bean.getName());
        assertEquals("1234", bean.getPhone());
    }
View Full Code Here

        XStream xstream = new XStream(new DomDriver());
        TestBean bean = new TestBean();

        assertTrue("Expected start with [<" + TestBean.class.getName() + ">].  Got [" + xml + "]", xml.startsWith("<" + TestBean.class.getName() + ">"));
        xstream.fromXML(xml, bean);
       
        assertEquals("Tom", bean.getName());
        assertEquals("1234", bean.getPhone());
    }
View Full Code Here

        XStream xstream = new XStream(new DomDriver());
        xstream.alias("TomsClass", TestBean.class);
        TestBean bean = new TestBean();

        assertTrue("Expected start with [<TomsClass>].  Got [" + xml + "]", xml.startsWith("<TomsClass>"));
        xstream.fromXML(xml, bean);
       
        assertEquals("Tom", bean.getName());
        assertEquals("1234", bean.getPhone());
    }
   
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.