Package org.apache.tools.ant.types.resources

Examples of org.apache.tools.ant.types.resources.StringResource$StringResourceFilterOutputStream


    /**
     * Get the resources to concatenate.
     */
    private ResourceCollection getResources() {
        if (rc == null) {
            return new StringResource(getProject(), textBuffer.toString());
        }
        if (dest != null) {
            Intersect checkDestNotInSources = new Intersect();
            checkDestNotInSources.setProject(getProject());
            checkDestNotInSources.add(rc);
View Full Code Here


        } catch (UnsupportedOperationException e) {
        }
    }

    public void teststringoutput1() {
        StringResource r = new StringResource();
        testoutputbe(r);
        assertEquals("foo", r.getValue());
    }
View Full Code Here

        testoutputbe(r);
        assertEquals("foo", r.getValue());
    }

    public void teststringoutput2() {
        StringResource r = new StringResource("bar");
        try {
            testoutput(r);
            fail("should have caught ImmutableResourceException");
        } catch (ImmutableResourceException e) {
        } catch (IOException e) {
            fail("caught some other IOException: " + e);
        }
        assertEquals("bar", r.getValue());
    }
View Full Code Here

            throw new BuildException(e);
        }
    }

    private void testoutput(Resource dest) throws IOException {
        ResourceUtils.copyResource(new StringResource("foo"), dest, null);
    }
View Full Code Here

    /**
     * Get the resources to concatenate.
     */
    private ResourceCollection getResources() {
        if (rc == null) {
            return new StringResource(getProject(), textBuffer.toString());
        }
        if (dest != null) {
            Intersect checkDestNotInSources = new Intersect();
            checkDestNotInSources.setProject(getProject());
            checkDestNotInSources.add(rc);
View Full Code Here

     */
    public void execute() throws BuildException {
        final String msg = "".equals(message) ? StringUtils.LINE_SEP : message;
        try {
            ResourceUtils
                    .copyResource(new StringResource(msg), output == null
                                  ? new LogOutputResource(this, logLevel)
                                  : output,
                                  null, null, false, false, append, null,
                                  "".equals(encoding) ? null : encoding,
                                  getProject(), force);
View Full Code Here

                       Project.MSG_DEBUG);
    }

    private static void assertMessages(LogContent content, String[] messages,
                                       int upTo) throws IOException {
        StringResource s = new StringResource();
        ResourceUtils.copyResource(content, s);
        String actual = s.getValue();
        for (int i = 0; i <= upTo && i < messages.length; i++) {
            Assert.assertTrue("checking for " + messages[i] + " in " + actual,
                              actual.indexOf(messages[i]) > -1);
        }
        for (int i = upTo + 1; i < messages.length; i++) {
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.resources.StringResource$StringResourceFilterOutputStream

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.