Skip to main content

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

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.



Back to the top