Skip to content

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

Open
@mrother-stoneriver

Description

@mrother-stoneriver

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ctg-bugIssue is a bug

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions