Search in sources :

Example 6 with HandleArchiveStage

use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage in project sofa-ark by alipay.

the class HandleArchiveTest method testExcludeBiz.

@Test
public void testExcludeBiz() {
    try {
        HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
        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.assertTrue(handleArchiveStage.isBizExcluded(bizModel));
        bizModel.setBizName("bizB");
        Assert.assertTrue(handleArchiveStage.isBizExcluded(bizModel));
        bizModel.setBizName("bizC");
        Assert.assertFalse(handleArchiveStage.isBizExcluded(bizModel));
    } finally {
        System.clearProperty(BIZ_ACTIVE_EXCLUDE);
    }
}
Also used : HandleArchiveStage(com.alipay.sofa.ark.container.pipeline.HandleArchiveStage) BizModel(com.alipay.sofa.ark.container.model.BizModel) Test(org.junit.Test)

Example 7 with HandleArchiveStage

use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage 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);
    }
}
Also used : PluginModel(com.alipay.sofa.ark.container.model.PluginModel) HandleArchiveStage(com.alipay.sofa.ark.container.pipeline.HandleArchiveStage) Test(org.junit.Test)

Example 8 with HandleArchiveStage

use of com.alipay.sofa.ark.container.pipeline.HandleArchiveStage in project sofa-ark by alipay.

the class HandleArchiveTest method testNoIncludeExcludePlugin.

@Test
public void testNoIncludeExcludePlugin() {
    HandleArchiveStage handleArchiveStage = new HandleArchiveStage();
    BizModel bizModel = new BizModel();
    bizModel.setBizName("bizA").setBizVersion("1.0.0");
    Assert.assertFalse(handleArchiveStage.isBizExcluded(bizModel));
    bizModel.setBizName("bizB");
    Assert.assertFalse(handleArchiveStage.isBizExcluded(bizModel));
}
Also used : HandleArchiveStage(com.alipay.sofa.ark.container.pipeline.HandleArchiveStage) BizModel(com.alipay.sofa.ark.container.model.BizModel) Test(org.junit.Test)

Aggregations

HandleArchiveStage (com.alipay.sofa.ark.container.pipeline.HandleArchiveStage)8 Test (org.junit.Test)8 BizModel (com.alipay.sofa.ark.container.model.BizModel)4 PluginModel (com.alipay.sofa.ark.container.model.PluginModel)4