Skip to content

Incorrect links in Java docs for classes without packages #1174

Closed

Description

@alisevych

Description

Links in Java docs are starting with '.' if the tested class has no package and is placed in the Sources root.

To Reproduce

  1. Download UnitTestBot plugin from main
  2. Install it in IntelliJ Idea (remove previous)
  3. Open/create a project
  4. Add the following Java class to the Sources root - without package:
public class A {

    public int test(){
        return 1;
    }
}
  1. Generate tests with UnitTestBot... for it
  2. Wait tests are generated

Expected behavior

Links to classes/methods are supposed to be resolved.

Actual behavior

Links to the class / method are starting with '.' and cannot be resolved.
They are displayed red.

Visual proofs (screenshots, logs, images)

The following test class is generated:

image

image

public class ATest {
    ///region Test suites for executable A.test

    ///region FUZZER: SUCCESSFUL EXECUTIONS for method test()

    /**
     * @utbot.classUnderTest {@link .A}
     * @utbot.methodUnderTest {@link .A#test()}
     */
    @Test
    @DisplayName("test: arg_0 = A() -> return 1")
    public void testTestReturnsOne() {
        A a = new A();

        int actual = a.test();

        assertEquals(1, actual);
    }
    ///endregion

    ///endregion
}

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.4 (JBR 11) - 2022.2.3 (JBR 17)

Activity

  1. added
    ctg-bugIssue is a bug
    comp-summariesSomething related to the method names, code comments and display names generation
    on Oct 18, 2022
  2. moved this to Todo in UTBot Javaon Oct 18, 2022
  3. added this to the 2022.11 Release milestone on Oct 18, 2022
  4. Repository owner moved this from Todo to Done in UTBot Javaon Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

comp-summariesSomething related to the method names, code comments and display names generationctg-bugIssue is a bug

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions