Package org.apache.commons.mail

Examples of org.apache.commons.mail.DataSourceResolver.resolve()


    public void testResolvingClassPathLenient() throws Exception
    {
        DataSourceResolver dataSourceResolver;

        dataSourceResolver = new DataSourceClassPathResolver("/", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("/asf_logo_wide.gif"));

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
View Full Code Here


    {
        DataSourceResolver dataSourceResolver;

        dataSourceResolver = new DataSourceClassPathResolver("/", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("/asf_logo_wide.gif"));

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("asf_logo_wide.gif")).length == IMG_SIZE);
View Full Code Here

        DataSourceResolver dataSourceResolver;

        dataSourceResolver = new DataSourceClassPathResolver("/", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("/asf_logo_wide.gif"));

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./asf_logo_wide.gif")).length == IMG_SIZE);
View Full Code Here

        dataSourceResolver = new DataSourceClassPathResolver("/", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("/asf_logo_wide.gif"));

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/asf_logo_wide.gif")).length == IMG_SIZE);
View Full Code Here

        assertTrue(toByteArray(dataSourceResolver.resolve("./images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("/asf_logo_wide.gif"));

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("./images/asf_logo_wide.gif"));
    }
View Full Code Here

        assertTrue(toByteArray(dataSourceResolver.resolve("/images/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("/asf_logo_wide.gif"));

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("./images/asf_logo_wide.gif"));
    }

    @Test(expected = IOException.class)
View Full Code Here

        assertNull(dataSourceResolver.resolve("/asf_logo_wide.gif"));

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("./images/asf_logo_wide.gif"));
    }

    @Test(expected = IOException.class)
    public void testResolvingClassPathNonLenient() throws Exception
View Full Code Here

        dataSourceResolver = new DataSourceClassPathResolver("/images", true);
        assertTrue(toByteArray(dataSourceResolver.resolve("asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("./asf_logo_wide.gif")).length == IMG_SIZE);
        assertTrue(toByteArray(dataSourceResolver.resolve("/asf_logo_wide.gif")).length == IMG_SIZE);
        assertNull(dataSourceResolver.resolve("./images/asf_logo_wide.gif"));
    }

    @Test(expected = IOException.class)
    public void testResolvingClassPathNonLenient() throws Exception
    {
View Full Code Here

    @Test(expected = IOException.class)
    public void testResolvingClassPathNonLenient() throws Exception
    {
        final DataSourceResolver dataSourceResolver = new DataSourceClassPathResolver("/", false);
        assertNotNull(dataSourceResolver.resolve("images/asf_logo_wide.gif"));

        dataSourceResolver.resolve("asf_logo_wide.gif");
    }

}
View Full Code Here

    public void testResolvingClassPathNonLenient() throws Exception
    {
        final DataSourceResolver dataSourceResolver = new DataSourceClassPathResolver("/", false);
        assertNotNull(dataSourceResolver.resolve("images/asf_logo_wide.gif"));

        dataSourceResolver.resolve("asf_logo_wide.gif");
    }

}
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.