Search code examples
ubuntu-16.04randoop

Unable to set the package name for classpath in randoop


Here the project structure cloned from github after compiling on Ubuntu successfully,

javaml 
     bin
       net/sf/javaml/core/Dataset.class
javaml
     src
      net/sf/javaml/core/Dataset.java

When the following command wa given:

java -ea -classpath /home/shahid/git/javaml/bin:/home/shahid/a_f_w/randoop-3.1.5/randoop-all-3.1.5.jar  randoop.main.Main gentests --testclass=net.sf.javaml.core.Dataset --literals-file=CLASSES

It generated the error: "Ignoring interface net.sf.javaml.core.Dataset specified via --classlist or --testclass. No classes to test ".

while the other command

java -ea -classpath /home/shahid/git/java-ml/bin:/home/shahid/a_f_w/randoop-3.1.5/randoop-all-3.1.5.jar  randoop.main.Main gentests --testclass=DataSet --literals-file=CLASSES
without package for other project working perfectly. Any help will be appretiated.


Solution

  • The error message gives you the answer:

    Ignoring interface net.sf.javaml.core.Dataset specified via --classlist or --testclass. No classes to test

    You are supposed to provide a class, not an interface, to the --testclass command-line argument.

    By passing --testclass=net.sf.javaml.core.Dataset to Randoop, you indicated that you only want Randoop to create objects of type net.sf.javaml.core.Dataset. However, since that is an interface, it cannot be instantiated, and Randoop cannot create any objects, nor any tests.