Package org.apache.hivemind

Examples of org.apache.hivemind.Resource


        ClassResolver resolver = getClassResolver();

        List descriptorResources = new ArrayList();
        for (int i = 0; i < files.length; i++)
        {
            Resource resource = getResource(files[i]);

            descriptorResources.add(resource);
        }

        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver,
View Full Code Here


     */
    protected Location fabricateLocation(int line)
    {
        String path = "/" + getClass().getName().replace('.', '/');

        Resource r = new ClasspathResource(getClassResolver(), path);

        return new LocationImpl(r, line);
    }
View Full Code Here

        ClassResolver resolver = getClassResolver();

        List descriptorResources = new ArrayList();
        for (int i = 0; i < files.length; i++)
        {
            Resource resource = getResource(files[i]);

            descriptorResources.add(resource);
        }

        ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver,
View Full Code Here

     */
    protected Location fabricateLocation(int line)
    {
        String path = "/" + getClass().getName().replace('.', '/');

        Resource r = new ClasspathResource(getClassResolver(), path);

        return new LocationImpl(r, line);
    }
View Full Code Here

    public void testExisting() throws Exception
    {
        String path = getFrameworkPath(BASEFILE);

        Resource r = new FileResource(path);

        File file = new File(path);
        URL expected = file.toURL();

        assertEquals(expected, r.getResourceURL());
    }
View Full Code Here

    public void testMissing() throws Exception
    {
        String path = getFrameworkPath(DIR + "/does-not-exist");

        Resource r = new FileResource(path);

        assertEquals(null, r.getResourceURL());
    }
View Full Code Here

    public void testCreateWithLocale() throws Exception
    {
        String path = getFrameworkPath(DIR + "/localizable_fr.properties");

        Resource r = new FileResource(path, Locale.CANADA_FRENCH);

        assertEquals(path, r.getPath());
        assertEquals(Locale.CANADA_FRENCH, r.getLocale());
    }
View Full Code Here

    public void testGetLocalization()
    {
        String path = getFrameworkPath(BASEFILE);

        Resource base = new FileResource(path);
        Resource localized = base.getLocalization(Locale.FRANCE);

        String expected = getFrameworkPath(DIR + "/localizable_fr.properties");

        assertEquals(expected, localized.getPath());
    }
View Full Code Here

    public void testLocalizationMissing()
    {
        String path = getFrameworkPath(BASEFILE);

        Resource base = new FileResource(path);
        Resource localized = base.getLocalization(Locale.CHINA);

        assertSame(base, localized);
    }
View Full Code Here

    public void testToString()
    {
        String path = getFrameworkPath(BASEFILE);

        Resource r = new FileResource(path);

        assertEquals(path, r.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.Resource

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.