KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > dataset > adapter > TabularDataModelAdapterMetaDataProviderTest


1 /*
2  * $Id: TabularDataModelAdapterMetaDataProviderTest.java,v 1.1 2005/03/01 13:28:01 kleopatra Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7 package org.jdesktop.dataset.adapter;
8
9 import org.jdesktop.dataset.DataSet;
10 import org.jdesktop.dataset.DataTable;
11 import org.jdesktop.swing.data.AbstractMetaDataProviderTst;
12 import org.jdesktop.swing.data.MetaData;
13 import org.jdesktop.swing.data.MetaDataProvider;
14 import org.jdesktop.swing.util.DataSetTestSupport;
15
16 /**
17  * tests MetaDataProvider role of TablurDataModelAdapter
18  *
19  * @author Jeanette Winzenburg
20  */

21 public class TabularDataModelAdapterMetaDataProviderTest extends
22         AbstractMetaDataProviderTst {
23
24     protected MetaDataProvider createFilledMetaDataProvider() {
25         DataSet dataSet = DataSetTestSupport.createDefaultDataSet(3);
26         DataSetTestSupport.fillDefaultTable(dataSet);
27         DataTable table = dataSet.getTable(DataSetTestSupport.ADAPTEE_TABLE_NAME);
28         return new TabularDataModelAdapter(table);
29     }
30
31     protected MetaDataProvider createEmptyMetaDataProvider() {
32         DataTable table = DataSetTestSupport.createDataSet(new MetaData[] { }, 0).getTable(DataSetTestSupport.ADAPTEE_TABLE_NAME);
33         return new TabularDataModelAdapter(table);
34     }
35
36 }
37
Popular Tags