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

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


    /**
     * Get the resources to concatenate.
     */
    private ResourceCollection getResources() {
        if (rc == null) {
            return new StringResource(getProject(), textBuffer.toString());
        }
        Restrict noexistRc = new Restrict();
        noexistRc.add(NOT_EXISTS);
        noexistRc.add(rc);
        for (Iterator i = noexistRc.iterator(); i.hasNext();) {
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

        helper = repo.getProjectHelperForBuildFile(r);
        assertTrue(helper instanceof SomeHelper);
        helper = repo.getProjectHelperForAntlib(r);
        assertTrue(helper instanceof SomeHelper);

        r = new StringResource("test.myext");
        helper = repo.getProjectHelperForBuildFile(r);
        assertTrue(helper instanceof ProjectHelper2);
        helper = repo.getProjectHelperForAntlib(r);
        assertTrue(helper instanceof ProjectHelper2);

        r = new StringResource("test.other");
        helper = repo.getProjectHelperForBuildFile(r);
        assertTrue(helper instanceof ProjectHelper2);
        helper = repo.getProjectHelperForAntlib(r);
        assertTrue(helper instanceof ProjectHelper2);
    }
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

        }
    }

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

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

    @Test
    public void teststringoutput2() throws IOException {
        StringResource r = new StringResource("bar");
        try {
            testoutput(r);
            fail("should have caught ImmutableResourceException");
        } catch (ImmutableResourceException e) {
            //TODO assert exception message
        }
        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

    createSignaturesFile().setFile(file);
  }
 
  /** Support for API signatures list as nested text */
  public void addText(String text) {
    addSignaturesResource(new StringResource(text));
  }
View Full Code Here

        fakeServer = new DiscardProtocol(PORT);
        fakeServer.start();
        record = fakeServer.recordNext();
       
        stubResourceCollection = new Union();       
        stubResource = new StringResource("C: " + SCRIPT);
        stubResourceCollection.add(stubResource);
       
        subject = new MailProtocolTestTask();
        subject.setHost("127.0.0.1");
        subject.setPort(PORT);
View Full Code Here

TOP

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

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.