You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Konstantin Boudnik (JIRA)" <ji...@apache.org> on 2009/10/15 00:02:31 UTC

[jira] Created: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Create an adapter to access some of package-private methods of DataNode from tests
----------------------------------------------------------------------------------

                 Key: HDFS-705
                 URL: https://issues.apache.org/jira/browse/HDFS-705
             Project: Hadoop HDFS
          Issue Type: Test
          Components: test
    Affects Versions: 0.22.0
            Reporter: Konstantin Boudnik
            Assignee: Konstantin Boudnik
             Fix For: 0.22.0


Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.

This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Philip Zeyliger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765781#action_12765781 ] 

Philip Zeyliger commented on HDFS-705:
--------------------------------------

In other places, I've seen things marked as public with a comment (we could also do annotation) indicating that it ought to be used for testing only.  If the package is server.datanode, that's pretty clearly internal to HDFS, no?

I'm merely curious about the preferred coding style for this codebase.  Definitely something JSR 294 ("superpackages") will help address.

-- Philip

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769064#action_12769064 ] 

Hudson commented on HDFS-705:
-----------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #79 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/79/])
    

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Aaron Kimball (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765811#action_12765811 ] 

Aaron Kimball commented on HDFS-705:
------------------------------------

As a contrasting datapoint, in my own code I often get around this issue by creating public accessor methods which are named e.g. "getFooForTestingOnly()".  So it's pretty clear that if you're using this, that it's an API not intended for stable use.

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768396#action_12768396 ] 

Hudson commented on HDFS-705:
-----------------------------

Integrated in Hdfs-Patch-h2.grid.sp2.yahoo.net #47 (See [http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/47/])
    

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765788#action_12765788 ] 

Konstantin Boudnik commented on HDFS-705:
-----------------------------------------

Also, having access methods like this one has yet another advantage. One can assert if the invocation hasn't happened from a class which, say, starts with 'Test' prefix. Pretty efficient safeguard, I'd say

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765849#action_12765849 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-705:
---------------------------------------------

> In fact, I thought that it might be pretty cool idea to assert on invocation class' name if it doesn't start with Test...

We only have to make sure the source codes can be compiled without the test codes.  Check name may not help much.

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766230#action_12766230 ] 

Konstantin Boudnik commented on HDFS-705:
-----------------------------------------

Oops, seems like I forgot to post the results of test-patch run. Here it is
{noformat}
There appear to be 109 release audit warnings before the patch and 109 release audit warnings after applying the patch.

+1 overall.  
    +1 @author.  The patch does not contain any @author tags.
    +1 tests included.  The patch appears to include 3 new or modified tests.
    +1 javadoc.  The javadoc tool did not generate any warning messages.
    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.
    +1 findbugs.  The patch does not introduce any new Findbugs warnings.
    +1 release audit.  The applied patch does not increase the total number of release audit warnings.
{noformat}

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766136#action_12766136 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-705:
---------------------------------------------

+1 patch looks good

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Philip Zeyliger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765797#action_12765797 ] 

Philip Zeyliger commented on HDFS-705:
--------------------------------------

Ok, thanks for the explanation.

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765842#action_12765842 ] 

Konstantin Shvachko commented on HDFS-705:
------------------------------------------

I think it is a good idea to combine all test tools in test directories. This was started with NameNodeAdapter. This is another adapter for exposing data-node internals for testing. I think it is better when classes like DataNode or NameNode contain the essential logic +only+ not polluted with public methods for testing whether they are marked as such with annotations or naming conventions.
We should move all testing methods from DataNode and NameNode to the respective adapters, 
*and stop accessing {{volumeMap}}, {{blockManager}}, and alike directly from data-node and name-node tests.*

# TestNNLeaseRecovery is not yet in the code base, and probably does not need to be imported.
# Instead of using {{getClassName()}} and then looking for a substring you can call {{getClass().getSimpleName()}}, which will return the class name without the package.

The rest look good to me +1.

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated HDFS-705:
------------------------------------

    Attachment: HDFS-705.patch

In fact, I thought that it might be pretty cool idea to assert on invocation class' name if it doesn't start with {{Test...}}

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik resolved HDFS-705.
-------------------------------------

    Resolution: Fixed

I've just committed this

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Philip Zeyliger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765822#action_12765822 ] 

Philip Zeyliger commented on HDFS-705:
--------------------------------------

bq. In fact, I thought that it might be pretty cool idea to assert on invocation class' name if it doesn't start with Test... 

It's cute, but it seems unnecessary.  If people are loading classes from foo-test.jar, they deserve everything that goes wrong.

In a previous life, I simply stuck a VisibleForTesting annotation on things (http://code.google.com/p/google-collections/source/browse/trunk/src/com/google/common/annotations/VisibleForTesting.java?spec=svn80&r=80) and marked the method I needed public.

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770260#action_12770260 ] 

Hudson commented on HDFS-705:
-----------------------------

Integrated in Hdfs-Patch-h5.grid.sp2.yahoo.net #78 (See [http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/78/])
    

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765785#action_12765785 ] 

Konstantin Boudnik commented on HDFS-705:
-----------------------------------------

It is totally internal to HDFS. However, I'm working on a test which has to be in {{server.namenode}} package but is needed an access to a block's replica info (which is accessible through a {{server.datanode}} call). 

Also, this new getter is kept withing tests' source code and isn't a part of application source code. I'm opposing any public API's put into the production code merely for the testing purposes: it's bad. In fact, this was one of the reasons to have injection framework in Hadoop (HADOOP-6204, HDFS-435)

JSR 294 might help address the issue. However, the last time I checked it was in 'Inactive' state, so...

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated HDFS-705:
------------------------------------

    Attachment: HDFS-705.patch

I agree with Konstantin's point: we need to move test related methods to an adapters like this one wherever possible. Your comments are addressed (I have no idea why I was dissecting this poor thing instead of calling {{getSimplename()}} - don't ask :-)

On the second thought (thanks Nicholas) i decided to get rid of the assertion because it will add hardcoded limitation and might affect tests which are coming from differently named classes. Although the chances are slim. 

Thus, simplified version of the patch, but essentially the same.

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769805#action_12769805 ] 

Hudson commented on HDFS-705:
-----------------------------

Integrated in Hadoop-Hdfs-trunk #120 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/120/])
    

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch, HDFS-705.patch, HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HDFS-705) Create an adapter to access some of package-private methods of DataNode from tests

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated HDFS-705:
------------------------------------

    Attachment: HDFS-705.patch

This is the patch for the issue

> Create an adapter to access some of package-private methods of DataNode from tests
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-705
>                 URL: https://issues.apache.org/jira/browse/HDFS-705
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.22.0
>
>         Attachments: HDFS-705.patch
>
>
> Some of tests from packages other than {{org.apache.hadoop.hdfs.server.datanode}} need an access to package-private methods of that package. Proposed patch will add new adapter class which will have public getter methods to provide such access to outside of the package.
> This is TEST ONLY class: it never has to be used for ANY development purposes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.