use of com.sldeditor.datasource.config.DataSourceAttributeModel in project sldeditor by robward-scisys.
the class DataSourceAttributeModelTest method testIsCellEditable.
/**
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#isCellEditable(int, int)}.
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#setConnectedToDataSource(boolean)}.
*/
@Test
public void testIsCellEditable() {
DataSourceAttributeModel model = new DataSourceAttributeModel();
// Not connected to data source
assertTrue(model.isCellEditable(0, 0));
assertTrue(model.isCellEditable(0, 1));
// Connected to data source
model.setConnectedToDataSource(true);
assertFalse(model.isCellEditable(0, 0));
assertTrue(model.isCellEditable(0, 2));
}
use of com.sldeditor.datasource.config.DataSourceAttributeModel in project sldeditor by robward-scisys.
the class DataSourceAttributeModelTest method testGetTypeData.
/**
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#getTypeData()}.
*/
@Test
public void testGetTypeData() {
DataSourceAttributeModel model = new DataSourceAttributeModel();
assertTrue(model.getTypeData().length > 0);
}
use of com.sldeditor.datasource.config.DataSourceAttributeModel in project sldeditor by robward-scisys.
the class DataSourceAttributeModelTest method testTimestampField.
/**
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#addNewField()}.
*/
@Test
public void testTimestampField() {
DataSourceAttributeModel model = new DataSourceAttributeModel();
assertEquals(0, model.getRowCount());
model.addNewField();
assertEquals(1, model.getRowCount());
model.setValueAt("Timestamp", 0, 1);
Object actualResult = model.getValueAt(0, 1);
assertNotNull(actualResult);
}
use of com.sldeditor.datasource.config.DataSourceAttributeModel in project sldeditor by robward-scisys.
the class DataSourceAttributeModelTest method testAddNewField.
/**
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#addNewField()}.
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#removeFields(int[])}.
*/
@Test
public void testAddNewField() {
DataSourceAttributeModel model = new DataSourceAttributeModel();
assertEquals(0, model.getRowCount());
model.addNewField();
assertEquals(1, model.getRowCount());
model.addNewField();
model.addNewField();
assertEquals(3, model.getRowCount());
model.removeFields(null);
assertEquals(3, model.getRowCount());
int[] selectedRowIndexes = new int[3];
selectedRowIndexes[0] = 0;
selectedRowIndexes[1] = -1;
selectedRowIndexes[2] = 5;
model.removeFields(selectedRowIndexes);
assertEquals(2, model.getRowCount());
}
use of com.sldeditor.datasource.config.DataSourceAttributeModel in project sldeditor by robward-scisys.
the class DataSourceAttributeModelTest method testGetColumnCount.
/**
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#getColumnCount()}.
* Test method for {@link com.sldeditor.datasource.config.DataSourceAttributeModel#getColumnName(int)}.
*/
@Test
public void testGetColumnCount() {
DataSourceAttributeModel model = new DataSourceAttributeModel();
assertEquals(3, model.getColumnCount());
String col1 = model.getColumnName(0);
String col2 = model.getColumnName(1);
String col3 = model.getColumnName(2);
assertFalse(col1.isEmpty());
assertFalse(col2.isEmpty());
assertFalse(col3.isEmpty());
}
Aggregations