Current Situation
As a pre-build test, I am trying to check that any commits/changes to java fixtures will not break any fitnesse tests I have in my fitnesse server.
The approach I have taken is to grab all the tests (context.txt) files that I want to verify the commit will not break, and parse it the best I can and compare it with the available methods I can grab using reflection from my projects.
Currently, I have a HashMap of 'class name' to 'class object' for all my available java fixtures. I also have been able to get access to all the fitnesse tests as File objects. It looks a little like this:
HashMap<String, Class<?>> availableJavaClassesMap = initJavaMap();
List<File> allFitnesseTestFiles = initTestFiles();
Goal
Now I want to be able to do something like this:
HashMap<String, Method> parsedMethodsFromFitnesseMap;
For(File file: allFitnesseTestFiles) {
parsedMethodsFromFitnesseMap.addAll( parseFile( file ) );
}
Then I would simply compare the two HashMaps and make sure the parsedMethodsFromFitnesseMap HashMap is a subset of the availableJavaClassesMap HashMap.
Worries
- Include files: how to handle parsing those first/other approaches
- Scenarios: create my own list of known scenarios and how they work
Ideal Solution
- Is there an already made parser that will do this?
- I have found the Slim Code and think it could be refactored to my needs.
- Is this the best approach for this pre-build check?
Note
Each test is very expensive to run, therefore simply running all the tests to see if they still work is not an option for my needs.
Ideas? Thanks.