Skip to content

Support for stubbing assertion methods

Compare
Choose a tag to compare
@martinschaef martinschaef released this 11 Jan 16:36
· 4 commits to master since this release

Added support for user provided stubs for assertion methods such as com.google.common.base.Verify.verify(boolean). The stubs are provided in json format to tell bixie which paramert(s) constitute the assertion, which operator to use (if any), and if the guard should be negated. This is a very limited way of stubbing and will be extended in the future.

#get bixie and guava
wget https://github.com/SRI-CSL/bixie/releases/download/0.4/bixie.jar
wget https://github.com/google/guava/releases/download/v20.0/guava-20.0.jar

#get the example file
wget https://gist.githubusercontent.com/martinschaef/24c922b0e75a09af3ba3dae5500d118d/raw/72d55612d7fc9f018a20662826029b1cf1775f1b/BixieStubTest.java 

#compile the file
mkdir out
javac -cp ./guava-20.0.jar BixieStubTest.java -d out

#get the example stubs in json format
wget https://raw.githubusercontent.com/SRI-CSL/bixie/master/src/main/resources/builtin_stubs.json

#run bixie with the json stubs.
java -jar bixie.jar -j out -importStubs builtin_stubs.json