### Start a Docker container for testing Source: https://randoop.github.io/randoop/manual/dev.html Use these commands to pull the Randoop testing image and start an interactive bash session. ```bash docker pull mdernst/randoop-ubuntu-jdk24 docker run -it mdernst/randoop-ubuntu-jdk24 /bin/bash ``` -------------------------------- ### Get Randoop Help Information Source: https://randoop.github.io/randoop/manual/index.html Use the 'help' command to display usage messages. You can get general help or specific help for commands like 'gentests' or 'minimize'. ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help ``` ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help gentests ``` ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help minimize ``` -------------------------------- ### RunnerThread Setup Method Source: https://randoop.github.io/randoop/api/randoop/util/RunnerThread.html Sets the ReflectionCode to be executed by this thread. ```java public void setup(ReflectionCode code) ``` -------------------------------- ### Run Randoop System Test Example Source: https://randoop.github.io/randoop/manual/dev.html Illustrates setting up a test environment, configuring Randoop options, and running the generation and testing process. Use this as a template for new system tests. ```java @Test public void runLiteralsTest() { // 1. Set up a working directory -- choose a unique name TestEnvironment testEnvironment = systemTestEnvironment.createTestEnvironment("literals-test"); // 2. Set options for test generation RandoopOptions options = RandoopOptions.createOptions(testEnvironment); options.setPackageName(""); options.setRegressionBasename("LiteralsReg"); options.setErrorBasename("LiteralsErr"); options.setOption("inputlimit", "1000"); options.addTestClass("randoop.literals.A"); options.addTestClass("randoop.literals.A2"); options.addTestClass("randoop.literals.B"); options.setOption("literals-level", "CLASS"); options.setOption("literals-file", "resources/systemTest/literalsfile.txt"); // 3. Indicate whether you expect regression tests (if you don't care use ExpectedTests.DONT_CARE) ExpectedTests expectedRegressionTests = ExpectedTests.SOME; ExpectedTests expectedErrorTests = ExpectedTests.NONE; // 4. Run Randoop, compile and run generated tests, and check to see if expectations met generateAndTest(testEnvironment, options, expectedRegressionTests, expectedErrorTests); } ``` -------------------------------- ### Get Elapsed Time Source: https://randoop.github.io/randoop/api/randoop/generation/AbstractGenerator.html Retrieves the elapsed time since the generator started. ```APIDOC ## GET /elapsedTime ### Description Elapsed time since the generator started. ### Method GET ### Endpoint /elapsedTime ### Parameters None ### Response #### Success Response (200) - **elapsedTime** (long) - elapsed time since the generator started #### Response Example ```json { "elapsedTime": 123456789 } ``` ``` -------------------------------- ### Get Elapsed Time Source: https://randoop.github.io/randoop/api/randoop/generation/AbstractGenerator.html Returns the time elapsed since the generator started. ```java private long elapsedTime() ``` -------------------------------- ### Initialize Help constructor Source: https://randoop.github.io/randoop/api/randoop/main/Help.html Constructor for creating the help command instance. ```java public Help() ``` -------------------------------- ### Get Resource Directory Path Source: https://randoop.github.io/randoop/api/randoop/main/GenTests.html Retrieves the path for a resource directory within the jar file. Ensure the resourceDirectory parameter starts with '/'. ```java public Path getResourceDirectory(String resourceDirectory) throws RandoopBug ``` -------------------------------- ### Create distribution files Source: https://randoop.github.io/randoop/manual/dev.html Build the release artifacts, including running tests. ```bash ./gradlew clean buildRelease ``` -------------------------------- ### Access Randoop help commands Source: https://randoop.github.io/randoop/manual/index.html Use the main class to display general help or specific command documentation. ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help ``` ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help gentests ``` -------------------------------- ### Get Fully Qualified Name of Type Source: https://randoop.github.io/randoop/api/randoop/types/NullReferenceType.html Returns the fully-qualified name of a type, including type arguments for parameterized types. For example, `java.util.List` returns `"java.util.List"`. ```java public java.lang.String getFqName() ``` -------------------------------- ### Get String Set from File (Basic) Source: https://randoop.github.io/randoop/api/randoop/main/GenInputsAbstract.html Reads a file and returns a set of strings, where each line is an element. Lines starting with '#' are ignored. Returns an empty set if the file is null. ```java public static java.util.Set getStringSetFromFile(java.nio.file.Path listFile, java.lang.String fileDescription) ``` -------------------------------- ### Example Unit Test for LinkedList Size Source: https://randoop.github.io/randoop/manual/dev.html This Java code demonstrates a basic unit test checking if the size of a LinkedList is correctly reported after adding an element. It includes setup, execution, and assertion steps. ```java 1. // Tests that the size of a list is 1 after adding an element. 2. public void testAdd() { 3. LinkedList list = new LinkedList<>(); 4. boolean b = list.add(null); 5. assertEquals(1, list.size()); 6. } ``` -------------------------------- ### Build and validate project Source: https://randoop.github.io/randoop/manual/dev.html Compile the project, run tests, and generate documentation. ```bash ./gradlew clean assemble javadoc validateAPI manual validateSite build ``` -------------------------------- ### Method Detail - get Source: https://randoop.github.io/randoop/api/randoop/util/OneMoreElementList.html Details for the get(int index) method. ```APIDOC ### Method Detail #### get ```java public E get(int index) ``` Description copied from interface: `SimpleList` Return the element at the given position of this list. Specified by: `get` in interface `SimpleList` Parameters: `index` - the position for the element Returns: the element at the index ``` -------------------------------- ### Globals and Configuration Source: https://randoop.github.io/randoop/api/index-all.html Documentation for global settings and configuration parameters. ```APIDOC ## Globals and Configuration ### `COLWIDTH` #### Description Column width for printing messages. (Static variable in `randoop.Globals`) ``` -------------------------------- ### Example Sequence Definition Source: https://randoop.github.io/randoop/manual/dev.html An example sequence of operations involving LinkedList, TreeSet, and synchronizedSet. ```Java LinkedList l = new LinkedList<>(); String str = "hi!"; l.addFirst(str); int i = l.size(); TreeSet t = new TreeSet<>(l); Set s = Collections.synchronizedSet(t); ``` -------------------------------- ### initialize Source: https://randoop.github.io/randoop/api/randoop/instrument/CoveredClassVisitor.html Performs initialization steps before sequence execution. ```APIDOC ## Method: initialize ### Description Called before execution of a sequence, to allow the visitor to perform any initialization steps required before execution. ### Parameters - **eseq** (ExecutableSequence) - Required - The code sequence to be visited. ``` -------------------------------- ### Get Anonymous Enum Operation Source: https://randoop.github.io/randoop/api/randoop/operation/TypedOperation.html A private static helper method to get an anonymous enum operation from a method and its parameter types. Returns a nullable TypedClassOperation. ```java private static @Nullable TypedClassOperation getAnonEnumOperation(java.lang.reflect.Method method, java.util.List methodParamTypes) ``` -------------------------------- ### Get Randoop Minimize Help Source: https://randoop.github.io/randoop/manual Displays help information specific to the 'minimize' command. Ensure the Randoop JAR is in the classpath. ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help minimize ``` -------------------------------- ### CountDownTimer Static Method Source: https://randoop.github.io/randoop/api/index-all.html Documentation for the 'createAndStart' static method in CountDownTimer. ```APIDOC ## CountDownTimer - Static Method 'createAndStart(long)' ### Description Creates and starts a countdown timer. ### Method POST (or similar, depending on context) ### Endpoint N/A ### Parameters * **long** - Description: The duration of the timer in milliseconds. ``` -------------------------------- ### Example Unit Test in Java Source: https://randoop.github.io/randoop/manual/dev.html A typical JUnit test case demonstrating list manipulation and assertions. This serves as an example for understanding Randoop's concept of checks. ```java 1. // Tests that the size of a list is 1 after adding an element. 2. @Test 3. public void testAdd() { 4. LinkedList l = new LinkedList(); // Create a list. 5. assertEquals(l, l); // List should be equal to itself. 6. Object o = new Object(); 7. boolean b = l.add(o); // Add an element to it. 8. org.junit.Assert.assertEquals(1, l.size()); // List should have size 1. 9. org.junit.Assert.assertEquals(l, l); // List should still be equal to itself. 10. int i = 10; 11. try { 12. Object o2 = l.remove(i); // Removing from invalid index 13. org.junit.Assert.fail(); // should throw exception. 14. } catch (IndexOutOfBoundsException e) { 15. // expected exception. 16. } 17. } ``` -------------------------------- ### Get Randoop Help Source: https://randoop.github.io/randoop/manual Displays general Randoop usage information. Ensure the Randoop JAR is in the classpath. ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help ``` -------------------------------- ### Main Entry Point Source: https://randoop.github.io/randoop/api/randoop/main/Main.html The Main class provides the entry point for Randoop, delegating command handling to registered handlers. ```APIDOC ## static void main(java.lang.String[] args) ### Description Main entry point for Randoop. Asks the command handlers who can handle the command given by the user, and passes control to whoever does. ### Parameters - **args** (java.lang.String[]) - Required - The command-line arguments ## void nonStaticMain(java.lang.String[] args) ### Description The real entry point of Main. ### Parameters - **args** (java.lang.String[]) - Required - The command-line arguments ``` -------------------------------- ### GET /isGeneric Source: https://randoop.github.io/randoop/api/randoop/types/ClassOrInterfaceType.html Checks if the type is generic. ```APIDOC ## GET /isGeneric ### Description Indicate whether this type is generic. A type is generic if it has one or more type variables. ### Method GET ### Parameters #### Query Parameters - **ignoreWildcards** (boolean) - Required - If true, ignore wildcards; treat wildcards as not making the operation generic. ### Response #### Success Response (200) - **boolean** - true if this type is generic, false otherwise. ``` -------------------------------- ### main Method Source: https://randoop.github.io/randoop/api/randoop/util/ClassFileConstants.html A simple driver program that prints output literals file format. ```APIDOC ## main Method ### Description A simple driver program that prints output literals file format. ### Method ```java public static void main(java.lang.String[] args) ``` ### Parameters #### Path Parameters - **args** (java.lang.String[]) - the command line arguments ### Throws - `java.io.IOException` - if an error occurs in writing the constants ### See Also - `LiteralFileReader` ``` -------------------------------- ### GET /isAbstract Source: https://randoop.github.io/randoop/api/randoop/types/ClassOrInterfaceType.html Checks if the class is abstract. ```APIDOC ## GET /isAbstract ### Description Indicate whether this class is abstract. ### Method GET ### Response #### Success Response (200) - **boolean** - true if this class is abstract, false otherwise. ``` -------------------------------- ### MultiVisitor Constructors Source: https://randoop.github.io/randoop/api/randoop/MultiVisitor.html Details on how to create instances of the MultiVisitor class. ```APIDOC ### Constructor Summary Constructors Constructor and Description --- `MultiVisitor()` Creates a new MultiVisitor. `MultiVisitor(java.util.List visitors)` Creates a new MultiVisitor. ### Constructor Detail #### MultiVisitor ```java public MultiVisitor() ``` Creates a new MultiVisitor. #### MultiVisitor ```java public MultiVisitor(java.util.List visitors) ``` Creates a new MultiVisitor. Parameters: `visitors` - the list of visitors ``` -------------------------------- ### GET getRawSignature Source: https://randoop.github.io/randoop/api/randoop/operation/TypedClassOperation.html Retrieves the RawSignature for the operation. ```APIDOC ## GET getRawSignature ### Description Returns the RawSignature for this operation if it is a method or constructor call. ### Method GET ### Response - **RawSignature** - The RawSignature of this method or constructor, or null if it is another kind of operation. ``` -------------------------------- ### GET /isStatic Source: https://randoop.github.io/randoop/api/randoop/operation/FieldSet.html Checks if the operation is static. ```APIDOC ## GET /isStatic ### Description Predicate to indicate whether the object represents a static operation on the declaring class. ### Method GET ### Endpoint /isStatic ### Response #### Success Response (200) - **isStatic** (boolean) - True if operation corresponds to a static method or field of a class, false otherwise. ``` -------------------------------- ### Randoop Main and Options Source: https://randoop.github.io/randoop/api/index-all.html Documentation for Randoop's main execution classes and option handling. ```APIDOC ## Class randoop.main.OptionsCache ### Description Caches options for classes with annotations. ### Variables - **cacheList** () - The list of caches for classes with Options annotations. ``` ```APIDOC ## Class randoop.main.GenInputsAbstract ### Description Abstract class for Randoop input generation. ### Variables - **capture_output** (static) - No description available. - **check_compilable** (static) - Whether to check that generated sequences can be compiled. - **checked_exception** (static) - If a test throws a checked exception, should it be included in the error-revealing test suite (value: ERROR), regression test suite (value: EXPECTED), or should it be discarded (value: INVALID)? ``` ```APIDOC ## Class randoop.main.Minimize ### Description Utilities for minimizing generated tests. ### Methods - **checkCorrectlyMinimized**(Path, String, String, Map, int) - Check if a Java file has been correctly minimized. ``` -------------------------------- ### Build Randoop using Gradle Source: https://randoop.github.io/randoop/manual/dev.html Standard Gradle commands for compiling and building Randoop artifacts. ```bash ./gradlew build manual ``` ```bash ./gradlew assemble ``` ```bash ./gradlew shadowJar ``` ```bash ./gradlew tasks ``` ```bash ./gradlew jar ``` ```bash ./gradlew shadowJar ``` ```bash ./gradlew check ``` ```bash ./gradlew testReport ``` ```bash ./gradlew clean ``` ```bash ./gradlew compileJava ``` ```bash ./gradlew compileTestJava ``` ```bash ./gradlew compileCoveredTestJava ``` ```bash ./gradlew manual ``` ```bash ./gradlew clean build ``` -------------------------------- ### GET /name Source: https://randoop.github.io/randoop/api/randoop/operation/FieldSet.html Retrieves the name of the operation. ```APIDOC ## GET /name ### Description Returns the name for the operation. ### Method GET ### Endpoint /name ### Response #### Success Response (200) - **name** (String) - The name for this operation. ``` -------------------------------- ### Initialize DummyVisitor constructor Source: https://randoop.github.io/randoop/api/randoop/DummyVisitor.html Constructor for the DummyVisitor class. ```java public DummyVisitor() ``` -------------------------------- ### GET /randoop/util/SimpleList/size Source: https://randoop.github.io/randoop/api/index-all.html Retrieves the number of elements in a SimpleList. ```APIDOC ## GET /randoop/util/SimpleList/size ### Description Returns the number of elements in this list. ### Method GET ### Endpoint /randoop/util/SimpleList/size ### Response #### Success Response (200) - **size** (int) - The number of elements in the list. ``` -------------------------------- ### GET /randoop/util/IMultiMap/keySet Source: https://randoop.github.io/randoop/api/index-all.html Retrieves the set of keys in the multi-map. ```APIDOC ## GET /randoop/util/IMultiMap/keySet ### Description Returns the set of keys in this map (the domain). ### Method GET ### Endpoint randoop.util.IMultiMap.keySet() ``` -------------------------------- ### Get Randoop Gentests Help Source: https://randoop.github.io/randoop/manual Displays help information specific to the 'gentests' command. Ensure the Randoop JAR is in the classpath. ```bash java -classpath ${RANDOOP_JAR} randoop.main.Main help gentests ``` -------------------------------- ### HelperSequenceCreator - getDefaultConstructor Source: https://randoop.github.io/randoop/api/index-all.html Gets the default constructor for a `ClassOrInterfaceType`. ```APIDOC ## getDefaultConstructor(ClassOrInterfaceType) ### Description Gets the default constructor for a `ClassOrInterfaceType`. ### Method Static method ### Endpoint N/A (Static method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Typical Randoop invocation with classpath Source: https://randoop.github.io/randoop/manual A standard way to run Randoop, including Randoop's JAR and the classes under test in the classpath. Use semicolons for path separation on Windows. ```bash java -classpath _myclasspath_:${RANDOOP_JAR} randoop.main.Main ... ``` -------------------------------- ### GET /randoop/ExecutionOutcome/get_output Source: https://randoop.github.io/randoop/api/index-all.html Retrieves the output of a statement execution. ```APIDOC ## GET /randoop/ExecutionOutcome/get_output ### Description Retrieve the output of the statement. ``` -------------------------------- ### initialize Method Source: https://randoop.github.io/randoop/api/randoop/ExecutionVisitor.html Performs initialization steps before the execution of a sequence. ```java void initialize(ExecutableSequence eseq) ``` -------------------------------- ### GET /randoop/contract/ObjectContract/get_observer_str Source: https://randoop.github.io/randoop/api/index-all.html Retrieves a string description of an observer. ```APIDOC ## GET /randoop/contract/ObjectContract/get_observer_str ### Description Returns a string describing the observer. ``` -------------------------------- ### Initialize TestCoverageInfo Source: https://randoop.github.io/randoop/api/randoop/util/TestCoverageInfo.html Constructor for creating a new TestCoverageInfo instance. ```java public TestCoverageInfo(int totalBranches, java.util.Map> map) ``` -------------------------------- ### Help Class Method Source: https://randoop.github.io/randoop/api/index-all.html Documentation for the handle method in the Help class. ```APIDOC ## handle(String[]) ### Description Handles help commands. ### Method N/A (Class Method) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### GET /connection/status Source: https://randoop.github.io/randoop/manual/net_connection_java.txt Checks if the current connection is open. ```APIDOC ## GET /connection/status ### Description Indicates whether this Connection is open. ### Method GET ### Endpoint /connection/status ### Response #### Success Response (200) - **isOpen** (boolean) - true if the connection is open, false otherwise. ``` -------------------------------- ### Get wildcard type Source: https://randoop.github.io/randoop/api/randoop/types/WildcardArgument.html Retrieves the underlying WildcardType. ```java WildcardType getWildcardType() ``` -------------------------------- ### CreatedJUnitFile Class Overview Source: https://randoop.github.io/randoop/api/randoop/runtime/CreatedJUnitFile.html Provides an overview of the CreatedJUnitFile class, its purpose, and its implementation details. ```APIDOC ## Class: CreatedJUnitFile ### Description A message indicating that Randoop created a specific JUnit file containing generated tests. ### Implements `java.io.Serializable`, `IMessage` ### Fields - `file` (java.nio.file.Path) - The file that was created. - `isDriver` (boolean) - Indicates if the created file is a driver file. - `serialVersionUID` (long) - Static field for serialization. ### Constructors - `CreatedJUnitFile(java.nio.file.Path f, boolean isDriver)` - Constructor for CreatedJUnitFile. ### Methods - `getFile()` - Returns the path of the created JUnit file. - `isDriver()` - Returns true if the created file is a driver file, false otherwise. ``` -------------------------------- ### GET /type/is-void Source: https://randoop.github.io/randoop/api/randoop/types/VoidType.html Checks if the current type is void. ```APIDOC ## GET /type/is-void ### Description Indicate whether this type is void. ### Method GET ### Response #### Success Response (200) - **isVoid** (boolean) - true if this type is void, false otherwise. ``` -------------------------------- ### Randoop GenTests handle Method Source: https://randoop.github.io/randoop/manual/dev.html The main entry point within `GenTests` for Randoop's test generation logic. It manages setup before generation and outputting tests afterward. ```java handle ``` -------------------------------- ### GET /getBinaryName Source: https://randoop.github.io/randoop/api/randoop/types/VoidType.html Returns the binary name of the VoidType. ```APIDOC ## GET /getBinaryName ### Description Returns the binary name of this type. ### Method GET ### Endpoint /getBinaryName ### Response #### Success Response (200) - **String** (string) - The binary name. ``` -------------------------------- ### CountDownTimer createAndStart Method Source: https://randoop.github.io/randoop/api/randoop/util/CountDownTimer.html A static factory method to create and immediately start a CountDownTimer with a given total duration. This is the recommended way to instantiate the timer. ```java public staticCountDownTimercreateAndStart(longtotalTimeMillis) ``` -------------------------------- ### GET /getFqName Source: https://randoop.github.io/randoop/api/randoop/types/VoidType.html Returns the fully-qualified name of the VoidType. ```APIDOC ## GET /getFqName ### Description Returns the fully-qualified name of this type. ### Method GET ### Endpoint /getFqName ### Response #### Success Response (200) - **String** (string) - The fully-qualified name. ``` -------------------------------- ### Randoop Main and Configuration Source: https://randoop.github.io/randoop/api/index-all.html Documentation for classes related to Randoop's main execution and input configuration. ```APIDOC ## Class randoop.main.GenInputsAbstract ### Description Abstract class for Randoop's input generation. ### Static Variables - **LIMIT_DEFAULT** - **literals_file** - A file containing literal values to be used as inputs to methods under test, or "CLASSES". - **literals_level** - How to use literal values that are specified via the `--literals-file` command-line option. ### Inner Classes - **Limits** ### Constructors - **Limits()** - **Limits(int, int, int, int)** ``` -------------------------------- ### GET /getVoidType Source: https://randoop.github.io/randoop/api/randoop/types/VoidType.html Retrieves the singleton instance of the VoidType. ```APIDOC ## GET /getVoidType ### Description Returns the singleton instance of the VoidType class. ### Method GET ### Endpoint /getVoidType ### Response #### Success Response (200) - **VoidType** (object) - The singleton instance of VoidType. ``` -------------------------------- ### DummyVisitor Execution Lifecycle Methods Source: https://randoop.github.io/randoop/api/randoop/DummyVisitor.html Methods used to hook into the execution of an ExecutableSequence. ```APIDOC ## initialize(ExecutableSequence eseq) ### Description Called before execution of a sequence, to allow the visitor to perform any initialization steps required before execution. ### Parameters - **eseq** (ExecutableSequence) - Required - The code sequence to be visited ## visitBeforeStatement(ExecutableSequence eseq, int i) ### Description Invoked by ExecutableSequence.execute before the i-th statement executes. ### Parameters - **eseq** (ExecutableSequence) - Required - The code sequence to be visited - **i** (int) - Required - The position of statement to visit ## visitAfterStatement(ExecutableSequence eseq, int i) ### Description Invoked by ExecutableSequence.execute after the i-th statement executes. ### Parameters - **eseq** (ExecutableSequence) - Required - The code sequence to be visited - **i** (int) - Required - The position of statement to visit ## visitAfterSequence(ExecutableSequence eseq) ### Description Called after execution of a sequence. ### Parameters - **eseq** (ExecutableSequence) - Required - The visited code sequence ``` -------------------------------- ### GET /getSuperclass Source: https://randoop.github.io/randoop/api/randoop/types/ClassOrInterfaceType.html Retrieves the superclass of the current type. ```APIDOC ## GET /getSuperclass ### Description Returns the type for the superclass for this class. If this type has no superclass, it returns the Object type. ### Method GET ### Response #### Success Response (200) - **ClassOrInterfaceType** - The superclass of this type, or the Object type. ``` -------------------------------- ### GET hasGenericBound Source: https://randoop.github.io/randoop/api/randoop/types/ParameterType.html Checks if the type has a generic bound. ```APIDOC ## GET hasGenericBound ### Description Return true if this has a generic bound. ### Method GET ### Response - **boolean** - true if this has a generic bound. ``` -------------------------------- ### Randoop CLI Configuration Options Source: https://randoop.github.io/randoop/manual/index.html A comprehensive list of command-line arguments for configuring Randoop's test generation behavior. ```APIDOC ## Randoop CLI Options ### JUnit Generation Options - **--testsperfile** (int) - Optional - Maximum number of tests to write to each JUnit file. [default: 500] - **--error-test-basename** (string) - Optional - Base name of the JUnit file containing error-revealing tests. [default: ErrorTest] - **--regression-test-basename** (string) - Optional - Base name of the JUnit file containing regression tests. [default: RegressionTest] - **--junit-package-name** (string) - Optional - Name of the package for the generated JUnit files. - **--junit-before-each** (string) - Optional - File containing code for @Before/@BeforeEach methods. - **--junit-after-each** (string) - Optional - File containing code for @After/@AfterEach methods. - **--junit-before-all** (string) - Optional - File containing code for @BeforeClass/@BeforeAll methods. - **--junit-after-all** (string) - Optional - File containing code for @AfterClass/@AfterAll methods. - **--junit-output-dir** (string) - Optional - Directory for writing JUnit files. - **--dont-output-tests** (boolean) - Optional - Run test generation without output. [default: false] - **--junit-reflection-allowed** (boolean) - Optional - Whether to use JUnit's standard reflective mechanisms. [default: true] ### Runtime Environment - **--system-props** (string) - Optional - System properties to set (x=y). - **--jvm-max-memory** (string) - Optional - Memory limit for new JVMs. [default: 3000m] ### Controlling Randomness - **--randomseed** (int) - Optional - Random seed for the generation process. [default: 0] - **--deterministic** (boolean) - Optional - Ensures Randoop is run in a deterministic mode. [default: false] ### Logging and Troubleshooting - **--progressdisplay** (boolean) - Optional - Display progress updates. [default: true] ``` -------------------------------- ### Configure All Logs Source: https://randoop.github.io/randoop/api/randoop/generation/TestUtils.html Sets command-line arguments for logging using system properties. ```java public static void setAllLogs(AbstractGenerator generator) ``` ```java -Drandoop.log=randoop-log.txt -Drandoop.selection.log=selection-log.txt -Drandoop.operation.history.log=operation-log.txt ``` -------------------------------- ### GET hasCaptureVariable Source: https://randoop.github.io/randoop/api/randoop/types/ParameterType.html Checks if the ReferenceType has a capture variable. ```APIDOC ## GET hasCaptureVariable ### Description Indicates whether this ReferenceType has a capture variable. ### Method GET ### Response - **boolean** - true iff this type has a capture variable. ``` -------------------------------- ### GET /operation/properties Source: https://randoop.github.io/randoop/api/randoop/operation/TypedOperation.html Methods to inspect the nature of an operation. ```APIDOC ## GET /operation/properties ### Description Methods to determine if an operation is a constant field, constructor call, or non-receiving value. ### Methods - isConstantField(): boolean - isConstructorCall(): boolean - isNonreceivingValue(): boolean ### Response - **result** (boolean) - Returns true if the condition is met. ``` -------------------------------- ### POST /connection/open Source: https://randoop.github.io/randoop/manual/net_connection_java.txt Establishes the connection to allow message transmission. ```APIDOC ## POST /connection/open ### Description Establishes this Connection allowing messages to be sent and received. ### Method POST ### Endpoint /connection/open ### Response #### Success Response (200) - **status** (void) - Connection successfully opened. #### Error Handling - **IllegalStateException** - Thrown if the connection is already open. ``` -------------------------------- ### GET getFullyQualifiedSignature Source: https://randoop.github.io/randoop/api/randoop/operation/TypedClassOperation.html Retrieves the fully-qualified signature for the operation. ```APIDOC ## GET getFullyQualifiedSignature ### Description Returns the fully-qualified signature for this operation if it is a method or constructor call. ### Method GET ### Response - **String** - The fully qualified signature, or null if not a method or constructor. ``` -------------------------------- ### Configure Randoop with the Replacecall Agent Source: https://randoop.github.io/randoop/manual/index.html Use these command-line options when running Randoop or generated tests to enable the agent via the boot classpath. ```bash -Xbootclasspath/a:${RANDOOP_PATH}/replacecall-4.3.4.jar -javaagent:${RANDOOP_PATH}/replacecall-4.3.4.jar ``` ```bash -Xbootclasspath/a:${RANDOOP_PATH}/replacecall-4.3.4.jar -javaagent:${RANDOOP_PATH}/replacecall-4.3.4.jar ``` -------------------------------- ### Get Operation Name Source: https://randoop.github.io/randoop/api/randoop/operation/TypedClassOperation.html Returns the name for the operation. ```java java.lang.String getName() ``` -------------------------------- ### ExecutionVisitor Interface Source: https://randoop.github.io/randoop/api/index-all.html Documentation for the ExecutionVisitor interface and its initialization method. ```APIDOC ## initialize(ExecutableSequence) ### Description Called before execution of a sequence, to allow the visitor to perform any initialization steps required before execution. ### Method void ### Parameters #### Request Body - **ExecutableSequence** (object) - Required - The sequence to be initialized. ``` -------------------------------- ### Get All Sequences Source: https://randoop.github.io/randoop/api/randoop/generation/AbstractGenerator.html Returns all sequences generated by this object. ```APIDOC ## GET /getAllSequences ### Description Return all sequences generated by this object. ### Method GET ### Endpoint /getAllSequences ### Parameters None ### Response #### Success Response (200) - **getAllSequences** (Set) - all generated sequences #### Response Example ```json { "getAllSequences": [ {"sequence": "..."}, {"sequence": "..."} ] } ``` ``` -------------------------------- ### Execute Randoop Tests with Gradle Source: https://randoop.github.io/randoop/manual/dev.html Run the standard Gradle check task to execute the Randoop test suite. ```bash ./gradlew check ``` -------------------------------- ### Get All Sequences Source: https://randoop.github.io/randoop/api/randoop/generation/AbstractGenerator.html Retrieves all sequences generated by the object. ```java public abstract java.util.Set getAllSequences() ``` -------------------------------- ### CommandHandler Method Details Source: https://randoop.github.io/randoop/api/randoop/main/CommandHandler.html Detailed explanations for each method in the CommandHandler class. ```APIDOC ### Method Detail #### handles ```java public final boolean handles(String command) ``` Returns true if this CommandHandler handles the given command. **Parameters:** - `command` (String): a command **Returns:** - `true` if this CommandHandler handles the given command #### handle ```java public abstract boolean handle(String[] args) ``` #### printHTML ```java public final void printHTML(PrintStream out) ``` Prints out formatted text in (google code) Wiki format. **Parameters:** - `out` (PrintStream): the output stream for printing html formatted usage #### usageMessage ```java public final void usageMessage(PrintStream out) ``` ``` -------------------------------- ### Generate IntelliJ IDEA Configuration Files Source: https://randoop.github.io/randoop/manual/dev.html Run this command to generate configuration files for IntelliJ IDEA. This allows you to import the Randoop project into IntelliJ. ```bash ./gradlew idea ``` -------------------------------- ### GET /GrtNumericFuzzer/instance Source: https://randoop.github.io/randoop/api/randoop/generation/GrtNumericFuzzer.html Retrieves the singleton instance of the GrtNumericFuzzer. ```APIDOC ## GET /GrtNumericFuzzer/instance ### Description Obtain the singleton instance of GrtNumericFuzzer. ### Method GET ### Response #### Success Response (200) - **instance** (GrtNumericFuzzer) - The singleton instance of the fuzzer. ``` -------------------------------- ### Check HTML documentation Source: https://randoop.github.io/randoop/manual/dev.html Run the HTML sanity checker to identify broken links or missing resources. ```bash ./gradlew htmlSanityCheck ``` -------------------------------- ### Get Operation Name Source: https://randoop.github.io/randoop/api/randoop/condition/specification/OperationSignature.html Returns the name of this OperationSignature. ```java public java.lang.String getName() ``` -------------------------------- ### GET /ExecutableSpecification/isEmpty Source: https://randoop.github.io/randoop/api/randoop/condition/ExecutableSpecification.html Checks if the full specification is empty. ```APIDOC ## GET /ExecutableSpecification/isEmpty ### Description Indicates whether the full specification is empty: this ExecutableSpecification, and any member of the parent list, has no guard expressions, no property pairs, and no throws pairs. ### Method GET ### Endpoint /ExecutableSpecification/isEmpty ### Response #### Success Response (200) - **isEmpty** (boolean) - true if there are no guard expressions, or property or throws pairs in this or the parent list, false otherwise ``` -------------------------------- ### POST /reflection/instantiate Source: https://randoop.github.io/randoop/api/index-all.html Operations for instantiating generic types and operations within the Randoop reflection model. ```APIDOC ## POST /reflection/instantiate ### Description Provides methods to instantiate generic operations and types by selecting appropriate type arguments. ### Method POST ### Endpoint /reflection/instantiate ### Parameters #### Request Body - **operation** (TypedClassOperation) - Required - The generic operation to instantiate. - **typeArguments** (List) - Optional - The type arguments to apply to the generic type. ``` -------------------------------- ### GET /operations Source: https://randoop.github.io/randoop/api/index-all.html Retrieves operations from the model or specific files. ```APIDOC ## GET /operations ### Description Returns the operations of the model as a list. ### Method GET ### Endpoint /operations ### Response #### Success Response (200) - **operations** (list) - A list of TypedOperation objects. ``` -------------------------------- ### Static Method create() Source: https://randoop.github.io/randoop/api/randoop/NotExecuted.html Creates or retrieves the singleton instance of the NotExecuted class. ```APIDOC ## static NotExecuted create() ### Description Creates or retrieves the singleton instance of the NotExecuted class. ### Method Static Method ### Response - **NotExecuted** - The singleton instance of the NotExecuted class. ``` -------------------------------- ### HashMap Constructor String Representation Source: https://randoop.github.io/randoop/api/randoop/operation/OperationParser.html An example of a string representation for a HashMap constructor. ```text cons : java.util.HashMap.() ``` -------------------------------- ### Sequence Operation Source: https://randoop.github.io/randoop/api/index-all.html Method to get the operation from which a sequence was generated. ```APIDOC ## GET /api/sequences/operation ### Description Return the operation from which this sequence was generated -- the operation of the last statement of this sequence. ### Method GET ### Endpoint /api/sequences/operation ### Response #### Success Response (200) - **operation** (Operation) - The operation of the last statement in the sequence. ### Response Example ```json { "operation": { "name": "lastStatementOperation" } } ``` ``` -------------------------------- ### GET /randoop/generation/ComponentManager/getAllGeneratedSequences Source: https://randoop.github.io/randoop/api/index-all.html Returns all sequences generated by the component manager. ```APIDOC ## GET /randoop/generation/ComponentManager/getAllGeneratedSequences ### Description Returns the set of all generated sequences. ``` -------------------------------- ### InputSequenceSelector and OrienteeringSelection Methods Source: https://randoop.github.io/randoop/api/index-all.html Documentation for the 'createdExecutableSequence' methods. ```APIDOC ## InputSequenceSelector - Method 'createdExecutableSequence(ExecutableSequence)' ### Description A hook that is called after a new sequence has been created and executed. ### Method POST (or similar, depending on context) ### Endpoint N/A ### Parameters * **ExecutableSequence** - Description: The newly created and executed sequence. ``` ```APIDOC ## OrienteeringSelection - Method 'createdExecutableSequence(ExecutableSequence)' ### Description A hook that is called after a new sequence has been created and executed. ### Method POST (or similar, depending on context) ### Endpoint N/A ### Parameters * **ExecutableSequence** - Description: The newly created and executed sequence. ``` -------------------------------- ### GET /randoop/util/SimpleList/get Source: https://randoop.github.io/randoop/api/index-all.html Retrieves an element at a specific position from a list. ```APIDOC ## GET /randoop/util/SimpleList/get ### Description Return the element at the given position of this list. ### Method GET ### Parameters #### Query Parameters - **index** (int) - Required - The position of the element to retrieve. ``` -------------------------------- ### MultiMap Constructors Source: https://randoop.github.io/randoop/api/randoop/util/MultiMap.html Details on how to instantiate the MultiMap class. ```APIDOC ## MultiMap Constructors ### Description Provides methods to create new instances of the MultiMap. ### Constructor Summary Constructors | Constructor and Description ---|--- `MultiMap()` | Creates a new, empty MultiMap. `MultiMap(int initialCapacity)` | Constructor that takes an initial capacity. ### Constructor Detail #### MultiMap ```java public MultiMap() ``` Creates a new, empty MultiMap. #### MultiMap ```java public MultiMap(int initialCapacity) ``` ``` -------------------------------- ### GET /connection/receive Source: https://randoop.github.io/randoop/manual/net_connection_java.txt Receives a coded integer message from the connection. ```APIDOC ## GET /connection/receive ### Description Receives a coded integer message on this Connection. ### Method GET ### Endpoint /connection/receive ### Response #### Success Response (200) - **code** (int) - The received non-negative code value. ### Error Handling - **IllegalStateException** - Thrown if the connection is not open. ``` -------------------------------- ### Instance Method: visitBefore Source: https://randoop.github.io/randoop/api/randoop/reflection/DeclarationExtractor.html Performs an action on a class before other visit methods are called. ```APIDOC ## void visitBefore(Class c) ### Description Performs an action on a class. This method is triggered before other visit methods are executed. ### Parameters - **c** (java.lang.Class) - Required - The class to visit. ``` -------------------------------- ### Set version environment variables Source: https://randoop.github.io/randoop/manual/dev.html Define the old, new, and next version numbers for the release process. ```bash OLDVERSION=_4.3.4_ NEWVERSION=_4.3.5_ NEXTVERSION=_4.3.6_ ``` -------------------------------- ### GET /size Source: https://randoop.github.io/randoop/api/randoop/util/CheckpointingMultiMap.html Returns the total number of mappings in the map. ```APIDOC ## GET /size ### Description Returns the size of this map: the number of mappings. ### Response #### Success Response (200) - **size** (int) - The number of entries in this map. ``` -------------------------------- ### Instance visit() Methods Source: https://randoop.github.io/randoop/api/randoop/reflection/OperationExtractor.html Methods used to process class members and create corresponding operation objects. ```APIDOC ## visit(member) ### Description Creates operation objects for specific class members. ### Parameters - **constructor** (java.lang.reflect.Constructor) - Required - Creates a ConstructorCall object. - **e** (java.lang.Enum) - Required - Creates an EnumConstant object. - **field** (java.lang.reflect.Field) - Required - Adds Operation objects for getters and setters. - **method** (java.lang.reflect.Method) - Required - Creates a MethodCall object. ### Response - **void** - No return value. ``` -------------------------------- ### GET /keySet Source: https://randoop.github.io/randoop/api/randoop/util/CheckpointingMultiMap.html Retrieves the set of all keys present in the map. ```APIDOC ## GET /keySet ### Description Returns the set of keys in this map (the domain). ### Response #### Success Response (200) - **keys** (Set) - The set of keys in this map. ``` -------------------------------- ### CreatedJUnitFile Class Source: https://randoop.github.io/randoop/api/index-all.html Documentation for the CreatedJUnitFile class and its constructor. ```APIDOC ## CreatedJUnitFile - Class ### Description A message indicating that Randoop created a specific JUnit file containing generated tests. ## CreatedJUnitFile(Path, boolean) - Constructor ### Description Initializes a CreatedJUnitFile message. ### Method Constructor ### Endpoint N/A ### Parameters * **Path** - Description: The path to the created JUnit file. * **boolean** - Description: Indicates if the file was newly created. ``` -------------------------------- ### GET /containsKey Source: https://randoop.github.io/randoop/api/randoop/util/CheckpointingMultiMap.html Checks if the map contains a specific key. ```APIDOC ## GET /containsKey ### Description Returns true if this map contains the given key. ### Parameters #### Query Parameters - **key** (Object) - Required - The key to look for. ### Response #### Success Response (200) - **result** (boolean) - True if the map contains the key. ``` -------------------------------- ### Randoop Output and Globals Source: https://randoop.github.io/randoop/api/index-all.html Documentation for classes related to Randoop's output and global settings. ```APIDOC ## Class randoop.output.FailingAssertionCommentWriter.Match ### Description Represents a match found by the comment writer. ### Variables - **line** - The line that matched the pattern. ``` ```APIDOC ## Class randoop.Globals ### Description Contains global constants and settings for Randoop. ### Static Variables - **lineSep** - The system-specific line separator string. ``` -------------------------------- ### GET /isSubtypeOf Source: https://randoop.github.io/randoop/api/randoop/types/ClassOrInterfaceType.html Tests if the type is a subtype of another type. ```APIDOC ## GET /isSubtypeOf ### Description Test whether this type is a subtype of the given type according to transitive closure of definition of the direct supertype relation. ### Method GET ### Parameters #### Query Parameters - **otherType** (Type) - Required - The possible supertype. ### Response #### Success Response (200) - **boolean** - true if this type is a subtype of the given type, false otherwise. ``` -------------------------------- ### GET /getSuperTypes Source: https://randoop.github.io/randoop/api/randoop/types/ClassOrInterfaceType.html Retrieves the set of all supertypes for the current type. ```APIDOC ## GET /getSuperTypes ### Description Return the set of all of the supertypes of this type. ### Method GET ### Response #### Success Response (200) - **Collection** - The set of all supertypes of this type. ``` -------------------------------- ### NotExecuted Static Method Source: https://randoop.github.io/randoop/api/index-all.html Documentation for the 'create' static method in NotExecuted. ```APIDOC ## NotExecuted - Static Method 'create()' ### Description Creates an instance of NotExecuted. ### Method POST (or similar, depending on context) ### Endpoint N/A ``` -------------------------------- ### Initialize Visitors in MultiVisitor Source: https://randoop.github.io/randoop/api/randoop/MultiVisitor.html Calls the initialize method for each visitor in the chain, in the order they were provided during construction. ```java public void initialize(ExecutableSequence eseq) ``` -------------------------------- ### Get Bound Type Source: https://randoop.github.io/randoop/api/randoop/types/ReferenceBound.html Retrieves the ReferenceType associated with this bound. ```java public ReferenceType getBoundType() ``` -------------------------------- ### GET hasWildcard Source: https://randoop.github.io/randoop/api/randoop/types/ParameterType.html Indicates whether the type contains a wildcard. ```APIDOC ## GET hasWildcard ### Description Indicates whether this type has a wildcard anywhere within it. ### Method GET ### Response - **boolean** - true if this type has a wildcard, false otherwise. ``` -------------------------------- ### Run System Process Source: https://randoop.github.io/randoop/api/randoop/main/Minimize.html Executes a command string in a specified directory and returns the output and error results. ```java public static Minimize.Outputs runProcess(java.lang.String command, java.nio.file.Path executionDir, int timeoutLimit) ``` -------------------------------- ### GET /type/getRawtype Source: https://randoop.github.io/randoop/api/randoop/types/ArrayType.html Returns the non-generic raw type for this type. ```APIDOC ## GET /type/getRawtype ### Description Returns the raw type for this type, which is this type except for generic types. ### Method GET ### Response #### Success Response (200) - **raw_type** (Type) - The raw type corresponding to this type ``` -------------------------------- ### Configure Boot Classpath for Replacement Classes Source: https://randoop.github.io/randoop/manual/index.html Use these command-line options when running Randoop or generated tests if your replacement classes must be loaded by the bootstrap class loader. ```bash -Xbootclasspath/a:mypath/myreplace.jar ``` ```bash -Xbootclasspath/a:mypath/myreplace.jar ``` -------------------------------- ### Run Randoop Main Class Source: https://randoop.github.io/randoop/manual/index.html This is the general command structure for invoking Randoop's main class. Replace _command_ and _args..._ with specific Randoop operations. ```bash java randoop.main.Main _command_ _args... ``` -------------------------------- ### GET /randoop/types/NullReferenceType/getNullType Source: https://randoop.github.io/randoop/api/randoop/types/NullReferenceType.html Retrieves the singleton instance of the null type. ```APIDOC ## GET /randoop/types/NullReferenceType/getNullType ### Description Returns the null type object. ### Method GET ### Endpoint randoop.types.NullReferenceType.getNullType() ### Response #### Success Response (200) - **result** (NullReferenceType) - The null type object. ``` -------------------------------- ### Configure TestEnvironment methods Source: https://randoop.github.io/randoop/api/randoop/execution/TestEnvironment.html Methods for setting up agents, timeouts, and executing tests. ```java public void addAgent(java.nio.file.Path agentPath, java.lang.String agentArgumentString) ``` ```java public void setReplaceCallAgent(java.nio.file.Path agentPath, java.lang.String agentArgs) ``` ```java public void setTimeoutMillis(long timeoutMillis) ``` ```java public RunCommand.Status runTest(java.lang.String testClassName, java.nio.file.Path workingDirectory) throws RunCommand.CommandException ``` -------------------------------- ### Get type instantiator Source: https://randoop.github.io/randoop/api/randoop/sequence/SequenceCollection.html Retrieves the TypeInstantiator associated with this collection. ```java public TypeInstantiator getTypeInstantiator() ``` -------------------------------- ### GET getMessage Source: https://randoop.github.io/randoop/api/randoop/sequence/SequenceParseException.html Retrieves the error message associated with the exception. ```APIDOC ## GET getMessage ### Description Returns the detail message of this exception. ### Response #### Success Response (200) - **message** (java.lang.String) - The error message string. ``` -------------------------------- ### Constructor Summary Source: https://randoop.github.io/randoop/api/randoop/types/EagerReferenceBound.html Lists the constructors available for the EagerReferenceBound class. ```APIDOC ## Constructor Summary Constructors | Description ---|--- `EagerReferenceBound(ReferenceType boundType)` | Creates a bound for the given reference type. ``` -------------------------------- ### randoop.util.* Source: https://randoop.github.io/randoop/api/constant-values.html Documentation for classes within the randoop.util package, including list implementations, randomness utilities, and exceptions. ```APIDOC ## randoop.util.ListOfLists ### Description A list implementation that holds other lists. ### Constant Field - **serialVersionUID** (long) - The serialization version UID for this class. - Value: `-3307714585442970263L` ## randoop.util.OneMoreElementList ### Description A list that ensures at least one element is present. ### Constant Field - **serialVersionUID** (long) - The serialization version UID for this class. - Value: `1332963552183905833L` ## randoop.util.Randomness ### Description Utility class for handling randomness, including default seed values. ### Constant Field - **DEFAULT_SEED** (long) - The default seed value for random number generation. - Value: `0L` ## randoop.util.RandoopLoggingError ### Description An error class used for logging within Randoop. ### Constant Field - **serialVersionUID** (long) - The serialization version UID for this error class. - Value: `-3641426773814539646L` ## randoop.util.randoop.util.ReflectionCode.ReflectionCodeException ### Description An exception related to reflection operations within Randoop. ### Constant Field - **serialVersionUID** (long) - The serialization version UID for this exception. - Value: `-7508201027241079866L` ## randoop.util.SimpleArrayList ### Description A simple implementation of an ArrayList. ### Constant Field - **serialVersionUID** (long) - The serialization version UID for this class. - Value: `20180317L` ``` -------------------------------- ### Get Declaring Type Source: https://randoop.github.io/randoop/api/randoop/operation/TypedClassOperation.html Returns the class in which the operation is defined. ```java ClassOrInterfaceType getDeclaringType() ``` -------------------------------- ### GET /canFuzz Source: https://randoop.github.io/randoop/api/randoop/generation/GrtFuzzer.html Checks if a fuzzer can handle a specific type. ```APIDOC ## GET /canFuzz ### Description Returns true if the fuzzer can handle the specified type. ### Parameters #### Query Parameters - **type** (Type) - Required - The type to check. ### Response #### Success Response (200) - **boolean** (Boolean) - True if the fuzzer can handle the type, false otherwise. ```