Examples of StringResource


Examples of com.jamierf.dropwizard.debpkg.resource.StringResource

    }

    @Test(expected = MissingParameterException.class)
    public void testFailsOnMissingTemplateVariables() throws IOException, PackagingException {
        createPackage(ImmutableList.<Resource>of(
                new StringResource("hello {{{missing.variable}}}", true, "/tmp/test.txt", USER, USER, TarEntry.DEFAULT_FILE_MODE)
        ));
    }
View Full Code Here

Examples of httl.spi.loaders.resources.StringResource

  public void add(String name, String source) {
    add(name, null, source);
  }
 
  public void add(String name, Locale locale, String source) {
    templates.put(getTemplateKey(name, locale), new StringResource(engine, name, locale, STRING_ENCODING, System.currentTimeMillis(), source));
  }
View Full Code Here

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

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());
        }
        if (dest != null) {
            Intersect checkDestNotInSources = new Intersect();
            checkDestNotInSources.setProject(getProject());
            checkDestNotInSources.add(rc);
View Full Code Here

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

        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

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

     */
    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

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

        }
    }

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

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

        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

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

            throw new BuildException(e);
        }
    }

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

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());
        }
        if (dest != null) {
            Intersect checkDestNotInSources = new Intersect();
            checkDestNotInSources.setProject(getProject());
            checkDestNotInSources.add(rc);
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.