DESCRIPTION

New tests for merging through Team (GitSubscriberMergeContext).

IMergeContext offers API for clients to merge files or models through
pure Team APIs, without resorting to repository provider dependencies.
This adds tests for these actions and fixes some issues (NPEs) because
of EGit UI not checking whether the workbench is initialized before
using it.

Change-Id: Ia140f490d8a0831bc9fe6106d38b7078e3e6d93e
Signed-off-by: Gustavo Green xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2014-07-16 09:42:02.000000000

Patch Set 6:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/6035/

-------------------------------------
author: Brenden Conley
date: 2014-07-16 09:57:38.000000000

Patch Set 6: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/6035/ : UNSTABLE

-------------------------------------
author: Gustavo Green
date: 2014-07-16 12:22:36.000000000

Patch Set 6:

And now they pass... I somply can't understand how these tests work at all.

-------------------------------------
author: Juliet Cantu
date: 2014-07-16 17:24:40.000000000

Patch Set 6:

(2 comments)

Line:406, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContextTest.java -> Just let exceptions that would fail the test also escape the test give us some more information, such as stack traces and the original error message. Never drop the original exception.

Line:227, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Am explanation would be nice

-------------------------------------
author: Gustavo Green
date: 2014-07-17 08:18:13.000000000

Patch Set 6:

(2 comments)

Line:406, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContextTest.java -> Done

Line:227, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> "PlatformUI.getWorkbench()" will simply fail if called without prior checking. However, this should have been made in a separate review. I'll extract this out.

Launching these from Eclipse as headless tests should net you a better explanation (right click > run as > JUnit plugin test will do that by default). setupFocusHandling relies on the workbench being fully initialized, which is not the case when running unit tests. Since there's little that prevents us from running headless tests, I thought protecting against these failures would be interesting.

Caused by: java.lang.IllegalStateException: Workbench has not been created yet.
	at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:93)
	at org.eclipse.egit.ui.Activator.setupFocusHandling(Activator.java:270)
	at org.eclipse.egit.ui.Activator.start(Activator.java:227)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)

-------------------------------------
author: Juliet Cantu
date: 2014-08-02 22:57:40.000000000

Patch Set 6:

(1 comment)

Line:227, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> ok, saw it now

-------------------------------------
