JobEntryUtils { public static Long asLong( String s, VariableSpace variableSpace ) { String value = variableSpace.environmentSubstitute( s ); return value == null ? null : Long.valueOf( value, 10 ); }  static Logger findLogger( String logName ); static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache,
      String... logNames ); static void removeAppenderFrom( Appender appender, Map<String, Level> logLevelCache, String... logNames ); static boolean asBoolean( String s, VariableSpace variableSpace ); static Long asLong( String s, VariableSpace variableSpace );  }
@Test public void asLong() { VariableSpace variableSpace = new Variables(); assertNull( JobEntryUtils.asLong( null, variableSpace ) ); assertEquals( Long.valueOf( "10", 10 ), JobEntryUtils.asLong( "10", variableSpace ) ); variableSpace.setVariable( "long", "150" ); assertEquals( Long.valueOf( "150", 10 ), JobEntryUtils.asLong( "${long}", variableSpace ) ); try { JobEntryUtils.asLong( "NaN", variableSpace ); fail( "expected number format exception" ); } catch ( NumberFormatException ex ) { } }