Search in sources :

Example 1 with BeansManager

use of com.stanfy.enroscar.beans.BeansManager in project enroscar by stanfy.

the class CacheSwitcherTest method setupCache.

@Before
public void setupCache() throws IOException {
    final BeansManager beansManager = BeansManager.get(Robolectric.application);
    cache1 = (SimpleFileCache) beansManager.getContainer().getBean("testCache1", SimpleFileCache.class);
    cache2 = (SimpleFileCache) beansManager.getContainer().getBean("testCache2", SimpleFileCache.class);
}
Also used : BeansManager(com.stanfy.enroscar.beans.BeansManager) Before(org.junit.Before)

Example 2 with BeansManager

use of com.stanfy.enroscar.beans.BeansManager in project enroscar by stanfy.

the class RemoteServerApiConfigurationTest method configureBean.

@Before
public void configureBean() {
    BeansManager manager = BeansManager.get(Robolectric.application);
    manager.edit().put("defaultCacheBeanName", new DummyResponseCache()).put("defaultContentHandlerName", new StringContentHandler(Robolectric.application)).put(RemoteServerApiConfiguration.class).commit();
    RemoteServerApiConfiguration config = manager.getContainer().getBean(RemoteServerApiConfiguration.class);
    config.setDefaultCacheBeanName("defaultCacheBeanName");
    config.setDefaultContentHandlerName("defaultContentHandlerName");
}
Also used : BeansManager(com.stanfy.enroscar.beans.BeansManager) StringContentHandler(com.stanfy.enroscar.rest.response.handler.StringContentHandler) RemoteServerApiConfiguration(com.stanfy.enroscar.rest.RemoteServerApiConfiguration) DummyResponseCache(com.stanfy.enroscar.net.test.cache.DummyResponseCache) Before(org.junit.Before)

Aggregations

BeansManager (com.stanfy.enroscar.beans.BeansManager)2 Before (org.junit.Before)2 DummyResponseCache (com.stanfy.enroscar.net.test.cache.DummyResponseCache)1 RemoteServerApiConfiguration (com.stanfy.enroscar.rest.RemoteServerApiConfiguration)1 StringContentHandler (com.stanfy.enroscar.rest.response.handler.StringContentHandler)1