Permalink
Browse files

Fix formatting of TestTestingHttpServer

  • Loading branch information...
1 parent 5512996 commit b66a02cbb82c64a881ec4fe47412f564b1477bfc @electrum committed Mar 7, 2012
@@ -151,20 +151,18 @@ public void testGuiceInjectionWithoutFilters()
try {
Injector injector = Guice.createInjector(
- new TestingNodeModule(),
- new TestingHttpServerModule(),
- new ConfigurationModule(new ConfigurationFactory(Collections.<String, String>emptyMap())),
- new Module()
- {
- @Override
- public void configure(Binder binder)
+ new TestingNodeModule(),
+ new TestingHttpServerModule(),
+ new ConfigurationModule(new ConfigurationFactory(Collections.<String, String>emptyMap())),
+ new Module()
{
- binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(servlet);
- binder.bind(new TypeLiteral<Map<String, String>>()
+ @Override
+ public void configure(Binder binder)
{
- }).annotatedWith(TheServlet.class).toInstance(ImmutableMap.<String, String>of());
- }
- });
+ binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(servlet);
+ binder.bind(new TypeLiteral<Map<String, String>>(){}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.<String, String>of());
+ }
+ });
server = injector.getInstance(TestingHttpServer.class);
server.start();
@@ -199,28 +197,27 @@ public void testGuiceInjectionWithFilters()
try {
Injector injector = Guice.createInjector(
- new TestingNodeModule(),
- new TestingHttpServerModule(),
- new ConfigurationModule(new ConfigurationFactory(Collections.<String, String>emptyMap())),
- new Module()
- {
- @Override
- public void configure(Binder binder)
+ new TestingNodeModule(),
+ new TestingHttpServerModule(),
+ new ConfigurationModule(new ConfigurationFactory(Collections.<String, String>emptyMap())),
+ new Module()
{
- binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(servlet);
- binder.bind(new TypeLiteral<Map<String, String>>()
+ @Override
+ public void configure(Binder binder)
{
- }).annotatedWith(TheServlet.class).toInstance(ImmutableMap.<String, String>of());
- }
- },
- new Module()
- {
- @Override
- public void configure(Binder binder)
+ binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(servlet);
+ binder.bind(new TypeLiteral<Map<String, String>>(){}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.<String, String>of());
+ }
+ },
+ new Module()
{
- Multibinder.newSetBinder(binder, Filter.class, TheServlet.class).addBinding().toInstance(filter);
+ @Override
+ public void configure(Binder binder)
+ {
+ Multibinder.newSetBinder(binder, Filter.class, TheServlet.class).addBinding().toInstance(filter);
+ }
}
- });
+ );
server = injector.getInstance(TestingHttpServer.class);
server.start();
@@ -316,7 +313,7 @@ protected synchronized void doGet(HttpServletRequest req, HttpServletResponse re
}
static class DummyFilter
- implements Filter
+ implements Filter
{
private final AtomicInteger callCount = new AtomicInteger();
@@ -344,5 +341,4 @@ public void destroy()
{
}
}
-
}

0 comments on commit b66a02c

Please sign in to comment.