Package org.togglz.core.metadata

Examples of org.togglz.core.metadata.FeatureMetaData


    }

    @Override
    public FeatureMetaData getMetaData(Feature feature) {
        Validate.notNull(feature, "feature is required");
        FeatureMetaData metadata = featureProvider.getMetaData(feature);
        if (metadata != null) {
            return metadata;
        }
        return new EmptyFeatureMetaData(feature);
    }
View Full Code Here


        List<ActivationStrategy> strategies = featureManager.getActivationStrategies();

        IndexPageTabView tabView = new IndexPageTabView(strategies);

        for (Feature feature : featureManager.getFeatures()) {
            FeatureMetaData metadata = featureManager.getMetaData(feature);
            FeatureState featureState = featureManager.getFeatureState(feature);
            tabView.add(feature, metadata, featureState);
        }

        Map<String, Object> model = new HashMap<String, Object>();
View Full Code Here

        if (feature == null) {
            response.sendError(403);
            return;
        }

        FeatureMetaData metadata = featureManager.getMetaData(feature);
        List<ActivationStrategy> impls = featureManager.getActivationStrategies();
        FeatureModel featureModel = new FeatureModel(feature, metadata, impls);

        // GET requests for this feature
        if ("GET".equals(request.getMethod())) {
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

        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())
            .hasSize(1)
            .areExactly(1, groupNamed("Group1"));

    }
View Full Code Here

        assertThat(features)
            .hasSize(2)
            .areExactly(1, featureNamed("ID_1"))
            .areExactly(1, featureNamed("ID_2"));

        FeatureMetaData metadata1 = provider.getMetaData(new NamedFeature("ID_1"));
        assertThat(metadata1).isNotNull();
        assertThat(metadata1.getLabel()).isEqualTo("ID 1");
        assertThat(metadata1.isEnabledByDefault()).isTrue();
        assertThat(metadata1.getGroups())
            .hasSize(2)
            .areExactly(1, groupNamed("Group 1"))
            .areExactly(1, groupNamed("Group Other"));

        FeatureMetaData metadata2 = provider.getMetaData(new NamedFeature("ID_2"));
        assertThat(metadata2).isNotNull();
        assertThat(metadata2.getLabel()).isEqualTo("ID 2");
        assertThat(metadata2.isEnabledByDefault()).isFalse();
        assertThat(metadata2.getGroups())
            .hasSize(1)
            .areExactly(1, groupNamed("Group 2"));

    }
View Full Code Here

    @Test
    public void shouldReturnMetaDataWithCorrectLabel() {

        FeatureProvider provider = new EnumBasedFeatureProvider(ValidFeatureEnum.class);
        FeatureMetaData metaData = provider.getMetaData(ValidFeatureEnum.FEATURE1);
        assertThat(metaData.getLabel()).isEqualTo("First feature");

    }
View Full Code Here

TOP

Related Classes of org.togglz.core.metadata.FeatureMetaData

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.