Package com.google.gwt.inject.rebind.util

Examples of com.google.gwt.inject.rebind.util.GuiceUtil


  public void testTwoUnnamedStringAnnotations() {
    try {
      new FactoryBinding(Collections.<Key<?>, TypeLiteral<?>>emptyMap(),
          Key.get(TwoUnnamedStringsFactory.class), CONTEXT,
          new GuiceUtil(createInjectableCollector()), null);
      fail("Expected ConfigurationException.");
    } catch (ConfigurationException e) {
      assertTrue(e.getMessage().contains("has more than one parameter of type " +
          "java.lang.String annotated with @Assisted(\"\")."));
    }
View Full Code Here


  public void testDuplicateNamedAssistedAnnotations() {
    try {
      new FactoryBinding(Collections.<Key<?>, TypeLiteral<?>>emptyMap(),
          Key.get(TwoAssistedFooStringsFactory.class), CONTEXT,
          new GuiceUtil(createInjectableCollector()), null);
      fail("Expected ConfigurationException.");
    } catch (ConfigurationException e) {
      assertTrue(e.getMessage().contains("has more than one parameter of type " +
          "java.lang.String annotated with @Assisted(\"foo\")."));
    }
View Full Code Here

  }

  public void testWorkingEmptyAssistedAnnotations() {
    new FactoryBinding(Collections.<Key<?>, TypeLiteral<?>>emptyMap(),
        Key.get(UnnamedStringAndIntegerFactory.class), CONTEXT,
        new GuiceUtil(createInjectableCollector()), null);
    // Just testing that there are no exceptions thrown during configuration.
  }
View Full Code Here

  }

  public void testWorkingNamedAssistedAnnotations() {
    new FactoryBinding(Collections.<Key<?>, TypeLiteral<?>>emptyMap(),
        Key.get(StringIntegerWithSameAssistedValueFactory.class), CONTEXT,
        new GuiceUtil(createInjectableCollector()), null);
    // Just testing that there are no exceptions thrown during configuration.
  }
View Full Code Here

  public void testMismatchedFactoryAndClassAnnotations() {
    try {
      new FactoryBinding(Collections.<Key<?>, TypeLiteral<?>>emptyMap(),
          Key.get(MismatchedFactoryAndClassAssistedValuesFactory.class), CONTEXT,
          new GuiceUtil(createInjectableCollector()), null);
      fail("Expected ConfigurationException.");
    } catch (ConfigurationException e) {
      assertTrue(e.getMessage(), e.getMessage().contains("has no constructors matching " +
          "the parameters in method"));
    }
View Full Code Here

      Set<Module> modules = new HashSet<Module>();
      for (Class<? extends GinModule> literal : classLiterals) {
         LOGGER.debug("wrapping GinModule literal " + literal);
         MemberCollector memberCollector = new MemberCollector(GwtTreeLogger.get());
         GuiceUtil guiceUtil = new GuiceUtil(memberCollector);
         modules.add(new GinModuleAdapter(literal.newInstance(), new GinjectorBindings(null,
                  GwtTreeLogger.get(), guiceUtil, ginectorClass, null, memberCollector, null, null)));
      }

      return modules;
View Full Code Here

TOP

Related Classes of com.google.gwt.inject.rebind.util.GuiceUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.