当前位置: 首页>>代码示例>>Java>>正文


Java Language.EN_US属性代码示例

本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.Language.EN_US属性的典型用法代码示例。如果您正苦于以下问题:Java Language.EN_US属性的具体用法?Java Language.EN_US怎么用?Java Language.EN_US使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.smartdevicelink.proxy.rpc.enums.Language的用法示例。


在下文中一共展示了Language.EN_US属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testBuildChangeRegistration

public void testBuildChangeRegistration () {
	
	Language testLang = Language.EN_US, testHMILang = Language.EN_AU;
	Integer testCorrelationID = 0;
	ChangeRegistration testCR;
	
	// Test -- BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID)
	testCR = RPCRequestFactory.BuildChangeRegistration(testLang, testHMILang, testCorrelationID);
	assertEquals(Test.MATCH, testLang, testCR.getLanguage());
	assertEquals(Test.MATCH, testHMILang, testCR.getHmiDisplayLanguage());
	assertEquals(Test.MATCH, testCorrelationID, testCR.getCorrelationID());
	
	testCR = RPCRequestFactory.BuildChangeRegistration(null, null, null);
	assertNull(Test.NULL, testCR.getLanguage());
	assertNull(Test.NULL, testCR.getHmiDisplayLanguage());
	assertNotNull(Test.NOT_NULL, testCR.getCorrelationID());
}
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:17,代码来源:RPCRequestFactoryTests.java

示例2: buildRegisterAppInterface

public static RegisterAppInterface buildRegisterAppInterface(
		SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName, 
		String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, 
		Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
		String appID, Integer correlationID, DeviceInfo deviceInfo) {
	RegisterAppInterface msg = new RegisterAppInterface();
	
	if (correlationID == null) {
		correlationID = 1;
	}
	msg.setCorrelationID(correlationID);
	
	if (sdlMsgVersion == null) {
		sdlMsgVersion = new SdlMsgVersion();
		sdlMsgVersion.setMajorVersion(Integer.valueOf(SDL_MSG_MAJOR_VERSION));
		sdlMsgVersion.setMinorVersion(Integer.valueOf(SDL_MSG_MINOR_VERSION));
	} 
	msg.setSdlMsgVersion(sdlMsgVersion);
	msg.setDeviceInfo(deviceInfo);
	msg.setAppName(appName);
	
	msg.setTtsName(ttsName);
	
	if (ngnMediaScreenAppName == null) {
		ngnMediaScreenAppName = appName;
	}
	
	msg.setNgnMediaScreenAppName(ngnMediaScreenAppName);
	
	if (vrSynonyms == null) {
		vrSynonyms = new Vector<String>();
		vrSynonyms.add(appName);
	}
	msg.setVrSynonyms(vrSynonyms);
	
	msg.setIsMediaApplication(isMediaApp);
	
	if (languageDesired == null) {
		languageDesired = Language.EN_US;
	}
	msg.setLanguageDesired(languageDesired);
	
	if (hmiDisplayLanguageDesired == null) {
		hmiDisplayLanguageDesired = Language.EN_US;
	}		
	
	msg.setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
	
	msg.setAppHMIType(appType);
	
	msg.setAppID(appID);

	return msg;
}
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:54,代码来源:RPCRequestFactory.java

示例3: testBuildRegisterAppInterface

public void testBuildRegisterAppInterface () {
	
	SdlMsgVersion testSMV = new SdlMsgVersion();
	testSMV.setMajorVersion(1);
	testSMV.setMinorVersion(0);
	String testAppName = "test", testNGN = "ngn", testAppID = "id";
	Vector<TTSChunk> testTTSName = TTSChunkFactory.createSimpleTTSChunks("name");
	Vector<String> testSynonyms = new Vector<String>();
	testSynonyms.add("examine");
	Boolean testIMA = false;
	Integer testCorrelationID = 0;
	Language testLang = Language.EN_US, testHMILang = Language.EN_GB;
	Vector<AppHMIType> testHMIType = new Vector<AppHMIType>();
	testHMIType.add(AppHMIType.DEFAULT);
	DeviceInfo testDI = RPCRequestFactory.BuildDeviceInfo(null);
	RegisterAppInterface testRAI;
	
	// Test -- buildRegisterAppInterface(String appName, String appID)
	// ^ Calls another build method.
	
	// Test -- buildRegisterAppInterface(String appName, Boolean isMediaApp, String appID)
	// ^ Calls another build method.
	
	// Test -- buildRegisterAppInterface(SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,  Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID, Integer correlationID)
	testRAI = RPCRequestFactory.buildRegisterAppInterface(testSMV, testAppName, testTTSName, testNGN, testSynonyms, testIMA, testLang, testHMILang, testHMIType, testAppID, testCorrelationID,testDI);
	assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(testSMV, testRAI.getSdlMsgVersion()));
	assertEquals(Test.MATCH, testAppName, testRAI.getAppName());
	assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSName, testRAI.getTtsName()));
	assertEquals(Test.MATCH, testNGN, testRAI.getNgnMediaScreenAppName());
	assertTrue(Test.TRUE, Validator.validateStringList(testSynonyms, testRAI.getVrSynonyms()));
	assertEquals(Test.MATCH, testIMA, testRAI.getIsMediaApplication());
	assertEquals(Test.MATCH, testLang, testRAI.getLanguageDesired());
	assertEquals(Test.MATCH, testHMILang, testRAI.getHmiDisplayLanguageDesired());
	assertEquals(Test.MATCH, AppHMIType.DEFAULT, testRAI.getAppHMIType().get(0));
	assertEquals(Test.MATCH, testAppID, testRAI.getAppID());
	assertEquals(Test.MATCH, testCorrelationID, testRAI.getCorrelationID());
	assertEquals(Test.MATCH, testDI, testRAI.getDeviceInfo());

	
	testRAI = RPCRequestFactory.buildRegisterAppInterface(null, null, null, null, null, null, null, null, null, null, null,null);
	assertEquals(Test.MATCH, (Integer) 1, testRAI.getCorrelationID());
	assertEquals(Test.MATCH, testSMV.getMajorVersion(), testRAI.getSdlMsgVersion().getMajorVersion());
	assertEquals(Test.MATCH, testSMV.getMinorVersion(), testRAI.getSdlMsgVersion().getMinorVersion());
	assertNull(Test.NULL, testRAI.getAppName());
	assertNull(Test.NULL, testRAI.getTtsName());
	assertNull(Test.NULL, testRAI.getNgnMediaScreenAppName());
	assertNull(Test.NULL, testRAI.getVrSynonyms());
	assertNull(Test.NULL, testRAI.getIsMediaApplication());
	assertNotNull(Test.NOT_NULL, testRAI.getLanguageDesired());
	assertNotNull(Test.NOT_NULL, testRAI.getHmiDisplayLanguageDesired());
	assertNull(Test.NULL, testRAI.getAppHMIType());
	assertNull(Test.NULL, testRAI.getAppID());
	assertNull(Test.NULL, testRAI.getDeviceInfo());
}
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:54,代码来源:RPCRequestFactoryTests.java


注:本文中的com.smartdevicelink.proxy.rpc.enums.Language.EN_US属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。