Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 1c30be08872db1eeb69318e3c870e6b41bcafc1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*******************************************************************************
 * Copyright (c) 2007 Brad Reynolds 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:
 *     Brad Reynolds - initial API and implementation
 ******************************************************************************/

package org.eclipse.core.tests.internal.databinding.beans;

import java.beans.PropertyDescriptor;

import junit.framework.TestCase;

import org.eclipse.core.internal.databinding.beans.BeanObservableSetDecorator;
import org.eclipse.core.internal.databinding.beans.JavaBeanObservableSet;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.widgets.Display;

/**
 * @since 3.3
 */
public class BeanObservableSetDecoratorTest extends TestCase {
	private PropertyDescriptor propertyDescriptor;
	private JavaBeanObservableSet observableSet;
	private BeanObservableSetDecorator decorator;

	/*
	 * (non-Javadoc)
	 * 
	 * @see junit.framework.TestCase#setUp()
	 */
	protected void setUp() throws Exception {
		super.setUp();

		Bean bean = new Bean();
		propertyDescriptor = new PropertyDescriptor("set",
				Bean.class);
		observableSet = new JavaBeanObservableSet(
				SWTObservables.getRealm(Display.getDefault()), bean,
				propertyDescriptor, String.class);
		decorator = new BeanObservableSetDecorator(
				observableSet, observableSet, propertyDescriptor);
	}

	public void testGetDelegate() throws Exception {
		assertEquals(observableSet, decorator.getDelegate());
	}

	public void testGetObserved() throws Exception {
		assertEquals(observableSet, decorator.getObserved());
	}

	public void testGetPropertyDescriptor() throws Exception {
		assertEquals(propertyDescriptor, decorator.getPropertyDescriptor());
	}
}

Back to the top