@BeforeMethod
public void setup()
throws Exception
{
Bootstrap app = new Bootstrap(
new TestingNodeModule(),
new InMemoryEventModule(),
new TestingHttpServerModule(),
new JsonModule(),
new JaxrsModule(),
new Module()
{
@Override
public void configure(Binder binder)
{
binder.bind(QueryResource.class).in(Scopes.SINGLETON);
binder.bind(StageResource.class).in(Scopes.SINGLETON);
binder.bind(TaskResource.class).in(Scopes.SINGLETON);
binder.bind(QueryManager.class).to(MockQueryManager.class).in(Scopes.SINGLETON);
binder.bind(MockTaskManager.class).in(Scopes.SINGLETON);
binder.bind(TaskManager.class).to(Key.get(MockTaskManager.class)).in(Scopes.SINGLETON);
binder.bind(PagesResponseWriter.class).in(Scopes.SINGLETON);
binder.bind(InternalNodeManager.class).to(InMemoryNodeManager.class).in(Scopes.SINGLETON);
binder.bind(NodeManager.class).to(Key.get(InternalNodeManager.class)).in(Scopes.SINGLETON);
binder.bind(LocationFactory.class).to(HttpLocationFactory.class).in(Scopes.SINGLETON);
}
});
Injector injector = app
.strictConfig()
.doNotInitializeLogging()
.initialize();
lifeCycleManager = injector.getInstance(LifeCycleManager.class);