Details
Description
While working on an unitest case for HBASE-14644, crossed over
testAddCoprocessorWithSpecStr().
HTableDescriptor htd = new HTableDescriptor(TableName.META_TABLE_NAME); String cpName = "a.b.c.d"; boolean expected = false; try { htd.addCoprocessorWithSpec(cpName); } catch (IllegalArgumentException iae) { expected = true; } if (!expected) fail(); // Try minimal spec. try { htd.addCoprocessorWithSpec("file:///some/path" + "|" + cpName); } catch (IllegalArgumentException iae) { expected = false; } if (expected) fail(); // Try more spec. String spec = "hdfs:///foo.jar|com.foo.FooRegionObserver|1001|arg1=1,arg2=2"; try { htd.addCoprocessorWithSpec(spec); } catch (IllegalArgumentException iae) { expected = false; <<<< It should be true as it is expected to succeed. } if (expected) fail(); // Try double add of same coprocessor try { htd.addCoprocessorWithSpec(spec); } catch (IOException ioe) { expected = true; } if (!expected) fail();