[ 
https://issues.apache.org/jira/browse/HBASE-11819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306084#comment-15306084
 ] 

stack commented on HBASE-11819:
-------------------------------

[~talat] Some feedback on your patch.

It is 2 spaces, not 4 spaces when you tab over.

Statics are traditionally upper cased so instead of:

   private static HBaseTestingUtility util = new HBaseTestingUtility();

you'd write

   private static HBaseTestingUtility UTIL = new HBaseTestingUtility();

There are a few cases of the above. Check for them.

No harm putting a class comment on the test saying what it is testing?

Is this good....

115             } finally {
116                 admin.close();
117             }

... you are getting the Admin from UTIL and then closing the Admin even though 
you didn't create it....

Don't add commented out code. Just remove it:

119             //Get Table
120             //HTable table = new HTable(util.getConfiguration(), testTable);


Be careful with your formatting:

        try{

Also, rather than:

121             Table table = util.getConnection().getTable(testTable);
122      

... you could write:

try (Table table = util.getConnection().getTable(testTable)) {
....


then no need of the finally clause (see 
https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html
 )


Above are mostly nits but you are going to be around for the summer at least so 
lets get the little stuff right too... Thanks [~talat]

> Unit test for CoprocessorHConnection 
> -------------------------------------
>
>                 Key: HBASE-11819
>                 URL: https://issues.apache.org/jira/browse/HBASE-11819
>             Project: HBase
>          Issue Type: Test
>            Reporter: Andrew Purtell
>            Assignee: Talat UYARER
>            Priority: Minor
>              Labels: beginner
>             Fix For: 2.0.0, 0.98.14, 1.3.0, 1.2.2, 1.1.6
>
>         Attachments: HBASE-11819v4-master.patch, HBASE-11819v5-0.98 
> (1).patch, HBASE-11819v5-0.98.patch, HBASE-11819v5-master (1).patch, 
> HBASE-11819v5-master.patch, HBASE-11819v5-master.patch, 
> HBASE-11819v5-v0.98.patch, HBASE-11819v5-v1.0.patch, 
> HBASE-11819v6-branch-1.patch, HBASE-11819v6-master.patch
>
>
> Add a unit test to hbase-server that exercises CoprocessorHConnection . 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to