Package org.ff4j

Examples of org.ff4j.FF4j


        testingGeneratedFF4j(f2);
    }

    @Test
    public void testInitConstructor3() {
        FF4j f3 = new FF4j();
        f3.setAuthorizationsManager(mock(AuthorizationsManager.class));
        f3.autoCreate(true);

        testingGeneratedFF4j(f3);
        Assert.assertNotNull(f3.getAuthorizationsManager());
    }
View Full Code Here


public class ReleaseDateFlipStrategyTest extends AbstractFf4jTest {

    /** {@inheritDoc} */
    @Override
    public FF4j initFF4j() {
        return new FF4j("test-releaseDateStrategyTest-ok.xml");
    }
View Full Code Here

*/
public class FF4jTest extends AbstractFf4jTest {

    @Override
    public FF4j initFF4j() {
        return new FF4j("ff4j.xml");
    }
View Full Code Here

    @Test
    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
        assertTrue(ff4j.exist("autoCreatedFeature"));
    }
View Full Code Here

    @Test
    public void workingWithFeature() {

        // Initialize with empty store
        FF4j ff4j = new FF4j();

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

        // Assertions
        assertTrue(ff4j.exist("f1"));
        assertTrue(ff4j.check("f1"));
    }
View Full Code Here

    /** {@inheritDoc} */
    @Override
    public FF4j initFF4j() {
        // TOTO initialization through Java CODE ?
        return new FF4j("test-ponderationStrategy-ok.xml");
    }
View Full Code Here

        Assert.assertTrue("both result occured", nbOK > 0 && nbKO > 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testKOParameter() {
        new FF4j("test-ponderationStrategy-ko.xml");
    }
View Full Code Here

    // enabling...

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

    // disabling...

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

        Assert.assertFalse(ff4j.check("newffff"));
    }

    @Test(expected = FeatureNotFoundException.class)
    public void testDisableFeatureNotExist() {
        FF4j ff4j = new FF4j();
        ff4j.disable("newffff");
    }
View Full Code Here

TOP

Related Classes of org.ff4j.FF4j

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.