Added
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2007 Cerner Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
7 |
* |
8 |
* Contributors: |
9 |
* Cerner Corporation - initial API and implementation |
10 |
******************************************************************************/ |
11 |
|
12 |
package org.eclipse.jface.tests.viewers; |
13 |
|
14 |
import java.util.Arrays; |
15 |
|
16 |
import junit.framework.TestCase; |
17 |
|
18 |
import org.eclipse.jface.viewers.ColumnLayoutData; |
19 |
import org.eclipse.jface.viewers.ColumnPixelData; |
20 |
import org.eclipse.jface.viewers.ColumnWeightData; |
21 |
import org.eclipse.jface.viewers.TableLayout; |
22 |
|
23 |
/** |
24 |
* @since 3.3 |
25 |
*/ |
26 |
public class TableLayoutTest extends TestCase { |
27 |
public void testGetColumnDatasNoResultsReturnsEmptyArray() throws Exception { |
28 |
assertEquals(0, new TableLayout().getColumnDatas().length); |
29 |
} |
30 |
|
31 |
public void testGetColumnDatasWithResults() throws Exception { |
32 |
ColumnWeightData data1 = new ColumnWeightData(1); |
33 |
ColumnPixelData data2 = new ColumnPixelData(1); |
34 |
|
35 |
TableLayout layout = new TableLayout(); |
36 |
layout.addColumnData(data1); |
37 |
layout.addColumnData(data2); |
38 |
|
39 |
ColumnLayoutData[] datas = new ColumnLayoutData[] {data1, data2}; |
40 |
|
41 |
assertTrue(Arrays.equals(datas, layout.getColumnDatas())); |
42 |
} |
43 |
} |