use of com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel in project sldeditor by robward-scisys.
the class InLineFeatureModelTest method testSetValueAtObjectIntInt.
/**
* Test method for {@link com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel#setValueAt(java.lang.Object, int, int)}.
*/
@Test
public void testSetValueAtObjectIntInt() {
DummyInlineFeatureUpdated listener = new DummyInlineFeatureUpdated();
InLineFeatureModel model = new InLineFeatureModel(listener);
DummyInlineSLDFile testData1 = new DummyInlineSLDFile();
UserLayer userLayer = (UserLayer) testData1.getSLD().layers().get(0);
model.populate(userLayer);
assertEquals(1, model.getRowCount());
assertFalse(listener.hasInlineFeatureUpdatedCalled());
assertFalse(listener.hasInlineFeatureUpdatedCalled());
model.setValueAt(null, -1, 0);
model.setValueAt(null, 5, 0);
model.setValueAt(null, 0, -1);
model.setValueAt(null, 0, 5);
assertFalse(listener.hasInlineFeatureUpdatedCalled());
String expectedValue = "test value";
model.setValueAt(expectedValue, 0, 1);
String actualValue = (String) model.getValueAt(0, 1);
assertTrue(actualValue.compareTo(expectedValue) == 0);
assertTrue(listener.hasInlineFeatureUpdatedCalled());
}
use of com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel in project sldeditor by robward-scisys.
the class InLineFeatureModelTest method testGetFeatureCollection.
/**
* Test method for {@link com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel#getFeatureCollection()}.
* Test method for {@link com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel#getInlineFeatures()}.
*/
@Test
public void testGetFeatureCollection() {
DummyInlineFeatureUpdated listener = new DummyInlineFeatureUpdated();
InLineFeatureModel model = new InLineFeatureModel(listener);
assertNull(model.getFeatureCollection());
DummyInlineSLDFile testData1 = new DummyInlineSLDFile();
UserLayer userLayer = (UserLayer) testData1.getSLD().layers().get(0);
model.populate(userLayer);
assertNotNull(model.getFeatureCollection());
assertNotNull(model.getInlineFeatures());
}
use of com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel in project sldeditor by robward-scisys.
the class InLineFeatureModelTest method testGetValueAt.
/**
* Test method for {@link com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel#getValueAt(int, int)}.
* Test method for {@link com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel#populate(org.geotools.styling.UserLayer)}.
*/
@Test
public void testGetValueAt() {
DummyInlineFeatureUpdated listener = new DummyInlineFeatureUpdated();
InLineFeatureModel model = new InLineFeatureModel(listener);
DummyInlineSLDFile testData1 = new DummyInlineSLDFile();
UserLayer userLayer = (UserLayer) testData1.getSLD().layers().get(0);
model.populate(userLayer);
assertEquals(1, model.getRowCount());
assertFalse(listener.hasInlineFeatureUpdatedCalled());
assertNull(model.getValueAt(-1, 0));
assertNull(model.getValueAt(5, 0));
assertNull(model.getValueAt(0, -1));
assertNull(model.getValueAt(0, 5));
String actualValue = (String) model.getValueAt(0, 1);
assertTrue(actualValue.compareTo("Pacific NW") == 0);
}
use of com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel in project sldeditor by robward-scisys.
the class InLineFeatureModelTest method testGetRowCount.
/**
* Test method for {@link com.sldeditor.ui.detail.config.inlinefeature.InLineFeatureModel#getRowCount()}.
*/
@Test
public void testGetRowCount() {
InLineFeatureModel model = new InLineFeatureModel(null);
assertEquals(0, model.getRowCount());
DummyInlineSLDFile testData1 = new DummyInlineSLDFile();
UserLayer userLayer = (UserLayer) testData1.getSLD().layers().get(0);
model.populate(userLayer);
assertEquals(2, model.getColumnCount());
}
Aggregations