Search in sources :

Example 36 with EzyBeanContext

use of com.tvd12.ezyfox.bean.EzyBeanContext in project calabash by youngmonkeys.

the class LocalBaseTest method newBeanContext.

protected EzyBeanContext newBeanContext() {
    MongoClient mongoClient = newMongoClient();
    EzyBeanContextBuilder builder = EzyBeanContext.builder().addSingleton("mongoClient", mongoClient).scan("com.tvd12.calabash.local.test.mappersist");
    addAutoImplMongoRepo(builder, mongoClient);
    return builder.build();
}
Also used : MongoClient(com.mongodb.MongoClient) EzyBeanContextBuilder(com.tvd12.ezyfox.bean.EzyBeanContextBuilder)

Example 37 with EzyBeanContext

use of com.tvd12.ezyfox.bean.EzyBeanContext in project ezyfox-examples by tvd12.

the class EzyFoxBeanExample method main.

public static void main(String[] args) {
    final EzyBeanContext beanContext = EzyBeanContext.builder().scan("com.tvd12.ezyfox.example.bean").build();
    final BookController bookController = (BookController) beanContext.getBean(BookController.class);
    bookController.saveBook(new Book(1L, "EzyFox in action"));
}
Also used : EzyBeanContext(com.tvd12.ezyfox.bean.EzyBeanContext) Book(com.tvd12.ezyfox.example.bean.entity.Book) BookController(com.tvd12.ezyfox.example.bean.controller.BookController)

Aggregations

EzyBeanContext (com.tvd12.ezyfox.bean.EzyBeanContext)25 Test (org.testng.annotations.Test)15 ApplicationContextBuilder (com.tvd12.ezyhttp.server.core.ApplicationContextBuilder)6 ResourceResolver (com.tvd12.ezyhttp.server.core.resources.ResourceResolver)6 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)6 EzyBeanContextBuilder (com.tvd12.ezyfox.bean.EzyBeanContextBuilder)5 ResourceDownloadManager (com.tvd12.ezyhttp.core.resources.ResourceDownloadManager)5 ApplicationContext (com.tvd12.ezyhttp.server.core.ApplicationContext)5 ViewContextBuilder (com.tvd12.ezyhttp.server.core.view.ViewContextBuilder)5 ViewContext (com.tvd12.ezyhttp.server.core.view.ViewContext)4 List (java.util.List)4 Calabash (com.tvd12.calabash.Calabash)3 SimpleEntityMapPersistFactory (com.tvd12.calabash.persist.factory.SimpleEntityMapPersistFactory)3 EzyReflection (com.tvd12.ezyfox.reflect.EzyReflection)3 EzyFeatureCommandManager (com.tvd12.ezyfoxserver.support.manager.EzyFeatureCommandManager)3 EzyRequestCommandManager (com.tvd12.ezyfoxserver.support.manager.EzyRequestCommandManager)3 MongoClient (com.mongodb.MongoClient)2 StatisticsAware (com.tvd12.calabash.core.statistic.StatisticsAware)2 CalabashBuilder (com.tvd12.calabash.local.CalabashBuilder)2 SimpleEntityMapPersistSetting (com.tvd12.calabash.local.setting.SimpleEntityMapPersistSetting)2