use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage in project sofa-ark by alipay.
the class HandleArchiveTest method testIncludePlugin.
@Test
public void testIncludePlugin() {
try {
HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
System.setProperty(PLUGIN_ACTIVE_INCLUDE, "pluginA");
PluginModel pluginModel = new PluginModel();
pluginModel.setPluginName("pluginA");
Assert.assertFalse(handleArchiveStage.isPluginExcluded(pluginModel));
pluginModel.setPluginName("pluginB");
Assert.assertTrue(handleArchiveStage.isPluginExcluded(pluginModel));
pluginModel.setPluginName("pluginC");
Assert.assertTrue(handleArchiveStage.isPluginExcluded(pluginModel));
} finally {
System.clearProperty(PLUGIN_ACTIVE_INCLUDE);
}
}
use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage in project sofa-ark by alipay.
the class HandleArchiveTest method testIncludeExcludeBiz.
@Test
public void testIncludeExcludeBiz() {
try {
HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
System.setProperty(BIZ_ACTIVE_INCLUDE, "bizA:1.0.0");
System.setProperty(BIZ_ACTIVE_EXCLUDE, "bizA:1.0.0,BizB:1.0.0");
BizModel bizModel = new BizModel();
bizModel.setBizName("bizA").setBizVersion("1.0.0");
Assert.assertFalse(handleArchiveStage.isBizExcluded(bizModel));
bizModel.setBizName("bizB");
Assert.assertTrue(handleArchiveStage.isBizExcluded(bizModel));
bizModel.setBizName("bizC");
Assert.assertTrue(handleArchiveStage.isBizExcluded(bizModel));
} finally {
System.clearProperty(BIZ_ACTIVE_INCLUDE);
System.clearProperty(BIZ_ACTIVE_EXCLUDE);
}
}
use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage in project sofa-ark by alipay.
the class HandleArchiveTest method testIncludeExcludePlugin.
@Test
public void testIncludeExcludePlugin() {
try {
HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
System.setProperty(PLUGIN_ACTIVE_INCLUDE, "pluginA");
System.setProperty(PLUGIN_ACTIVE_EXCLUDE, "pluginA,pluginB");
PluginModel pluginModel = new PluginModel();
pluginModel.setPluginName("pluginA");
Assert.assertFalse(handleArchiveStage.isPluginExcluded(pluginModel));
pluginModel.setPluginName("pluginB");
Assert.assertTrue(handleArchiveStage.isPluginExcluded(pluginModel));
pluginModel.setPluginName("pluginC");
Assert.assertTrue(handleArchiveStage.isPluginExcluded(pluginModel));
} finally {
System.clearProperty(PLUGIN_ACTIVE_EXCLUDE);
System.clearProperty(PLUGIN_ACTIVE_INCLUDE);
}
}
use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage in project sofa-ark by alipay.
the class HandleArchiveTest method testNoIncludeExcludeBiz.
@Test
public void testNoIncludeExcludeBiz() {
HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
PluginModel pluginModel = new PluginModel();
pluginModel.setPluginName("pluginA");
Assert.assertFalse(handleArchiveStage.isPluginExcluded(pluginModel));
pluginModel.setPluginName("pluginB");
Assert.assertFalse(handleArchiveStage.isPluginExcluded(pluginModel));
}
use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage in project sofa-ark by alipay.
the class HandleArchiveTest method testIncludeBiz.
@Test
public void testIncludeBiz() {
try {
HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
System.setProperty(BIZ_ACTIVE_INCLUDE, "bizA:1.0.0");
BizModel bizModel = new BizModel();
bizModel.setBizName("bizA").setBizVersion("1.0.0");
Assert.assertFalse(handleArchiveStage.isBizExcluded(bizModel));
bizModel.setBizName("pluginB");
Assert.assertTrue(handleArchiveStage.isBizExcluded(bizModel));
bizModel.setBizName("pluginC");
Assert.assertTrue(handleArchiveStage.isBizExcluded(bizModel));
} finally {
System.clearProperty(BIZ_ACTIVE_INCLUDE);
}
}
Aggregations