Package org.ff4j

Examples of org.ff4j.FF4j.exist()


    public void autoCreateFeatureEnableTest() {

        // Default : store = inMemory, load features from ff4j.xml file
        FF4j ff4j = new FF4j("ff4j.xml");
        ff4j.setAutocreate(true);
        assertFalse(ff4j.exist("autoCreatedFeature"));

        // Auto creation by testing its value
        assertFalse(ff4j.check("autoCreatedFeature"));

        // Assertion
View Full Code Here


        // Auto creation by testing its value
        assertFalse(ff4j.check("autoCreatedFeature"));

        // Assertion
        assertTrue(ff4j.exist("autoCreatedFeature"));
    }

    @Test
    public void workingWithFeature() {
View Full Code Here

        // Dynamically register new features
        ff4j.create("f1").enable("f1");

        // Assertions
        assertTrue(ff4j.exist("f1"));
        assertTrue(ff4j.check("f1"));
    }

    // enabling...
View Full Code Here

    @Test
    public void testEnableFeature() {
        FF4j ff4j = new FF4j();
        ff4j.autoCreate(true);
        ff4j.enable("newffff");
        Assert.assertTrue(ff4j.exist("newffff"));
        Assert.assertTrue(ff4j.check("newffff"));
    }

    @Test(expected = FeatureNotFoundException.class)
    public void testEnableFeatureNotExist() {
View Full Code Here

    @Test
    public void testDisableFeature() {
        FF4j ff4j = new FF4j();
        ff4j.autoCreate(true);
        ff4j.disable("newffff");
        Assert.assertTrue(ff4j.exist("newffff"));
        Assert.assertFalse(ff4j.check("newffff"));
    }

    @Test(expected = FeatureNotFoundException.class)
    public void testDisableFeatureNotExist() {
View Full Code Here

                displayError("Cannot find FF4J bean as attribute (" + getFf4jAttributeName() + ") in any scope.");
                return SKIP_BODY;
            }

            // Handle where feature doe not exist
            if (!ff4j.exist(getFeatureid())) {
                displayError("Cannot find feature (" + getFeatureid() + ") anywhere.");
                return SKIP_BODY;
            }

            // Everything is OK
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.