Author: limpbizkit
Date: Thu Jun 11 22:31:32 2009
New Revision: 1013

Modified:
    trunk/test/com/google/inject/ImplicitBindingTest.java

Log:
Failing test for issue 319.

Modified: trunk/test/com/google/inject/ImplicitBindingTest.java
==============================================================================
--- trunk/test/com/google/inject/ImplicitBindingTest.java       (original)
+++ trunk/test/com/google/inject/ImplicitBindingTest.java       Thu Jun 11  
22:31:32 2009
@@ -103,4 +103,35 @@
      }
    }

+  /**
+   * When we're building the binding for A, we temporarily insert that  
binding to support circular
+   * dependencies. And so we can successfully create a binding for B. But  
later, when the binding
+   * for A ultimately fails, we need to clean up the dependent binding for  
B.
+   */
+  public void testCircularJitBindingsLeaveNoResidue() {
+    Injector injector = Guice.createInjector();
+
+    try {
+      injector.getBinding(A.class);
+      fail();
+    } catch (ConfigurationException expected) {
+    }
+
+    try {
+      injector.getBinding(B.class);
+      fail();
+    } catch (ConfigurationException expected) {
+    }
+  }
+
+  static class A {
+    @Inject B b;
+    @Inject D d;
+  }
+
+  static class B {
+    @Inject A a;
+  }
+
+  interface D {}
  }

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to