Search in sources :

Example 56 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FF4jTest method testInitCache.

@Test
public void testInitCache() {
    FF4j ff4j = new FF4j();
    ff4j.cache(new InMemoryCacheManager());
}
Also used : InMemoryCacheManager(org.ff4j.cache.InMemoryCacheManager) FF4j(org.ff4j.FF4j) Test(org.junit.Test)

Example 57 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FF4jTest method testgetProperty.

@Test
public void testgetProperty() {
    FF4j ff4j = new FF4j();
    ff4j.createProperty(new PropertyString("p1", "v1"));
    Assert.assertNotNull(ff4j.getProperty("p1"));
    Assert.assertNotNull(ff4j.getPropertyAsString("p1"));
    Assert.assertEquals("v1", ff4j.getPropertyAsString("p1"));
}
Also used : PropertyString(org.ff4j.property.PropertyString) FF4j(org.ff4j.FF4j) Test(org.junit.Test)

Example 58 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FeatureStoreJCacheTest method setUp.

/**
 * {@inheritDoc}
 */
@Before
public void setUp() throws Exception {
    ff4j = new FF4j();
    ff4j.setFeatureStore(initStore());
    testedStore = ff4j.getFeatureStore();
    assertFf4j = new AssertFf4j(ff4j);
}
Also used : AssertFf4j(org.ff4j.test.AssertFf4j) FF4j(org.ff4j.FF4j) Before(org.junit.Before)

Example 59 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FeatureStoreHttpSecured method testReadFeature.

@Test
public void testReadFeature() {
    String targetRestApiURL = "http://localhost:8080/api/ff4j/";
    String userName = "user";
    String userPassword = "userPass";
    // Init FF4j as HTTP CLIENT
    FF4j ff4j = new FF4j();
    ff4j.setFeatureStore(new FeatureStoreHttp(targetRestApiURL, userName, userPassword));
    ff4j.setPropertiesStore(new PropertyStoreHttp(targetRestApiURL, userName, userPassword));
    Feature f1 = ff4j.getFeatureStore().read("f1");
    System.out.println(f1);
}
Also used : FeatureStoreHttp(org.ff4j.web.jersey2.store.FeatureStoreHttp) PropertyStoreHttp(org.ff4j.web.jersey2.store.PropertyStoreHttp) FF4j(org.ff4j.FF4j) Feature(org.ff4j.core.Feature) Test(org.junit.Test)

Example 60 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FeatureStoreHttpTest method initializingInMemory.

/**
 * Start Server Grizzly before tests on remote FeatureStore.
 */
@BeforeClass
public static void initializingInMemory() throws Exception {
    // Reinit FF4J
    FeatureStoreHttpTestIT.ff4j = new FF4j(TEST_FEATURES_FILE);
    jt = new FeatureStoreHttpTestIT();
    jt.setUp();
}
Also used : FF4j(org.ff4j.FF4j) BeforeClass(org.junit.BeforeClass)

Aggregations

FF4j (org.ff4j.FF4j)60 Test (org.junit.Test)41 Before (org.junit.Before)9 Feature (org.ff4j.core.Feature)8 ArrayList (java.util.ArrayList)4 PropertyString (org.ff4j.property.PropertyString)4 InMemoryFeatureStore (org.ff4j.store.InMemoryFeatureStore)4 AssertFf4j (org.ff4j.test.AssertFf4j)4 InMemoryPropertyStore (org.ff4j.property.store.InMemoryPropertyStore)3 Date (java.util.Date)2 HashSet (java.util.HashSet)2 PropertyStoreAuditProxy (org.ff4j.audit.proxy.PropertyStoreAuditProxy)2 InMemoryCacheManager (org.ff4j.cache.InMemoryCacheManager)2 FeatureStore (org.ff4j.core.FeatureStore)2 PropertyDate (org.ff4j.property.PropertyDate)2 PropertyStore (org.ff4j.property.store.PropertyStore)2 SpringSecurityAuthorisationManager (org.ff4j.security.SpringSecurityAuthorisationManager)2 TestConstantsFF4j (org.ff4j.test.TestConstantsFF4j)2 ApiConfig (org.ff4j.web.ApiConfig)2 ApiConfigBuilder (org.ff4j.web.ApiConfigBuilder)2