-1

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.
tdube
  • 2,453
  • 2
  • 16
  • 25
Shahid
  • 3
  • 1
  • 3

2 Answers2

1

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.

mernst
  • 7,437
  • 30
  • 45
  • When the command: "java -ea -classpath ~/randoop.jar:~/lib/javaml-0.1.7.jar randoop.main.Main gentests --testclass=Dataset --literals-file=CLASSES --ignore-flaky-tests=true --only-test-public-members=true" was given, the error generated was "policy = sun.security.provider.PolicyFile@4dd8dc3" Throwable thrown while handling command: java.lang.Error: No class found for type name "Dataset"java.lang.Error: No class found for type name "Dataset" at randoop.main." – Shahid Jul 26 '17 at 01:24
  • 1
    This error message says the same thing: `Dataset` is not a fully-qualified path on your classpath. (The "policy = ..." output is not part of the error message.) – mernst Jul 27 '17 at 15:19
  • a similar issue was raised to randoop v 2.1.0 as given in the link "https://github.com/rjust/defects4j/issues/25" and solved by using the randoop v 2.1.2. I have tried all the versions but it is not resolving. Even giving the class path in double quotes. – Shahid Jul 27 '17 at 18:35
  • You still haven't produced a reproducible test case, as requested in the [Randoop manual](https://randoop.github.io/randoop/manual/#getting_help). You have just provided random command lines and complained that it doesn't work. Reading the messages has revealed a number of problems, so that is a good thing for you to do. More importantly, if you aren't willing to provide a reproducable test case, then others can't help you. – mernst Jul 28 '17 at 19:36
  • There is no test case generated, randoop terminates as the error appear, here is the link to the screenshot taken of the terminal Stack [pt.so]https://www.dropbox.com/s/zgxk6b1tddzuq9k/Screenshot%20from%202017-07-31%2005-29-00.png?dl=0[pt.so]
    and here is the link to randoop version used [pt.so] https://www.dropbox.com/sh/p90gxo23phcxpdk/AAAAV1tmbliFLmfy30J_-W7Ka?dl=0 [pt.so]
    – Shahid Jul 31 '17 at 01:25
  • I have multiple times given you the URL to the [Randoop manual](https://randoop.github.io/randoop/manual/index.html#getting_help) where it tells you how to report a test case, and what information is needed. Just a screenshot is not enough! – mernst Aug 01 '17 at 14:31
  • I was unable to generate the test cases by using prior versions but the 3.1.4 worked for me correctly. – Shahid Sep 09 '17 at 12:59
0

The following command worked for me:

java -ea -classpath ~/javaml/bin/:~/Randoop/randoop-all-3.1.4.jar  randoop.main.Main gentests --testclass=net.sf.javaml.core.Complex --literals-file=CLASSES

@mernst thanks for your kind response.

mernst
  • 7,437
  • 30
  • 45
Shahid
  • 3
  • 1
  • 3