本文整理汇总了Java中org.togglz.core.context.FeatureContext类的典型用法代码示例。如果您正苦于以下问题:Java FeatureContext类的具体用法?Java FeatureContext怎么用?Java FeatureContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FeatureContext类属于org.togglz.core.context包,在下文中一共展示了FeatureContext类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPaasFeatureManagerProvider
import org.togglz.core.context.FeatureContext; //导入依赖的package包/类
@PostConstruct
public void initPaasFeatureManagerProvider() {
logger.debug("Initialize PaasFeatureManagerProvider");
PaasFeatureManagerProvider.bind(config);
PaasFeatureManagerProvider.setPriority(getProviderPriority());
logger.info("Testing Feature Toggles Context is properly set-up");
FeatureContext.getFeatureManager();
}
示例2: setup
import org.togglz.core.context.FeatureContext; //导入依赖的package包/类
@Before
public void setup() {
// Ensure that PaasFeatureManagerProvider will be queried first
PaasFeatureManagerProvider.setPriority(0);
// Ensure FeatureContext cache is empty
FeatureContext.clearCache();
}
示例3: default_feature_manager_is_not_a_test_feature_manager
import org.togglz.core.context.FeatureContext; //导入依赖的package包/类
@Test
public void default_feature_manager_is_not_a_test_feature_manager() {
// Given a configured TestFeatureManagerProvider
FeatureManager testFeatureManager = new TestFeatureManager(PaasFeatures.class);
TestFeatureManagerProvider.setFeatureManager(testFeatureManager);
// When
FeatureManager featureManager = FeatureContext.getFeatureManager();
// Then
assertTrue("The feature manager should not be provided by the TestFeatureManagerProvider",featureManager != testFeatureManager);
assertTrue("The feature manager should not be provided by the FallbackTestFeatureManagerProvider",!(featureManager instanceof FallbackTestFeatureManager));
}
示例4: disable
import org.togglz.core.context.FeatureContext; //导入依赖的package包/类
public static void disable(final Feature feature) {
FeatureContext.getFeatureManager().setFeatureState(new FeatureState(feature, false));
}
示例5: a_default_feature_manager_should_be_available
import org.togglz.core.context.FeatureContext; //导入依赖的package包/类
@Test
public void a_default_feature_manager_should_be_available() {
FeatureManager featureManager = FeatureContext.getFeatureManager();
assertNotNull(featureManager);
}
示例6: isActive
import org.togglz.core.context.FeatureContext; //导入依赖的package包/类
@Override
public boolean isActive() {
return FeatureContext.getFeatureManager().isActive(this);
}
示例7: isFeatureActive
import org.togglz.core.context.FeatureContext; //导入依赖的package包/类
protected boolean isFeatureActive(Feature feature) {
return FeatureContext.getFeatureManager().isActive(feature);
}