{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/427","labels_url":"https://api.github.com/repos/jayway/powermock/issues/427/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/427/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/427/events","html_url":"https://github.com/jayway/powermock/issues/427","id":97130696,"number":427,"title":"PowerMockRunner processes JUnit Rules incorrectly","user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jayway/powermock/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jayway/powermock/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-24T19:49:22Z","updated_at":"2015-07-24T19:49:34Z","closed_at":null,"body":"_From [Iso.poc...@gmail.com](https://code.google.com/u/107642349162510209372/) on November 09, 2012 09:55:39_\n\nWhat steps will reproduce the problem? Use test class in attachment\r\n1. Run testWithoutException() without PowerMockRunner\r\n2. Run testWithoutException() with PowerMockRunner\r\n3. Run testWithException() without PowerMockRunner\r\n4. Run testWithException() with PowerMockRunner What is the expected output? What do you see instead? 1. NO EXCEPTION - START\r\nNO EXCEPTION - STOP\r\nRule1\r\nRule2 2. Rule1\r\nNO EXCEPTION - START\r\nNO EXCEPTION - STOP\r\nRule2 3. EXCEPTION - START\r\n\r\n4.\r\nRule1\r\nEXCEPTION - START What version of the product are you using? On what operating system? JUnit 4.8.2\r\nPowerMock 1.4.12 Please provide any additional information below. As you can see, PowerMockRunner handles JUnit Rules differently than BlockJUnit4ClassRunner. Please compare: PowerMockJUnit47RunnerDelegateImpl#executeTest(Method, Object, Runnable) with BlockJUnit4ClassRunner#withRules(FrameworkMethod, Object, Statement).\r\n\r\nJUnit PASSES each Rule's returned statement and the last declared rule gets statement that evaluates test method. On contrary PowerMockRunner runs every declared rule one by one.\r\n\r\nPlease see java doc of MethodRule: \"Multiple {@link MethodRule}s can be applied to a test method. The Statement that executes the method is passed to each annotated Rule in turn, and each may return a substitute or modified Statement, which is passed to the next {@link Rule}, if any.\".\r\nIt means that PowerMockRunner behaviour is wrong.\n\n**Attachment:** [TestClass.java](http://code.google.com/p/powermock/issues/detail?id=407)\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=407_"},"comment":{"url":"https://api.github.com/repos/jayway/powermock/issues/comments/124681118","html_url":"https://github.com/jayway/powermock/issues/427#issuecomment-124681118","issue_url":"https://api.github.com/repos/jayway/powermock/issues/427","id":124681118,"user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T19:49:34Z","updated_at":"2015-07-24T19:49:34Z","body":"_From [Iso.poc...@gmail.com](https://code.google.com/u/107642349162510209372/) on November 29, 2012 11:56:42_\n\nBy the way: is there (sorry that I am asking without even searching) any documentation what kind of cases PowerMock are dealing with and how it is going to achieve that (what kind of byte code manipulations) ?\r\nMoreover some kind of developer documentation (archotecture overview) and list of common problems that you have encountered during your work ?\r\nIn other work is it possible to third-party developer can quite easy support your work ?\r\nI don't think that fixing this particular problem without seeing whole picture can really work. It may or it may not.\r\n\r\nHow do you test the library ? Do you run test in multiple configurations (different Java versions, different versions of JUnit/TestNG) ?"}}