yaoh.wu
6 years ago
1 changed files with 54 additions and 54 deletions
@ -1,54 +1,54 @@ |
|||||||
package com.fr.env; |
//package com.fr.env;
|
||||||
|
//
|
||||||
import org.fest.swing.annotation.RunsInEDT; |
//import org.fest.swing.annotation.RunsInEDT;
|
||||||
import org.fest.swing.core.ComponentLookupScope; |
//import org.fest.swing.core.ComponentLookupScope;
|
||||||
import org.fest.swing.core.Robot; |
//import org.fest.swing.core.Robot;
|
||||||
import org.fest.swing.edt.GuiQuery; |
//import org.fest.swing.edt.GuiQuery;
|
||||||
import org.fest.swing.fixture.JPanelFixture; |
//import org.fest.swing.fixture.JPanelFixture;
|
||||||
import org.fest.swing.junit.testcase.FestSwingJUnitTestCase; |
//import org.fest.swing.junit.testcase.FestSwingJUnitTestCase;
|
||||||
import org.junit.Test; |
//import org.junit.Test;
|
||||||
|
//
|
||||||
import javax.swing.JFrame; |
//import javax.swing.JFrame;
|
||||||
import javax.swing.WindowConstants; |
//import javax.swing.WindowConstants;
|
||||||
|
//
|
||||||
import static org.fest.swing.edt.GuiActionRunner.execute; |
//import static org.fest.swing.edt.GuiActionRunner.execute;
|
||||||
|
//
|
||||||
public class RemoteEnvPaneTest extends FestSwingJUnitTestCase { |
//public class RemoteEnvPaneTest extends FestSwingJUnitTestCase {
|
||||||
|
//
|
||||||
@Override |
// @Override
|
||||||
protected void onSetUp() { |
// protected void onSetUp() {
|
||||||
|
//
|
||||||
} |
// }
|
||||||
|
//
|
||||||
@Test |
// @Test
|
||||||
public void test() { |
// public void test() {
|
||||||
|
//
|
||||||
Robot robot = robot(); |
// Robot robot = robot();
|
||||||
|
//
|
||||||
robot.settings().componentLookupScope(ComponentLookupScope.ALL); |
// robot.settings().componentLookupScope(ComponentLookupScope.ALL);
|
||||||
|
//
|
||||||
JPanelFixture rootFixture = new JPanelFixture(robot, createNewEditor()); |
// JPanelFixture rootFixture = new JPanelFixture(robot, createNewEditor());
|
||||||
rootFixture.checkBox("httpsCheckbox").check(); |
// rootFixture.checkBox("httpsCheckbox").check();
|
||||||
|
//
|
||||||
rootFixture.checkBox("httpsCheckbox").requireSelected(); |
// rootFixture.checkBox("httpsCheckbox").requireSelected();
|
||||||
} |
// }
|
||||||
|
//
|
||||||
@RunsInEDT |
// @RunsInEDT
|
||||||
private static RemoteEnvPane createNewEditor() { |
// private static RemoteEnvPane createNewEditor() {
|
||||||
|
//
|
||||||
return execute(new GuiQuery<RemoteEnvPane>() { |
// return execute(new GuiQuery<RemoteEnvPane>() {
|
||||||
@Override |
// @Override
|
||||||
protected RemoteEnvPane executeInEDT() { |
// protected RemoteEnvPane executeInEDT() {
|
||||||
RemoteEnvPane envPane = new RemoteEnvPane(); |
// RemoteEnvPane envPane = new RemoteEnvPane();
|
||||||
JFrame frame = new JFrame(); |
// JFrame frame = new JFrame();
|
||||||
frame.getContentPane().add(envPane); |
// frame.getContentPane().add(envPane);
|
||||||
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
// frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
frame.setResizable(false); |
// frame.setResizable(false);
|
||||||
frame.pack(); |
// frame.pack();
|
||||||
frame.setLocationRelativeTo(null); |
// frame.setLocationRelativeTo(null);
|
||||||
frame.setVisible(true); |
// frame.setVisible(true);
|
||||||
return envPane; |
// return envPane;
|
||||||
} |
// }
|
||||||
}); |
// });
|
||||||
} |
// }
|
||||||
} |
//}
|
||||||
|
Loading…
Reference in new issue