Questions tagged [randoop]

Randoop is a unit test generator for Java. It automatically creates unit tests for your classes, in JUnit format.

Randoop is a unit test generator for Java. It automatically creates unit tests for your classes, in JUnit format.

More info at https://randoop.github.io/randoop/

42 questions
2
votes
0 answers

Added Randoop plugin in maven to generate unit tests.. And Stuck with this error

I added Randoop plugin from GitHub's reference and Ran the mvn command mvn clean test. It failed to generate tests for all of my apps java classes. My application is based on Spring MVC, Java and Hibernate. Will Randoop work with Spring? JHipster ? …
2
votes
2 answers

Apply time limit to Gradle JavaExec tasks?

I'm setting up Randoop test case generation to run across my projects. I've achieved this with a Gradle task of type JavaExec: task RandoopGenerateL1Tests(dependsOn: ['assembleDebug']) { group = "Verification" description = "Lorem ipsum dolor…
1
vote
0 answers

Discovering the classpath for a testjar automatically, allowing the Randoop tool to generate Junit tests for the testjar

Currently, I am working on a project that requires me to utilize the Randoop tool to generate tests for a testjar named TEST.jar. To achieve this, I need to dynamically create a classpath consisting of jars from a directory named ABC, which contains…
maverick
  • 11
  • 2
1
vote
1 answer

How to resolve Invisible class error in Randoop?

I have a simple class in java conatining something like this package math; public class Math { /*Expected Behavior: Given upperBound >= 0, the method returns 1 + 2 + ... + upperBound But This…
1
vote
0 answers

Does anyone here know how to user Randoop with Dependency Inject of Spring?

I am working on Randoop, and I don't seem to get the library generate JUnit for my spring application. It can test for non-spring project only. Any help will be appreicated.
Cap-Sey
  • 11
  • 1
1
vote
1 answer

java.lang.IllegalStateException trying to generate unit tests with randoop

My objective is to generate very basic unit tests for a lot of legacy code we are migrating to a new platform. (I know unit tests are not useful this way, but sometimes it happens). We are only blocked for covering percentage so it is good to go…
Ricker Silva
  • 1,137
  • 4
  • 17
  • 37
1
vote
1 answer

Using Randoop to automatically generate Junit classes for Spring mvc controller .

I have a spring mvc web application and I want to automatically generate the junit class for each request handling method defined in my controller.How to use Randoop to generate Junit class that mocks my repository and service class. I need at least…
Juks
  • 11
  • 3
1
vote
1 answer

Randoop: No class found for type name ""

Getting this strange error while I'm pretty sure that the classpath is perfect. The error is not even revealing the class name it can't locate. Any pointers please! The command I'm running on command prompt under the project directory, is this: java…
Sau
  • 23
  • 5
1
vote
1 answer

Throwable and Exception in Java

Suppose I have a class named BugException which extends from RuntimeException And BugException has a copy constructor which takes a Throwable. This code compiles and typechecks: Throwable e = ...; if (e instanceof BugException) { throw new…
waylonion
  • 6,866
  • 8
  • 51
  • 92
1
vote
1 answer

Randoop Test Class Name

I am actually trying to Run Randoop for my project. The name of the test classes that it generates are like RandoopTest* I know the argument --junit-classname will set the base classname instead of RandoopTest. But I would like to have the test…
Praveen Kumar
  • 977
  • 3
  • 12
  • 26
1
vote
3 answers

Java Classpath error-cannot find my class

I am trying to use randoop(automatic test generator for Java) and randoop cannot find my class: eliezer@ubuntu:~/Desktop$ java -ea -classpath \ randoop.1.3.2.jar:home/eliezer/myclasses \ randoop.main.Main gentests \ …
E Shindler
  • 425
  • 7
  • 27
0
votes
0 answers

How to run unit tests generated with Randoop in Spring-Boot 3.0 or higher?

I was able to generate unit tests using Randdop tool. I tried to import those junit in my spring-boot application but I could not figure out how to run them. I have a lot of errors due to unrecognized imports. I tried to downgrade…
0
votes
2 answers

Randoop --testjar No Such file or directory

I'm running the following command in Ubuntu, having an openJDK 17: java -classpath Randoop/randoop-all-4.3.2.jar:./target randoop.main.Main gentests --testjar=myJar.jar As you can see, I'm running the command with --testjar option but I get the…
0
votes
0 answers

Modify Randoop's behavior to generate test cases based on the values defined inside the literal file

I am currently building a plugin that integrates Randoop with Eclipse env, and I want to modify the Randoop behavior to use values from a literal file and generate test cases based on those values instead of using primitive seed values. I have been…
Rajsh
  • 21
  • 1
0
votes
0 answers

How to generate test cases for a jar file using Randoop

I have generated a jar file in intelliJ and wanted to generate test cases for that jarfile. Can anyone help with command to generate the test cases. I tried using this command java -Xmx3000m -classpath…
1
2 3