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