source: class TestTonyClient {
  
    @Test(expectedExceptions = RuntimeException.class,
        expectedExceptionsMessageRegExp = ".*amount of " + Constants.GPUS + ".*requested exceeds.*")
    public void testValidateTonyConfTooManyGpus() {
  
target:     Configuration conf = new Configuration();
      conf.setInt(TonyConfigurationKeys.getResourceKey(Constants.WORKER_JOB_NAME, Constants.GPUS), 1);
      conf.setInt(TonyConfigurationKeys.getInstancesKey(Constants.WORKER_JOB_NAME), 10);
      conf.setInt(TonyConfigurationKeys.getMaxTotalResourceKey(Constants.GPUS), 5);
      TonyClient.validateTonyConf(conf);
    }
  
  }