Java Code Examples for java.util.Locale.CANADA_FRENCH

The following are Jave code examples for showing how to use CANADA_FRENCH of the java.util.Locale class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: alfresco-remote-api   File: SerializeTests.java   View Source Code Vote up 6 votes
@Test
public void testSerializeBinaryProperty() throws IOException
{
    BinaryProperty prop = new BinaryProperty(Format.JSON.mimetype(),"UTF-8");      
    String out = writeResponse(prop);
    assertTrue("Only show the mimeType",  out.equals("{\"mimeType\":\"application/json\"}"));
    prop = new BinaryProperty(Format.XML.mimetype(),"UTF-8", 45, null);      
    out = writeResponse(prop);
    assertTrue("Type is xml.",  StringUtils.contains(out, "\"mimeType\":\"text/xml\""));
    assertTrue("Size must be serialized.",  StringUtils.contains(out, "\"sizeInBytes\":45"));
    
    prop = new BinaryProperty(Format.XML.mimetype(),"UTF-8", 99, Locale.CANADA_FRENCH);      
    out = writeResponse(prop);
    assertFalse("Locale should not be serialized",  StringUtils.contains(out, "\"locale\""));
    
    //Check binary properties serialize ok as part of a bean.
    Flock flock = new Flock("myflock", 50, null, prop);
    out = writeResponse(flock);
    assertFalse("Locale should not be serialized",  StringUtils.contains(out, "\"locale\""));
    assertTrue("Type is xml.",  StringUtils.contains(out, "\"mimeType\":\"text/xml\""));
    assertTrue("Size must be serialized.",  StringUtils.contains(out, "\"sizeInBytes\":99"));
}
 
Example 2
Project: otter-G   File: ObjectProfiler.java   View Source Code Vote up 5 votes
private static boolean isSharedFlyweight(Object obj) {
    if (obj == null) {
        return true;
    }
    if (obj == Boolean.TRUE || obj == Boolean.FALSE) {
        return true;
    }
    if (/* obj == Locale.ROOT || *//* Java 6 */
    obj == Locale.ENGLISH || obj == Locale.FRENCH || obj == Locale.GERMAN || obj == Locale.ITALIAN
            || obj == Locale.JAPANESE || obj == Locale.KOREAN || obj == Locale.CHINESE
            || obj == Locale.SIMPLIFIED_CHINESE || obj == Locale.TRADITIONAL_CHINESE || obj == Locale.FRANCE
            || obj == Locale.GERMANY || obj == Locale.ITALY || obj == Locale.JAPAN || obj == Locale.KOREA
            || obj == Locale.CHINA || obj == Locale.PRC || obj == Locale.TAIWAN || obj == Locale.UK
            || obj == Locale.US || obj == Locale.CANADA || obj == Locale.CANADA_FRENCH) {
        return true;
    }
    if (obj == Collections.EMPTY_SET || obj == Collections.EMPTY_LIST || obj == Collections.EMPTY_MAP) {
        return true;
    }
    if (obj == BigInteger.ZERO || obj == BigInteger.ONE) {
        return true;
    }
    if (obj == System.in || obj == System.out || obj == System.err) {
        return true;
    }
    if (obj == String.CASE_INSENSITIVE_ORDER) {
        return true;
    }
    if (obj == JarFile.MANIFEST_NAME) {
        return true;
    }
    return false;
}
 
Example 3
Project: alfresco-data-model   File: MLTextTest.java   View Source Code Vote up 5 votes
@Override
protected void setUp()
{
    mlText = new MLText(Locale.CANADA_FRENCH, Locale.CANADA_FRENCH.toString());
    mlText.addValue(Locale.US, Locale.US.toString());
    mlText.addValue(Locale.UK, Locale.UK.toString());
    mlText.addValue(Locale.FRENCH, Locale.FRENCH.toString());
    mlText.addValue(Locale.CHINESE, Locale.CHINESE.toString());
}
 
Example 4
Project: FSTestTools   File: MockingScriptContextTest.java   View Source Code Vote up 4 votes
@Override
protected C createTestling(final BaseContext.Env environment, final boolean enableServiceBrokerFake) {
    return (C) new MockingScriptContext(Locale.CANADA_FRENCH, enableServiceBrokerFake, environment);
}
 
Example 5
Project: FSTestTools   File: MockingReportContextTest.java   View Source Code Vote up 4 votes
@Override
protected C createTestling(final BaseContext.Env environment, final boolean enableServiceBrokerFake) {
    return (C) new MockingReportContext(Locale.CANADA_FRENCH, enableServiceBrokerFake, environment);
}