testSteps.remove( ix );
testSteps.add( ix + offset, step );
TestStepConfig[] configs = new TestStepConfig[testSteps.size()];
TestCaseConfig conf = getConfig();
for( int c = 0; c < testSteps.size(); c++ )
{
if( offset > 0 )
{
if( c < ix )
configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
else if( c < ( ix + offset ) )
configs[c] = ( TestStepConfig )conf.getTestStepArray( c + 1 ).copy();
else if( c == ix + offset )
configs[c] = ( TestStepConfig )conf.getTestStepArray( ix ).copy();
else
configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
}
else
{
if( c < ix + offset )
configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
else if( c == ix + offset )
configs[c] = ( TestStepConfig )conf.getTestStepArray( ix ).copy();
else if( c <= ix )
configs[c] = ( TestStepConfig )conf.getTestStepArray( c - 1 ).copy();
else
configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
}
}
conf.setTestStepArray( configs );
for( int c = 0; c < configs.length; c++ )
{
( testSteps.get( c ) ).resetConfigOnMove( conf.getTestStepArray( c ) );
}
( getTestSuite() ).fireTestStepMoved( step, ix, offset );
}