Author: limpbizkit
Date: Sun Apr 26 13:36:42 2009
New Revision: 935
Modified:
trunk/test/com/google/inject/CircularDependencyTest.java
Log:
User reported testcase for bug 349.
Modified: trunk/test/com/google/inject/CircularDependencyTest.java
==============================================================================
--- trunk/test/com/google/inject/CircularDependencyTest.java (original)
+++ trunk/test/com/google/inject/CircularDependencyTest.java Sun Apr 26
13:36:42 2009
@@ -83,4 +83,32 @@
static class D {
@Inject D(C c) {}
}
+
+ /**
+ * As reported by issue 349, we give a lousy trace when a class is
circularly
+ * dependent on itself in multiple ways.
+ */
+ public void testCircularlyDependentMultipleWays() {
+ Injector injector = Guice.createInjector(new AbstractModule() {
+ protected void configure() {
+ binder.bind(A.class).to(E.class);
+ binder.bind(B.class).to(E.class);
+ }
+ });
+ injector.getInstance(A.class);
+ }
+
+ @Singleton
+ static class E implements A, B {
+ @Inject
+ public E(A a, B b) {}
+
+ public B getB() {
+ return this;
+ }
+
+ public A getA() {
+ return this;
+ }
+ }
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---