From d96822ea80fb323fbb3302ba4db52f344b0cf959 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 6 May 2015 21:23:20 -0400 Subject: Bump the version to 1.3-SNAPSHOT. --- sangria-log4j/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sangria-log4j') diff --git a/sangria-log4j/pom.xml b/sangria-log4j/pom.xml index b91bb7e..2b9fe74 100644 --- a/sangria-log4j/pom.xml +++ b/sangria-log4j/pom.xml @@ -7,7 +7,7 @@ com.tavianator.sangria sangria - 1.2-SNAPSHOT + 1.3-SNAPSHOT sangria-log4j -- cgit v1.2.3 From 2abbfaa3e5b1cbfcf8e9f8c4d27d3f6762175459 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 6 May 2015 21:39:59 -0400 Subject: slf4j, log4j: Fix some tests that "broke" due to Guice fixes. --- .../sangria/log4j/SangriaLog4jModuleTest.java | 26 ++++++++++++---------- .../sangria/slf4j/SangriaSlf4jModuleTest.java | 26 ++++++++++++---------- 2 files changed, 28 insertions(+), 24 deletions(-) (limited to 'sangria-log4j') diff --git a/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java b/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java index a3ecd66..ce6982b 100644 --- a/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java +++ b/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java @@ -57,21 +57,23 @@ public class SangriaLog4jModuleTest { assertThat(provider.get().getName(), equalTo(LogManager.ROOT_LOGGER_NAME)); } + static class HasProviderMethod extends AbstractModule { + @Override + protected void configure() { + install(new SangriaLog4jModule()); + } + + @Provides + String getLoggerName(Logger logger) { + return logger.getName(); + } + } + @Test public void testProviderMethod() { - Injector injector = Guice.createInjector(new AbstractModule() { - @Override - protected void configure() { - install(new SangriaLog4jModule()); - } - - @Provides - String getLoggerName(Logger logger) { - return logger.getName(); - } - }); + Injector injector = Guice.createInjector(new HasProviderMethod()); - assertThat(injector.getInstance(String.class), equalTo(LogManager.ROOT_LOGGER_NAME)); + assertThat(injector.getInstance(String.class), equalTo(HasProviderMethod.class.getName())); } @Test diff --git a/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java b/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java index aaf72b2..07bf068 100644 --- a/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java +++ b/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java @@ -58,21 +58,23 @@ public class SangriaSlf4jModuleTest { assertThat(provider.get().getName(), equalTo(Logger.ROOT_LOGGER_NAME)); } + static class HasProviderMethod extends AbstractModule { + @Override + protected void configure() { + install(new SangriaSlf4jModule()); + } + + @Provides + String getLoggerName(Logger logger) { + return logger.getName(); + } + } + @Test public void testProviderMethod() { - Injector injector = Guice.createInjector(new AbstractModule() { - @Override - protected void configure() { - install(new SangriaSlf4jModule()); - } - - @Provides - String getLoggerName(Logger logger) { - return logger.getName(); - } - }); + Injector injector = Guice.createInjector(new HasProviderMethod()); - assertThat(injector.getInstance(String.class), equalTo(Logger.ROOT_LOGGER_NAME)); + assertThat(injector.getInstance(String.class), equalTo(HasProviderMethod.class.getName())); } @Test -- cgit v1.2.3 From 55e93141ff7f93cbecb341ad49d2811800569e0d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 6 May 2015 21:41:44 -0400 Subject: log4j: Add missing JavaDoc on test. --- .../test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sangria-log4j') diff --git a/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java b/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java index ce6982b..9dbc560 100644 --- a/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java +++ b/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java @@ -34,6 +34,8 @@ import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; /** + * Tests for {@link SangriaLog4jModule}. + * * @author Tavian Barnes (tavianator@tavianator.com) * @version 1.0 * @since 1.0 -- cgit v1.2.3