You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by britter <gi...@git.apache.org> on 2015/05/03 14:21:52 UTC

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

GitHub user britter opened a pull request:

    https://github.com/apache/commons-lang/pull/76

    LANG-1127: Use JUnit rules to set and reset the default Locale and TimeZone

    Alternative proposal to fix [LANG-1127](https://issues.apache.org/jira/browse/LANG-1127) using JUnit TestRules.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/britter/commons-lang LANG-1127

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/76.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #76
    
----
commit abfcf0a8cfb40cd30c83d30923bea6d412cc5a22
Author: Benedikt Ritter <br...@apache.org>
Date:   2015-05-03T12:20:03Z

    LANG-1127: Use JUnit rules to set and reset the default Locale and TimeZone.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the pull request:

    https://github.com/apache/commons-lang/pull/76#issuecomment-99328066
  
    
    [![Coverage Status](https://coveralls.io/builds/2496885/badge)](https://coveralls.io/builds/2496885)
    
    Coverage increased (+0.06%) to 93.37% when pulling **3dbf1eedd93565481f8b5d3c9678a5e9234cb91a on britter:LANG-1127** into **8e7ea70a33ecb8db5207849ea6371b4a5a8ffd26 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by britter <gi...@git.apache.org>.
Github user britter commented on the pull request:

    https://github.com/apache/commons-lang/pull/76#issuecomment-98803478
  
    Hello @chonton,
    
    very good feedback, thank you!
    
    > 1. Allow tests to run in parallel. This will probably requires some sort of synchronization to allow only one tests at a time to change default TimeZone or Locale.
    
    Good point. Should be possible by wrapping the code in the apply method with some synchronization logic.
    
    > 2. Apply the rule to individual test methods instead of to all methods in a test class. Perhaps this could be done by creating annotation(s) which enable the Rule. I am thinking of something like SwitchDefaults(locale="locale_name", timezone="timezone_name").
    
    This is already possible by calling explicitly the setLocale method on the TestLocale instance. The idea is to set up a default for all tests and only switch it for tests when needed. However this doesn't make much sense in the light of parallel test execution...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the pull request:

    https://github.com/apache/commons-lang/pull/76#issuecomment-99995716
  
    
    [![Coverage Status](https://coveralls.io/builds/2512304/badge)](https://coveralls.io/builds/2512304)
    
    Coverage decreased (-0.04%) to 93.27% when pulling **d68f7f5f44924ddee14428e16b7458e2878baef2 on britter:LANG-1127** into **8e7ea70a33ecb8db5207849ea6371b4a5a8ffd26 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by chonton <gi...@git.apache.org>.
Github user chonton commented on the pull request:

    https://github.com/apache/commons-lang/pull/76#issuecomment-98777778
  
    Overall, I like this approach better than explicit classes.  Two items I would like to see:
    1. Allow tests to run in parallel.  This will probably requires some sort of synchronization to allow only one tests at a time to change default TimeZone or Locale.
    2. Apply the rule to individual test methods instead of to all methods in a test class.  Perhaps this could be done by creating annotation(s) which enable the Rule.  I am thinking of something like SwitchDefaults(locale="locale_name", timezone="timezone_name").


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by chonton <gi...@git.apache.org>.
Github user chonton commented on the pull request:

    https://github.com/apache/commons-lang/pull/76#issuecomment-100002112
  
    Iterate fast and often. Go forward with it. 
    
    Chas
    
    > On May 7, 2015, at 12:17 PM, Benedikt Ritter <no...@github.com> wrote:
    > 
    > @chonton I've worked some more on this. Renamed the Rule to SystemDefaultsSwitch and wrote a unit test. What do you think about integrating this now and create a new PR for the synchronization?
    > 
    > ―
    > Reply to this email directly or view it on GitHub.
    > 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the pull request:

    https://github.com/apache/commons-lang/pull/76#issuecomment-98475017
  
    
    [![Coverage Status](https://coveralls.io/builds/2475426/badge)](https://coveralls.io/builds/2475426)
    
    Coverage decreased (-0.01%) to 93.3% when pulling **abfcf0a8cfb40cd30c83d30923bea6d412cc5a22 on britter:LANG-1127** into **8e7ea70a33ecb8db5207849ea6371b4a5a8ffd26 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by britter <gi...@git.apache.org>.
Github user britter commented on the pull request:

    https://github.com/apache/commons-lang/pull/76#issuecomment-99986739
  
    @chonton I've worked some more on this. Renamed the Rule to SystemDefaultsSwitch and wrote a unit test. What do you think about integrating this now and create a new PR for the synchronization?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1127: Use JUnit rules to set and r...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/76


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---