use of jmri.jmrit.progsupport.ProgModeSelector in project JMRI by JMRI.
the class CombinedLocoSelListPaneTest method testSelectedDecoderType.
public void testSelectedDecoderType() {
ProgModeSelector sel = new ProgModeSelector() {
Programmer programmer = new jmri.progdebugger.ProgDebugger();
@Override
public Programmer getProgrammer() {
return programmer;
}
@Override
public boolean isSelected() {
return true;
}
@Override
public void dispose() {
}
};
JLabel val1 = new JLabel();
// ensure a valid DecoderIndexFile
jmri.jmrit.decoderdefn.DecoderIndexFile.resetInstance();
CombinedLocoSelListPane combinedlocosellistpane = new CombinedLocoSelListPane(val1, sel);
combinedlocosellistpane.mDecoderList.setSelectedIndex(4);
Assert.assertEquals("after update", true, combinedlocosellistpane.isDecoderSelected());
String stringRet = combinedlocosellistpane.selectedDecoderType();
Assert.assertEquals("selected item", "NMRA standard register definitions (NMRA standard register definitions)", stringRet);
}
use of jmri.jmrit.progsupport.ProgModeSelector in project JMRI by JMRI.
the class CombinedLocoSelListPaneTest method testIsDecoderSelected.
public void testIsDecoderSelected() {
ProgModeSelector sel = new ProgModeSelector() {
Programmer programmer = new jmri.progdebugger.ProgDebugger();
@Override
public Programmer getProgrammer() {
return programmer;
}
@Override
public boolean isSelected() {
return true;
}
@Override
public void dispose() {
}
};
JLabel val1 = new JLabel();
// ensure a valid DecoderIndexFile
jmri.jmrit.decoderdefn.DecoderIndexFile.resetInstance();
CombinedLocoSelListPane combinedlocosellistpane = new CombinedLocoSelListPane(val1, sel);
Assert.assertEquals("initial state", false, combinedlocosellistpane.isDecoderSelected());
combinedlocosellistpane.mDecoderList.setSelectedIndex(1);
Assert.assertEquals("after update", true, combinedlocosellistpane.isDecoderSelected());
}
Aggregations