本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.RequestType.valueForString方法的典型用法代码示例。如果您正苦于以下问题:Java RequestType.valueForString方法的具体用法?Java RequestType.valueForString怎么用?Java RequestType.valueForString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.smartdevicelink.proxy.rpc.enums.RequestType
的用法示例。
在下文中一共展示了RequestType.valueForString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInvalidEnum
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入方法依赖的package包/类
/**
* Verifies that an invalid assignment is null.
*/
public void testInvalidEnum () {
String example = "hTTp";
try {
RequestType temp = RequestType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (IllegalArgumentException exception) {
fail("Invalid enum throws IllegalArgumentException.");
}
}
示例2: testNullEnum
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入方法依赖的package包/类
/**
* Verifies that a null assignment is invalid.
*/
public void testNullEnum () {
String example = null;
try {
RequestType temp = RequestType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (NullPointerException exception) {
fail("Null string throws NullPointerException.");
}
}
示例3: testValidEnums
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入方法依赖的package包/类
/**
* Verifies that the enum values are not null upon valid assignment.
*/
public void testValidEnums () {
String example = "HTTP";
RequestType enumHttp = RequestType.valueForString(example);
example = "FILE_RESUME";
RequestType enumFileResume = RequestType.valueForString(example);
example = "AUTH_REQUEST";
RequestType enumAuthRequest = RequestType.valueForString(example);
example = "AUTH_CHALLENGE";
RequestType enumAuthChallenge = RequestType.valueForString(example);
example = "AUTH_ACK";
RequestType enumAuthAck = RequestType.valueForString(example);
example = "PROPRIETARY";
RequestType enumProprietary = RequestType.valueForString(example);
example = "QUERY_APPS";
RequestType enumQueryApps = RequestType.valueForString(example);
example = "LAUNCH_APP";
RequestType enumLaunchApp = RequestType.valueForString(example);
example = "LOCK_SCREEN_ICON_URL";
RequestType enumLockScreen = RequestType.valueForString(example);
example = "TRAFFIC_MESSAGE_CHANNEL";
RequestType enumTrafficMessage = RequestType.valueForString(example);
example = "DRIVER_PROFILE";
RequestType enumDriverProfile = RequestType.valueForString(example);
example = "VOICE_SEARCH";
RequestType enumVoiceSearch = RequestType.valueForString(example);
example = "NAVIGATION";
RequestType enumNavigation = RequestType.valueForString(example);
example = "PHONE";
RequestType enumPhone = RequestType.valueForString(example);
example = "CLIMATE";
RequestType enumClimate = RequestType.valueForString(example);
example = "SETTINGS";
RequestType enumSettings = RequestType.valueForString(example);
example = "VEHICLE_DIAGNOSTICS";
RequestType enumDiagnostics = RequestType.valueForString(example);
example = "EMERGENCY";
RequestType enumEmergency = RequestType.valueForString(example);
example = "MEDIA";
RequestType enumMedia = RequestType.valueForString(example);
example = "FOTA";
RequestType enumFota = RequestType.valueForString(example);
assertNotNull("HTTP returned null", enumHttp);
assertNotNull("FILE_RESUME returned null", enumFileResume);
assertNotNull("AUTH_REQUEST returned null", enumAuthRequest);
assertNotNull("AUTH_CHALLENGE returned null", enumAuthChallenge);
assertNotNull("AUTH_ACK returned null", enumAuthAck);
assertNotNull("PROPRIETARY returned null", enumProprietary);
assertNotNull(Test.NOT_NULL, enumQueryApps);
assertNotNull(Test.NOT_NULL, enumLaunchApp);
assertNotNull(Test.NOT_NULL, enumLockScreen);
assertNotNull(Test.NOT_NULL, enumTrafficMessage);
assertNotNull(Test.NOT_NULL, enumDriverProfile);
assertNotNull(Test.NOT_NULL, enumVoiceSearch);
assertNotNull(Test.NOT_NULL, enumNavigation);
assertNotNull(Test.NOT_NULL, enumPhone);
assertNotNull(Test.NOT_NULL, enumClimate);
assertNotNull(Test.NOT_NULL, enumSettings);
assertNotNull(Test.NOT_NULL, enumDiagnostics);
assertNotNull(Test.NOT_NULL, enumEmergency);
assertNotNull(Test.NOT_NULL, enumMedia);
assertNotNull(Test.NOT_NULL, enumFota);
}