Package org.archenos.locator

Examples of org.archenos.locator.ResourceLocator.findResource()


    @Test
    public void testFindResource() {
        ResourceLocator locator = new CurrentClassLoaderResourceLocator();

        try {
            URL url = locator.findResource("file1.txt");
            Assert.assertNotNull(url);
        } catch (ResourceNotFoundException e) {
            Assert.fail("Resource should be found but was not found.");
        }
View Full Code Here


        } catch (ResourceNotFoundException e) {
            Assert.fail("Resource should be found but was not found.");
        }

        try {
            URL url = locator.findResource("one/file2.txt");
            Assert.assertNotNull(url);
        } catch (ResourceNotFoundException e) {
            Assert.fail("Resource should be found but was not found.");
        }
View Full Code Here

        } catch (ResourceNotFoundException e) {
            Assert.fail("Resource should be found but was not found.");
        }

        try {
            URL url = locator.findResource("one/two/file3.txt");
            Assert.assertNotNull(url);
        } catch (ResourceNotFoundException e) {
            Assert.fail("Resource should be found but was not found.");
        }
View Full Code Here

        } catch (ResourceNotFoundException e) {
            Assert.fail("Resource should be found but was not found.");
        }

        try {
            locator.findResource("missing.txt");
            Assert.fail("Resource should not be found but was found.");
        } catch (ResourceNotFoundException e) {
            // Expected.
        }
    }
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.