Exemplo n.º 1
0
 @Test
 public void testParserNoClusterNoTasks() throws Exception {
   String jar = "mr4c.jar";
   String uri = "input.conf";
   String[] args = new String[] {jar, uri};
   MR4CArgumentParser parser = new MR4CArgumentParser(args, USAGE);
   parser.parse();
   assertEquals(jar, parser.getJar());
   assertEquals(URI.create(uri), parser.getExeConf());
   assertNull(parser.getCluster());
   assertNull(parser.getTasks());
 }
Exemplo n.º 2
0
 @Test
 public void testParserAllArgs() throws Exception {
   String jar = "mr4c.jar";
   String uri = "input.conf";
   String cluster = "dev";
   Integer tasks = 5;
   String[] args = new String[] {jar, uri, cluster, Integer.toString(tasks)};
   MR4CArgumentParser parser = new MR4CArgumentParser(args, USAGE);
   parser.parse();
   assertEquals(jar, parser.getJar());
   assertEquals(URI.create(uri), parser.getExeConf());
   assertEquals(tasks, parser.getTasks());
   assertEquals(cluster, parser.getCluster());
 }
Exemplo n.º 3
0
 @Test(expected = IllegalArgumentException.class)
 public void testParserTooManyArgs() throws Exception {
   String[] args = new String[] {"arg1", "arg2", "arg3", "arg4", "arg5"};
   MR4CArgumentParser parser = new MR4CArgumentParser(args, USAGE);
   parser.parse();
 }