You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/12/02 05:33:35 UTC

[shardingsphere] branch master updated: Remove NormalTestKeyProvider (#22583)

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

panjuan 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 e2a3c29ade1 Remove NormalTestKeyProvider (#22583)
e2a3c29ade1 is described below

commit e2a3c29ade1ca88ebe11d4aee48802427cde8ad7
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Dec 2 13:33:29 2022 +0800

    Remove NormalTestKeyProvider (#22583)
---
 .../test/runner/ParallelParameterized.java         |  9 ++---
 .../test/runner/ParallelRunningStrategy.java       |  4 +-
 .../runner/key/impl/NormalTestKeyProvider.java     | 43 ----------------------
 ....shardingsphere.test.runner.key.TestKeyProvider | 18 ---------
 4 files changed, 5 insertions(+), 69 deletions(-)

diff --git a/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelParameterized.java b/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelParameterized.java
index a6cc666fb7f..ab9b83e0fed 100644
--- a/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelParameterized.java
+++ b/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelParameterized.java
@@ -17,7 +17,6 @@
 
 package org.apache.shardingsphere.test.runner;
 
-import org.apache.shardingsphere.test.runner.ParallelRunningStrategy.ParallelLevel;
 import org.apache.shardingsphere.test.runner.executor.ParallelRunnerExecutors;
 import org.apache.shardingsphere.test.runner.scheduler.ParallelRunnerScheduler;
 import org.junit.runners.Parameterized;
@@ -31,11 +30,9 @@ public final class ParallelParameterized extends Parameterized {
     public ParallelParameterized(final Class<?> clazz) throws Throwable {
         // CHECKSTYLE:ON
         super(clazz);
-        setScheduler(new ParallelRunnerScheduler(getParallelLevel(clazz), new ParallelRunnerExecutors()));
-    }
-    
-    private ParallelLevel getParallelLevel(final Class<?> clazz) {
         ParallelRunningStrategy runningStrategy = clazz.getAnnotation(ParallelRunningStrategy.class);
-        return null == runningStrategy ? ParallelLevel.NORMAL : runningStrategy.value();
+        if (null != runningStrategy) {
+            setScheduler(new ParallelRunnerScheduler(runningStrategy.value(), new ParallelRunnerExecutors()));
+        }
     }
 }
diff --git a/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelRunningStrategy.java b/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelRunningStrategy.java
index 9919e99c3c9..3b6ed9e7f05 100644
--- a/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelRunningStrategy.java
+++ b/test/runner/src/main/java/org/apache/shardingsphere/test/runner/ParallelRunningStrategy.java
@@ -38,13 +38,13 @@ public @interface ParallelRunningStrategy {
      * 
      * @return parallel level
      */
-    ParallelLevel value() default ParallelLevel.NORMAL;
+    ParallelLevel value();
     
     /**
      * Parallel level.
      */
     enum ParallelLevel {
         
-        NORMAL, CASE, SCENARIO
+        CASE, SCENARIO
     }
 }
diff --git a/test/runner/src/main/java/org/apache/shardingsphere/test/runner/key/impl/NormalTestKeyProvider.java b/test/runner/src/main/java/org/apache/shardingsphere/test/runner/key/impl/NormalTestKeyProvider.java
deleted file mode 100644
index 0e6e6b1aa89..00000000000
--- a/test/runner/src/main/java/org/apache/shardingsphere/test/runner/key/impl/NormalTestKeyProvider.java
+++ /dev/null
@@ -1,43 +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.key.impl;
-
-import org.apache.shardingsphere.test.runner.ParallelRunningStrategy.ParallelLevel;
-import org.apache.shardingsphere.test.runner.key.TestKeyProvider;
-import org.apache.shardingsphere.test.runner.param.ParameterizedArray;
-
-/**
- * Normal test key provider.
- */
-public final class NormalTestKeyProvider implements TestKeyProvider {
-    
-    @Override
-    public String getRunnerKey(final ParameterizedArray parameterizedArray) {
-        return "";
-    }
-    
-    @Override
-    public String getExecutorKey(final ParameterizedArray parameterizedArray) {
-        return "";
-    }
-    
-    @Override
-    public ParallelLevel getParallelLevel() {
-        return ParallelLevel.NORMAL;
-    }
-}
diff --git a/test/runner/src/main/resources/META-INF/services/org.apache.shardingsphere.test.runner.key.TestKeyProvider b/test/runner/src/main/resources/META-INF/services/org.apache.shardingsphere.test.runner.key.TestKeyProvider
deleted file mode 100644
index 41e739efad3..00000000000
--- a/test/runner/src/main/resources/META-INF/services/org.apache.shardingsphere.test.runner.key.TestKeyProvider
+++ /dev/null
@@ -1,18 +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.
-#
-
-org.apache.shardingsphere.test.runner.key.impl.NormalTestKeyProvider