Source:
<code>public void testGetHadoopProperties() throws IOException { Props props = new Props(); <START> props.put(HadoopConfigurationInjector.INJECT_PREFIX + "mapreduce.task.io.sort.mb", "100"); <END> props.put(HadoopConfigurationInjector.INJECT_PREFIX + "mapreduce.task.io.sort.factor", "100"); props.put(HadoopConfigurationInjector.INJECT_PREFIX + "mapreduce.reduce.memory.mb", "2048"); props.put(HadoopConfigurationInjector.INJECT_PREFIX + "mapreduce.map.memory.mb", "2048"); Map<String, String> confProperties = TuningParameterUtils.getHadoopProperties(props); Assert.assertTrue("Failed to get hadoop properties mapreduce.task.io.sort.mb ", confProperties.containsKey("mapreduce.task.io.sort.mb")); Assert.assertTrue("Failed to get right value for hadoop properties mapreduce.task.io.sort.mb ", confProperties.get("mapreduce.task.io.sort.mb").equals("100")); Assert.assertTrue("Failed to get hadoop properties mapreduce.task.io.sort.factor ", confProperties.containsKey("mapreduce.task.io.sort.factor")); Assert.assertTrue("Failed to get right value for hadoop properties mapreduce.task.io.sort.factor ", confProperties .get("mapreduce.task.io.sort.factor").equals("100")); Assert.assertTrue("Failed to get hadoop properties mapreduce.reduce.memory.mb ", confProperties.containsKey("mapreduce.reduce.memory.mb")); Assert.assertTrue("Failed to get right value for hadoop properties mapreduce.reduce.memory.mb ", confProperties .get("mapreduce.reduce.memory.mb").equals("2048")); Assert.assertTrue("Failed to get hadoop properties mapreduce.map.memory.mb ", confProperties.containsKey("mapreduce.map.memory.mb")); Assert.assertTrue("Failed to get right value for hadoop properties mapreduce.map.memory.mb ", confProperties.get("mapreduce.map.memory.mb").equals("2048")); }</code><technical_language>Hadoop constants</technical_language>

Target:
public void testGetHadoopProperties() throws IOException { Props props = new Props(); props.put(HadoopConfigurationInjector.INJECT_PREFIX + MRJobConfig.IO_SORT_MB, "100"); props.put(HadoopConfigurationInjector.INJECT_PREFIX + MRJobConfig.IO_SORT_FACTOR, "100"); props.put(HadoopConfigurationInjector.INJECT_PREFIX + MRJobConfig.REDUCE_MEMORY_MB, "2048"); props.put(HadoopConfigurationInjector.INJECT_PREFIX + MRJobConfig.MAP_MEMORY_MB, "2048"); TuningParameterUtils tuningParameterUtils = new TuningParameterUtils(); Map<String, String> confProperties = tuningParameterUtils.getHadoopProperties(props); Assert.assertTrue("Failed to get hadoop properties " + MRJobConfig.IO_SORT_MB, confProperties.containsKey(MRJobConfig.IO_SORT_MB)); Assert.assertTrue("Failed to get right value for hadoop properties " + MRJobConfig.IO_SORT_MB, confProperties.get(MRJobConfig.IO_SORT_MB).equals("100")); Assert.assertTrue("Failed to get hadoop properties " + MRJobConfig.IO_SORT_FACTOR, confProperties.containsKey(MRJobConfig.IO_SORT_FACTOR)); Assert.assertTrue("Failed to get right value for hadoop properties " + MRJobConfig.IO_SORT_FACTOR, confProperties .get(MRJobConfig.IO_SORT_FACTOR).equals("100")); Assert.assertTrue("Failed to get hadoop properties " + MRJobConfig.REDUCE_MEMORY_MB, confProperties.containsKey(MRJobConfig.REDUCE_MEMORY_MB)); Assert.assertTrue("Failed to get right value for hadoop properties " + MRJobConfig.REDUCE_MEMORY_MB, confProperties .get(MRJobConfig.REDUCE_MEMORY_MB).equals("2048")); Assert.assertTrue("Failed to get hadoop properties " + MRJobConfig.MAP_MEMORY_MB, confProperties.containsKey(MRJobConfig.MAP_MEMORY_MB)); Assert.assertTrue("Failed to get right value for hadoop properties " + MRJobConfig.MAP_MEMORY_MB, confProperties .get(MRJobConfig.MAP_MEMORY_MB).equals("2048")); }