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

healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 761b660ba [INLONG-4660][Manager] PluginServiceTest adapts to the 
Windows system (#4661)
761b660ba is described below

commit 761b660badaeb822fbea803f7177cdadd27d37f0
Author: kipshi <[email protected]>
AuthorDate: Tue Jun 14 14:09:24 2022 +0800

    [INLONG-4660][Manager] PluginServiceTest adapts to the Windows system 
(#4661)
---
 .../manager/service/core/plugin/PluginServiceTest.java    | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git 
a/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/core/plugin/PluginServiceTest.java
 
b/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/core/plugin/PluginServiceTest.java
index f185590f8..832b5d75e 100644
--- 
a/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/core/plugin/PluginServiceTest.java
+++ 
b/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/core/plugin/PluginServiceTest.java
@@ -24,21 +24,30 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.io.File;
+import java.net.URISyntaxException;
+import java.nio.file.Paths;
 import java.util.List;
-import java.util.Objects;
 
 /**
  * Test class for reload plugin.
  */
 public class PluginServiceTest extends ServiceBaseTest {
 
+    public static final String PLUGIN_NAME = "plugins";
+
     @Autowired
     PluginService pluginService;
 
     @Test
     public void testReloadPlugin() {
-        String path = 
Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath();
-        pluginService.setPluginLoc(path + "plugins");
+        String path = null;
+        try {
+            path = 
Paths.get(this.getClass().getClassLoader().getResource("").toURI()).toString();
+        } catch (URISyntaxException e) {
+            Assert.fail(e.getMessage());
+        }
+        pluginService.setPluginLoc(path + File.separator + PLUGIN_NAME);
         pluginService.pluginReload();
         List<Plugin> pluginList = pluginService.getPlugins();
         Assert.assertTrue(pluginList.size() > 0);

Reply via email to