How to make the Logger snippet work [message #1785371] |
Fri, 13 April 2018 06:54  |
Janos Gyerik Messages: 1 Registered: April 2018 |
Junior Member |
|
|
Hi,
I read with great interest the Logger snippet on the Snippets page in the docs.
For a sanity test I tried to run it exactly as it is posted. Note that the post has compile errors, this is how I fixed it:
https://gist.github.com/janos-ss/775681899842947eb7472220890e293b#file-loggertest-java
And if I run this, I get the following failures:
-------------------------------------------------------------------------------
Test set: org.sonarlint.eclipse.its.LoggerTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.101 sec <<< FAILURE! - in org.sonarlint.eclipse.its.LoggerTest
org.sonarlint.eclipse.its.LoggerTest Time elapsed: 0.095 sec <<< ERROR!
java.lang.IllegalArgumentException: Logging bundle must not be null.
at org.eclipse.core.internal.runtime.Log.<init>(Log.java:30)
at org.eclipse.core.internal.runtime.InternalPlatform.getLog(InternalPlatform.java:351)
at org.eclipse.core.runtime.Platform.getLog(Platform.java:976)
at org.sonarlint.eclipse.its.LoggerTest.getLog(LoggerTest.java:56)
at org.sonarlint.eclipse.its.LoggerTest.registerLog(LoggerTest.java:47)
org.sonarlint.eclipse.its.LoggerTest Time elapsed: 0.101 sec <<< ERROR!
java.lang.IllegalArgumentException: Logging bundle must not be null.
at org.eclipse.core.internal.runtime.Log.<init>(Log.java:30)
at org.eclipse.core.internal.runtime.InternalPlatform.getLog(InternalPlatform.java:351)
at org.eclipse.core.runtime.Platform.getLog(Platform.java:976)
at org.sonarlint.eclipse.its.LoggerTest.getLog(LoggerTest.java:56)
at org.sonarlint.eclipse.its.LoggerTest.unregisterLog(LoggerTest.java:52)
The problem seems to be that Platform.getBundle("org.eclipse.swtbot") returns null, and I don't know how to fix that. Any ideas?
Thanks,
Janos
PS: It would be good to fix the Snippets page, because the example as given doesn't compile.
|
|
|
|
Powered by
FUDForum. Page generated in 0.01838 seconds