本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.SystemAction类的典型用法代码示例。如果您正苦于以下问题:Java SystemAction类的具体用法?Java SystemAction怎么用?Java SystemAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SystemAction类属于com.smartdevicelink.proxy.rpc.enums包,在下文中一共展示了SystemAction类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testValidEnums
import com.smartdevicelink.proxy.rpc.enums.SystemAction; //导入依赖的package包/类
/**
* Verifies that the enum values are not null upon valid assignment.
*/
public void testValidEnums () {
String example = "DEFAULT_ACTION";
SystemAction enumDefaultAction = SystemAction.valueForString(example);
example = "STEAL_FOCUS";
SystemAction enumStealFocus = SystemAction.valueForString(example);
example = "KEEP_CONTEXT";
SystemAction enumKeepContext = SystemAction.valueForString(example);
assertNotNull("DEFAULT_ACTION returned null", enumDefaultAction);
assertNotNull("STEAL_FOCUS returned null", enumStealFocus);
assertNotNull("KEEP_CONTEXT returned null", enumKeepContext);
}
示例2: testInvalidEnum
import com.smartdevicelink.proxy.rpc.enums.SystemAction; //导入依赖的package包/类
/**
* Verifies that an invalid assignment is null.
*/
public void testInvalidEnum () {
String example = "deFaulT_ActiON";
try {
SystemAction temp = SystemAction.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (IllegalArgumentException exception) {
fail("Invalid enum throws IllegalArgumentException.");
}
}
示例3: testNullEnum
import com.smartdevicelink.proxy.rpc.enums.SystemAction; //导入依赖的package包/类
/**
* Verifies that a null assignment is invalid.
*/
public void testNullEnum () {
String example = null;
try {
SystemAction temp = SystemAction.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (NullPointerException exception) {
fail("Null string throws NullPointerException.");
}
}
示例4: testListEnum
import com.smartdevicelink.proxy.rpc.enums.SystemAction; //导入依赖的package包/类
/**
* Verifies the possible enum values of SystemAction.
*/
public void testListEnum() {
List<SystemAction> enumValueList = Arrays.asList(SystemAction.values());
List<SystemAction> enumTestList = new ArrayList<SystemAction>();
enumTestList.add(SystemAction.DEFAULT_ACTION);
enumTestList.add(SystemAction.STEAL_FOCUS);
enumTestList.add(SystemAction.KEEP_CONTEXT);
assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
}
示例5: setSystemAction
import com.smartdevicelink.proxy.rpc.enums.SystemAction; //导入依赖的package包/类
public void setSystemAction(SystemAction systemAction) {
setValue(KEY_SYSTEM_ACTION, systemAction);
}
示例6: getSystemAction
import com.smartdevicelink.proxy.rpc.enums.SystemAction; //导入依赖的package包/类
public SystemAction getSystemAction() {
return (SystemAction) getObject(SystemAction.class, KEY_SYSTEM_ACTION);
}