{"action":"created","issue":{"url":"https://api.github.com/repos/cbeust/testng/issues/506","labels_url":"https://api.github.com/repos/cbeust/testng/issues/506/labels{/name}","comments_url":"https://api.github.com/repos/cbeust/testng/issues/506/comments","events_url":"https://api.github.com/repos/cbeust/testng/issues/506/events","html_url":"https://github.com/cbeust/testng/issues/506","id":30617992,"number":506,"title":"TestNG cannot find JUnit method names from Spock","user":{"login":"blackduck-joe","id":2691061,"avatar_url":"https://avatars.githubusercontent.com/u/2691061?v=3","gravatar_id":"","url":"https://api.github.com/users/blackduck-joe","html_url":"https://github.com/blackduck-joe","followers_url":"https://api.github.com/users/blackduck-joe/followers","following_url":"https://api.github.com/users/blackduck-joe/following{/other_user}","gists_url":"https://api.github.com/users/blackduck-joe/gists{/gist_id}","starred_url":"https://api.github.com/users/blackduck-joe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackduck-joe/subscriptions","organizations_url":"https://api.github.com/users/blackduck-joe/orgs","repos_url":"https://api.github.com/users/blackduck-joe/repos","events_url":"https://api.github.com/users/blackduck-joe/events{/privacy}","received_events_url":"https://api.github.com/users/blackduck-joe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cbeust/testng/labels/junit","name":"junit","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-04-01T17:06:39Z","updated_at":"2016-01-28T16:30:19Z","closed_at":null,"body":"The Spock framework creates JUnit tests.  These should be able to be run via TestNG.  However, in the org.testng.junit.JUnit4TestMethod class there is this code:\r\n\r\n\r\n    private static Method getMethod(Description desc) {\r\n        Class<?> c = desc.getTestClass();\r\n        String method = desc.getMethodName();\r\n        try {\r\n            return c.getMethod(method);\r\n        } catch (Throwable t) {\r\n            Utils.log(\"JUnit4TestMethod\", 2,\r\n                    \"Method '\" + method + \"' not found in class '\" + c.getName() + \"': \" + t.getMessage());\r\n            return null;\r\n        }\r\n    }\r\n\r\n\r\nSince the passed in description has the text of the Spock test (something like: \"This is my spock test\") and Spock mangles the test names, the simple \"c.getMethod(method)\" call fails.  If this is fixed, then TestNG should be able to run Spock (JUnit) tests as well."},"comment":{"url":"https://api.github.com/repos/cbeust/testng/issues/comments/176265308","html_url":"https://github.com/cbeust/testng/issues/506#issuecomment-176265308","issue_url":"https://api.github.com/repos/cbeust/testng/issues/506","id":176265308,"user":{"login":"rumatoest","id":1499231,"avatar_url":"https://avatars.githubusercontent.com/u/1499231?v=3","gravatar_id":"","url":"https://api.github.com/users/rumatoest","html_url":"https://github.com/rumatoest","followers_url":"https://api.github.com/users/rumatoest/followers","following_url":"https://api.github.com/users/rumatoest/following{/other_user}","gists_url":"https://api.github.com/users/rumatoest/gists{/gist_id}","starred_url":"https://api.github.com/users/rumatoest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rumatoest/subscriptions","organizations_url":"https://api.github.com/users/rumatoest/orgs","repos_url":"https://api.github.com/users/rumatoest/repos","events_url":"https://api.github.com/users/rumatoest/events{/privacy}","received_events_url":"https://api.github.com/users/rumatoest/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T16:30:19Z","updated_at":"2016-01-28T16:30:19Z","body":"+1"}}