UTBotJava icon indicating copy to clipboard operation
UTBotJava copied to clipboard

Building Generated Tests Under JDK 17 Files Due To Modules Export Error

Open mrother-stoneriver opened this issue 2 years ago • 0 comments

Description

After generating unit tests for existing java classes, the unit tests fail to build to java modules export error.

To Reproduce

Steps to reproduce the behavior:

Have a java class which has a java.util.Date instance variable. Generated test class has the following:

import sun.util.calendar.JulianCalendar;

which when compiles gives the following error

error: package sun.util.calendar is not visible [ERROR] (package sun.util.calendar is declared in module java.base, which does not export it)

Expected behavior

Generated tests compile.

Actual behavior

Tests failed compilation.

Visual proofs (screenshots, logs, images)

Example:

public void testFail_errors() {
// Couldn't generate some tests. List of errors:
//
// 684 occurrences of:
// Concrete execution failed
}

Environment

Substitute this text with an information that can help us to recreate the environment. For instance, specify Java version, test framework with a version (JUnit, TestNG...), Mockito configuration (packages, classes, statics), were the test parametrized or not and so on.

Additional context

Add any other context about the problem here.

mrother-stoneriver avatar Dec 03 '23 11:12 mrother-stoneriver