Skip to content

Instantly share code, notes, and snippets.

@jweden
Created May 4, 2011 00:36
Show Gist options
  • Save jweden/954539 to your computer and use it in GitHub Desktop.
Save jweden/954539 to your computer and use it in GitHub Desktop.
Reads in groovy-style properties file
package weden.jason.qa.someProduct;
/**
* This is the groovy class which puts the test cases in the external testCases.properties
* file into a data structure for the java program to use.
*/
public class TestcaseGrabber {
protected List<Map<String,String>> getTestcases() {
def testConfig = null;
try {
testConfig = new ConfigSlurper().parse(new File('src/main/resources/testCases.properties').toURL())
} catch (Exception ex) {
println('Error reading in test case property file');
}
return testConfig.testCases
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment