KentBeck/junit — pull request #451 by pettermahlen (2012-06-15 13:01:41+00:00)
Title: Making it possible to instantiate Descriptions for individual tests without an actual Java class

When using Cucumber-JVM and running BDD tests using its JUnit runner implementation, one doesn't actually have any real Java class within which a test case lives. Instead, a text string that corresponds to a Scenario description is used, and individual test cases correspond to steps within the scenario. Currently, it's not possible to instantiate test case descriptions without also indicating which Java class that test case lives in, which means that Cucumber-JVM has been using the createSuiteDescription method. However, as described in cucumber/cucumber-jvm#322, that leads to problems as the descriptions created cannot be parsed as 'class + method' using the regular expression in Description.

The proposed code changes fix that by adding a new test case description factory method that takes 'any string' instead of a class name.

Also, it feels like the solution of storing the class name + test case name as a single string and parsing things out of it is perhaps less than ideal, and splitting it into two strings might be better. But changing that seems like it might have side effects I don't understand, so I've left it as is.