Open
Description
Description
@utbot.invokes
in Javadoc for ExceptionExamples
contains full path to the class.
Other tags contain just short class name.
To Reproduce
- Run the 'utbot' project in IntelliJ Idea 2022.1-2.*
- Install plugin built from main - utbot-intellij-* artefact from this run was used
- Use default settings (custom Javadoc style)
- Generate tests for ExceptionExamples sample
- Open the generated test
Expected behavior
-
@utbot.invokes should contain short class names.
Needed classes are imported. -
do we need all implicit invocations, like StringBuilder in the second example below ?
Actual behavior
@utbot.invokes with user methods' invocations calls contain full paths to the methods.
Visual proofs (screenshots, logs, images)
///region SYMBOLIC EXECUTION: EXPLICITLY THROWN UNCHECKED EXCEPTIONS for method doNotCatchNested(int)
/**
* @utbot.classUnderTest {@link ExceptionExamples}
* @utbot.methodUnderTest {@link ExceptionExamples#doNotCatchNested(int)}
* @utbot.executesCondition {@code (i < 0): False}
* @utbot.invokes org.utbot.examples.exceptions.ExceptionExamples#checkAll(int)
* @utbot.invokes org.utbot.examples.exceptions.ExceptionExamples#checkPositive(int)
* @utbot.invokes org.utbot.examples.exceptions.ExceptionExamples#checkPositive(int)
* @utbot.throwsException {@link NullPointerException} in: return checkAll(i);
*/
@Test
@DisplayName("doNotCatchNested: return checkAll(i) : True -> ThrowNullPointerException")
public void testDoNotCatchNested_IGreaterOrEqualZero_1() {
ExceptionExamples exceptionExamples = new ExceptionExamples();
assertThrows(NullPointerException.class, () -> exceptionExamples.doNotCatchNested(1));
}
///region SYMBOLIC EXECUTION: SUCCESSFUL EXECUTIONS for method createException()
/**
* @utbot.classUnderTest {@link ExceptionExamples}
* @utbot.methodUnderTest {@link ExceptionExamples#createException()}
* @utbot.invokes {@link StringBuilder#append(String)}
* @utbot.invokes {@link Math#sqrt(double)}
* @utbot.invokes {@link StringBuilder#append(double)}
* @utbot.invokes {@link StringBuilder#toString()}
* @utbot.returnsFrom {@code return new IllegalArgumentException("Here we are: " + Math.sqrt(10));}
*/
@Test
@DisplayName("createException: StringBuilderAppend -> return new IllegalArgumentException(\"Here we are: \" + Math.sqrt(10))")
public void testCreateException_StringBuilderToString() throws Exception {
ExceptionExamples exceptionExamples = new ExceptionExamples();
IllegalArgumentException actual = exceptionExamples.createException();
IllegalArgumentException expected = ((IllegalArgumentException) createInstance("java.lang.IllegalArgumentException"));
}
///endregion
Environment
IntelliJ IDEA 2022.2
Gradle, JDK 11
Additional context
Other tags contain short class names.
@utbot.invoked with library methods' calls contain short names.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo