Home » Modeling » TMF (Xtext) » Testing content assist(Is there a tutorial or some code example ?)
|
Re: Testing content assist [message #705717 is a reply to message #705706] |
Sat, 30 July 2011 08:17 |
|
Hi,
the is not much to tutorialize
package test;
import org.eclipse.xtext.ISetup;
import org.eclipse.xtext.ui.junit.editor.contentassist.AbstractContentAssistProcessorTest;
import org.xtext.example.mydsl.MyDslUiInjectorProvider;
import com.google.inject.Injector;
public class CATest extends AbstractContentAssistProcessorTest {
public void testSomething() throws Exception {
newBuilder(getSetup())
.assertText("Hello")
.append("Hello")
.append(" ")
.assertText("Name")
.append("Michel")
.append(" ")
.assertText("!")
.append("!");
}
private ISetup getSetup() {
return new ISetup() {
@Override
public Injector createInjectorAndDoEMFRegistration() {
return new MyDslUiInjectorProvider().getInjector();
}
};
}
}
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
| | | |
Re: Testing content assist [message #714894 is a reply to message #714855] |
Thu, 11 August 2011 17:14 |
Michel Simeon Messages: 130 Registered: December 2009 |
Senior Member |
|
|
Thanks. It does run indeed if I specify Run as JUnit Plug-in test. But it takes quite a long time !
And it gives strange messages on the console, as follows:
!SESSION 2011-08-11 19:02:22.697 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -version 3 -port 65423 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames test.CATest -application org.eclipse.pde.junit.runtime.uitestapplication -product org.eclipse.sdk.ide -testpluginname org.xtext.example.mydsl.tests
Command-line arguments: -os win32 -ws win32 -arch x86 -consoleLog -version 3 -port 65423 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames test.CATest -application org.eclipse.pde.junit.runtime.uitestapplication -product org.eclipse.sdk.ide -data C:\Users\msimeon\workspaceIndigo/../junit-workspace -dev file:C:/Users/msimeon/workspaceIndigo/.metadata/.plugins/org.eclipse.pde.core/pde-junit/dev.properties -os win32 -ws win32 -arch x86 -consoleLog -testpluginname org.xtext.example.mydsl.tests
!ENTRY org.eclipse.osgi 2 0 2011-08-11 19:02:27.807
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.807
!MESSAGE Bundle org.eclipse.core.filesystem.aix.ppc_1.1.0.v20110423-0524 [90] was not resolved.
!SUBENTRY 2 org.eclipse.core.filesystem.aix.ppc 2 0 2011-08-11 19:02:27.807
!MESSAGE Platform filter did not match: (& (osgi.os=aix) (osgi.arch=ppc))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.808
!MESSAGE Bundle org.eclipse.core.filesystem.hpux.ia64_32_1.0.100.v20110423-0524 [91] was not resolved.
!SUBENTRY 2 org.eclipse.core.filesystem.hpux.ia64_32 2 0 2011-08-11 19:02:27.808
!MESSAGE Platform filter did not match: (& (osgi.os=hpux) (osgi.arch=ia64_32))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.808
!MESSAGE Bundle org.eclipse.core.filesystem.linux.x86_1.4.0.v20110423-0524 [92] was not resolved.
!SUBENTRY 2 org.eclipse.core.filesystem.linux.x86 2 0 2011-08-11 19:02:27.809
!MESSAGE Platform filter did not match: (& (osgi.os=linux) (osgi.arch=x86))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.809
!MESSAGE Bundle org.eclipse.core.filesystem.linux.x86_64_1.2.0.v20110423-0524 [93] was not resolved.
!SUBENTRY 2 org.eclipse.core.filesystem.linux.x86_64 2 0 2011-08-11 19:02:27.809
!MESSAGE Platform filter did not match: (& (osgi.os=linux) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.809
!MESSAGE Bundle org.eclipse.core.filesystem.macosx_1.3.0.v20110423-0524 [94] was not resolved.
!SUBENTRY 2 org.eclipse.core.filesystem.macosx 2 0 2011-08-11 19:02:27.810
!MESSAGE Platform filter did not match: (& (osgi.os=macosx) (|(osgi.arch=x86) (osgi.arch=ppc) (osgi.arch=x86_64)))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.810
!MESSAGE Bundle org.eclipse.core.filesystem.solaris.sparc_1.2.0.v20110423-0524 [95] was not resolved.
!SUBENTRY 2 org.eclipse.core.filesystem.solaris.sparc 2 0 2011-08-11 19:02:27.810
!MESSAGE Platform filter did not match: (& (osgi.os=solaris) (osgi.arch=sparc))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.811
!MESSAGE Bundle org.eclipse.core.filesystem.win32.x86_64_1.1.300.v20110423-0524 [97] was not resolved.
!SUBENTRY 2 org.eclipse.core.filesystem.win32.x86_64 2 0 2011-08-11 19:02:27.811
!MESSAGE Platform filter did not match: (& (osgi.os=win32) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.811
!MESSAGE Bundle org.eclipse.core.net.linux.x86_1.1.200.I20110419-0800 [100] was not resolved.
!SUBENTRY 2 org.eclipse.core.net.linux.x86 2 0 2011-08-11 19:02:27.812
!MESSAGE Platform filter did not match: (& (osgi.os=linux) (osgi.arch=x86))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.812
!MESSAGE Bundle org.eclipse.core.net.linux.x86_64_1.1.0.I20110331-0827 [101] was not resolved.
!SUBENTRY 2 org.eclipse.core.net.linux.x86_64 2 0 2011-08-11 19:02:27.812
!MESSAGE Platform filter did not match: (& (osgi.os=linux) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.813
!MESSAGE Bundle org.eclipse.core.net.win32.x86_64_1.0.100.I20110331-0827 [103] was not resolved.
!SUBENTRY 2 org.eclipse.core.net.win32.x86_64 2 0 2011-08-11 19:02:27.813
!MESSAGE Platform filter did not match: (& (osgi.os=win32) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.813
!MESSAGE Bundle org.eclipse.equinox.launcher.carbon.macosx_1.1.100.v20110502 [211] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.carbon.macosx 2 0 2011-08-11 19:02:27.814
!MESSAGE Platform filter did not match: (& (osgi.ws=carbon) (osgi.os=macosx) (|(osgi.arch=x86)(osgi.arch=ppc)) )
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.814
!MESSAGE Bundle org.eclipse.equinox.launcher.cocoa.macosx_1.1.100.v20110502 [212] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.cocoa.macosx 2 0 2011-08-11 19:02:27.814
!MESSAGE Platform filter did not match: (& (osgi.ws=cocoa) (osgi.os=macosx) (|(osgi.arch=x86)(osgi.arch=ppc)) )
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.814
!MESSAGE Bundle org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.100.v20110502 [213] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.cocoa.macosx.x86_64 2 0 2011-08-11 19:02:27.815
!MESSAGE Platform filter did not match: (& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=x86_64) )
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.815
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.aix.ppc_1.1.0.v20110530 [214] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.aix.ppc 2 0 2011-08-11 19:02:27.815
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=aix) (osgi.arch=ppc))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.816
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.aix.ppc64_1.1.0.v20110530 [215] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.aix.ppc64 2 0 2011-08-11 19:02:27.816
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=aix) (osgi.arch=ppc64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.816
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.hpux.ia64_32_1.0.0.v20110502 [216] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.hpux.ia64_32 2 0 2011-08-11 19:02:27.816
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=hpux) (osgi.arch=ia64_32))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.817
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.linux.ppc64_1.0.100.v20110505 [217] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.linux.ppc64 2 0 2011-08-11 19:02:27.817
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=ppc64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.817
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.linux.s390_1.1.100.v20110505 [218] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.linux.s390 2 0 2011-08-11 19:02:27.818
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=s390))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.818
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.linux.s390x_1.1.100.v20110505 [219] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.linux.s390x 2 0 2011-08-11 19:02:27.818
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=s390x))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.819
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.linux.x86_1.1.100.v20110505 [220] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.linux.x86 2 0 2011-08-11 19:02:27.819
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.819
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505 [221] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.linux.x86_64 2 0 2011-08-11 19:02:27.819
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.820
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.solaris.sparc_1.1.100.v20110505 [222] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.solaris.sparc 2 0 2011-08-11 19:02:27.821
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=solaris) (osgi.arch=sparc))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.821
!MESSAGE Bundle org.eclipse.equinox.launcher.gtk.solaris.x86_1.1.100.v20110505 [223] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.gtk.solaris.x86 2 0 2011-08-11 19:02:27.821
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=solaris) (osgi.arch=x86))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.821
!MESSAGE Bundle org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502 [225] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.launcher.win32.win32.x86_64 2 0 2011-08-11 19:02:27.822
!MESSAGE Platform filter did not match: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.822
!MESSAGE Bundle org.eclipse.equinox.security.macosx_1.100.100.v20100503 [260] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.security.macosx 2 0 2011-08-11 19:02:27.822
!MESSAGE Platform filter did not match: (& (osgi.os=macosx) (|(osgi.arch=x86)(osgi.arch=x86_64)(osgi.arch=ppc)) )
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.823
!MESSAGE Bundle org.eclipse.equinox.security.win32.x86_64_1.0.0.v20110502 [263] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.security.win32.x86_64 2 0 2011-08-11 19:02:27.823
!MESSAGE Platform filter did not match: (& (osgi.os=win32) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.823
!MESSAGE Bundle org.eclipse.jdt.launching.macosx_3.2.100.v20110509 [291] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.launching.macosx 2 0 2011-08-11 19:02:27.824
!MESSAGE Platform filter did not match: (osgi.os=macosx)
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.824
!MESSAGE Bundle org.eclipse.jdt.launching.ui.macosx_1.0.100.v20110509 [292] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.launching.ui.macosx 2 0 2011-08-11 19:02:27.824
!MESSAGE Platform filter did not match: (osgi.os=macosx)
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.824
!MESSAGE Bundle org.eclipse.swt.carbon.macosx_3.7.0.v3735b [357] was not resolved.
!SUBENTRY 2 org.eclipse.swt.carbon.macosx 2 0 2011-08-11 19:02:27.825
!MESSAGE Platform filter did not match: (& (osgi.ws=carbon) (osgi.os=macosx) (|(osgi.arch=x86)(osgi.arch=ppc)) )
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.825
!MESSAGE Bundle org.eclipse.swt.cocoa.macosx_3.7.0.v3735b [358] was not resolved.
!SUBENTRY 2 org.eclipse.swt.cocoa.macosx 2 0 2011-08-11 19:02:27.825
!MESSAGE Platform filter did not match: (& (osgi.ws=cocoa) (osgi.os=macosx) (|(osgi.arch=x86)(osgi.arch=ppc)) )
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.826
!MESSAGE Bundle org.eclipse.swt.cocoa.macosx.x86_64_3.7.0.v3735b [359] was not resolved.
!SUBENTRY 2 org.eclipse.swt.cocoa.macosx.x86_64 2 0 2011-08-11 19:02:27.826
!MESSAGE Platform filter did not match: (& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=x86_64) )
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.826
!MESSAGE Bundle org.eclipse.swt.gtk.aix.ppc_3.7.0.v3735b [360] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.aix.ppc 2 0 2011-08-11 19:02:27.826
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=aix) (osgi.arch=ppc))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.827
!MESSAGE Bundle org.eclipse.swt.gtk.aix.ppc64_3.7.0.v3735b [361] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.aix.ppc64 2 0 2011-08-11 19:02:27.827
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=aix) (osgi.arch=ppc64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.827
!MESSAGE Bundle org.eclipse.swt.gtk.hpux.ia64_32_3.7.0.v3735b [362] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.hpux.ia64_32 2 0 2011-08-11 19:02:27.827
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=hpux) (osgi.arch=ia64_32))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.828
!MESSAGE Bundle org.eclipse.swt.gtk.linux.ppc64_3.7.0.v3735b [363] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.linux.ppc64 2 0 2011-08-11 19:02:27.828
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=ppc64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.828
!MESSAGE Bundle org.eclipse.swt.gtk.linux.s390_3.7.0.v3735b [364] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.linux.s390 2 0 2011-08-11 19:02:27.829
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=s390))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.829
!MESSAGE Bundle org.eclipse.swt.gtk.linux.s390x_3.7.0.v3735b [365] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.linux.s390x 2 0 2011-08-11 19:02:27.829
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=s390x))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.829
!MESSAGE Bundle org.eclipse.swt.gtk.linux.x86_3.7.0.v3735b [366] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.linux.x86 2 0 2011-08-11 19:02:27.830
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.830
!MESSAGE Bundle org.eclipse.swt.gtk.linux.x86_64_3.7.0.v3735b [367] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.linux.x86_64 2 0 2011-08-11 19:02:27.830
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.831
!MESSAGE Bundle org.eclipse.swt.gtk.solaris.sparc_3.7.0.v3735b [368] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.solaris.sparc 2 0 2011-08-11 19:02:27.835
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=solaris) (osgi.arch=sparc))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.835
!MESSAGE Bundle org.eclipse.swt.gtk.solaris.x86_3.7.0.v3735b [369] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.solaris.x86 2 0 2011-08-11 19:02:27.836
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=solaris) (osgi.arch=x86))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.836
!MESSAGE Bundle org.eclipse.swt.win32.win32.x86_64_3.7.0.v3735b [371] was not resolved.
!SUBENTRY 2 org.eclipse.swt.win32.win32.x86_64 2 0 2011-08-11 19:02:27.837
!MESSAGE Platform filter did not match: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86_64))
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.837
!MESSAGE Bundle org.eclipse.ui.carbon_4.0.100.I20101109-0800 [390] was not resolved.
!SUBENTRY 2 org.eclipse.ui.carbon 2 0 2011-08-11 19:02:27.838
!MESSAGE Platform filter did not match: (osgi.ws=carbon)
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.839
!MESSAGE Bundle org.eclipse.ui.cocoa_1.1.0.I20101109-0800 [392] was not resolved.
!SUBENTRY 2 org.eclipse.ui.cocoa 2 0 2011-08-11 19:02:27.846
!MESSAGE Platform filter did not match: (osgi.ws=cocoa)
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-08-11 19:02:27.846
!MESSAGE Bundle org.eclipse.update.core.linux_3.2.200.v20100512 [419] was not resolved.
!SUBENTRY 2 org.eclipse.update.core.linux 2 0 2011-08-11 19:02:27.846
!MESSAGE Platform filter did not match: (& (osgi.os=linux) (osgi.arch=x86))
!ENTRY org.eclipse.jface 2 0 2011-08-11 19:02:54.146
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2011-08-11 19:02:54.146
!MESSAGE A conflict occurred for ALT+CTRL+I:
Binding(ALT+CTRL+I,
ParameterizedCommand(Command(org.eclipse.egit.ui.team.Ignore,Ignore,
,
Category(org.eclipse.egit.ui.commandCategory,Git,null,true),
org.eclipse.egit.ui.internal.actions.IgnoreActionHandler,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+CTRL+I,
ParameterizedCommand(Command(org.eclipse.team.svn.ui.command.AddToSVNIgnoreCommand,Add to svn:ignore...,
,
Category(org.eclipse.team.svn.ui.command.category,SVN,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2011-08-11 19:02:54.147
!MESSAGE A conflict occurred for ALT+CTRL+C:
Binding(ALT+CTRL+C,
ParameterizedCommand(Command(org.eclipse.egit.ui.team.Commit,Commit,
,
Category(org.eclipse.egit.ui.commandCategory,Git,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+CTRL+C,
ParameterizedCommand(Command(org.eclipse.team.svn.ui.command.CommitCommand,Commit...,
,
Category(org.eclipse.team.svn.ui.command.category,SVN,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
What should I do about it ?
More broadly, could you give me some pointers on how to test the following kind of situation:
- at a given point, CA gives me the choice between various user-defined templates, templates that might include cross-references or enum lists.
- I'd like to test not only the template but also the enum list or the cross-reference list of IDs
Thanks for your help
MS
|
|
|
Re: Testing content assist [message #716792 is a reply to message #714894] |
Thu, 18 August 2011 13:36 |
Michel Simeon Messages: 130 Registered: December 2009 |
Senior Member |
|
|
Following the previous exhanges, I just did the following:
- I updated XText to the latest (nightly) 2.0.1 version using the recently announced composite update site
- I created a new workspace
- I created a new default XText project (MyDsl), I created a CATest.java file by copying the code provided by Christian earlier, and run it as a JUnit plug-in test. This is what I get:
In the console:
!ENTRY org.eclipse.jface 2 0 2011-08-18 15:29:24.745
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2011-08-18 15:29:24.745
!MESSAGE A conflict occurred for ALT+CTRL+I:
Binding(ALT+CTRL+I,
ParameterizedCommand(Command(org.eclipse.egit.ui.team.Ignore,Ignore,
,
Category(org.eclipse.egit.ui.commandCategory,Git,null,true),
org.eclipse.egit.ui.internal.actions.IgnoreActionHandler,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+CTRL+I,
ParameterizedCommand(Command(org.eclipse.team.svn.ui.command.AddToSVNIgnoreCommand,Add to svn:ignore...,
,
Category(org.eclipse.team.svn.ui.command.category,SVN,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2011-08-18 15:29:24.745
!MESSAGE A conflict occurred for ALT+CTRL+C:
Binding(ALT+CTRL+C,
ParameterizedCommand(Command(org.eclipse.egit.ui.team.Commit,Commit,
,
Category(org.eclipse.egit.ui.commandCategory,Git,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+CTRL+C,
ParameterizedCommand(Command(org.eclipse.team.svn.ui.command.CommitCommand,Commit...,
,
Category(org.eclipse.team.svn.ui.command.category,SVN,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
In the JUnit view:
java.lang.Exception: No runnable methods
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:177)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:122)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:269)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:66)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:58)
at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:13)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
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.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:41)
at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
=================
Then I have an additional problem:
I installed the Domainmodel example and created a similar CATest file (where MyDslUiInjectorProvider is replaced by DomainmodelUiInjectorProvider but the rest is identical.
I get and error in getSetup() that goes away when I drop the @Override annotation.
I do not understand why there is this difference in behavior !
Help most welcome, as usual !
MS
|
|
|
Re: Testing content assist [message #716930 is a reply to message #716792] |
Thu, 18 August 2011 19:44 |
|
Hi,
regarding the exception a simple @Test to the textXXX method should
make the class Junit 4 enabled.
regarding your other problem. this is a Java 5 (execution envirionment
of the domain example) vs java 6 (execution envirionment of the mydsl
created by the wizard) problem
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: Testing content assist [message #716947 is a reply to message #716930] |
Thu, 18 August 2011 21:17 |
Michel Simeon Messages: 130 Registered: December 2009 |
Senior Member |
|
|
Hi Christian.
Many thanks for the tips.
I did add:
import org.junit.Test;
...
@Test
public void testSomething() throws Exception {
super.setUp();
...
Now the test runs ...
The console still gives messages and I do not really understand what is going on :
!SUBENTRY 1 org.eclipse.jface 2 0 2011-08-18 23:14:17.919
!MESSAGE A conflict occurred for ALT+CTRL+I:
Binding(ALT+CTRL+I,
ParameterizedCommand(Command(org.eclipse.egit.ui.team.Ignore,Ignore,
,
Category(org.eclipse.egit.ui.commandCategory,Git,null,true),
org.eclipse.egit.ui.internal.actions.IgnoreActionHandler,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+CTRL+I,
ParameterizedCommand(Command(org.eclipse.team.svn.ui.command.AddToSVNIgnoreCommand,Add to svn:ignore...,
,
Category(org.eclipse.team.svn.ui.command.category,SVN,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2011-08-18 23:14:17.919
!MESSAGE A conflict occurred for ALT+CTRL+C:
Binding(ALT+CTRL+C,
ParameterizedCommand(Command(org.eclipse.egit.ui.team.Commit,Commit,
,
Category(org.eclipse.egit.ui.commandCategory,Git,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+CTRL+C,
ParameterizedCommand(Command(org.eclipse.team.svn.ui.command.CommitCommand,Commit...,
,
Category(org.eclipse.team.svn.ui.command.category,SVN,null,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
log4j:WARN No appenders could be found for logger (org.eclipse.xtext.ui.internal.Activator).
log4j:WARN Please initialize the log4j system properly.
Thanks again
MS
|
|
| | | |
Re: Testing content assist [message #726039 is a reply to message #726018] |
Fri, 16 September 2011 13:07 |
Michel Simeon Messages: 130 Registered: December 2009 |
Senior Member |
|
|
Hi Eszter,
Regarding your first point, your "MyDslUiInjectorProvider" should be part of a .../mydsl/tests project that should have been generated automatically if you created your project with the latest version of XText. If this is not the case you could try to recreate a project from scratch (i.e. using your xtext grammar), or try to just create the missing class. Mine is as follows (Mads is the name of my language):
package fr.msimeon.mads;
import org.eclipse.xtext.junit4.IInjectorProvider;
import com.google.inject.Injector;
public class MadsUiInjectorProvider implements IInjectorProvider {
public Injector getInjector() {
return fr.msimeon.mads.ui.internal.MadsActivator.getInstance().getInjector("fr.msimeon.mads.Mads");
}
}
On the second point: you can build your model file step by step, and a any point test CA content with assertText, as follows:
package CATests;
import org.eclipse.xtext.ISetup;
import org.eclipse.xtext.ui.junit.editor.contentassist.AbstractContentAssistProcessorTest;
import fr.msimeon.mads.MadsUiInjectorProvider;
import com.google.inject.Injector;
import org.junit.Test;
@SuppressWarnings("all")
// Testing content assist (CA) - run as JUnit Plug-in Test
public class CATest_Headers extends AbstractContentAssistProcessorTest {
@Test
public void testHeaders() throws Exception {
super.setUp();
newBuilder(SetUp.getSetup())
.assertText( "\"countryName\"",
"-Headers in English - template for header data", "-Headers in French - template for header data",
"Country Name", "Nom du pays")
.append("Country Name")
.append(" ")
.assertText("=")
.append("=")
.append(" ")
.assertText("\"countryName\"")
.append("Mali")
.append(" ")
.append(";")
.append("\n ")
.assertText("\"projectName\"", "Project Name", "Nom du projet")
.append("Project Name")
.append(" = ")
.assertText("\"projectName\"")
.append("Project CA Test")
.append(" ")
.append(" ; ")
..............
.append("end")
.append(" ")
.assertText("model")
.append("model")
.appendNl(" ")
;
}
}
The setup file:
package CATests;
import org.eclipse.xtext.ISetup;
import com.google.inject.Injector;
import fr.msimeon.mads.MadsUiInjectorProvider;
class SetUp {
static ISetup getSetup() throws Exception {
return new ISetup() {
@Override
public Injector createInjectorAndDoEMFRegistration() {
return new MadsUiInjectorProvider().getInjector();
}
};
}
}
Hope this helps
MS
|
|
| | |
Re: Testing content assist [message #726667 is a reply to message #726660] |
Mon, 19 September 2011 08:26 |
|
Hi, the content assist class does not support this out of the box but
it is easy to reach it anyway: create the project and the files with
eclipse resource means (dont forget the Xtext nature) and patch the
test class regarding the URI so that the test model is created within
the project. Regards Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Goto Forum:
Current Time: Thu Apr 25 01:45:13 GMT 2024
Powered by FUDForum. Page generated in 0.05027 seconds
|