Search in sources :

Example 11 with FF4jCacheProxy

use of org.ff4j.cache.FF4jCacheProxy in project ff4j by ff4j.

the class FeatureStoreStepDef method the_feature_store_is_cached.

@Given("^the feature store is cached$")
public void the_feature_store_is_cached() throws Throwable {
    FF4jCacheProxy proxy = new FF4jCacheProxy(ff4j.getFeatureStore(), null, new InMemoryCacheManager());
    ff4j.setFeatureStore(proxy);
}
Also used : InMemoryCacheManager(org.ff4j.cache.InMemoryCacheManager) FF4jCacheProxy(org.ff4j.cache.FF4jCacheProxy) Given(cucumber.api.java.en.Given)

Example 12 with FF4jCacheProxy

use of org.ff4j.cache.FF4jCacheProxy in project ff4j by ff4j.

the class PropertyStoreServices method clearCachedPropertyStore.

public void clearCachedPropertyStore() {
    FF4jCacheProxy cacheProxy = ff4j.getCacheProxy();
    if (cacheProxy == null) {
        throw new PropertyStoreNotCached();
    }
    cacheProxy.getCacheManager().clearProperties();
}
Also used : FF4jCacheProxy(org.ff4j.cache.FF4jCacheProxy) PropertyStoreNotCached(org.ff4j.services.exceptions.PropertyStoreNotCached)

Example 13 with FF4jCacheProxy

use of org.ff4j.cache.FF4jCacheProxy in project ff4j by ff4j.

the class MappingUtilsTest method testJsonMapping.

@Test
public void testJsonMapping() {
    JsonUtils.permissionsAsJson(null);
    JsonUtils.customPropertiesAsJson(null);
    JsonUtils.customPropertiesAsJson(new HashMap<String, Property<?>>());
    FeatureStore store1 = new InMemoryFeatureStore();
    FF4jCacheProxy proxy = new FF4jCacheProxy(store1, null, null);
    JsonUtils.cacheJson(proxy);
}
Also used : InMemoryFeatureStore(org.ff4j.store.InMemoryFeatureStore) PropertyString(org.ff4j.property.PropertyString) FF4jCacheProxy(org.ff4j.cache.FF4jCacheProxy) Property(org.ff4j.property.Property) InMemoryFeatureStore(org.ff4j.store.InMemoryFeatureStore) FeatureStore(org.ff4j.core.FeatureStore) Test(org.junit.Test)

Example 14 with FF4jCacheProxy

use of org.ff4j.cache.FF4jCacheProxy in project ff4j by ff4j.

the class FF4JServicesStepDef method the_feature_store_is_cached.

@Given("^the feature store is cached$")
public void the_feature_store_is_cached() throws Throwable {
    FF4jCacheProxy proxy = new FF4jCacheProxy(ff4j.getFeatureStore(), null, new InMemoryCacheManager());
    ff4j.setFeatureStore(proxy);
}
Also used : InMemoryCacheManager(org.ff4j.cache.InMemoryCacheManager) FF4jCacheProxy(org.ff4j.cache.FF4jCacheProxy) Given(cucumber.api.java.en.Given)

Example 15 with FF4jCacheProxy

use of org.ff4j.cache.FF4jCacheProxy in project ff4j by ff4j.

the class PropertyStoreServicesStepDef method the_property_store_is_cached.

@Given("^the property store is cached$")
public void the_property_store_is_cached() throws Throwable {
    FF4jCacheProxy proxy = new FF4jCacheProxy(ff4j.getFeatureStore(), ff4j.getPropertiesStore(), new InMemoryCacheManager());
    ff4j.setPropertiesStore(proxy);
    ff4j.setFeatureStore(proxy);
}
Also used : InMemoryCacheManager(org.ff4j.cache.InMemoryCacheManager) FF4jCacheProxy(org.ff4j.cache.FF4jCacheProxy) Given(cucumber.api.java.en.Given)

Aggregations

FF4jCacheProxy (org.ff4j.cache.FF4jCacheProxy)21 InMemoryCacheManager (org.ff4j.cache.InMemoryCacheManager)9 Test (org.junit.Test)9 Given (cucumber.api.java.en.Given)5 InMemoryFeatureStore (org.ff4j.store.InMemoryFeatureStore)5 PropertyString (org.ff4j.property.PropertyString)3 InMemoryPropertyStore (org.ff4j.property.store.InMemoryPropertyStore)3 ApiOperation (io.swagger.annotations.ApiOperation)2 ApiResponses (io.swagger.annotations.ApiResponses)2 HashSet (java.util.HashSet)2 POST (javax.ws.rs.POST)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 FF4JCacheManager (org.ff4j.cache.FF4JCacheManager)2 Feature (org.ff4j.core.Feature)2 FeatureStore (org.ff4j.core.FeatureStore)2 Property (org.ff4j.property.Property)2 FileItem (org.apache.commons.fileupload.FileItem)1 DiskFileItemFactory (org.apache.commons.fileupload.disk.DiskFileItemFactory)1 ServletFileUpload (org.apache.commons.fileupload.servlet.ServletFileUpload)1