Java 类org.apache.hadoop.fs.shell.CommandFormat.NotEnoughArgumentsException 实例源码

项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testNoArgs() {
  checkArgLimits(null, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1);
  checkArgLimits(NotEnoughArgumentsException.class, 1, 2);
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testOneArg() {
  args = listOf("a");
  expectedArgs = listOf("a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(null, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(NotEnoughArgumentsException.class, 2, 3);
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testTwoArgs() {
  args = listOf("a", "b");
  expectedArgs = listOf("a", "b");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(null, 2, 2);
  checkArgLimits(null, 2, 3);
  checkArgLimits(NotEnoughArgumentsException.class, 3, 3);
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testOneOpt() {
  args = listOf("-a");
  expectedOpts = setOf("a");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testTwoOpts() {
  args = listOf("-a", "-b");
  expectedOpts = setOf("a", "b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testOptArg() {
  args = listOf("-a", "b");
  expectedOpts = setOf("a");
  expectedArgs = listOf("b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(null, 1, 1, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 2, 2, "a", "b");
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testArgOpt() {
  args = listOf("b", "-a");
  expectedArgs = listOf("b", "-a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testOptStopOptArg() {
  args = listOf("-a", "--", "-b", "c");
  expectedOpts = setOf("a");
  expectedArgs = listOf("-b", "c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 1, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:hadoop-oss    文件:TestCommandFormat.java   
@Test
public void testOptDashArg() {
  args = listOf("-b", "-", "-c");
  expectedOpts = setOf("b");
  expectedArgs = listOf("-", "-c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "b", "c");
  checkArgLimits(TooManyArgumentsException.class, 1, 1, "b", "c");
  checkArgLimits(null, 2, 2, "b", "c");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "b", "c");
}
项目:hadoop-oss    文件:TestCount.java   
@Test
public void processOptionsMissingArgs() {
  LinkedList<String> options = new LinkedList<String>();
  Count count = new Count();
  try {
    count.processOptions(options);
    fail("Count.processOptions - NotEnoughArgumentsException not thrown");
  } catch (NotEnoughArgumentsException e) {
  }
  assertFalse(count.isShowQuotas());
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testNoArgs() {
  checkArgLimits(null, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1);
  checkArgLimits(NotEnoughArgumentsException.class, 1, 2);
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testOneArg() {
  args = listOf("a");
  expectedArgs = listOf("a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(null, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(NotEnoughArgumentsException.class, 2, 3);
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testTwoArgs() {
  args = listOf("a", "b");
  expectedArgs = listOf("a", "b");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(null, 2, 2);
  checkArgLimits(null, 2, 3);
  checkArgLimits(NotEnoughArgumentsException.class, 3, 3);
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testOneOpt() {
  args = listOf("-a");
  expectedOpts = setOf("a");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testTwoOpts() {
  args = listOf("-a", "-b");
  expectedOpts = setOf("a", "b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testOptArg() {
  args = listOf("-a", "b");
  expectedOpts = setOf("a");
  expectedArgs = listOf("b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(null, 1, 1, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 2, 2, "a", "b");
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testArgOpt() {
  args = listOf("b", "-a");
  expectedArgs = listOf("b", "-a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testOptStopOptArg() {
  args = listOf("-a", "--", "-b", "c");
  expectedOpts = setOf("a");
  expectedArgs = listOf("-b", "c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 1, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:hadoop    文件:TestCommandFormat.java   
@Test
public void testOptDashArg() {
  args = listOf("-b", "-", "-c");
  expectedOpts = setOf("b");
  expectedArgs = listOf("-", "-c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "b", "c");
  checkArgLimits(TooManyArgumentsException.class, 1, 1, "b", "c");
  checkArgLimits(null, 2, 2, "b", "c");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "b", "c");
}
项目:hadoop    文件:TestCount.java   
@Test
public void processOptionsMissingArgs() {
  LinkedList<String> options = new LinkedList<String>();
  Count count = new Count();
  try {
    count.processOptions(options);
    fail("Count.processOptions - NotEnoughArgumentsException not thrown");
  } catch (NotEnoughArgumentsException e) {
  }
  assertFalse(count.isShowQuotas());
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testNoArgs() {
  checkArgLimits(null, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1);
  checkArgLimits(NotEnoughArgumentsException.class, 1, 2);
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testOneArg() {
  args = listOf("a");
  expectedArgs = listOf("a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(null, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(NotEnoughArgumentsException.class, 2, 3);
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testTwoArgs() {
  args = listOf("a", "b");
  expectedArgs = listOf("a", "b");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(null, 2, 2);
  checkArgLimits(null, 2, 3);
  checkArgLimits(NotEnoughArgumentsException.class, 3, 3);
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testOneOpt() {
  args = listOf("-a");
  expectedOpts = setOf("a");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testTwoOpts() {
  args = listOf("-a", "-b");
  expectedOpts = setOf("a", "b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testOptArg() {
  args = listOf("-a", "b");
  expectedOpts = setOf("a");
  expectedArgs = listOf("b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(null, 1, 1, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 2, 2, "a", "b");
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testArgOpt() {
  args = listOf("b", "-a");
  expectedArgs = listOf("b", "-a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testOptStopOptArg() {
  args = listOf("-a", "--", "-b", "c");
  expectedOpts = setOf("a");
  expectedArgs = listOf("-b", "c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 1, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:aliyun-oss-hadoop-fs    文件:TestCommandFormat.java   
@Test
public void testOptDashArg() {
  args = listOf("-b", "-", "-c");
  expectedOpts = setOf("b");
  expectedArgs = listOf("-", "-c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "b", "c");
  checkArgLimits(TooManyArgumentsException.class, 1, 1, "b", "c");
  checkArgLimits(null, 2, 2, "b", "c");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "b", "c");
}
项目:aliyun-oss-hadoop-fs    文件:TestCount.java   
@Test
public void processOptionsMissingArgs() {
  LinkedList<String> options = new LinkedList<String>();
  Count count = new Count();
  try {
    count.processOptions(options);
    fail("Count.processOptions - NotEnoughArgumentsException not thrown");
  } catch (NotEnoughArgumentsException e) {
  }
  assertFalse(count.isShowQuotas());
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testNoArgs() {
  checkArgLimits(null, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1);
  checkArgLimits(NotEnoughArgumentsException.class, 1, 2);
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testOneArg() {
  args = listOf("a");
  expectedArgs = listOf("a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(null, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(NotEnoughArgumentsException.class, 2, 3);
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testTwoArgs() {
  args = listOf("a", "b");
  expectedArgs = listOf("a", "b");

  checkArgLimits(TooManyArgumentsException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 1, 1);
  checkArgLimits(null, 1, 2);
  checkArgLimits(null, 2, 2);
  checkArgLimits(null, 2, 3);
  checkArgLimits(NotEnoughArgumentsException.class, 3, 3);
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testOneOpt() {
  args = listOf("-a");
  expectedOpts = setOf("a");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testTwoOpts() {
  args = listOf("-a", "-b");
  expectedOpts = setOf("a", "b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(null, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1, "a", "b");
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testOptArg() {
  args = listOf("-a", "b");
  expectedOpts = setOf("a");
  expectedArgs = listOf("b");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 0, 1, "a", "b");
  checkArgLimits(null, 1, 1, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 2, 2, "a", "b");
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testArgOpt() {
  args = listOf("b", "-a");
  expectedArgs = listOf("b", "-a");

  checkArgLimits(TooManyArgumentsException.class, 0, 0, "a", "b");
  checkArgLimits(null, 1, 2, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testOptStopOptArg() {
  args = listOf("-a", "--", "-b", "c");
  expectedOpts = setOf("a");
  expectedArgs = listOf("-b", "c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 1, "a", "b");
  checkArgLimits(null, 2, 2, "a", "b");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "a", "b");
}
项目:big-c    文件:TestCommandFormat.java   
@Test
public void testOptDashArg() {
  args = listOf("-b", "-", "-c");
  expectedOpts = setOf("b");
  expectedArgs = listOf("-", "-c");

  checkArgLimits(UnknownOptionException.class, 0, 0);
  checkArgLimits(TooManyArgumentsException.class, 0, 0, "b", "c");
  checkArgLimits(TooManyArgumentsException.class, 1, 1, "b", "c");
  checkArgLimits(null, 2, 2, "b", "c");
  checkArgLimits(NotEnoughArgumentsException.class, 3, 4, "b", "c");
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestCommandFormat.java   
@Test
public void testNoArgs() {
  checkArgLimits(null, 0, 0);
  checkArgLimits(null, 0, 1);    
  checkArgLimits(NotEnoughArgumentsException.class, 1, 1);
  checkArgLimits(NotEnoughArgumentsException.class, 1, 2);
}