Сбой GWTTestCase с Guava 10.0.1 - трассировки стека жалуются на javax.annotation.Nullable - PullRequest
0 голосов
/ 03 ноября 2011

Я пишу код, используя ImmutableCollections.Я включил банки gwt-guava, guava и jsr305 в мой путь к классам.Я использую муравей для компиляции и запуска тестов.Я последовательно получаю ошибки времени выполнения на этапе выполнения теста GWT / Junit.Помимо самой трассировки стека, код ForwardingImmutableCollection помечается следующим образом. Означает ли это, что это не будет работать, пока ForwardingImmutableCollection не станет сериализуемой GWT?

// TODO: Сделать этот класс GWT сериализуемым.Класс ForwardingImmutableCollection extends ImmutableCollection {

Трассировка стека ошибок времени выполнения:

[junit] ------------- Standard Output ---------------
[junit] 0    [main] INFO  {gwt-log} () - database file path is /Users/glick/alpp-sqlite.db
[junit] 371  [main] INFO  {gwt-log} () - ProtocolServiceImpl.init
[junit] 371  [main] WARN  {gwt-log} () - This is a 'WARN' test message in ProtocolServiceImpl.init
[junit] 371  [main] ERROR {gwt-log} () - This is a 'ERROR' test message in ProtocolServiceImpl.init
[junit] 371  [main] FATAL {gwt-log} () - This is a 'FATAL' test message ProtocolServiceImpl.init
[junit] 1250 [main] ERROR {gwt-log} () - an UNKNOWN USER was encountered with userId "0"
[junit] 1751 [main] ERROR {gwt-log} () - an UNKNOWN USER was encountered with userId "11"
[junit] 1754 [main] ERROR {gwt-log} () - an UNKNOWN USER was encountered with userId "11"
[junit] 1764 [main] ERROR {gwt-log} () - an UNKNOWN USER was encountered with userId "11"
[junit] logging for HtmlUnit thread
[junit]    [WARN] Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://192.168.1.13:52522/com.abacalab.alpp.ALPP.JUnit/com.abacalab.alpp.ALPP.JUnit.nocache.js', but got 'application/x-javascript'.
[junit] [ERROR] Errors in 'jar:file:/m2-repo/com/google/guava/guava-gwt/10.0.1/guava-gwt-10.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableCollection.java'
[junit]    [ERROR] Line 21: The import javax.annotation.Nullable cannot be resolved
[junit]    [ERROR] Line 42: Nullable cannot be resolved to a type
[junit] [ERROR] Errors in 'jar:file:/m2-repo/com/google/guava/guava-gwt/10.0.1/guava-gwt-10.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableCollection.java'
[junit]    [ERROR] Line 25: The import javax.annotation.Nullable cannot be resolved
[junit]    [ERROR] Line 67: Nullable cannot be resolved to a type
[junit] ------------- ---------------- ---------------
[junit] Testcase: testStub(com.abacalab.alpp.client.GwtRpcStubTest):    Caused an ERROR
[junit] Remote test failed at 192.168.1.13 / Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
[junit] java.lang.RuntimeException: Remote test failed at 192.168.1.13 / Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
[junit]     at com.google.gwt.junit.JUnitShell.processTestResult(JUnitShell.java:1288)
[junit]     at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1408)
[junit]     at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1309)
[junit]     at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:653)
[junit]     at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:441)
[junit]     at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:296)
[junit] Caused by: java.lang.Error: Unresolved compilation problems: 
[junit]     The import javax.annotation.Nullable cannot be resolved
[junit]     Nullable cannot be resolved to a type
[junit] 
[junit]     at com.google.common.collect.ForwardingImmutableCollection.<init>(ForwardingImmutableCollection.java:21)
[junit]     at com.google.common.collect.ImmutableSet.<init>(ImmutableSet.java:44)
[junit]     at com.google.common.collect.ImmutableSet.<init>(ImmutableSet.java:48)
[junit]     at com.google.common.collect.EmptyImmutableSet.<init>(EmptyImmutableSet.java:24)
[junit]     at com.google.common.collect.EmptyImmutableSet.<clinit>(EmptyImmutableSet.java:26)
[junit]     at com.google.common.collect.ImmutableSet.of(ImmutableSet.java:54)
[junit]     at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:125)
[junit]     at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:120)
[junit]     at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:110)
[junit]     at com.abacalab.alpp.shared.ConcretePrivilegeSetProvider.getPrivilegeSet(ConcretePrivilegeSetProvider.java:88)

1 Ответ

0 голосов
/ 07 ноября 2011

Похоже, вам просто нужно вставить jsr305 в ваш classpath:

Caused by: java.lang.Error: Unresolved compilation problems: 
[junit]     The import javax.annotation.Nullable cannot be resolved
[junit]     Nullable cannot be resolved to a type
...