You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the junit-quickcheck property testing tool together with Pirtest 1.6.4. However, I am encountering a problem. Pitest doesn't seem to be able to find the tests in my test class.
The message "PIT >> INFO: Found 0 tests" is always returned.
I believe that this problem occurs because the junit-quickcheck tool requires @RunWith (JUnitQuickcheck.class).
Does anyone have a solution to this problem?
Below is my code, test code and pom.xml:
package sort_selection_sort;
public class SelectionSort {
public int[] sort(int arr[]) {
int n = arr.length;
// One by one move boundary of unsorted subarray
for (int i = 0; i < n - 1; i++) {
// Find the minimum element in unsorted array
int min_idx = i;
for (int j = i + 1; j < n; j++)
if (arr[j] < arr[min_idx])
min_idx = j;
// Swap the found minimum element with the first
// element
int temp = arr[min_idx];
arr[min_idx] = arr[i];
arr[i] = temp;
}
return arr;
}
}
package sort_selection_sort;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import org.junit.runner.RunWith;
import com.pholser.junit.quickcheck.Property;
import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
@RunWith(JUnitQuickcheck.class)
public class SelectionSortPropertiesTest {
@Property(trials = 10)
public void property(int arr[]) {
SelectionSort ob = new SelectionSort();
int[] copyOfArr = Arrays.copyOf(arr, arr.length);
Arrays.sort(copyOfArr);
int[] sort = ob.sort(arr);
assertTrue(Arrays.equals(copyOfArr, sort));
}
}
Pitest + junit-quickcheck will be super cool..! Strong test generator & oracle meets strong test adequacy criterion. @ricardosm Did you get it to work yet, by any chance?
I am trying to use the junit-quickcheck property testing tool together with Pirtest 1.6.4. However, I am encountering a problem. Pitest doesn't seem to be able to find the tests in my test class.
The message "PIT >> INFO: Found 0 tests" is always returned.
I believe that this problem occurs because the junit-quickcheck tool requires @RunWith (JUnitQuickcheck.class).
Does anyone have a solution to this problem?
Below is my code, test code and pom.xml:
The text was updated successfully, but these errors were encountered: