Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Plug-in test works in IDE, fails when built with "mvn install"

The test bundle needs to Require-Bundle the bundle that provides
no.priv.bang.modeler.core.gef.editor.Editor, which I believe is
modeler.core.

PDE/IDE adds all workspace bundles to the test eclipse runtime by
default. Tycho only adds bundles that are required.

--
Regards,
Igor

On 2014-05-26, 15:18, Steinar Bang wrote:
The EditorTest.testOpenEditorBy() test in the below URL, works when I
run the test as a JUnit Plug-in test in the eclipse JUnit test view, but
fails when I run it from the command line:
  https://github.com/steinarb/modeler/blob/master/modeler.test/src/main/java/no/priv/bang/modeler/core/EditorTest.java

What the test does is trying to open the editor with an IDE, and assert
that the returned IEditorPart isn't null.
	@Test
	public void testOpenEditorById()
			throws PartInitException
	{
		String editorId = "no.priv.bang.modeler.core.gef.editor.Editor";
		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
		IEditorPart editorPart = window.getActivePage().openEditor(new StringEditorInput("Dummy text"), editorId);
		assertNotNull(editorPart);
	}

It is the assert that fails in the test (ie. the returned IEditorPart is
null).

Is it expected that something like this will fail when being run with
"mvn install"?  Or should the test have here as well worked?

Both running from the eclipse IDE, and when running with "mvn install",
will open an eclipse workbench window.

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



Back to the top