jeffoffutt / muJava

Mutation system for Java programs, including OO mutation operators.
Apache License 2.0
66 stars 43 forks source link

How to use mujava to mutate the entire project? #20

Open Provence613 opened 4 years ago

Provence613 commented 4 years ago

Hi,my problem now is that I want to mutate the java files in the entire joda-time project, but the java files will call the methods of other classes of the package or the methods of other package classes. Can situations like this be handled by mujava? No matter I put the whole project or a single java file into the src folder, it will report an error. If I put a single java file into the src folder, the log file shows the following error:

[Error] MonthDay.java java.lang.NoClassDefFoundError: Could not initialize class org.joda.time.DateTimeFieldType
MutantsGenPanel:
java.lang.NoClassDefFoundError: Could not initialize class org.joda.time.DateTimeFieldType

If I put the whole project into the src folder, the log file shows the following error:

[Error] org\joda\time\Chronology.java java.lang.NoClassDefFoundError: Could not initialize class org.joda.time.DateTimeZone
MutantsGenPanel:
java.lang.NoClassDefFoundError: Could not initialize class org.joda.time.DateTimeZone

Regards.

winonecheng commented 4 years ago

There is a similar question in FAQ.

Provence613 commented 4 years ago

There is a similar question in FAQ.

Hi.After many attempts, I still can't successfully use mujava to mutate in a large java library. My operations are as follows:

  1. Copy the src code in the java library to the src folder of mujavaHome.
  2. Copy the class file in the corresponding java library to the classes folder of mujavaHome to mutate. The command line reports the following error: image image I didn't find a solution in the FAQ, how can I solve this situation? Regards.
winonecheng commented 4 years ago

According the answer of question 1 in FAQ, it is usually due to corrupted result data in the result folder. You should delete everything in the result folder and try again.

Is your GUI showing after typing the command?

Provence613 commented 4 years ago

According the answer of question 1 in FAQ, it is usually due to corrupted result data in the result folder. You should delete everything in the result folder and try again.

Is your GUI showing after typing the command?

My gui is displayed. I have tried to delete the result folder and run it multiple times, it is still the original error

winonecheng commented 4 years ago

There is instruction in FAQ. If the GUI shows without problems after typing the command, NoClassDefFoundError is usually because muJava can’t find the class. This is probably because either the classpath is set incorrectly (not pointing to the correct files or folders), or the compiled .class file is not in the class folder.

What is ur CLASSPATH setting? And, did u place compiled file in class folder?

Provence613 commented 4 years ago

But I put all the class files compiled in “idea” into the classes folder

winonecheng commented 4 years ago

Could you share your code or Mujava directory structure? Its hard to help you without them.

Provence613 commented 4 years ago

Could you share your code or Mujava directory structure? Its hard to help you without them.

Yes,I can.

image

image

image

Mujava directory structure: image

Regards.