Search in sources :

Example 1 with InjectorWriteContext

use of com.google.gwt.inject.rebind.util.InjectorWriteContext in project google-gin by gwtplus.

the class BindConstantBindingTest method assertCreationStatements.

/**
 * Verifies that invoking binding.getCreationStatements() produces no helper
 * methods, does not invoke any methods on the write context, and produces the
 * given statements.
 */
private void assertCreationStatements(Binding binding, String expectedStatements) throws NoSourceNameException {
    InjectorWriteContext writeContextMock = createMock(InjectorWriteContext.class);
    replay(writeContextMock);
    List<InjectorMethod> methods = new ArrayList<InjectorMethod>();
    String actualStatements = binding.getCreationStatements(null, methods).getSource(writeContextMock);
    assertEquals(expectedStatements, actualStatements);
    assertEquals(0, methods.size());
    verify(writeContextMock);
}
Also used : InjectorMethod(com.google.gwt.inject.rebind.util.InjectorMethod) ArrayList(java.util.ArrayList) InjectorWriteContext(com.google.gwt.inject.rebind.util.InjectorWriteContext)

Aggregations

InjectorMethod (com.google.gwt.inject.rebind.util.InjectorMethod)1 InjectorWriteContext (com.google.gwt.inject.rebind.util.InjectorWriteContext)1 ArrayList (java.util.ArrayList)1