WorkflowRuntimeParameters { public static Integer getIntegerParamValue(String paramName, Configuration configuration) throws NumberFormatException { String paramValue = getParamValue(paramName, configuration); return paramValue!=null?Integer.valueOf(paramValue):null; } private  WorkflowRuntimeParameters(); static String getParamValue(String paramName, Configuration configuration); static Integer getIntegerParamValue(String paramName, Configuration configuration); static String getParamValue(String paramName, String fallbackParamName, Configuration configuration); static String getParamValue(String paramName, String defaultValue, Map<String, String> parameters); static String getParamValueWithUndefinedCheck(String paramName, String defaultValue, Map<String, String> parameters); static final String OOZIE_ACTION_OUTPUT_FILENAME; static final char DEFAULT_CSV_DELIMITER; static final String UNDEFINED_NONEMPTY_VALUE; static final String DNET_SERVICE_READ_TIMEOUT_DEFAULT_VALUE; static final String DNET_SERVICE_CONNECTION_TIMEOUT_DEFAULT_VALUE; static final String DNET_SERVICE_CLIENT_READ_TIMEOUT; static final String DNET_SERVICE_CLIENT_CONNECTION_TIMEOUT; }
@Test public void testGetIntegerParamValue() throws Exception { String paramName = "paramName1"; int paramValue = 12; configuration.set(paramName, String.valueOf(paramValue)); Integer result = WorkflowRuntimeParameters.getIntegerParamValue(paramName, configuration); assertEquals(paramValue, result.intValue()); }
@Test public void testGetIntegerParamValueMissing() throws Exception { String paramName = "paramName1"; Integer result = WorkflowRuntimeParameters.getIntegerParamValue(paramName, configuration); assertNull(result); }