Examples of PonderationStrategy


Examples of org.ff4j.strategy.PonderationStrategy

     */
    @Test
    public void testUpdateFeatureCoreData() {
        // Parameters
        String newDescription = "new-description";
        FlippingStrategy newStrategy = new PonderationStrategy(0.12);
        // Given
        assertFf4j.assertThatFeatureExist(F1);
        Assert.assertFalse(newDescription.equals(testedStore.read(F1).getDescription()));
        // When
        Feature fpBis = testedStore.read(F1);
        fpBis.setDescription(newDescription);
        fpBis.setFlippingStrategy(newStrategy);
        testedStore.update(fpBis);
        // Then
        Feature updatedFeature = testedStore.read(F1);
        Assert.assertTrue(newDescription.equals(updatedFeature.getDescription()));
        Assert.assertEquals(newStrategy.toString(), updatedFeature.getFlippingStrategy().toString());
    }
View Full Code Here

Examples of org.ff4j.strategy.PonderationStrategy

    }

    @Test
    public void testFullToStringImpl() {
        List<String> auths = Arrays.asList(new String[] {"something"});
        Feature f = new Feature("ok", true, "grp1", "description", auths, new PonderationStrategy());
        Assert.assertTrue(f.toString().contains("ok"));
    }
View Full Code Here

Examples of org.ff4j.strategy.PonderationStrategy

    public void testBuildFromScratchFeature() {
        Feature empty = new Feature("abc");
        empty.setUid("abc");

        // Flipping strategy
        empty.setFlippingStrategy(new PonderationStrategy());
        Assert.assertNotNull(empty.getFlippingStrategy());

        // Authorization filling
        List<String> auths = Arrays.asList(new String[] {"something"});
        empty.setPermissions(new HashSet<String>(auths));
View Full Code Here

Examples of org.ff4j.strategy.PonderationStrategy

    }

    @Test
    public void testUnitFeatureInitialization() {
        InMemoryFeatureStore imfs = new InMemoryFeatureStore();
        imfs.create(new Feature("default", true, "grp1", "desc", null, new PonderationStrategy()));
        Assert.assertEquals(1, imfs.readAll().size());
    }
View Full Code Here

Examples of org.ff4j.strategy.PonderationStrategy

        new FF4j("test-ponderationStrategy-ko.xml");
    }

    @Test
    public void testInitializationThroughIOc() {
        PonderationStrategy pfs = new PonderationStrategy();
        pfs.setWeight(0.5);
    }
View Full Code Here

Examples of org.ff4j.strategy.PonderationStrategy

     */
    @Test
    public void testUpdateFeatureCoreData() {
        // Parameters
        String newDescription = "new-description";
        FlippingStrategy newStrategy = new PonderationStrategy(0.12);
        // Given
        assertFf4j.assertThatFeatureExist(F1);
        Assert.assertFalse(newDescription.equals(testedStore.read(F1).getDescription()));
        // When
        Feature fpBis = testedStore.read(F1);
        fpBis.setDescription(newDescription);
        fpBis.setFlippingStrategy(newStrategy);
        testedStore.update(fpBis);
        // Then
        Feature updatedFeature = testedStore.read(F1);
        Assert.assertTrue(newDescription.equals(updatedFeature.getDescription()));
        Assert.assertNotNull(updatedFeature.getFlippingStrategy());
        Assert.assertEquals(newStrategy.toString(), updatedFeature.getFlippingStrategy().toString());
    }
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.