Ejemplo n.º 1
0
 /**
  * Tests adding jars one-by-one to a job's configuration.
  *
  * @throws IOException If there is a problem adding the jars.
  */
 @Test
 public void testAddJar() throws IOException {
   // Add each valid jar path to the distributed cache configuration, and verify each was
   // added correctly in turn.
   for (int i = 0; i < testFilePaths.length; i++) {
     DistCache.addJarToDistributedCache(testConf, testFilePaths[i]);
     assertEquals(
         "tmpjars configuration var does not contain expected value.",
         StringUtils.join(testFileQualifiedPaths, ",", 0, i + 1),
         testConf.get("tmpjars"));
   }
 }
Ejemplo n.º 2
0
 /**
  * Tests that attempting to add the path to a jar that does not exist to the configuration throws
  * an exception.
  *
  * @throws IOException If the added jar path does not exist. This exception is expected.
  */
 @Test(expected = IOException.class)
 public void testAddJarThatDoesntExist() throws IOException {
   DistCache.addJarToDistributedCache(testConf, "/garbage/doesntexist.jar");
 }