Examples of LocalizedNameGenerator


Examples of org.apache.hivemind.util.LocalizedNameGenerator

        assertTrue(!g.more());
    }

    public void testVariantWithoutCountry()
    {
        LocalizedNameGenerator g =
            new LocalizedNameGenerator("fred", new Locale("en", "", "GEEK"), ".foo");

        assertTrue(g.more());

        // The double-underscore is correct, it's a kind
        // of placeholder for the null country.
        // JDK1.3 always converts the locale to upper case.  JDK 1.4
        // does not.  To keep this test happyt, we selected an all-uppercase
        // locale.

        assertEquals("fred_en__GEEK.foo", g.next());

        assertTrue(g.more());
        assertEquals("fred_en.foo", g.next());

        assertTrue(g.more());
        assertEquals("fred.foo", g.next());

        assertTrue(!g.more());
    }
View Full Code Here

Examples of org.apache.hivemind.util.LocalizedNameGenerator

        assertTrue(!g.more());
    }

    public void testNullLocale()
    {
        LocalizedNameGenerator g = new LocalizedNameGenerator("nullLocale", null, ".bar");

        assertTrue(g.more());
        assertEquals("nullLocale.bar", g.next());

        assertTrue(!g.more());
    }
View Full Code Here

Examples of org.apache.hivemind.util.LocalizedNameGenerator

        assertTrue(!g.more());
    }

    public void testNullSuffix()
    {
        LocalizedNameGenerator g = new LocalizedNameGenerator("nullSuffix", null, null);

        assertTrue(g.more());
        assertEquals("nullSuffix", g.next());

        assertTrue(!g.more());
    }
View Full Code Here

Examples of org.apache.hivemind.util.LocalizedNameGenerator

        assertTrue(!g.more());
    }

    public void testForException()
    {
        LocalizedNameGenerator g = new LocalizedNameGenerator("bob", null, ".foo");

        assertTrue(g.more());
        assertEquals("bob.foo", g.next());

        assertTrue(!g.more());

        try
        {
            g.next();

            throw new AssertionFailedError("Unreachable.");
        }
        catch (NoSuchElementException ex)
        {
View Full Code Here

Examples of org.apache.hivemind.util.LocalizedNameGenerator

    {
        List result = new ArrayList();

        String baseName = extractBaseName(resource);

        LocalizedNameGenerator g = new LocalizedNameGenerator(baseName, locale, SUFFIX);

        while (g.more())
        {
            String localizedName = g.next();
            Locale l = g.getCurrentLocale();
            Resource localizedResource = resource.getRelativeResource(localizedName);

            result.add(new ResourceLocalization(l, localizedResource));
        }
View Full Code Here

Examples of org.apache.tapestry.ioc.internal.util.LocalizedNameGenerator

        Resource propertiesResource = bundle.getBaseResource().withExtension("properties");

        List<Resource> localizations = newList();

        for (String localizedFile : new LocalizedNameGenerator(propertiesResource.getFile(), locale))
        {
            Resource localized = propertiesResource.forFile(localizedFile);

            localizations.add(localized);
        }
View Full Code Here

Examples of org.apache.tapestry.ioc.internal.util.LocalizedNameGenerator

        Resource propertiesResource = bundle.getBaseResource().withExtension("properties");

        List<Resource> localizations = newList();

        for (String localizedFile : new LocalizedNameGenerator(propertiesResource.getFile(), locale))
        {
            Resource localized = propertiesResource.forFile(localizedFile);

            localizations.add(localized);
        }
View Full Code Here

Examples of org.apache.tapestry.ioc.internal.util.LocalizedNameGenerator

        Resource propertiesResource = bundle.getBaseResource().withExtension("properties");

        List<Resource> localizations = newList();

        for (String localizedFile : new LocalizedNameGenerator(propertiesResource.getFile(), locale))
        {
            Resource localized = propertiesResource.forFile(localizedFile);

            localizations.add(localized);
        }
View Full Code Here

Examples of org.apache.tapestry.ioc.internal.util.LocalizedNameGenerator

        Resource propertiesResource = bundle.getBaseResource().withExtension("properties");

        List<Resource> localizations = newList();

        for (String localizedFile : new LocalizedNameGenerator(propertiesResource.getFile(), locale))
        {
            Resource localized = propertiesResource.forFile(localizedFile);

            localizations.add(localized);
        }
View Full Code Here

Examples of org.apache.tapestry.ioc.internal.util.LocalizedNameGenerator

        Resource propertiesResource = bundle.getBaseResource().withExtension("properties");

        List<Resource> localizations = newList();

        for (String localizedFile : new LocalizedNameGenerator(propertiesResource.getFile(), locale))
        {
            Resource localized = propertiesResource.forFile(localizedFile);

            localizations.add(localized);
        }
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.