Package com.memetix.mst.language

Examples of com.memetix.mst.language.Language


     * Test of valueOf method, of class Language.
     */
    @Test
    public void testValueOf() {
        String name = "ENGLISH";
        Language expResult = Language.ENGLISH;
        Language result = Language.valueOf(name);
        assertEquals(expResult, result);

    }
View Full Code Here


     * Test of fromString method, of class Language.
     */
    @Test
    public void testFromString() {
        String pLanguage = "en";
        Language expResult = Language.ENGLISH;
        Language result = Language.fromString(pLanguage);
        assertEquals(expResult, result);
    }
View Full Code Here

   
    @Test
    public void testFromString_ClientIdOnly() {
        String pLanguage = "en";
        Language.setKey(null);
        Language expResult = Language.ENGLISH;
        Language result = Language.fromString(pLanguage);
        assertEquals(expResult, result);
    }
View Full Code Here

    }
    @Test
    public void testGetLanguage_NoKey() throws Exception {
        Language.setKey(null);
        Language.setClientId(null);
        Language locale = Language.PERSIAN;
       
        exception.expect(RuntimeException.class);
        exception.expectMessage("Must provide a Windows Azure Marketplace Client Id and Client Secret - Please see http://msdn.microsoft.com/en-us/library/hh454950.aspx for further documentation");
        Language.FRENCH.getName(locale);
    }
View Full Code Here

    }
   
    @Test
    public void testGetLanguage_WrongKey() throws Exception {
        Language.setKey("wrong_key");
        Language locale = Language.PERSIAN;
       
        exception.expect(RuntimeException.class);
        exception.expectMessage("INVALID_API_KEY - Please set the API Key with your Bing Developer's Key");
        Language.FRENCH.getName(locale);
    }
View Full Code Here

    /**
     * Test of toString method, of class Language.
     */
    @Test
    public void testToString() {
        Language instance = Language.ENGLISH;
        String expResult = "en";
        String result = instance.toString();
        assertEquals(expResult, result);
    }
View Full Code Here

    /**
     * Test of getLanguageName method, of class Language.
     */
    @Test
    public void testGetNameLocalized() throws Exception {
        Language locale = Language.ENGLISH;
        String expResult = "French";
        String result = Language.FRENCH.getName(locale);
        assertEquals(expResult, result);
       
        locale = Language.FRENCH;
View Full Code Here

        assert languageCodes.size() > 0;
    }
   
    @Test
    public void testGetLocalizedNameMap() throws Exception {
        Language locale = Language.ENGLISH;
        Map<String,Language> result = Language.values(locale);
        /*
        for(String langName : result.keySet()) {
            System.out.println(langName);
        }
View Full Code Here

    @Test
    public void testGetSpokenDialect_NoKey() throws Exception {
        SpokenDialect.flushNameCache();
        SpokenDialect.setKey(null);
        SpokenDialect.setClientId(null);
        Language locale = Language.ENGLISH;
       
        exception.expect(RuntimeException.class);
        exception.expectMessage("Must provide a Windows Azure Marketplace Client Id and Client Secret - Please see http://msdn.microsoft.com/en-us/library/hh454950.aspx for further documentation");
        SpokenDialect.FRENCH_CANADA.getName(locale);
    }
View Full Code Here

   
    @Test
    public void testGetSpokenDialect_WrongKey() throws Exception {
        SpokenDialect.flushNameCache();
        SpokenDialect.setKey("wrong");
        Language locale = Language.ENGLISH;
       
        exception.expect(RuntimeException.class);
        exception.expectMessage("INVALID_API_KEY - Please set the API Key with your Bing Developer's Key");
        SpokenDialect.FRENCH_CANADA.getName(locale);
    }
View Full Code Here

TOP

Related Classes of com.memetix.mst.language.Language

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.