fmgasparino / google-gin

Automatically exported from code.google.com/p/google-gin
Apache License 2.0
0 stars 0 forks source link

Gin unit tests do not compile against GWT trunk #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Gin unit tests work fine against GWT 1.5, but when compiling them
against GWT trunk r4244 I get these compile errors:

    [javac] Compiling 62 source files to
/home/bstoler/src/gin/google-gin/out/test
    [javac]
/home/bstoler/src/gin/google-gin/test/com/google/gwt/inject/rebind/util/Abstract
UtilTester.java:108:
getCompilationState(com.google.gwt.core.ext.TreeLogger) in
com.google.gwt.dev.cfg.ModuleDef cannot be applied to ()
    [javac]         compilationState = userModule.getCompilationState();
    [javac]                                      ^
    [javac]
/home/bstoler/src/gin/google-gin/test/com/google/gwt/inject/rebind/util/Abstract
UtilTester.java:111:
cannot find symbol
    [javac] symbol  : method
addGeneratedCompilationUnit(com.google.gwt.dev.javac.CompilationUnit)
    [javac] location: class com.google.gwt.dev.javac.CompilationState
    [javac]           compilationState.addGeneratedCompilationUnit(unit);
    [javac]                           ^
    [javac]
/home/bstoler/src/gin/google-gin/test/com/google/gwt/inject/rebind/util/Abstract
UtilTester.java:114:
compile(com.google.gwt.core.ext.TreeLogger,java.util.Set<com.google.gwt.dev.java
c.CompilationUnit>)
in com.google.gwt.dev.javac.CompilationState cannot be applied to
(com.google.gwt.dev.util.log.PrintWriterTreeLogger)
    [javac]         compilationState.compile(logger);
    [javac]                         ^
    [javac]
/home/bstoler/src/gin/google-gin/test/com/google/gwt/inject/rebind/util/Abstract
UtilTester.java:134:
com.google.gwt.inject.rebind.util.AbstractUtilTester.MyJavaSourceFile is
not abstract and does not override abstract method isSuperSource() in
com.google.gwt.dev.javac.JavaSourceFile
    [javac]   private static class MyJavaSourceFile extends JavaSourceFile {
    [javac]                  ^
    [javac] 4 errors

Seems like this merge from 1.6 changed APIs we use:
http://code.google.com/p/google-web-toolkit/source/detail?spec=svn4375&r=4032

I am afraid that our tests are depending on internal implementation details
of GWT and thus are bound to break. We may need to reconsider how we do
these tests. r61 changed these tests from using EasyMock to using GWT
internals to create instances of the needed Java AST types.

@aragos: What do you think we can do?

Original issue reported on code.google.com by bstoler+code@google.com on 2 Jan 2009 at 7:51

GoogleCodeExporter commented 9 years ago
The changes mostly simplified the API and added some logging.  I attached a fix 
for
the issues below, but won't submit this for a while - unless we want to require 
GWT
1.6 to run the tests?

In general, I agree that we shouldn't rely on the inner workings of the GWT 
compiler.
 However, since there is no (reasonable [1]) framework to run tests against the GWT
AST, I fear we need to keep this dependency alive for now.  

[1] We could try to re-create the AST with EasyMock, but that would (a) still 
make us
dependent on the GWT implementation (since all mocks would have to exactly 
mirror
that) and (b) require a huge amount of work, since we have to exactly re-create 
the
AST generation.  Due to theses issues I don't think we can mock this out at the 
moment.

Original comment by aragos on 5 Jan 2009 at 5:09

Attachments:

GoogleCodeExporter commented 9 years ago
Hi aragos, could you not apply this patch until 1.6 comes out? Requiring the 
trunk to run tests will make building 
a new release very inconvenient (the build runs the tests, right?). Thank you.

Original comment by arthur.k...@gmail.com on 5 Jan 2009 at 2:24

GoogleCodeExporter commented 9 years ago
Since GWT 1.6 is now released, here's an up-to-date patch for our tests:
http://codereview.appspot.com/67106

Original comment by aragos on 25 May 2009 at 8:13

GoogleCodeExporter commented 9 years ago
Fixed in r103.

Original comment by bstoler+code@google.com on 31 May 2009 at 10:19

GoogleCodeExporter commented 9 years ago
Fixed in r103.

Original comment by bstoler+code@google.com on 31 May 2009 at 10:19