use of com.axway.ats.agent.core.action.ArgumentValue in project ats-framework by Axway.
the class Test_IntegerRangeParameterDataProvider method perInvocationGeneration.
@Test
public void perInvocationGeneration() {
IntegerRangeParameterDataProvider dataProvider = new IntegerRangeParameterDataProvider("param1", 10, 20, ParameterProviderLevel.PER_INVOCATION);
ArgumentValue generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals(10, generatedValue.getValue());
//make sure only one instance per thread is returned
generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals(11, generatedValue.getValue());
}
use of com.axway.ats.agent.core.action.ArgumentValue in project ats-framework by Axway.
the class Test_IntegerRangeParameterDataProvider method whenRangeEndIsReachedProviderGoesBackToRangeStart.
@Test
public void whenRangeEndIsReachedProviderGoesBackToRangeStart() {
IntegerRangeParameterDataProvider dataProvider = new IntegerRangeParameterDataProvider("param1", 10, 14, ParameterProviderLevel.PER_INVOCATION);
ArgumentValue generatedValue;
for (int i = 10; i < 15; i++) {
generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals(i, generatedValue.getValue());
}
//make sure only one instance per thread is returned
generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals(10, generatedValue.getValue());
}
use of com.axway.ats.agent.core.action.ArgumentValue in project ats-framework by Axway.
the class Test_IntegerRangeParameterDataProvider method initialize.
@Test
public void initialize() throws AgentException {
IntegerRangeParameterDataProvider dataProvider = new IntegerRangeParameterDataProvider("param1", 10, 20, ParameterProviderLevel.PER_INVOCATION);
ArgumentValue generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals(10, generatedValue.getValue());
dataProvider.initialize();
//make sure only one instance per thread is returned
generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals(10, generatedValue.getValue());
}
use of com.axway.ats.agent.core.action.ArgumentValue in project ats-framework by Axway.
the class Test_ListParameterDataProvider method initialize.
@Test
public void initialize() throws AgentException {
List<String> values = new ArrayList<String>();
for (int i = 10; i < 14; i++) {
values.add("value" + i);
}
ListParameterDataProvider dataProvider = new ListParameterDataProvider("param1", values, ParameterProviderLevel.PER_THREAD);
ArgumentValue generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals("value10", generatedValue.getValue());
dataProvider.initialize();
//make sure only one instance per thread is returned
generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals("value10", generatedValue.getValue());
}
use of com.axway.ats.agent.core.action.ArgumentValue in project ats-framework by Axway.
the class Test_ListParameterDataProvider method perThreadStaticGeneration.
@Test
public void perThreadStaticGeneration() {
List<String> values = new ArrayList<String>();
for (int i = 10; i < 20; i++) {
values.add("value" + i);
}
ListParameterDataProvider dataProvider = new ListParameterDataProvider("param1", values, ParameterProviderLevel.PER_THREAD_STATIC);
ArgumentValue generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals("value10", generatedValue.getValue());
//make sure only one instance per thread is returned
generatedValue = dataProvider.getValue(new ArrayList<ArgumentValue>());
assertEquals("param1", generatedValue.getName());
assertEquals("value10", generatedValue.getValue());
}
Aggregations