Class ObjectContractUtils

java.lang.Object
randoop.contract.ObjectContractUtils

public class ObjectContractUtils extends Object
Utility methods for safely executing and printing ObjectContract code.
  • Constructor Details

    • ObjectContractUtils

      private ObjectContractUtils()
  • Method Details

    • execute

      public static ExecutionOutcome execute(ObjectContract c, Object... objs)
      Executes the given contract via reflection.
      Parameters:
      c - the contract to execute
      objs - the list of values to substitute for variables
      Returns:
      the outcome from the execution
    • localizeContractCode

      public static String localizeContractCode(String str, Variable... vars)
      Replace dummy variables such as "x0" in the code by their real names.
      Parameters:
      str - the contract code as a string with dummy variables
      vars - list of Variable objects
      Returns:
      the contract code with actual variable names substituted for dummy names