david-schuler/javalanche — pull request #7 by kevinjalbert (2012-03-07 06:16:47+00:00)
Title: Easy command line properties

I found it slightly cumbersome to adjust the properties of Javalanche (according to the [PropertyConfiguration.java][1] file). I modified *javalanche.xml* to accept these properties from the command-line (before they would not work this way). The adjustment does not influence the old functionality of Javalanche, since if no properties are provided a default value of "" is used.

The following shows how one would use this (on the triangle example) to disable all mutations except for the *replace variable* type:

ant -f javalanche.xml -Dprefix=triangle -Dcp=target/classes/:./lib/junit.jar \
-Dtests=triangle.tests.TriangleTestSuite -Djavalanche=../../ \
-Djavalanche.mutation.analyzers=de.unisb.cs.st.javalanche.mutation.analyze.MutationScoreAnalyzer \
-Djavalanche.properties="-Djavalanche.enable.arithmetic.replace=false \
-Djavalanche.enable.negate.jump=false -Djavalanche.enable.remove.call=false \
-Djavalanche.enable.replace.constant=false -Djavalanche.enable.replace.variable=true \
-Djavalanche.enable.absolute.value=false -Djavalanche.enable.unary.operator=false \
-Djavalanche.enable.monitor.remove=false -Djavalanche.enable.replace.thread.call=false" mutationTest

-----

Essentially there is a new command-line property ```... -Djavalanche.properties="" ...```

[1]: https://github.com/david-schuler/javalanche/blob/master/src/main/java/de/unisb/cs/st/javalanche/mutation/properties/PropertyConfiguration.java