From eefc3079f7b149dbf42da9226df6535aad199164 Mon Sep 17 00:00:00 2001 From: Raigor Date: Sun, 26 Mar 2023 21:47:50 +0800 Subject: [PATCH] remove PluginJarLoaderTest (#24841) (#24842) (cherry picked from commit 7a7b9118535348835001404176b197899f632571) Co-authored-by: jiangML <1060319118@qq.com> --- .../core/plugin/jar/PluginJarLoaderTest.java | 50 ------------------ .../test/resources/plugins/test-plugin.jar | Bin 22 -> 0 bytes 2 files changed, 50 deletions(-) delete mode 100644 agent/core/src/test/java/org/apache/shardingsphere/agent/core/plugin/jar/PluginJarLoaderTest.java delete mode 100644 agent/core/src/test/resources/plugins/test-plugin.jar diff --git a/agent/core/src/test/java/org/apache/shardingsphere/agent/core/plugin/jar/PluginJarLoaderTest.java b/agent/core/src/test/java/org/apache/shardingsphere/agent/core/plugin/jar/PluginJarLoaderTest.java deleted file mode 100644 index 198ab0f756632..0000000000000 --- a/agent/core/src/test/java/org/apache/shardingsphere/agent/core/plugin/jar/PluginJarLoaderTest.java +++ /dev/null @@ -1,50 +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.agent.core.plugin.jar; - -import org.junit.Test; - -import java.io.File; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.util.Collection; -import java.util.Objects; -import java.util.jar.JarFile; - -import static org.hamcrest.CoreMatchers.endsWith; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -public class PluginJarLoaderTest { - - @Test - public void assertLoad() throws IOException { - Collection jarFiles = PluginJarLoader.load(new File(getResourceURL())); - assertThat(jarFiles.size(), is(1)); - assertThat(jarFiles.iterator().next().getName(), endsWith("test-plugin.jar")); - } - - private String getResourceURL() throws UnsupportedEncodingException { - return URLDecoder.decode( - Objects.requireNonNull(PluginJarLoader.class.getClassLoader().getResource("")) - .getFile(), - "UTF8"); - } - -} diff --git a/agent/core/src/test/resources/plugins/test-plugin.jar b/agent/core/src/test/resources/plugins/test-plugin.jar deleted file mode 100644 index 15cb0ecb3e219d1701294bfdf0fe3f5cb5d208e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22 NcmWIWW@Tf*000g10H*)|