mirror of
https://github.com/nasa/trick.git
synced 2025-02-06 19:09:20 +00:00
Created test suite for Tool Bar Buttons
This commit is contained in:
parent
265aa9a59e
commit
25936b0301
@ -467,6 +467,7 @@ public abstract class TrickApplication extends SingleFrameApplication implements
|
|||||||
button.setVerticalTextPosition(JButton.BOTTOM);
|
button.setVerticalTextPosition(JButton.BOTTOM);
|
||||||
button.setHorizontalTextPosition(JButton.CENTER);
|
button.setHorizontalTextPosition(JButton.CENTER);
|
||||||
button.setAction(getAction(actionName));
|
button.setAction(getAction(actionName));
|
||||||
|
button.setName(actionName + "Button");
|
||||||
button.setFocusable(false);
|
button.setFocusable(false);
|
||||||
if (!showText) {
|
if (!showText) {
|
||||||
button.setText(null);
|
button.setText(null);
|
||||||
|
@ -38,6 +38,7 @@ import org.assertj.swing.fixture.JOptionPaneFixture;
|
|||||||
import org.assertj.swing.fixture.JPanelFixture;
|
import org.assertj.swing.fixture.JPanelFixture;
|
||||||
import org.assertj.swing.fixture.JTextComponentFixture;
|
import org.assertj.swing.fixture.JTextComponentFixture;
|
||||||
import org.assertj.swing.fixture.JToggleButtonFixture;
|
import org.assertj.swing.fixture.JToggleButtonFixture;
|
||||||
|
import org.assertj.swing.fixture.JToolBarFixture;
|
||||||
import org.assertj.swing.fixture.FrameFixture;
|
import org.assertj.swing.fixture.FrameFixture;
|
||||||
import org.assertj.swing.fixture.MouseInputSimulationFixture;
|
import org.assertj.swing.fixture.MouseInputSimulationFixture;
|
||||||
import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase;
|
import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase;
|
||||||
@ -57,6 +58,7 @@ public class StubbedSimControlTests extends AssertJSwingJUnitTestCase {
|
|||||||
private FrameFixture mainFrame;
|
private FrameFixture mainFrame;
|
||||||
private JPanelFixture findPanel;
|
private JPanelFixture findPanel;
|
||||||
private JTextComponentFixture editorFixture;
|
private JTextComponentFixture editorFixture;
|
||||||
|
private JToolBarFixture toolBarFixture;
|
||||||
private StubbedSimControlApplication app = null;
|
private StubbedSimControlApplication app = null;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
@ -89,6 +91,8 @@ public class StubbedSimControlTests extends AssertJSwingJUnitTestCase {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
toolBarFixture = mainFrame.toolBar();
|
||||||
|
|
||||||
sleep(500);
|
sleep(500);
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
@ -457,6 +461,34 @@ public class StubbedSimControlTests extends AssertJSwingJUnitTestCase {
|
|||||||
assertThat(loggedAction).isEqualTo(THROTTLE_ACTION);
|
assertThat(loggedAction).isEqualTo(THROTTLE_ACTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------
|
||||||
|
// Toolbar Tests
|
||||||
|
//--------------------
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testStartTrickViewButton() {
|
||||||
|
final JButtonFixture TV_BUTTON = toolBarFixture.button("startTVButton");
|
||||||
|
final ActionID TV_ACTION = ActionID.TV;
|
||||||
|
|
||||||
|
testConnectedAction(TV_BUTTON, TV_ACTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testStartMalfunctionTrickViewButton() {
|
||||||
|
final JButtonFixture MTV_BUTTON = toolBarFixture.button("startMTVButton");
|
||||||
|
final ActionID MTV_ACTION = ActionID.MTV;
|
||||||
|
|
||||||
|
testConnectedAction(MTV_BUTTON, MTV_ACTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testThrottleButton() {
|
||||||
|
final JButtonFixture THROTTLE_BUTTON = toolBarFixture.button("throttleButton");
|
||||||
|
final ActionID THROTTLE_ACTION = ActionID.THROTTLE;
|
||||||
|
|
||||||
|
testConnectedAction(THROTTLE_BUTTON, THROTTLE_ACTION);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------
|
//--------------------
|
||||||
// Helper Methods
|
// Helper Methods
|
||||||
//--------------------
|
//--------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user