Package org.switchyard.common.io.pull

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


    public void testWriteRemoteRest() throws Exception {
        doTestWrite(REMOTEREST_XML);
    }

    private void doTestWrite(String xml) 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


    Message _message;

    @Override
    public String getDataForItem(String itemId) {
        try {
            return new StringPuller().pull(_message.getAttachment(itemId).getInputStream());
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
    }
View Full Code Here

    public void testWriteRemoteRest() throws Exception {
        doTestWrite(REMOTEREST_XML);
    }

    private void doTestWrite(String xml) 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

        Assert.assertEquals("implementation.bean", qname.getLocalPart());
    }

    @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

        boolean propertyMatch = propC.equals(propM);
        boolean contentMatch = in.equals(message.getContent(String.class));
        DataSource attach = message.getAttachment("someAttach");
        String attachData;
        try {
            attachData = new StringPuller().pull(attach.getInputStream());
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
        boolean attachMatch = "someAttach".equals(attach.getName()) && "text/plain".equals(attach.getContentType()) && "someAttachData".equals(attachData);
        return propertyMatch + ", " + contentMatch + ", " + attachMatch;
View Full Code Here

        Assert.assertEquals("crow", propsMap.get("bird"));
    }

    @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 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

    private static final String BASIC_TXT = BASE_PATH + "Basic.txt";
    private static final String DIGEST_TXT = BASE_PATH + "Digest.txt";

    @Test
    public void testBasic() throws Exception {
        String source = new StringPuller().pull(BASIC_TXT, AuthorizationHeaderCredentialExtractorTests.class);
        Set<Credential> creds = new AuthorizationHeaderCredentialExtractor().extract(source);
        boolean foundName = false;
        boolean foundPassword = false;
        for (Credential cred : creds) {
            if (cred instanceof NameCredential) {
View Full Code Here

    @Test
    public void testDigest() throws Exception {
        // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        // https://issues.jboss.org/browse/SWITCHYARD-1082
        // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        String source = new StringPuller().pull(DIGEST_TXT, AuthorizationHeaderCredentialExtractorTests.class);
        Set<Credential> creds = new AuthorizationHeaderCredentialExtractor().extract(source);
        boolean foundName = false;
        for (Credential cred : creds) {
            if (cred instanceof NameCredential) {
                foundName = true;
View Full Code Here

                } else {
                    getLog().info(_project_file.getAbsolutePath() + " not modified. Skipping...");
                }
                File installerFile = new File(new File(_project_file.getParentFile(), "scripts"), "installer.properties");
                if (installerFile.exists()) {
                    final String installerOld = new StringPuller().pull(installerFile);
                    String installerNew = installerOld;
                    String[][] replacements = new String[][] {
                            new String[] {_oldVersion_pom, _newVersion_pom},
                            new String[] {_oldVersion_download, _newVersion_download},
                            new String[] {_oldVersion_distro, _newVersion_distro}
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.