You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mrunit.apache.org by "Brock Noland (JIRA)" <ji...@apache.org> on 2012/07/01 21:28:57 UTC

[jira] [Created] (MRUNIT-122) Context should be mockable

Brock Noland created MRUNIT-122:
-----------------------------------

             Summary: Context should be mockable
                 Key: MRUNIT-122
                 URL: https://issues.apache.org/jira/browse/MRUNIT-122
             Project: MRUnit
          Issue Type: Improvement
    Affects Versions: 0.9.0
            Reporter: Brock Noland


We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.

There are two ways to implement providing a custom context to MRUnit.

1) User provides MRUnit context object
Pros
User can use any mocking tool they wish
Cons
Puts massive ugliness into MRUnit code (I implemented this)

2) User can "get" context from MRUnit and then override any mocked methods via Mockito
Pros
Much cleaner to implement
Cons
User must use Mockito to override methods on context

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MRUNIT-122) Context should be mockable

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

Brock Noland updated MRUNIT-122:
--------------------------------

    Fix Version/s: 0.9.1
    
> Context should be mockable
> --------------------------
>
>                 Key: MRUNIT-122
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-122
>             Project: MRUnit
>          Issue Type: Improvement
>    Affects Versions: 0.9.0
>            Reporter: Brock Noland
>            Assignee: Brock Noland
>             Fix For: 0.9.1
>
>         Attachments: MRUNIT-122-1.patch
>
>
> We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
> However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.
> There are two ways to implement providing a custom context to MRUnit.
> 1) User provides MRUnit context object
> Pros
> User can use any mocking tool they wish
> Cons
> Puts massive ugliness into MRUnit code (I implemented this)
> MRUnit is not providing much value since inputs/outputs and such come from Context.
> 2) User can "get" context from MRUnit and then override any mocked methods via Mockito
> Pros
> Much cleaner to implement
> Cons
> User must use Mockito to override methods on context

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MRUNIT-122) Context should be mockable

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

Brock Noland resolved MRUNIT-122.
---------------------------------

    Resolution: Fixed
      Assignee: Brock Noland

1355990. and 1355989.
                
> Context should be mockable
> --------------------------
>
>                 Key: MRUNIT-122
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-122
>             Project: MRUnit
>          Issue Type: Improvement
>    Affects Versions: 0.9.0
>            Reporter: Brock Noland
>            Assignee: Brock Noland
>         Attachments: MRUNIT-122-1.patch
>
>
> We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
> However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.
> There are two ways to implement providing a custom context to MRUnit.
> 1) User provides MRUnit context object
> Pros
> User can use any mocking tool they wish
> Cons
> Puts massive ugliness into MRUnit code (I implemented this)
> MRUnit is not providing much value since inputs/outputs and such come from Context.
> 2) User can "get" context from MRUnit and then override any mocked methods via Mockito
> Pros
> Much cleaner to implement
> Cons
> User must use Mockito to override methods on context

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MRUNIT-122) Context should be mockable

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

Brock Noland updated MRUNIT-122:
--------------------------------

    Attachment: MRUNIT-122-1.patch

Attached in case people want to check it out.
                
> Context should be mockable
> --------------------------
>
>                 Key: MRUNIT-122
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-122
>             Project: MRUnit
>          Issue Type: Improvement
>    Affects Versions: 0.9.0
>            Reporter: Brock Noland
>         Attachments: MRUNIT-122-1.patch
>
>
> We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
> However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.
> There are two ways to implement providing a custom context to MRUnit.
> 1) User provides MRUnit context object
> Pros
> User can use any mocking tool they wish
> Cons
> Puts massive ugliness into MRUnit code (I implemented this)
> MRUnit is not providing much value since inputs/outputs and such come from Context.
> 2) User can "get" context from MRUnit and then override any mocked methods via Mockito
> Pros
> Much cleaner to implement
> Cons
> User must use Mockito to override methods on context

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MRUNIT-122) Context should be mockable

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

Brock Noland updated MRUNIT-122:
--------------------------------

    Description: 
We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.

There are two ways to implement providing a custom context to MRUnit.

1) User provides MRUnit context object
Pros
User can use any mocking tool they wish
Cons
Puts massive ugliness into MRUnit code (I implemented this)
MRUnit is not providing much value since inputs/outputs and such come from Context.

2) User can "get" context from MRUnit and then override any mocked methods via Mockito
Pros
Much cleaner to implement
Cons
User must use Mockito to override methods on context

  was:
We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.

There are two ways to implement providing a custom context to MRUnit.

1) User provides MRUnit context object
Pros
User can use any mocking tool they wish
Cons
Puts massive ugliness into MRUnit code (I implemented this)

2) User can "get" context from MRUnit and then override any mocked methods via Mockito
Pros
Much cleaner to implement
Cons
User must use Mockito to override methods on context

    
> Context should be mockable
> --------------------------
>
>                 Key: MRUNIT-122
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-122
>             Project: MRUnit
>          Issue Type: Improvement
>    Affects Versions: 0.9.0
>            Reporter: Brock Noland
>
> We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
> However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.
> There are two ways to implement providing a custom context to MRUnit.
> 1) User provides MRUnit context object
> Pros
> User can use any mocking tool they wish
> Cons
> Puts massive ugliness into MRUnit code (I implemented this)
> MRUnit is not providing much value since inputs/outputs and such come from Context.
> 2) User can "get" context from MRUnit and then override any mocked methods via Mockito
> Pros
> Much cleaner to implement
> Cons
> User must use Mockito to override methods on context

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MRUNIT-122) Context should be mockable

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

Brock Noland updated MRUNIT-122:
--------------------------------

    Fix Version/s:     (was: 0.9.1)
                   1.0.0
    
> Context should be mockable
> --------------------------
>
>                 Key: MRUNIT-122
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-122
>             Project: MRUnit
>          Issue Type: Improvement
>    Affects Versions: 0.9.0
>            Reporter: Brock Noland
>            Assignee: Brock Noland
>             Fix For: 1.0.0
>
>         Attachments: MRUNIT-122-1.patch
>
>
> We should allow users to mock the Context object. I have thought about this and I think there are two ways to go about it. In MRUnit we have a single codebase which supports Hadoop 0.20 - 2.0.
> However, Context itself was changed from a class in 0.20 to an interface in > 0.20. As such, we use Mockito to create the object regardless of the version of Hadoop the user is using.
> There are two ways to implement providing a custom context to MRUnit.
> 1) User provides MRUnit context object
> Pros
> User can use any mocking tool they wish
> Cons
> Puts massive ugliness into MRUnit code (I implemented this)
> MRUnit is not providing much value since inputs/outputs and such come from Context.
> 2) User can "get" context from MRUnit and then override any mocked methods via Mockito
> Pros
> Much cleaner to implement
> Cons
> User must use Mockito to override methods on context

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira