Examples of FeatureState


Examples of org.togglz.core.repository.FeatureState

    @Test
    public void shouldReturnFalseWhenCurrentVersionCannotBeResolved() {
        SystemProperty.applicationVersion.set("");
        ApplicationVersionActivationStrategy strategy = new ApplicationVersionActivationStrategy();
        FeatureState state = aVersionState(CURRENT_VERSION);
        boolean active = strategy.isActive(state, aFeatureUser(JOHN));
        Assert.assertFalse(active);
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

    }

    @Test
    public void shouldReturnTrueWhenMatchesServerCurrentVersion() {
        ApplicationVersionActivationStrategy strategy = new ApplicationVersionActivationStrategy();
        FeatureState state = aVersionState(CURRENT_VERSION);
        boolean active = strategy.isActive(state, aFeatureUser(JOHN));
        Assert.assertTrue(active);
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

    }

    @Test
    public void shouldReturnTrueWhenAtLeastOneOfTheVersionsMatchServerCurrentVersion() {
        ApplicationVersionActivationStrategy strategy = new ApplicationVersionActivationStrategy();
        FeatureState state = aVersionState(CURRENT_VERSION + ",alpha,dev,uat");
        boolean active = strategy.isActive(state, aFeatureUser(JOHN));
        Assert.assertTrue(active);
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

    }

    @Test
    public void shouldReturnFalseWhenNoneOfTheVersionsMatchTheServerCurrentVersion() {
        ApplicationVersionActivationStrategy strategy = new ApplicationVersionActivationStrategy();
        FeatureState state = aVersionState("test,alpha,dev,uat,rc1");
        boolean active = strategy.isActive(state, aFeatureUser(JOHN));
        Assert.assertFalse(active);
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

        boolean active = strategy.isActive(state, aFeatureUser(JOHN));
        Assert.assertFalse(active);
    }

    private FeatureState aVersionState(String lang) {
        return new FeatureState(ScriptFeature.FEATURE)
            .setStrategyId(ApplicationVersionActivationStrategy.ID)
            .setParameter(ApplicationVersionActivationStrategy.PARAM_VERSIONS, lang);
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

    @Before
    public void setUp() {
        helper.setUp();
        delegate = Mockito.mock(StateRepository.class);
        Mockito.when(delegate.getFeatureState(TestFeature.F1))
            .thenReturn(new FeatureState(TestFeature.F1, true));
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

            Thread.sleep(10);
        }
        assertTrue(ms.contains(repository.key(TestFeature.F1.name())));

        // now modify the feature state
        repository.setFeatureState(new FeatureState(TestFeature.F1, true));
        assertFalse(ms.contains(repository.key(TestFeature.F1.name())));

        // do some lookups
        for (int i = 0; i < 5; i++) {
            assertTrue(repository.getFeatureState(TestFeature.F1).isEnabled());
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

        return null;
    }

    @Override
    public FeatureState getFeatureState(Feature feature) {
        return new FeatureState(feature, isActive(feature));
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

        return null;
    }

    @Override
    public FeatureState getFeatureState(Feature feature) {
        return new FeatureState(feature, true);
    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

    @Test
    public void shouldReturnFalseForUnsupportedLanguage() {

        ScriptEngineActivationStrategy strategy = new ScriptEngineActivationStrategy();

        FeatureState state = aScriptState(UNKNOWN_LANGUAGE, SOME_SCRIPT);
        boolean active = strategy.isActive(state, aFeatureUser("john"));

        assertThat(active).isFalse();

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.