@@ -0,0 +1,2347 @@
+/*%0A * Copyright (C) 2012-present the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.pf4j;%0A%0Aimport org.junit.jupiter.api.AfterEach;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.io.TempDir;%0Aimport org.pf4j.plugin.PluginJar;%0Aimport org.pf4j.plugin.TestPlugin;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Path;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0Aimport static org.junit.jupiter.api.Assertions.assertFalse;%0Aimport static org.junit.jupiter.api.Assertions.assertTrue;%0A%0Apublic class JarPluginManagerTest %7B%0A%0A    private PluginJar pluginJar;%0A    private JarPluginManager pluginManager;%0A%0A    @TempDir%0A    Path pluginsPath;%0A%0A    @BeforeEach%0A    public void setUp() throws IOException %7B%0A        pluginJar = new PluginJar.Builder(pluginsPath.resolve(%22test-plugin.jar%22), %22test-plugin%22)%0A            .pluginClass(TestPlugin.class.getName())%0A            .pluginVersion(%221.2.3%22)%0A            .build();%0A%0A        pluginManager = new JarPluginManager(pluginsPath);%0A    %7D%0A%0A    @AfterEach%0A    public void tearDown() %7B%0A        pluginJar = null;%0A        pluginManager = null;%0A    %7D%0A%0A    @Test%0A    public void unloadPlugin() throws Exception %7B%0A        pluginManager.loadPlugins();%0A%0A        assertEquals(1, pluginManager.getPlugins().size());%0A%0A        boolean unloaded = pluginManager.unloadPlugin(pluginJar.pluginId());%0A        assertTrue(unloaded);%0A%0A        assertTrue(pluginJar.file().exists());%0A    %7D%0A%0A    @Test%0A    public void deletePlugin() throws Exception %7B%0A        pluginManager.loadPlugins();%0A%0A        assertEquals(1, pluginManager.getPlugins().size());%0A%0A        boolean deleted = pluginManager.deletePlugin(pluginJar.pluginId());%0A        assertTrue(deleted);%0A%0A        assertFalse(pluginJar.file().exists());%0A    %7D%0A%0A%7D%0A

Add JarPluginManagerTest