Skip to content

Commit

Permalink
Move RunnerParameters (#22496)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Nov 29, 2022
1 parent 288fc4d commit 34c5cba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.shardingsphere.test.integration.framework.runner.parallel;

import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.framework.param.RunnerParameters;
import org.apache.shardingsphere.test.runner.param.RunnerParameters;
import org.apache.shardingsphere.test.integration.framework.param.model.ITParameterizedArray;
import org.apache.shardingsphere.test.runner.ParallelRunningStrategy.ParallelLevel;
import org.apache.shardingsphere.test.runner.executor.ParallelRunnerExecutorFactory;
Expand All @@ -35,7 +35,7 @@ public ParameterizedParallelRunnerScheduler(final ParallelLevel parallelLevel, f

@Override
public void schedule(final Runnable childStatement) {
ITParameterizedArray parameterizedArray = new RunnerParameters(childStatement).getParameterizedArray();
ITParameterizedArray parameterizedArray = (ITParameterizedArray) new RunnerParameters(childStatement).getParameterizedArray();
getExecutorFactory().getExecutor(parameterizedArray.getDatabaseType(), getParallelLevel()).execute(parameterizedArray, childStatement);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
* limitations under the License.
*/

package org.apache.shardingsphere.test.integration.framework.param;
package org.apache.shardingsphere.test.runner.param;

import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.apache.shardingsphere.test.integration.framework.param.model.ITParameterizedArray;
import org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters;

import java.lang.reflect.Field;
Expand All @@ -38,11 +37,11 @@ public final class RunnerParameters {
* @return parameterized array
*/
@SneakyThrows(ReflectiveOperationException.class)
public ITParameterizedArray getParameterizedArray() {
public ParameterizedArray getParameterizedArray() {
Field parametersField = BlockJUnit4ClassRunnerWithParameters.class.getDeclaredField("parameters");
parametersField.setAccessible(true);
Object[] params = (Object[]) parametersField.get(getRunner());
return (ITParameterizedArray) params[0];
return (ParameterizedArray) params[0];
}

@SneakyThrows(ReflectiveOperationException.class)
Expand Down

0 comments on commit 34c5cba

Please sign in to comment.