diff --git a/utbot-framework/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt b/utbot-framework/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt
index 8134633b32..5db0444ffa 100644
--- a/utbot-framework/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt
+++ b/utbot-framework/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt
@@ -141,7 +141,7 @@ internal class SortTest : UtValueTestCaseChecker(testClass = Sort::class) {
DocCodeStmt("(array.length < 4): False"),
DocRegularStmt("\n"),
DocRegularStmt("invokes:\n"),
- DocRegularStmt(" Arrays::sort once"),
+ DocRegularStmt(" {@link java.util.Arrays#sort(int[])} once"),
DocRegularStmt("\n"),
DocRegularStmt("returns from: "),
DocCodeStmt("return array;"),
diff --git a/utbot-summary-tests/src/test/kotlin/examples/algorithms/SummaryReturnExampleTest.kt b/utbot-summary-tests/src/test/kotlin/examples/algorithms/SummaryReturnExampleTest.kt
index a12c2854e6..8e6da56ce9 100644
--- a/utbot-summary-tests/src/test/kotlin/examples/algorithms/SummaryReturnExampleTest.kt
+++ b/utbot-summary-tests/src/test/kotlin/examples/algorithms/SummaryReturnExampleTest.kt
@@ -165,19 +165,19 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
@Test
fun testInnerVoidCompareChars() {
- val summary1 = "Test calls ReturnExample::compareChars,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): True\n" +
" returns from: return ' ';\n" +
" " // TODO: generates empty String or \n a the end
- val summary2 = "Test calls ReturnExample::compareChars,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): False\n" +
" iterates the loop for(int i = 0; i < n; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (Character.toChars(i)[0] == a): True\n" +
" returns from: return b;"
- val summary3 = "Test calls ReturnExample::compareChars,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): False\n" +
" iterates the loop for(int i = 0; i < n; i++) once,\n" +
@@ -186,7 +186,7 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" (Character.toChars(i)[0] == b): False\n" +
" Test then returns from: return a;\n" +
" " // TODO: generates empty String or \n a the end
- val summary4 = "Test calls ReturnExample::compareChars,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): False\n" +
" iterates the loop for(int i = 0; i < n; i++) once,\n" +
@@ -235,13 +235,13 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
@Test
fun testInnerReturnCompareChars() {
- val summary1 = "Test calls ReturnExample::compareChars,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): True\n" +
" returns from: return ' ';\n" +
" \n" +
"Test later returns from: return compareChars(a, b, n);\n"
- val summary2 = "Test calls ReturnExample::compareChars,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): False\n" +
" iterates the loop for(int i = 0; i < n; i++) once,\n" +
@@ -249,7 +249,7 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" (Character.toChars(i)[0] == a): True\n" +
" returns from: return b;\n" +
"Test later returns from: return compareChars(a, b, n);\n"
- val summary3 = "Test calls ReturnExample::compareChars,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): False\n" +
" iterates the loop for(int i = 0; i < n; i++) once,\n" +
@@ -259,7 +259,7 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" Test then returns from: return a;\n" +
" \n" + //
"Test afterwards returns from: return compareChars(a, b, n);\n"
- val summary4 = "Test calls ReturnExample::compareChars,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compareChars(char,char,int)},\n" +
" there it executes conditions:\n" +
" (n < 1): False\n" +
" iterates the loop for(int i = 0; i < n; i++) once,\n" +
@@ -309,13 +309,13 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
@Test
fun testInnerVoidCompare() {
- val summary1 = "Test calls ReturnExample::compare,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): True\n" +
" returns from: return a;\n" +
" " // TODO: remove blank line
- val summary2 = "Test calls ReturnExample::compare,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
@@ -323,19 +323,19 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" (a > b): True\n" +
" returns from: return b;\n" +
" " // TODO: remove blank line
- val summary3 = "Test calls ReturnExample::compare,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
" (b == 10): True\n" +
" returns from: return c;\n" +
" " // TODO: remove blank line
- val summary4 = "Test calls ReturnExample::compare,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): True\n" +
" returns from: return a;\n" +
" " // TODO: remove blank line
- val summary5 = "Test calls ReturnExample::compare,\n" +
+ val summary5 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
@@ -344,7 +344,7 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" (a < b): True\n" +
" returns from: return a;\n" +
" " // TODO: remove blank line
- val summary6 = "Test calls ReturnExample::compare,\n" +
+ val summary6 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
@@ -404,14 +404,14 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
@Test
fun testInnerReturnCompare() {
- val summary1 = "Test calls ReturnExample::compare,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): True\n" +
" returns from: return a;\n" +
" \n" +
"Test then returns from: return compare(a, b);\n"
- val summary2 = "Test calls ReturnExample::compare,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
@@ -420,7 +420,7 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" returns from: return b;\n" +
" \n" +
"Test afterwards returns from: return compare(a, b);\n"
- val summary3 = "Test calls ReturnExample::compare,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
@@ -428,13 +428,13 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" returns from: return c;\n" +
" \n" +
"Test then returns from: return compare(a, b);\n"
- val summary4 = "Test calls ReturnExample::compare,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): True\n" +
" returns from: return a;\n" +
" \n" +
"Test next returns from: return compare(a, b);\n"
- val summary5 = "Test calls ReturnExample::compare,\n" +
+ val summary5 = "Test calls{@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
@@ -444,7 +444,7 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" returns from: return a;\n" +
" \n" +
"Test afterwards returns from: return compare(a, b);\n"
- val summary6 = "Test calls ReturnExample::compare,\n" +
+ val summary6 = "Test calls {@link org.utbot.examples.algorithms.ReturnExample#compare(int,int)},\n" +
" there it executes conditions:\n" +
" (a < 0): False,\n" +
" (b < 0): False,\n" +
diff --git a/utbot-summary-tests/src/test/kotlin/examples/collections/SummaryListWrapperReturnsVoidTest.kt b/utbot-summary-tests/src/test/kotlin/examples/collections/SummaryListWrapperReturnsVoidTest.kt
index 1d3c9a6aef..1b2d24c6b0 100644
--- a/utbot-summary-tests/src/test/kotlin/examples/collections/SummaryListWrapperReturnsVoidTest.kt
+++ b/utbot-summary-tests/src/test/kotlin/examples/collections/SummaryListWrapperReturnsVoidTest.kt
@@ -69,7 +69,7 @@ class SummaryListWrapperReturnsVoidTest : SummaryTestCaseGeneratorTest(
" sum[0] += i;\n" +
" }\n" +
"});"
- val summary2 = "Test invokes: List::forEach once\n" +
+ val summary2 = "Test invokes: {@link java.util.List#forEach(java.util.function.Consumer)} once\n" +
"throws NullPointerException in: list.forEach(i -> {\n" +
" if (i > 0) {\n" +
" sum[0] += i;\n" +
diff --git a/utbot-summary-tests/src/test/kotlin/examples/controlflow/SummaryCycleTest.kt b/utbot-summary-tests/src/test/kotlin/examples/controlflow/SummaryCycleTest.kt
index b4e3a6f3ba..a192414cb4 100644
--- a/utbot-summary-tests/src/test/kotlin/examples/controlflow/SummaryCycleTest.kt
+++ b/utbot-summary-tests/src/test/kotlin/examples/controlflow/SummaryCycleTest.kt
@@ -1,13 +1,9 @@
package examples.controlflow
import examples.SummaryTestCaseGeneratorTest
-import org.junit.Ignore
-import org.junit.jupiter.api.Disabled
-import org.junit.jupiter.api.Tag
-import org.utbot.examples.controlflow.Cycles
import org.junit.jupiter.api.Test
import org.utbot.examples.DoNotCalculate
-import org.utbot.examples.algorithms.ReturnExample
+import org.utbot.examples.controlflow.Cycles
import org.utbot.framework.plugin.api.MockStrategyApi
class SummaryCycleTest : SummaryTestCaseGeneratorTest(
@@ -19,7 +15,8 @@ class SummaryCycleTest : SummaryTestCaseGeneratorTest(
" inside this loop, the test executes conditions:\n" +
" (i < 0): True\n" +
"returns from: return 2;"
- val summary2 = "Test does not iterate for(int i = x - 5; i < x; i++), for(int j = i; j < x + i; j++), returns from: return -1;\n" // TODO: should it be formatted from the new string?
+ val summary2 =
+ "Test does not iterate for(int i = x - 5; i < x; i++), for(int j = i; j < x + i; j++), returns from: return -1;\n" // TODO: should it be formatted from the new string?
val summary3 = "Test iterates the loop for(int i = x - 5; i < x; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (i < 0): False\n" +
@@ -123,7 +120,7 @@ class SummaryCycleTest : SummaryTestCaseGeneratorTest(
methodName3
)
- val method = Cycles::structureLoop
+ val method = Cycles::structureLoop
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate
diff --git a/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryInnerCallsTest.kt b/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryInnerCallsTest.kt
index 005ff1d64c..838cb1afcd 100644
--- a/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryInnerCallsTest.kt
+++ b/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryInnerCallsTest.kt
@@ -1,14 +1,9 @@
package examples.inner
import examples.SummaryTestCaseGeneratorTest
-import guava.examples.math.Stats
-import org.junit.Ignore
-import org.junit.jupiter.api.Disabled
-import org.junit.jupiter.api.Tag
-import org.utbot.examples.inner.InnerCalls
import org.junit.jupiter.api.Test
import org.utbot.examples.DoNotCalculate
-import org.utbot.examples.controlflow.Cycles
+import org.utbot.examples.inner.InnerCalls
import org.utbot.framework.plugin.api.MockStrategyApi
class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@@ -16,7 +11,7 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
) {
@Test
fun testCallLoopInsideLoop() {
- val summary1 = "Test calls Cycles::loopInsideLoop,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (i < 0): False\n" +
@@ -25,17 +20,17 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
" (j == 7): True\n" +
" returns from: return 1;\n" +
"Test afterwards returns from: return cycles.loopInsideLoop(x);\n"
- val summary2 = "Test calls Cycles::loopInsideLoop,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (i < 0): True\n" +
" returns from: return 2;\n" +
"Test then returns from: return cycles.loopInsideLoop(x);\n"
- val summary3 = "Test calls Cycles::loopInsideLoop,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it does not iterate for(int i = x - 5; i < x; i++), for(int j = i; j < x + i; j++), returns from: return -1;\n" +
" \n" +
"Test later returns from: return cycles.loopInsideLoop(x);\n"
- val summary4 = "Test calls Cycles::loopInsideLoop,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (i < 0): False\n" +
@@ -45,7 +40,7 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
" (j == 7): True\n" +
" returns from: return 1;\n" +
"Test later returns from: return cycles.loopInsideLoop(x);\n"
- val summary5 = "Test calls Cycles::loopInsideLoop,\n" +
+ val summary5 = "Test calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) 5 times. \n" +
" Test further does not iterate for(int j = i; j < x + i; j++), returns from: return -1;\n" +
" \n" +
@@ -99,13 +94,13 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testCallLeftBinSearch() {
//NOTE: 5 and 6 cases has different paths but throws the equal exception.
- val summary1 = "Test calls BinarySearch::leftBinSearch,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.algorithms.BinarySearch#leftBinSearch(long[],long)},\n" +
" there it does not iterate while(left < right - 1), executes conditions:\n" +
" (found): False\n" +
" returns from: return -1;\n" +
" \n" +
"Test then returns from: return binarySearch.leftBinSearch(array, key);\n"
- val summary2 = "Test calls BinarySearch::leftBinSearch,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.algorithms.BinarySearch#leftBinSearch(long[],long)},\n" +
" there it iterates the loop while(left < right - 1) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (array[middle] == key): False,\n" +
@@ -115,7 +110,7 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
" returns from: return -1;\n" +
" \n" +
"Test next returns from: return binarySearch.leftBinSearch(array, key);\n"
- val summary3 = "Test calls BinarySearch::leftBinSearch,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.algorithms.BinarySearch#leftBinSearch(long[],long)},\n" +
" there it iterates the loop while(left < right - 1) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (array[middle] == key): False,\n" +
@@ -125,7 +120,7 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
" returns from: return -1;\n" +
" \n" +
"Test next returns from: return binarySearch.leftBinSearch(array, key);\n"
- val summary4 = "Test calls BinarySearch::leftBinSearch,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.algorithms.BinarySearch#leftBinSearch(long[],long)},\n" +
" there it iterates the loop while(left < right - 1) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (array[middle] == key): True,\n" +
@@ -139,9 +134,9 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
"throws IllegalArgumentException in: return binarySearch.leftBinSearch(array, key);\n"
val summary6 = "Test \n" +
"throws IllegalArgumentException in: return binarySearch.leftBinSearch(array, key);\n"
- val summary7 = "Test calls BinarySearch::leftBinSearch,\n" +
+ val summary7 = "Test calls {@link org.utbot.examples.algorithms.BinarySearch#leftBinSearch(long[],long)},\n" +
" there it invokes:\n" +
- " BinarySearch::isUnsorted once\n" +
+ " {@link org.utbot.examples.algorithms.BinarySearch#isUnsorted(long[])} once\n" +
" triggers recursion of leftBinSearch once, \n" +
"Test throws NullPointerException in: return binarySearch.leftBinSearch(array, key);\n"
@@ -158,7 +153,8 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
val displayName2 = "array[middle] < key : True -> return -1"
val displayName3 = "while(left < right - 1) -> return -1"
val displayName4 = "array[middle] == key : True -> return right + 1"
- val displayName5 = "return binarySearch.leftBinSearch(array, key) : True -> ThrowIllegalArgumentException" // TODO: probably return statement could be removed
+ val displayName5 =
+ "return binarySearch.leftBinSearch(array, key) : True -> ThrowIllegalArgumentException" // TODO: probably return statement could be removed
val displayName6 = "return binarySearch.leftBinSearch(array, key) : True -> ThrowIllegalArgumentException"
val displayName7 = "return binarySearch.leftBinSearch(array, key) : True -> ThrowNullPointerException"
@@ -203,19 +199,21 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
// TODO: SAT-1211
@Test
fun testCallCreateNewThreeDimensionalArray() {
- val summary1 = "Test calls ArrayOfArrays::createNewThreeDimensionalArray,\n" +
- " there it executes conditions:\n" +
- " (length != 2): True\n" +
- " returns from: return new int[0][][];\n" +
- " "
- val summary2 = "Test calls ArrayOfArrays::createNewThreeDimensionalArray,\n" +
- " there it executes conditions:\n" +
- " (length != 2): False\n" +
- " iterates the loop for(int i = 0; i < length; i++) once,\n" +
- " inside this loop, the test iterates the loop for(int j = 0; j < length; j++) once,\n" +
- " inside this loop, the test iterates the loop for(int k = 0; k < length; k++)\n" +
- " Test then returns from: return matrix;\n" +
- " "
+ val summary1 =
+ "Test calls {@link org.utbot.examples.arrays.ArrayOfArrays#createNewThreeDimensionalArray(int,int)},\n" +
+ " there it executes conditions:\n" +
+ " (length != 2): True\n" +
+ " returns from: return new int[0][][];\n" +
+ " "
+ val summary2 =
+ "Test calls {@link org.utbot.examples.arrays.ArrayOfArrays#createNewThreeDimensionalArray(int,int)},\n" +
+ " there it executes conditions:\n" +
+ " (length != 2): False\n" +
+ " iterates the loop for(int i = 0; i < length; i++) once,\n" +
+ " inside this loop, the test iterates the loop for(int j = 0; j < length; j++) once,\n" +
+ " inside this loop, the test iterates the loop for(int k = 0; k < length; k++)\n" +
+ " Test then returns from: return matrix;\n" +
+ " "
val methodName1 = "testCallCreateNewThreeDimensionalArray_LengthNotEquals2"
val methodName2 = "testCallCreateNewThreeDimensionalArray_LengthEquals2"
@@ -248,25 +246,25 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testCallInitExamples() {
// NOTE: paths are different for test cases 1 and 2
- val summary1 = "Test calls ExceptionExamples::initAnArray,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.exceptions.ExceptionExamples#initAnArray(int)},\n" +
" there it catches exception:\n" +
" IndexOutOfBoundsException e\n" +
" returns from: return -3;\n" +
" \n" +
"Test later returns from: return exceptionExamples.initAnArray(n);\n"
- val summary2 = "Test calls ExceptionExamples::initAnArray,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.exceptions.ExceptionExamples#initAnArray(int)},\n" +
" there it catches exception:\n" +
" IndexOutOfBoundsException e\n" +
" returns from: return -3;\n" +
" \n" +
"Test then returns from: return exceptionExamples.initAnArray(n);\n"
- val summary3 = "Test calls ExceptionExamples::initAnArray,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.exceptions.ExceptionExamples#initAnArray(int)},\n" +
" there it catches exception:\n" +
" NegativeArraySizeException e\n" +
" returns from: return -2;\n" +
" \n" +
"Test next returns from: return exceptionExamples.initAnArray(n);\n"
- val summary4 = "Test calls ExceptionExamples::initAnArray,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.exceptions.ExceptionExamples#initAnArray(int)},\n" +
" there it returns from: return a[n - 1] + a[n - 2];\n" +
" \n" +
"Test afterwards returns from: return exceptionExamples.initAnArray(n);\n"
@@ -311,19 +309,19 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testCallFactorial() {
- val summary1 = "Test calls Recursion::factorial,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.recursion.Recursion#factorial(int)},\n" +
" there it executes conditions:\n" +
" (n == 0): True\n" +
" returns from: return 1;\n" +
" \n" +
"Test next returns from: return r.factorial(n);\n"
- val summary2 = "Test calls Recursion::factorial,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.recursion.Recursion#factorial(int)},\n" +
" there it executes conditions:\n" +
" (n == 0): False\n" +
" triggers recursion of factorial once, returns from: return n * factorial(n - 1);\n" +
" \n" +
"Test further returns from: return r.factorial(n);\n"
- val summary3 = "Test calls Recursion::factorial,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.recursion.Recursion#factorial(int)},\n" +
" there it executes conditions:\n" +
" (n < 0): True\n" +
" triggers recursion of factorial once, \n" +
@@ -364,24 +362,24 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testCallSimpleInvoke() {
- val summary1 = "Test calls InvokeExample::simpleFormula,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.invokes.InvokeExample#simpleFormula(int,int)},\n" +
" there it executes conditions:\n" +
" (fst < 100): False,\n" +
" (snd < 100): True\n" +
" \n" +
"Test throws IllegalArgumentException in: return invokeExample.simpleFormula(f, s);\n"
- val summary2 = "Test calls InvokeExample::simpleFormula,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.invokes.InvokeExample#simpleFormula(int,int)},\n" +
" there it executes conditions:\n" +
" (fst < 100): True\n" +
" \n" +
"Test throws IllegalArgumentException in: return invokeExample.simpleFormula(f, s);\n"
- val summary3 = "Test calls InvokeExample::simpleFormula,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.invokes.InvokeExample#simpleFormula(int,int)},\n" +
" there it executes conditions:\n" +
" (fst < 100): False,\n" +
" (snd < 100): False\n" +
" invokes:\n" +
- " InvokeExample::half once,\n" +
- " InvokeExample::mult once\n" +
+ " {@link org.utbot.examples.invokes.InvokeExample#half(int)} once,\n" +
+ " {@link org.utbot.examples.invokes.InvokeExample#mult(int,int)} once\n" +
" returns from: return mult(x, y);\n" +
" \n" +
"Test then returns from: return invokeExample.simpleFormula(f, s);\n"
@@ -421,36 +419,41 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testCallComplicatedMethod() {
- val summary1 = "Test calls StringExamples::indexOf,\n" +
- " there it invokes:\n" +
- " String::indexOf once\n" +
- " triggers recursion of indexOf once, \n" +
- "Test throws NullPointerException in: return stringExamples.indexOf(s, key);\n"
- val summary2 = "Test calls StringExamples::indexOf,\n" +
- " there it invokes:\n" +
- " String::indexOf once\n" +
- " \n" +
- "Test throws NullPointerException \n"
- val summary3 = "Test calls StringExamples::indexOf,\n" +
- " there it executes conditions:\n" +
- " (i > 0): False,\n" +
- " (i == 0): True\n" +
- " returns from: return i;\n" +
- " \n" +
- "Test further returns from: return stringExamples.indexOf(s, key);\n"
- val summary4 = "Test calls StringExamples::indexOf,\n" +
- " there it executes conditions:\n" +
- " (i > 0): False,\n" +
- " (i == 0): False\n" +
- " returns from: return i;\n" +
- " \n" +
- "Test later returns from: return stringExamples.indexOf(s, key);\n"
- val summary5 = "Test calls StringExamples::indexOf,\n" +
- " there it executes conditions:\n" +
- " (i > 0): True\n" +
- " returns from: return i;\n" +
- " \n" +
- "Test afterwards returns from: return stringExamples.indexOf(s, key);\n"
+ val summary1 =
+ "Test calls {@link org.utbot.examples.strings.StringExamples#indexOf(java.lang.String,java.lang.String)},\n" +
+ " there it invokes:\n" +
+ " {@link java.lang.String#indexOf(java.lang.String)} once\n" +
+ " triggers recursion of indexOf once, \n" +
+ "Test throws NullPointerException in: return stringExamples.indexOf(s, key);\n"
+ val summary2 =
+ "Test calls {@link org.utbot.examples.strings.StringExamples#indexOf(java.lang.String,java.lang.String)},\n" +
+ " there it invokes:\n" +
+ " {@link java.lang.String#indexOf(java.lang.String)} once\n" +
+ " \n" +
+ "Test throws NullPointerException \n"
+ val summary3 =
+ "Test calls {@link org.utbot.examples.strings.StringExamples#indexOf(java.lang.String,java.lang.String)},\n" +
+ " there it executes conditions:\n" +
+ " (i > 0): False,\n" +
+ " (i == 0): True\n" +
+ " returns from: return i;\n" +
+ " \n" +
+ "Test further returns from: return stringExamples.indexOf(s, key);\n"
+ val summary4 =
+ "Test calls {@link org.utbot.examples.strings.StringExamples#indexOf(java.lang.String,java.lang.String)},\n" +
+ " there it executes conditions:\n" +
+ " (i > 0): False,\n" +
+ " (i == 0): False\n" +
+ " returns from: return i;\n" +
+ " \n" +
+ "Test later returns from: return stringExamples.indexOf(s, key);\n"
+ val summary5 =
+ "Test calls {@link org.utbot.examples.strings.StringExamples#indexOf(java.lang.String,java.lang.String)},\n" +
+ " there it executes conditions:\n" +
+ " (i > 0): True\n" +
+ " returns from: return i;\n" +
+ " \n" +
+ "Test afterwards returns from: return stringExamples.indexOf(s, key);\n"
val methodName1 = "testCallStringExample_StringIndexOf"
val methodName2 = "testCallStringExample_StringIndexOf_1"
@@ -497,16 +500,16 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testCallSimpleSwitch() {
- val summary1 = "Test calls Switch::simpleSwitch,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.controlflow.Switch#simpleSwitch(int)},\n" +
" there it activates switch case: 12, returns from: return 12;\n" +
" "
- val summary2 = "Test calls Switch::simpleSwitch,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.controlflow.Switch#simpleSwitch(int)},\n" +
" there it activates switch case: 13, returns from: return 13;\n" +
" "
- val summary3 = "Test calls Switch::simpleSwitch,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.controlflow.Switch#simpleSwitch(int)},\n" +
" there it activates switch case: 10, returns from: return 10;\n" +
" "
- val summary4 = "Test calls Switch::simpleSwitch,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.controlflow.Switch#simpleSwitch(int)},\n" +
" there it activates switch case: default, returns from: return -1;\n" +
" "
@@ -550,16 +553,16 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testCallLookup() {
- val summary1 = "Test calls Switch::lookupSwitch,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.controlflow.Switch#lookupSwitch(int)},\n" +
" there it activates switch case: 20, returns from: return 20;\n" +
" "
- val summary2 = "Test calls Switch::lookupSwitch,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.controlflow.Switch#lookupSwitch(int)},\n" +
" there it activates switch case: 30, returns from: return 30;\n" +
" "
- val summary3 = "Test calls Switch::lookupSwitch,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.controlflow.Switch#lookupSwitch(int)},\n" +
" there it activates switch case: 0, returns from: return 0;\n" +
" "
- val summary4 = "Test calls Switch::lookupSwitch,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.controlflow.Switch#lookupSwitch(int)},\n" +
" there it activates switch case: default, returns from: return -1;\n" +
" "
@@ -603,27 +606,27 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testDoubleCall() {
- val summary1 = "Test calls InnerCalls::callSimpleInvoke,\n" +
- " there it calls InvokeExample::simpleFormula,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callSimpleInvoke(int,int)},\n" +
+ " there it calls {@link org.utbot.examples.invokes.InvokeExample#simpleFormula(int,int)},\n" +
" there it executes conditions:\n" +
" (fst < 100): True\n" +
" \n" +
"Test throws IllegalArgumentException in: callSimpleInvoke(f, s);\n"
- val summary2 = "Test calls InnerCalls::callSimpleInvoke,\n" +
- " there it calls InvokeExample::simpleFormula,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callSimpleInvoke(int,int)},\n" +
+ " there it calls {@link org.utbot.examples.invokes.InvokeExample#simpleFormula(int,int)},\n" +
" there it executes conditions:\n" +
" (fst < 100): False,\n" +
" (snd < 100): True\n" +
" \n" +
"Test throws IllegalArgumentException in: callSimpleInvoke(f, s);\n"
- val summary3 = "Test calls InnerCalls::callSimpleInvoke,\n" +
- " there it calls InvokeExample::simpleFormula,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callSimpleInvoke(int,int)},\n" +
+ " there it calls {@link org.utbot.examples.invokes.InvokeExample#simpleFormula(int,int)},\n" +
" there it executes conditions:\n" +
" (fst < 100): False,\n" +
" (snd < 100): False\n" +
" invokes:\n" +
- " InvokeExample::half once,\n" +
- " InvokeExample::mult once\n" +
+ " {@link org.utbot.examples.invokes.InvokeExample#half(int)} once,\n" +
+ " {@link org.utbot.examples.invokes.InvokeExample#mult(int,int)} once\n" +
" returns from: return mult(x, y);\n" +
" \n" +
" Test later returns from: return invokeExample.simpleFormula(f, s);\n" +
@@ -664,8 +667,8 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testDoubleCallLoopInsideLoop() {
- val summary1 = "Test calls InnerCalls::callLoopInsideLoop,\n" +
- " there it calls Cycles::loopInsideLoop,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callLoopInsideLoop(int)},\n" +
+ " there it calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (i < 0): True\n" +
@@ -673,15 +676,15 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
" Test afterwards returns from: return cycles.loopInsideLoop(x);\n" +
" \n" +
"Test further returns from: return result;\n"
- val summary2 = "Test calls InnerCalls::callLoopInsideLoop,\n" +
- " there it calls Cycles::loopInsideLoop,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callLoopInsideLoop(int)},\n" +
+ " there it calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it does not iterate for(int i = x - 5; i < x; i++), for(int j = i; j < x + i; j++), returns from: return -1;\n" +
" \n" +
" Test next returns from: return cycles.loopInsideLoop(x);\n" +
" \n" +
"Test later returns from: return result;\n"
- val summary3 = "Test calls InnerCalls::callLoopInsideLoop,\n" +
- " there it calls Cycles::loopInsideLoop,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callLoopInsideLoop(int)},\n" +
+ " there it calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (i < 0): False\n" +
@@ -692,8 +695,8 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
" Test next returns from: return cycles.loopInsideLoop(x);\n" +
" \n" +
"Test further returns from: return result;\n"
- val summary4 = "Test calls InnerCalls::callLoopInsideLoop,\n" +
- " there it calls Cycles::loopInsideLoop,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callLoopInsideLoop(int)},\n" +
+ " there it calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) once,\n" +
" inside this loop, the test executes conditions:\n" +
" (i < 0): False\n" +
@@ -705,8 +708,8 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
" Test further returns from: return cycles.loopInsideLoop(x);\n" +
" \n" +
"Test then returns from: return result;\n"
- val summary5 = "Test calls InnerCalls::callLoopInsideLoop,\n" +
- " there it calls Cycles::loopInsideLoop,\n" +
+ val summary5 = "Test calls {@link org.utbot.examples.inner.InnerCalls#callLoopInsideLoop(int)},\n" +
+ " there it calls {@link org.utbot.examples.controlflow.Cycles#loopInsideLoop(int)},\n" +
" there it iterates the loop for(int i = x - 5; i < x; i++) 5 times. \n" +
" Test later does not iterate for(int j = i; j < x + i; j++), returns from: return -1;\n" +
" \n" +
@@ -759,27 +762,27 @@ class SummaryInnerCallsTest : SummaryTestCaseGeneratorTest(
@Test
fun testInnerCallFib() {
- val summary1 = "Test calls Recursion::fib,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.recursion.Recursion#fib(int)},\n" +
" there it executes conditions:\n" +
" (n == 0): False,\n" +
" (n == 1): True\n" +
" returns from: return 1;\n" +
" \n" +
"Test next returns from: return r.fib(n);\n"
- val summary2 = "Test calls Recursion::fib,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.recursion.Recursion#fib(int)},\n" +
" there it executes conditions:\n" +
" (n == 0): True\n" +
" returns from: return 0;\n" +
" \n" +
"Test next returns from: return r.fib(n);\n"
- val summary3 = "Test calls Recursion::fib,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.recursion.Recursion#fib(int)},\n" +
" there it executes conditions:\n" +
" (n == 0): False,\n" +
" (n == 1): False\n" +
" triggers recursion of fib twice, returns from: return fib(n - 1) + fib(n - 2);\n" +
" \n" +
"Test next returns from: return r.fib(n);\n"
- val summary4 = "Test calls Recursion::fib,\n" +
+ val summary4 = "Test calls {@link org.utbot.examples.recursion.Recursion#fib(int)},\n" +
" there it executes conditions:\n" +
" (n < 0): True\n" +
" triggers recursion of fib once, \n" +
diff --git a/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryNestedCallsTest.kt b/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryNestedCallsTest.kt
index 096aed7fc9..b28b38b65c 100644
--- a/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryNestedCallsTest.kt
+++ b/utbot-summary-tests/src/test/kotlin/examples/inner/SummaryNestedCallsTest.kt
@@ -1,13 +1,9 @@
package examples.inner
import examples.SummaryTestCaseGeneratorTest
-import org.junit.Ignore
-import org.junit.jupiter.api.Disabled
-import org.junit.jupiter.api.Tag
-import org.utbot.examples.inner.NestedCalls
import org.junit.jupiter.api.Test
import org.utbot.examples.DoNotCalculate
-import org.utbot.examples.inner.InnerCalls
+import org.utbot.examples.inner.NestedCalls
import org.utbot.framework.plugin.api.MockStrategyApi
class SummaryNestedCallsTest : SummaryTestCaseGeneratorTest(
@@ -15,19 +11,19 @@ class SummaryNestedCallsTest : SummaryTestCaseGeneratorTest(
) {
@Test
fun testInvokeExample() {
- val summary1 = "Test calls NestedCalls\$ExceptionExamples::initAnArray,\n" +
+ val summary1 = "Test calls {@link org.utbot.examples.inner.NestedCalls.ExceptionExamples#initAnArray(int)},\n" +
" there it catches exception:\n" +
" IndexOutOfBoundsException e\n" +
" returns from: return -3;\n" +
" \n" +
"Test next returns from: return exceptionExamples.initAnArray(n);\n"
- val summary2 = "Test calls NestedCalls\$ExceptionExamples::initAnArray,\n" +
+ val summary2 = "Test calls {@link org.utbot.examples.inner.NestedCalls.ExceptionExamples#initAnArray(int)},\n" +
" there it catches exception:\n" +
" NegativeArraySizeException e\n" +
" returns from: return -2;\n" +
" \n" +
"Test afterwards returns from: return exceptionExamples.initAnArray(n);"
- val summary3 = "Test calls NestedCalls\$ExceptionExamples::initAnArray,\n" +
+ val summary3 = "Test calls {@link org.utbot.examples.inner.NestedCalls.ExceptionExamples#initAnArray(int)},\n" +
" there it returns from: return a[n - 1] + a[n - 2];\n" +
" \n" +
"Test next returns from: return exceptionExamples.initAnArray(n);\n"
diff --git a/utbot-summary-tests/src/test/kotlin/examples/ternary/SummaryTernary.kt b/utbot-summary-tests/src/test/kotlin/examples/ternary/SummaryTernaryTest.kt
similarity index 90%
rename from utbot-summary-tests/src/test/kotlin/examples/ternary/SummaryTernary.kt
rename to utbot-summary-tests/src/test/kotlin/examples/ternary/SummaryTernaryTest.kt
index 893b223665..2c6a322c06 100644
--- a/utbot-summary-tests/src/test/kotlin/examples/ternary/SummaryTernary.kt
+++ b/utbot-summary-tests/src/test/kotlin/examples/ternary/SummaryTernaryTest.kt
@@ -1,17 +1,12 @@
package examples.ternary
import examples.SummaryTestCaseGeneratorTest
-import org.junit.Ignore
-import org.junit.jupiter.api.Disabled
-import org.utbot.examples.ternary.Ternary
-import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
import org.utbot.examples.DoNotCalculate
-import org.utbot.examples.inner.InnerCalls
-import org.utbot.examples.inner.NestedCalls
+import org.utbot.examples.ternary.Ternary
import org.utbot.framework.plugin.api.MockStrategyApi
-class SummaryTernary : SummaryTestCaseGeneratorTest(
+class SummaryTernaryTest : SummaryTestCaseGeneratorTest(
Ternary::class,
) {
@Test
@@ -96,9 +91,12 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
val methodName2 = "testStringExpr_NumLessOrEqual5"
val methodName3 = "testStringExpr_NumGreaterThan5"
- val displayName1 = "num > 10 : True -> return num > 10 ? \"Number is greater than 10\" : num > 5 ? \"Number is greater than 5\" : \"Number is less than equal to 5\""
- val displayName2 = "num > 5 : False -> return num > 10 ? \"Number is greater than 10\" : num > 5 ? \"Number is greater than 5\" : \"Number is less than equal to 5\""
- val displayName3 = "num > 5 : True -> return num > 10 ? \"Number is greater than 10\" : num > 5 ? \"Number is greater than 5\" : \"Number is less than equal to 5\""
+ val displayName1 =
+ "num > 10 : True -> return num > 10 ? \"Number is greater than 10\" : num > 5 ? \"Number is greater than 5\" : \"Number is less than equal to 5\""
+ val displayName2 =
+ "num > 5 : False -> return num > 10 ? \"Number is greater than 10\" : num > 5 ? \"Number is greater than 5\" : \"Number is less than equal to 5\""
+ val displayName3 =
+ "num > 5 : True -> return num > 10 ? \"Number is greater than 10\" : num > 5 ? \"Number is greater than 5\" : \"Number is less than equal to 5\""
val method = Ternary::stringExpr
val mockStrategy = MockStrategyApi.NO_MOCKS
@@ -133,15 +131,17 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
val summary2 = "Test executes conditions:\n" +
" (input == null || input.equals(\"\")): True\n" +
"invokes:\n" +
- " String::equals once\n" +
+ " {@link java.lang.String#equals(java.lang.Object)} once\n" +
"returns from: return value;\n"
val summary3 = "Test executes conditions:\n" +
- " (input == null || input.equals(\"\")): True,\n" +
+ " (input == null || input.equals(\"\")): True\n" +
+ "invokes:\n" +
+ " {@link java.lang.String#equals(java.lang.Object)} once\n" +
+ "executes conditions:\n" +
" (input == null || input.equals(\"\")): False\n" +
"invokes:\n" +
- " Integer::parseInt once\n" +
- "\n" +
- "throws NumberFormatException in: Integer.parseInt(input)\n"
+ " {@link java.lang.Integer#parseInt(java.lang.String)} once\n" +
+ "throws NumberFormatException in: Integer.parseInt(input)"
val methodName1 = "testParse_InputEqualsNullOrInputEquals"
val methodName2 = "testParse_InputNotEqualsNullOrInputEquals"
@@ -175,6 +175,7 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
check(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames)
}
+
@Test
fun testMinValue() {
val summary1 = "Test executes conditions:\n" +
@@ -366,11 +367,16 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
val methodName4 = "testVeryLongTernary_Num2EqualsNum3"
val methodName5 = "testVeryLongTernary_Num2GreaterThanNum3"
- val displayName1 = "num1 > num2 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
- val displayName2 = "num2 == num3 : False -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
- val displayName3 = "num1 == num2 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
- val displayName4 = "num2 == num3 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
- val displayName5 = "num2 > num3 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
+ val displayName1 =
+ "num1 > num2 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
+ val displayName2 =
+ "num2 == num3 : False -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
+ val displayName3 =
+ "num1 == num2 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
+ val displayName4 =
+ "num2 == num3 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
+ val displayName5 =
+ "num2 > num3 : True -> return num1 > num2 ? 1 : num1 == num2 ? 2 : num2 > num3 ? 3 : num2 == num3 ? 4 : 5"
val method = Ternary::veryLongTernary
val mockStrategy = MockStrategyApi.NO_MOCKS
@@ -407,7 +413,7 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
fun testMinMax() {
val summary1 = "Test executes conditions:\n" +
" (num1 > num2): False\n" +
- "calls Ternary::minValue,\n" +
+ "calls {@link org.utbot.examples.ternary.Ternary#minValue(int,int)},\n" +
" there it executes conditions:\n" +
" ((a < b)): True\n" +
" returns from: return (a < b) ? a : b;\n" +
@@ -415,7 +421,7 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
"Test then returns from: return a;\n"
val summary2 = "Test executes conditions:\n" +
" (num1 > num2): True\n" +
- "calls Ternary::max,\n" +
+ "calls {@link org.utbot.examples.ternary.Ternary#max(int,int)},\n" +
" there it executes conditions:\n" +
" (val1 >= val2): True\n" +
" returns from: return val1 >= val2 ? val1 : val2;\n" +
@@ -423,7 +429,7 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
"Test further returns from: return a;\n"
val summary3 = "Test executes conditions:\n" +
" (num1 > num2): False\n" +
- "calls Ternary::minValue,\n" +
+ "calls {@link org.utbot.examples.ternary.Ternary#minValue(int,int)},\n" +
" there it executes conditions:\n" +
" ((a < b)): False\n" +
" returns from: return (a < b) ? a : b;\n" +
@@ -469,12 +475,12 @@ class SummaryTernary : SummaryTestCaseGeneratorTest(
val summary1 = "Test executes conditions:\n" +
" (num1 > num2): True\n" +
"invokes:\n" +
- " Ternary::intFunc1 once\n" +
+ " {@link org.utbot.examples.ternary.Ternary#intFunc1()} once\n" +
"returns from: return num1 > num2 ? intFunc1() : intFunc2();\n"
val summary2 = "Test executes conditions:\n" +
" (num1 > num2): False\n" +
"invokes:\n" +
- " Ternary::intFunc2 once\n" +
+ " {@link org.utbot.examples.ternary.Ternary#intFunc2()} once\n" +
"returns from: return num1 > num2 ? intFunc1() : intFunc2();\n"
val methodName1 = "testIntFunc_Num1GreaterThanNum2"
diff --git a/utbot-summary-tests/src/test/kotlin/math/SummaryIntMath.kt b/utbot-summary-tests/src/test/kotlin/math/SummaryIntMathTest.kt
similarity index 99%
rename from utbot-summary-tests/src/test/kotlin/math/SummaryIntMath.kt
rename to utbot-summary-tests/src/test/kotlin/math/SummaryIntMathTest.kt
index 43b3520970..2d63980faf 100644
--- a/utbot-summary-tests/src/test/kotlin/math/SummaryIntMath.kt
+++ b/utbot-summary-tests/src/test/kotlin/math/SummaryIntMathTest.kt
@@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test
import org.utbot.examples.DoNotCalculate
import org.utbot.framework.plugin.api.MockStrategyApi
-class SummaryIntMath : SummaryTestCaseGeneratorTest(
+class SummaryIntMathTest : SummaryTestCaseGeneratorTest(
IntMath::class,
) {
@Test
diff --git a/utbot-summary-tests/src/test/kotlin/math/SummaryOfMath.kt b/utbot-summary-tests/src/test/kotlin/math/SummaryOfMathTest.kt
similarity index 76%
rename from utbot-summary-tests/src/test/kotlin/math/SummaryOfMath.kt
rename to utbot-summary-tests/src/test/kotlin/math/SummaryOfMathTest.kt
index 322cf5ff4f..9200310a58 100644
--- a/utbot-summary-tests/src/test/kotlin/math/SummaryOfMath.kt
+++ b/utbot-summary-tests/src/test/kotlin/math/SummaryOfMathTest.kt
@@ -12,29 +12,29 @@ import org.utbot.framework.plugin.api.MockStrategyApi
*
* @see Related issue
*/
-class SummaryOfMath : SummaryTestCaseGeneratorTest(
+class SummaryOfMathTest : SummaryTestCaseGeneratorTest(
Stats::class,
) {
@Test
fun testOfInts() {
- val summary1 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary1 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(int[])},\n" +
" there it triggers recursion of addAll once, \n" +
"Test throws NullPointerException in: acummulator.addAll(values);\n"
- val summary2 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary2 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(int[])},\n" +
" there it does not iterate for(int value: values), \n" +
- "Test later calls StatsAccumulator::snapshot,\n" +
+ "Test later calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test then returns from: return acummulator.snapshot();"
- val summary3 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary3 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(int[])},\n" +
" there it iterates the loop for(int value: values) once. \n" +
- "Test later calls StatsAccumulator::snapshot,\n" +
+ "Test later calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test then returns from: return acummulator.snapshot();"
- val summary4 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary4 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(int[])},\n" +
" there it iterates the loop for(int value: values) twice. \n" +
- "Test later calls StatsAccumulator::snapshot,\n" +
+ "Test later calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test later returns from: return acummulator.snapshot();\n"
@@ -79,22 +79,22 @@ class SummaryOfMath : SummaryTestCaseGeneratorTest(
@Test
fun testOfDoubles() {
- val summary1 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary1 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(double[])},\n" +
" there it triggers recursion of addAll once, \n" +
"Test throws NullPointerException in: acummulator.addAll(values);\n"
- val summary2 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary2 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(double[])},\n" +
" there it does not iterate for(double value: values), \n" +
- "Test next calls StatsAccumulator::snapshot,\n" +
+ "Test next calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test later returns from: return acummulator.snapshot();\n"
- val summary3 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary3 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(double[])},\n" +
" there it iterates the loop for(double value: values) twice,\n" +
- " inside this loop, the test calls StatsAccumulator::add,\n" +
+ " inside this loop, the test calls {@link guava.examples.math.StatsAccumulator#add(double)},\n" +
" there it executes conditions:\n" +
" (count == 0): True\n" +
" (!isFinite(value)): True\n" +
- " calls StatsAccumulator::add,\n" +
+ " calls {@link guava.examples.math.StatsAccumulator#add(double)},\n" +
" there it executes conditions:\n" +
" (count == 0): False\n" +
" (isFinite(value) && isFinite(mean)): True\n" +
@@ -106,26 +106,26 @@ class SummaryOfMath : SummaryTestCaseGeneratorTest(
" mean = calculateNewMeanNonFinite(mean, value);\n" +
" sumOfSquaresOfDeltas = NaN;\n" +
"}): False\n" +
- "Test afterwards calls StatsAccumulator::snapshot,\n" +
+ "Test afterwards calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test afterwards returns from: return acummulator.snapshot();\n"
- val summary4 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary4 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(double[])},\n" +
" there it iterates the loop for(double value: values) twice,\n" +
- " inside this loop, the test calls StatsAccumulator::add,\n" +
+ " inside this loop, the test calls {@link guava.examples.math.StatsAccumulator#add(double)},\n" +
" there it executes conditions:\n" +
" (!isFinite(value)): False\n" +
- "Test next calls StatsAccumulator::snapshot,\n" +
+ "Test next calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test then returns from: return acummulator.snapshot();\n"
- val summary5 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary5 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(double[])},\n" +
" there it iterates the loop for(double value: values) twice,\n" +
- " inside this loop, the test calls StatsAccumulator::add,\n" +
+ " inside this loop, the test calls {@link guava.examples.math.StatsAccumulator#add(double)},\n" +
" there it executes conditions:\n" +
" (count == 0): True\n" +
" (!isFinite(value)): False\n" +
- " calls StatsAccumulator::add,\n" +
+ " calls {@link guava.examples.math.StatsAccumulator#add(double)},\n" +
" there it executes conditions:\n" +
" (count == 0): False\n" +
" (isFinite(value) && isFinite(mean)): True\n" +
@@ -137,25 +137,25 @@ class SummaryOfMath : SummaryTestCaseGeneratorTest(
" mean = calculateNewMeanNonFinite(mean, value);\n" +
" sumOfSquaresOfDeltas = NaN;\n" +
"}): True\n" +
- "Test later calls StatsAccumulator::snapshot,\n" +
+ "Test later calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test then returns from: return acummulator.snapshot();\n"
- val summary6 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary6 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(double[])},\n" +
" there it iterates the loop for(double value: values) twice,\n" +
" inside this loop, the test calls StatsAccumulator::add,\n" +
" there it executes conditions:\n" +
" (!isFinite(value)): True\n" +
- "Test afterwards calls StatsAccumulator::snapshot,\n" +
+ "Test afterwards calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test then returns from: return acummulator.snapshot();\n"
- val summary7 = "Test calls StatsAccumulator::addAll,\n" +
+ val summary7 = "Test calls {@link guava.examples.math.StatsAccumulator#addAll(double[])},\n" +
" there it iterates the loop for(double value: values) twice,\n" +
- " inside this loop, the test calls StatsAccumulator::add,\n" +
+ " inside this loop, the test calls {@link guava.examples.math.StatsAccumulator#add(double)},\n" +
" there it executes conditions:\n" +
" (!isFinite(value)): True\n" +
- "Test later calls StatsAccumulator::snapshot,\n" +
+ "Test later calls {@link guava.examples.math.StatsAccumulator#snapshot()},\n" +
" there it returns from: return new Stats(count, mean, sumOfSquaresOfDeltas, min, max);\n" +
" \n" +
"Test further returns from: return acummulator.snapshot();\n"
diff --git a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleClusterCommentBuilder.kt b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleClusterCommentBuilder.kt
index 5079251acf..829308ed02 100644
--- a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleClusterCommentBuilder.kt
+++ b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleClusterCommentBuilder.kt
@@ -85,13 +85,15 @@ class SimpleClusterCommentBuilder(
val invokeSootMethod = statementTag.invokeSootMethod()
var invokeRegistered = false
if (invoke != null && invokeSootMethod != null) {
- val className = invokeSootMethod.declaringClass.javaStyleName
+ val className = invokeSootMethod.declaringClass.name
val methodName = invokeSootMethod.name
+ val methodParameterTypes = invokeSootMethod.parameterTypes
val sentenceInvoke = SimpleSentenceBlock(stringTemplates = StringsTemplatesPlural())
buildSentenceBlock(invoke, sentenceInvoke, invokeSootMethod)
sentenceInvoke.squashStmtText()
if (!sentenceInvoke.isEmpty()) {
- sentenceBlock.invokeSentenceBlock = Pair(invokeDescription(className, methodName), sentenceInvoke)
+ sentenceBlock.invokeSentenceBlock =
+ Pair(invokeDescription(className, methodName, methodParameterTypes), sentenceInvoke)
createNextBlock = true
invokeRegistered = true
}
diff --git a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleCommentBuilder.kt b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleCommentBuilder.kt
index 3a4a7622a0..579328fc32 100644
--- a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleCommentBuilder.kt
+++ b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleCommentBuilder.kt
@@ -22,6 +22,7 @@ import org.utbot.summary.tag.StatementTag
import org.utbot.summary.tag.TraceTagWithoutExecution
import org.utbot.summary.tag.UniquenessTag
import soot.SootMethod
+import soot.Type
import soot.jimple.Stmt
import soot.jimple.internal.JAssignStmt
import soot.jimple.internal.JInvokeStmt
@@ -182,13 +183,15 @@ open class SimpleCommentBuilder(
val invokeSootMethod = statementTag.invokeSootMethod()
var invokeRegistered = false
if (invoke != null && invokeSootMethod != null) {
- val className = invokeSootMethod.declaringClass.javaStyleName
+ val className = invokeSootMethod.declaringClass.name
val methodName = invokeSootMethod.name
+ val methodParameterTypes = invokeSootMethod.parameterTypes
val sentenceInvoke = SimpleSentenceBlock(stringTemplates = sentenceBlock.stringTemplates)
buildSentenceBlock(invoke, sentenceInvoke, invokeSootMethod)
sentenceInvoke.squashStmtText()
if (!sentenceInvoke.isEmpty()) {
- sentenceBlock.invokeSentenceBlock = Pair(invokeDescription(className, methodName), sentenceInvoke)
+ sentenceBlock.invokeSentenceBlock =
+ Pair(invokeDescription(className, methodName, methodParameterTypes), sentenceInvoke)
createNextBlock = true
invokeRegistered = true
}
@@ -293,9 +296,10 @@ open class SimpleCommentBuilder(
*/
protected fun addTextInvoke(sentenceBlock: SimpleSentenceBlock, stmt: Stmt, frequency: Int) {
if (stmt is JAssignStmt || stmt is JInvokeStmt) {
- val className = stmt.invokeExpr.methodRef.declaringClass.javaStyleName
+ val className = stmt.invokeExpr.methodRef.declaringClass.name
val methodName = stmt.invokeExpr.method.name
- addTextInvoke(sentenceBlock, className, methodName, frequency)
+ val methodParameterTypes = stmt.invokeExpr.method.parameterTypes
+ addTextInvoke(sentenceBlock, className, methodName, methodParameterTypes, frequency)
}
}
@@ -306,13 +310,14 @@ open class SimpleCommentBuilder(
sentenceBlock: SimpleSentenceBlock,
className: String,
methodName: String,
+ methodParameterTypes: List,
frequency: Int
) {
if (!shouldSkipInvoke(methodName))
sentenceBlock.stmtTexts.add(
StmtDescription(
StmtType.Invoke,
- invokeDescription(className, methodName),
+ invokeDescription(className, methodName, methodParameterTypes),
frequency
)
)
@@ -337,9 +342,23 @@ open class SimpleCommentBuilder(
}
/**
- * Returns method call as styled String
+ * Returns a reference to the invoked method.
+ *
+ * It looks like {@link packageName.className#methodName(type1, type2)}.
+ *
+ * In case when an enclosing class in nested, we need to replace '$' with '.'
+ * to render the reference.
*/
- protected fun invokeDescription(className: String, methodName: String) = "$className::$methodName" //TODO SAT-1311
+ protected fun invokeDescription(className: String, methodName: String, methodParameterTypes: List): String {
+ val prettyClassName: String = className.replace("$", ".")
+
+ return if (methodParameterTypes.isEmpty()) {
+ "{@link $prettyClassName#$methodName()}"
+ } else {
+ val methodParametersAsString = methodParameterTypes.joinToString(",")
+ "{@link $prettyClassName#$methodName($methodParametersAsString)}"
+ }
+ }
protected fun buildIterationsBlock(
iterations: List,