You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by su...@apache.org on 2022/11/19 04:56:17 UTC

[shardingsphere] branch master updated: Remove useless ParallelRunner (#22273)

This is an automated email from the ASF dual-hosted git repository.

sunnianjun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d636d3f837 Remove useless ParallelRunner (#22273)
9d636d3f837 is described below

commit 9d636d3f83747b1bb97c36512ebfdf0ddcd15bf6
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Nov 19 12:56:11 2022 +0800

    Remove useless ParallelRunner (#22273)
---
 .../ShardingSphereParallelTestParameterized.java   |  2 +-
 .../test/runner/parallel/ParallelRunner.java       | 40 ----------------------
 2 files changed, 1 insertion(+), 41 deletions(-)

diff --git a/test/common/src/main/java/org/apache/shardingsphere/test/runner/ShardingSphereParallelTestParameterized.java b/test/common/src/main/java/org/apache/shardingsphere/test/runner/ShardingSphereParallelTestParameterized.java
index 53f999a9f68..08677d77cd9 100644
--- a/test/common/src/main/java/org/apache/shardingsphere/test/runner/ShardingSphereParallelTestParameterized.java
+++ b/test/common/src/main/java/org/apache/shardingsphere/test/runner/ShardingSphereParallelTestParameterized.java
@@ -34,6 +34,6 @@ public final class ShardingSphereParallelTestParameterized extends Parameterized
         super(clazz);
         ParallelRuntimeStrategy parallelRuntimeStrategy = clazz.getAnnotation(ParallelRuntimeStrategy.class);
         ParallelLevel level = null != parallelRuntimeStrategy ? parallelRuntimeStrategy.value() : ParallelLevel.DEFAULT;
-        setScheduler(new ParallelRunnerScheduler(level, new DefaultParallelRunnerExecutorFactory()));
+        setScheduler(new ParallelRunnerScheduler(level, new DefaultParallelRunnerExecutorFactory<>()));
     }
 }
diff --git a/test/common/src/main/java/org/apache/shardingsphere/test/runner/parallel/ParallelRunner.java b/test/common/src/main/java/org/apache/shardingsphere/test/runner/parallel/ParallelRunner.java
deleted file mode 100644
index 10015ca6ae5..00000000000
--- a/test/common/src/main/java/org/apache/shardingsphere/test/runner/parallel/ParallelRunner.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.runner.parallel;
-
-import org.apache.shardingsphere.test.runner.parallel.annotaion.ParallelLevel;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.model.InitializationError;
-
-/**
- * Parallel runner for junit.
- */
-public class ParallelRunner extends BlockJUnit4ClassRunner {
-    
-    /**
-     * Creates a ParallelRunner to run {@code klass}.
-     * If you now annotate a test-class with @RunWith(ParallelRunner.class) each method will run within its own thread.
-     *
-     * @param klass test class
-     * @throws InitializationError if the test class is malformed.
-     */
-    public ParallelRunner(final Class<?> klass) throws InitializationError {
-        super(klass);
-        setScheduler(new ParallelRunnerScheduler(ParallelLevel.DEFAULT, new DefaultParallelRunnerExecutorFactory()));
-    }
-}