46 lines
1.3 KiB
Java
46 lines
1.3 KiB
Java
package jmri.jmrit.operations.locations.tools;
|
|
|
|
import java.awt.GraphicsEnvironment;
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import org.junit.Assert;
|
|
import org.junit.Assume;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import jmri.jmrit.operations.OperationsTestCase;
|
|
import jmri.jmrit.operations.locations.gui.SpurEditFrame;
|
|
import jmri.util.JUnitUtil;
|
|
import jmri.util.JmriJFrame;
|
|
|
|
/**
|
|
*
|
|
* @author Paul Bender Copyright (C) 2017
|
|
*/
|
|
public class AlternateTrackActionTest extends OperationsTestCase {
|
|
|
|
@Test
|
|
public void testCTor() {
|
|
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
|
|
SpurEditFrame tf = new SpurEditFrame();
|
|
AlternateTrackAction t = new AlternateTrackAction(tf);
|
|
Assert.assertNotNull("exists",t);
|
|
}
|
|
|
|
@Test
|
|
public void testAction() {
|
|
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
|
|
SpurEditFrame tf = new SpurEditFrame();
|
|
AlternateTrackAction a = new AlternateTrackAction(tf);
|
|
Assert.assertNotNull("exists", a);
|
|
|
|
a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null));
|
|
|
|
JmriJFrame f = JmriJFrame.getFrame(Bundle.getMessage("AlternateTrack"));
|
|
Assert.assertNotNull("exists", f);
|
|
JUnitUtil.dispose(f);
|
|
}
|
|
|
|
// private static final Logger log = LoggerFactory.getLogger(AlternateTrackActionTest.class);
|
|
|
|
}
|