HADOOP-14533. Size of args cannot be less than zero in TraceAdmin#run as its linkedlist. Contributed by Weisen Han.
This commit is contained in:
parent
099dfe92a9
commit
2e9daa2e27
|
@ -166,7 +166,7 @@ public class TraceAdmin extends Configured implements Tool {
|
|||
System.err.println("You must specify a host with -host.");
|
||||
return 1;
|
||||
}
|
||||
if (args.size() < 0) {
|
||||
if (args.isEmpty()) {
|
||||
System.err.println("You must specify an operation.");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -77,6 +77,14 @@ public class TestTraceAdmin extends SaslDataTransferTestCase {
|
|||
return "127.0.0.1:" + dns.get(index).getIpcPort();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoOperator() throws Exception {
|
||||
TraceAdmin trace = new TraceAdmin();
|
||||
trace.setConf(new Configuration());
|
||||
Assert.assertEquals("ret:1, You must specify an operation." + NEWLINE,
|
||||
runTraceCommand(trace, "-host", "127.0.0.1:12346"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateAndDestroySpanReceiver() throws Exception {
|
||||
Configuration conf = new Configuration();
|
||||
|
|
Loading…
Reference in New Issue