use of com.alipay.sofa.ark.container.model.PluginModel in project sofa-ark by alipay.
the class HandleArchiveTest method testExcludePlugin.
@Test
public void testExcludePlugin() {
try {
HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
System.setProperty(PLUGIN_ACTIVE_EXCLUDE, "pluginA,pluginB");
PluginModel pluginModel = new PluginModel();
pluginModel.setPluginName("pluginA");
Assert.assertTrue(handleArchiveStage.isPluginExcluded(pluginModel));
pluginModel.setPluginName("pluginB");
Assert.assertTrue(handleArchiveStage.isPluginExcluded(pluginModel));
pluginModel.setPluginName("pluginC");
Assert.assertFalse(handleArchiveStage.isPluginExcluded(pluginModel));
} finally {
System.clearProperty(PLUGIN_ACTIVE_EXCLUDE);
}
}
use of com.alipay.sofa.ark.container.model.PluginModel in project sofa-ark by alipay.
the class PluginManagerServiceTest method testGetAllPluginNames.
@Test
public void testGetAllPluginNames() {
PluginModel pluginA = new PluginModel();
pluginA.setPluginName("plugin A");
pluginManagerService.registerPlugin(pluginA);
PluginModel pluginB = new PluginModel();
pluginB.setPluginName("plugin B");
pluginManagerService.registerPlugin(pluginB);
Assert.assertTrue(pluginManagerService.getAllPluginNames().contains(pluginA.getPluginName()));
Assert.assertTrue(pluginManagerService.getAllPluginNames().contains(pluginB.getPluginName()));
Assert.assertEquals(2, pluginManagerService.getAllPluginNames().size());
}
Aggregations