Bug 168153 [DataBinding] Simplify the management of the default Realm
In the bug where Realms where born there was talk of making the setting of the Realm a little more foolproof. Currently when setting the Realm the developer needs to remember to retrieve the current Realm and to set it back in a finally block to be a good citizen. I think Boris spoke of something like the following to remedy this... Realm.setDefault(myRealm, new Runnable() { public void run() { //do stuff with myRealm as default } }); I've been finding myself writing a method that does just this in my own code. I think this should be added to Realm to ensure that the default realm is being set and reset correctly.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java
import org.eclipse.jface.tests.databinding.observable.list.AbstractObservableListTest;
import org.eclipse.jface.tests.databinding.observable.list.ObservableListTest;
import org.eclipse.jface.tests.databinding.observable.list.WritableListTest;
import org.eclipse.jface.tests.databinding.observable.value.AbstractObservableValueTest;
import org.eclipse.jface.tests.databinding.observable.value.AbstractVetoableValueTest;
import org.eclipse.jface.tests.databinding.observable.value.WritableValueTest;
import org.eclipse.jface.tests.databinding.scenarios.BindingScenariosTestSuite;
import org.eclipse.jface.tests.databinding.swt.TextObservableValueTests;
import org.eclipse.jface.tests.databinding.viewers.ObservableMapLabelProviderTest;
import org.eclipse.jface.tests.databinding.viewers.ObservableSetContentProviderTest;
import org.eclipse.jface.tests.examples.model.PersonTests;
import org.eclipse.jface.tests.internal.databinding.internal.ListBindingTest;
import org.eclipse.jface.tests.internal.databinding.internal.ValueBindingTest;
import org.eclipse.jface.tests.internal.databinding.internal.beans.JavaBeanObservableMapTest;
import org.eclipse.jface.tests.internal.databinding.internal.beans.JavaBeanObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.observable.UnmodifiableObservableListTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.ButtonObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.CComboObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.CLabelObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.ComboObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.ControlObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.LabelObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.SpinnerObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.swt.TableObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.internal.viewers.SelectionProviderSingleSelectionObservableValueTest;
import org.eclipse.jface.tests.internal.databinding.provisional.observable.AbstractObservableTest;
import org.eclipse.jface.tests.internal.databinding.provisional.observable.ObservablesTest;
import org.eclipse.jface.tests.internal.databinding.provisional.viewers.SelectionObservableValueTest;
public class BindingTestSuite extends TestSuite {
    public static void main(String[] args) {