| /******************************************************************************* |
| * Copyright (c) 2006 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| ******************************************************************************/ |
| |
| package org.eclipse.jface.tests.databinding.swt; |
| |
| import junit.framework.TestCase; |
| |
| /** |
| * @since 1.0 |
| * |
| */ |
| public abstract class AbstractGetAndSetSelectionObservableCollectionTest extends TestCase { |
| // |
| // public void testGetSelectedObject() { |
| // SelectionAwareObservableCollection observable = getSelectionAwareObservable(new String[] {"foo", "bar"}); |
| // assertEquals("No initial selection should be found.", null, observable.getSelectedObject()); |
| // setSelectedValueOfControl("bar"); |
| // assertEquals("bar", observable.getSelectedObject()); |
| // } |
| // |
| // /* |
| // * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.setSelectedObject(Object)' |
| // */ |
| // public void testSetSelectedObject() { |
| // SelectionAwareObservableCollection observable = getSelectionAwareObservable(new String[] {"foo", "bar"}); |
| // observable.setSelectedObject("bar"); |
| // assertEquals("bar", getSelectedObjectOfControl()); |
| // observable.setSelectedObject("bar1"); |
| // assertEquals("bar", getSelectedObjectOfControl()); |
| // observable.setSelectedObject("foo"); |
| // assertEquals("foo", getSelectedObjectOfControl()); |
| // observable.setSelectedObject(null); |
| // assertEquals(null, getSelectedObjectOfControl()); |
| // } |
| // |
| // protected abstract SelectionAwareObservableCollection getSelectionAwareObservable(String[] values); |
| // |
| // protected abstract Object getSelectedObjectOfControl(); |
| // |
| // protected abstract void setSelectedValueOfControl(String value); |
| } |