Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 232c2dab311b4c56b9cb8295376d68762a16dfd3 (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
package org.eclipse.jface.widgets;

import static org.junit.Assert.assertEquals;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.junit.Test;

public class TestUnitCompositeFactory extends AbstractFactoryTest {
	@Test
	public void createsComposite() {
		Composite composite = CompositeFactory.newComposite(SWT.MULTI).create(shell);

		assertEquals(shell, composite.getParent());
		assertEquals(SWT.MULTI, composite.getStyle() & SWT.MULTI);
	}

	@Test
	public void createCompositeWithAllProperties() {
		GridLayout gridLayout = new GridLayout();
		Composite composite = CompositeFactory.newComposite(SWT.NONE).layout(gridLayout).create(shell);

		assertEquals(gridLayout, composite.getLayout());
	}
}

Back to the top