Cannot inject IHyperlinkHelper in junit [message #1705695] |
Tue, 18 August 2015 08:26  |
Eclipse User |
|
|
|
Hi,
I am trying to make a junit test for hyperlinking. I already implemented by hyperlinkHelper for my language in the UI module and added its binding in the UIModule class (configure method).
I was trying to add
@Inject
private IHyperlinkHelper hyperlink;
to my test but it is always giving me this error
com.google.inject.ConfigurationException: Guice configuration errors:
1) No implementation for org.eclipse.xtext.ui.resource.IStorage2UriMapper was bound.
while locating org.eclipse.xtext.ui.resource.IStorage2UriMapper
for field at org.eclipse.xtext.ui.editor.GlobalURIEditorOpener.mapper(Unknown Source)
while locating org.eclipse.xtext.ui.editor.IURIEditorOpener
for field at org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink.uriEditorOpener(Unknown Source)
while locating com.google.inject.Provider<org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink>
for field at org.eclipse.xtext.ui.editor.hyperlinking.HyperlinkHelper.hyperlinkProvider(Unknown Source)
while locating org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkHelper
for field at com.xtext.lang.tests.Scoping.HyperlinkTest.hyperlink(Unknown Source)
while locating com.xtext.lang.tests.Scoping.HyperlinkTest
2) No implementation for org.eclipse.jface.viewers.ILabelProvider annotated with @org.eclipse.xtext.ui.editor.hyperlinking.HyperlinkLabelProvider() was bound.
while locating org.eclipse.jface.viewers.ILabelProvider annotated with @org.eclipse.xtext.ui.editor.hyperlinking.HyperlinkLabelProvider()
for field at org.eclipse.xtext.ui.editor.hyperlinking.HyperlinkHelper.labelProvider(Unknown Source)
while locating org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkHelper
for field at com.xtext.lang.tests.Scoping.HyperlinkTest.hyperlink(Unknown Source)
while locating com.xtext.lang.tests.Scoping.HyperlinkTest
2 errors
at com.google.inject.internal.InjectorImpl.getMembersInjector(InjectorImpl.java:952)
at com.google.inject.internal.InjectorImpl.getMembersInjector(InjectorImpl.java:957)
at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:943)
at org.eclipse.xtext.junit4.XtextRunner.createTest(XtextRunner.java:33)
at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:244)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:241)
at org.eclipse.xtext.junit4.XtextRunner.superMethodBlock(XtextRunner.java:64)
at org.eclipse.xtext.junit4.XtextRunner.methodBlock(XtextRunner.java:44)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Any help?
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04139 seconds