Skip to content

Commit

Permalink
Make TestDeltaPerfComparison parametric test
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Feb 2, 2021
1 parent 55cea61 commit 93b8ba2
Showing 1 changed file with 13 additions and 5 deletions.
Expand Up @@ -8,6 +8,7 @@

import org.javasimon.Split;
import org.javasimon.Stopwatch;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import com.evolveum.midpoint.prism.PrismContainerValue;
Expand All @@ -26,16 +27,23 @@ public class TestDeltaPerfComparison extends AbstractSchemaPerformanceTest {
private static final int REPETITIONS = 10000;


@Test
public void testIncrementAndCompare() throws SchemaException {

for (int i = 1; i <= 4; i++) {
complexStructure((int) Math.pow(10,i), PlusMinusZero.PLUS);
complexStructure((int) Math.pow(10,i), PlusMinusZero.MINUS);
@DataProvider(name = "combinations")
public Object[][] testIncrementAndCompare() throws SchemaException {

int level = 4;

Object[][] ret = new Object[2*level][];
for (int i = 0; i < level; i++) {
int count=(int) Math.pow(10, i+1);
ret[i] = new Object[] { count, PlusMinusZero.PLUS};
ret[i+level] = new Object[] {count, PlusMinusZero.MINUS};
}
return ret;
}


@Test(dataProvider = "combinations")
public void complexStructure(int assigmentCount, PlusMinusZero operation) throws SchemaException {

PrismObject<UserType> user = PrismTestUtil.getPrismContext().createObject(UserType.class);
Expand Down

0 comments on commit 93b8ba2

Please sign in to comment.