Package hipi.unittest

Source Code of hipi.unittest.HipiJobTestCase

package hipi.unittest;

import static org.junit.Assert.*;
import hipi.imagebundle.mapreduce.HipiJob;

import org.apache.hadoop.conf.Configuration;
import org.junit.Before;
import org.junit.Test;

public class HipiJobTestCase {

  private HipiJob job;
 
  @Before
  public void setUp() throws Exception {
    Configuration conf = new Configuration();
    job = new HipiJob(conf);
  }

  @Test
  public void testSetMapSpeculativeExecution() {
    job.setMapSpeculativeExecution(false);
    assertEquals(false, job.getConfiguration().getBoolean("mapred.map.tasks.speculative.execution", true));
   
    job.setMapSpeculativeExecution(true);
    assertEquals(true, job.getConfiguration().getBoolean("mapred.map.tasks.speculative.execution", false));
  }

  @Test
  public void testSetReduceSpeculativeExecution() {
    job.setReduceSpeculativeExecution(false);
    assertEquals(false, job.getConfiguration().getBoolean("mapred.reduce.tasks.speculative.execution", true));
   
    job.setReduceSpeculativeExecution(true);
    assertEquals(true, job.getConfiguration().getBoolean("mapred.reduce.tasks.speculative.execution", false));
  }

  @Test
  public void testSetCompressMapOutput() {
    job.setCompressMapOutput(false);
    assertEquals(false, job.getConfiguration().getBoolean("mapred.compress.map.output", true));
   
    job.setCompressMapOutput(true);
    assertEquals(true, job.getConfiguration().getBoolean("mapred.compress.map.output", false));
  }

}
TOP

Related Classes of hipi.unittest.HipiJobTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.