Package org.switchyard.common.io.pull

Examples of org.switchyard.common.io.pull.StringPuller


    }

    @Test
    public void testWrite() throws Exception {
        String old_xml = new StringPuller().pull(XML, getClass());
        SwitchYardModel switchyard = _puller.pull(new StringReader(old_xml));
        String new_xml = switchyard.toString();
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(old_xml, new_xml);
        Assert.assertTrue(diff.toString(), diff.identical());
View Full Code Here


    @Test
    public void testDataSource() throws Exception {
        TestDataSource ds = new TestDataSource("name", "text/plain", "data");
        Assert.assertEquals("name", ds.getName());
        Assert.assertEquals("text/plain", ds.getContentType());
        Assert.assertEquals("data", new StringPuller().pull(ds.getInputStream()));
        Assert.assertEquals("data", ds.getDataString());
        ds.setDataString("delta");
        Assert.assertEquals("delta", ds.getDataString());
        OutputStream os = ds.getOutputStream();
        os.write("written".getBytes("UTF-8"));
View Full Code Here

    private StringPuller _str_puller;

    @Before
    public void before() {
        _cfg_puller = new ConfigurationPuller();
        _str_puller = new StringPuller();
    }
View Full Code Here

                for (String namespace : namespaces) {
                    String schemaLocation = getSchemaLocation(namespace);
                    if (schemaLocation != null) {
                        URL url = Classes.getResource(schemaLocation, Descriptor.class);
                        if (url != null) {
                            String xsd = new StringPuller().pull(url);
                            nsSourceMap.put(namespace, new StreamSource(new StringReader(xsd)));
                        }
                    }
                }
                if (nsSourceMap.size() > 0) {
View Full Code Here

                String schema = baseURI.substring(0, baseURI.lastIndexOf('/')+1) + systemId;
                schemaLocation = _descriptor.getSchemaLocation(null, schema);
            }
            if (schemaLocation != null) {
                try {
                    String xsd = new StringPuller().pull(schemaLocation, getClass());
                    if (xsd != null) {
                        return new DescriptorLSInput(xsd, publicId, systemId, baseURI);
                    }
                } catch (IOException ioe) {
                    throw new RuntimeException(ioe);
View Full Code Here

        assertEquals("component." + System.getProperty("user.name"), componentPr.resolveProperty("component.userName"));
    }
   
    @Test
    public void testWriteComplete() throws Exception {
        String old_xml = new StringPuller().pull(COMPLETE_XML, getClass());
        CompositeModel composite = _puller.pull(new StringReader(old_xml));
        String new_xml = composite.toString();
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(old_xml, new_xml);
        assertTrue(diff.toString(), diff.identical());
View Full Code Here

        testFileWriter1.write(expected);
        testFileWriter1.flush();
        testFileWriter1.close();
        File testFile2 = File.createTempFile("test-2", ".txt");
        Files.copy(testFile1, testFile2);
        final String actual = new StringPuller().pull(testFile2);
        testFile1.delete();
        testFile2.delete();
        Assert.assertEquals(expected, actual);
    }
View Full Code Here

        Assert.assertEquals(artifacts, syModel.getArtifacts());
    }

    @Test
    public void testWriteComplete() throws Exception {
        String old_xml = new StringPuller().pull(COMPLETE_XML, getClass());
        SwitchYardModel switchyard = _puller.pull(new StringReader(old_xml));
        String new_xml = switchyard.toString();
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(old_xml, new_xml);
        Assert.assertTrue(diff.toString(), diff.identical());
View Full Code Here

    private static final Logger LOGGER = Logger.getLogger(HelpDeskMain.class);

    public static void main(String... args) throws Exception {
        final String ticketId = "TCKT-" + System.currentTimeMillis();
        final String soapRequest = new StringPuller().pull("/xml/soap-request.xml").replaceAll("TICKET_ID", ticketId);
        final HTTPMixIn http = new HTTPMixIn();
        http.initialize();
        try {
            String port = System.getProperty("org.switchyard.component.soap.client.port", "8080");
            http.postString("http://localhost:" + port + "/HelpDeskService/HelpDeskService", soapRequest);
View Full Code Here

    private static final String HELP = "help";

    private static final String MAVEN_USAGE = String.format("Maven Usage: mvn exec:java -Dexec.args=\"%s %s %s\"", CONFIDENTIALITY, CLIENT_AUTHENTICATION, HELP);

    private static void invokeWorkService(String scheme, int port, String context, Element assertion) throws Exception {
        String soapRequest = new StringPuller().pull("/xml/soap-request.xml").replaceAll("WORK_CMD", "CMD-" + System.currentTimeMillis());
        if (assertion != null) {
            soapRequest = soapRequest.replaceFirst("<!-- Assertion -->", XMLHelper.toString(assertion));
        }
        HTTPMixIn http = new HTTPMixIn();
        http.initialize();
View Full Code Here

TOP

Related Classes of org.switchyard.common.io.pull.StringPuller

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.