Package org.togglz.core.util

Examples of org.togglz.core.util.NamedFeature


        return isActive ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY;
    }

    protected boolean isFeatureActive() {
        if (Strings.isNotBlank(name)) {
            return featureManager.isActive(new NamedFeature(name));
        }
        return false;
    }
View Full Code Here


        for (Entry<Object, Object> entry : properties.entrySet()) {

            String name = entry.getKey().toString();
            String spec = entry.getValue().toString();

            NamedFeature feature = new NamedFeature(name);

            features.add(feature);
            metadata.put(name, new PropertyFeatureMetaData(feature, spec));

        }
View Full Code Here

        delegate = Mockito.mock(StateRepository.class);
        // the mock supports the ENUM
        Mockito.when(delegate.getFeatureState(DummyFeature.TEST))
            .thenReturn(new FeatureState(DummyFeature.TEST, true));
        // and NamedFeature
        Mockito.when(delegate.getFeatureState(new NamedFeature("TEST")))
            .thenReturn(new FeatureState(DummyFeature.TEST, true));
    }
View Full Code Here

        StateRepository repository = new CachingStateRepository(delegate, 0);

        // do some lookups
        for (int i = 0; i < 10; i++) {
            Feature feature = (i % 2 == 0) ? DummyFeature.TEST :
                new NamedFeature(DummyFeature.TEST.name());
            assertTrue(repository.getFeatureState(feature).isEnabled());
            Thread.sleep(10);
        }

        // delegate only called once
View Full Code Here

                    WithFeature withFeature = description.getAnnotation(WithFeature.class);
                    if (withFeature != null) {
                        for (String featureName : withFeature.value()) {
                            if (withFeature.disable()) {
                                disable(new NamedFeature(featureName));
                            } else {
                                enable(new NamedFeature(featureName));
                            }
                        }
                    }
                   
                    // run the test
View Full Code Here

        if (!initialized) {
            throw new FactoryBeanNotInitializedException();
        }

        // create the invocation handler that switches between implementations
        Feature namedFeature = new NamedFeature(feature);
        FeatureProxyInvocationHandler proxy = new FeatureProxyInvocationHandler(namedFeature, active, inactive);

        // obtain the interface for which to create the proxy
        Class<?> proxyType = getEffectiveProxyType();
View Full Code Here

        Set<Feature> features = provider.getFeatures();
        assertThat(features)
            .hasSize(1)
            .areExactly(1, featureNamed("F1"));

        FeatureMetaData metadata = provider.getMetaData(new NamedFeature("F1"));
        assertThat(metadata).isNotNull();
        assertThat(metadata.getLabel()).isEqualTo("F1");
        assertThat(metadata.isEnabledByDefault()).isFalse();
        assertThat(metadata.getGroups()).isEmpty();
View Full Code Here

        Set<Feature> features = provider.getFeatures();
        assertThat(features)
            .hasSize(1)
            .areExactly(1, featureNamed("F1"));

        FeatureMetaData metadata = provider.getMetaData(new NamedFeature("F1"));
        assertThat(metadata).isNotNull();
        assertThat(metadata.getLabel()).isEqualTo("My Feature");
        assertThat(metadata.isEnabledByDefault()).isFalse();
        assertThat(metadata.getGroups()).isEmpty();
View Full Code Here

        Set<Feature> features = provider.getFeatures();
        assertThat(features)
            .hasSize(1)
            .areExactly(1, featureNamed("F1"));

        FeatureMetaData metadata = provider.getMetaData(new NamedFeature("F1"));
        assertThat(metadata).isNotNull();
        assertThat(metadata.getLabel()).isEqualTo("My Feature");
        assertThat(metadata.isEnabledByDefault()).isTrue();
        assertThat(metadata.getGroups()).isEmpty();
View Full Code Here

        Set<Feature> features = provider.getFeatures();
        assertThat(features)
            .hasSize(1)
            .areExactly(1, featureNamed("F1"));

        FeatureMetaData metadata = provider.getMetaData(new NamedFeature("F1"));
        assertThat(metadata).isNotNull();
        assertThat(metadata.getLabel()).isEqualTo("My Feature");
        assertThat(metadata.isEnabledByDefault()).isTrue();
        assertThat(metadata.getGroups()).isEmpty();
View Full Code Here

TOP

Related Classes of org.togglz.core.util.NamedFeature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.