use of org.ff4j.strategy.PonderationStrategy in project ff4j by ff4j.
the class PonderationStrategyTest method testInitializations.
@Test
public void testInitializations() {
PonderationStrategy pfs = new DarkLaunchStrategy();
pfs.setWeight(0.5);
new DarkLaunchStrategy(0.5);
}
use of org.ff4j.strategy.PonderationStrategy in project ff4j by ff4j.
the class FeatureStoreNeo4jLimitTest method testChangeGroup.
@Test
public void testChangeGroup() {
try (Transaction tx = graphDb.beginTx()) {
graphDb.execute("CREATE " + " (h0:FF4J_FEATURE_GROUP { name:'h0' }),\n" + " (h1:FF4J_FEATURE { uid:'h1', enable:false, description:'second', roles:['USER'] }),\n" + " (h1)-[:MEMBER_OF]->(h0);");
tx.success();
}
Feature f1 = testedStore.read("h1");
Property<?> newP = new PropertyString("ppp", "vvv");
newP.setDescription("a description");
f1.addProperty(newP);
FlippingStrategy fs = new PonderationStrategy(0.1);
fs.getInitParams().put("p1", "v1");
fs.getInitParams().put("p2", "v2");
f1.setFlippingStrategy(fs);
f1.setGroup("g2");
testedStore.update(f1);
Assert.assertEquals("g2", testedStore.read("h1").getGroup());
f1.getFlippingStrategy().getInitParams().put("p3", "v3");
testedStore.update(f1);
testedStore.setGraphDb(testedStore.getGraphDb());
}
Aggregations