Package org.ff4j

Examples of org.ff4j.FF4j


        ff4j.disable("newffff");
    }

    @Test
    public void testGetFeatures() {
        FF4j ff4j = new FF4j("ff4j.xml");
        Assert.assertEquals(5, ff4j.getFeatures().size());
    }
View Full Code Here


    public void testGetFeature_DoesNotExistAutoCreate() {}

    @Test
    public void testFlipped() {
        FF4j ff4j = new FF4j().autoCreate(true).create(
                new Feature("coco", true, "grp2", "", Arrays.asList(new String[] {"ROLEA"})));
        Assert.assertTrue(ff4j.check("coco"));
        ff4j.setAuthorizationsManager(mockAuthManager);
        Assert.assertTrue(ff4j.check("coco"));
        FlippingExecutionContext ex = new FlippingExecutionContext();
        ex.putString("OK", "OK");
        Assert.assertTrue(ff4j.check("coco", ex));
        Assert.assertTrue(ff4j.checkOveridingStrategy("coco", mockFlipStrategy));
        Assert.assertTrue(ff4j.checkOveridingStrategy("coco", null, null));
        Assert.assertFalse(ff4j.checkOveridingStrategy("cocorico", mockFlipStrategy));
    }
View Full Code Here

public class ServerFilterStrategyTest extends AbstractFf4jTest {

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

public class OfficeHoursFlippingStrategyTest  {
 
  @Test
  public void testExpression() throws Exception {
   
    new FF4j("ff4j-office.xml");
    //Assert.assertTrue(FF4j.isFlipped("displayCallMeButton"));
   
  }
View Full Code Here

    /** {@inheritDoc} */
    @Override
    public int doStartTag() throws JspException {
        try {

            FF4j ff4j = (FF4j) pageContext.findAttribute(getFf4jAttributeName());

            // Handle where no ff4j available
            if (ff4j == null) {
                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

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.