/** * Shows a pop-up menu using this fixture's {@code JPanel} as the invoker of the pop-up menu. * * @return a fixture that manages the displayed pop-up menu. * @throws IllegalStateException if {@link org.assertj.swing.core.Settings#clickOnDisabledComponentsAllowed()} is <code>false</code> and this * fixture's {@code JPanel} is disabled. * @throws IllegalStateException if this fixture's {@code JPanel} is not showing on the screen. * @throws org.assertj.swing.exception.ComponentLookupException if a pop-up menu cannot be found. */ @Override @Nonnull public JPopupMenuFixture showPopupMenu() { return new JPopupMenuFixture(robot(), driver().invokePopupMenu(target())); }
@Test public void validateFormWithSSHTunnelingAndPasswordAuthMethod() { frameFixture.textBox("labelField").setText("MyServer"); frameFixture.textBox("serverUrlsField").setText("localhost:25"); frameFixture.tabbedPane("tabbedSettings") .selectTab("SSH"); frameFixture.textBox("sshProxyUrlField").setText("remotehost:22"); frameFixture.comboBox("sshAuthenticationMethodComboBox").selectItem("Password"); frameFixture.label("passLabel").requireText("Password:"); frameFixture.panel(new TextFieldWithBrowseButtonGenericTypeMatcher("sshPrivateKeyPathComponent")).requireNotVisible(); frameFixture.textBox("sshProxyUsernameField").setText("john.doe"); frameFixture.textBox("sshProxyPasswordField").setText("myPassword"); ServerConfiguration configuration = new ServerConfiguration(); configurationPanel.applyConfigurationData(configuration); assertThat(configuration.getServerUrls()).containsExactly("localhost:25"); SshTunnelingConfiguration sshTunnelingConfiguration = configuration.getSshTunnelingConfiguration(); assertThat(sshTunnelingConfiguration).isNotNull(); assertThat(sshTunnelingConfiguration.getProxyUrl()).isEqualTo("remotehost:22"); assertThat(sshTunnelingConfiguration.getAuthenticationMethod()).isEqualTo(AuthenticationMethod.PASSWORD); assertThat(sshTunnelingConfiguration.getProxyUser()).isEqualTo("john.doe"); assertThat(sshTunnelingConfiguration.getPrivateKeyPath()).isNull(); assertThat(sshTunnelingConfiguration.getProxyPassword()).isEqualTo("myPassword"); }
@Override public JTableFixture me() { return logViewPanel.table("LogViewPanel.log table"); } }
/** * Asserts that the toolTip in this fixture's {@code JPanel} matches the given value. * * @param expected the given value. It can be a regular expression. * @return this fixture. * @throws AssertionError if the toolTip in this fixture's {@code JPanel} does not match the given value. */ @Override @Nonnull public JPanelFixture requireToolTip(@Nullable String expected) { driver().requireToolTip(target(), expected); return this; }
public OpenPanel addFile(File file) throws InterruptedException { me().button("OpenPanel.add more files").click(); final DialogFixture vfsBrowserDialog = WindowFinder.findDialog("VfsBrowserDialog").using(robot); openFile(file, vfsBrowserDialog); LOGGER.info("File " + file.getAbsolutePath() + " added to open list"); return this; }
@RunsInEDT @Override @Nonnull public JPanelFixture panel(@Nonnull GenericTypeMatcher<? extends JPanel> matcher) { return new JPanelFixture(robot(), find(matcher)); }
@Test public void setPreviewTextShouldReplaceText() throws Exception { // setup final JPanelFixture fixture = findPreviewPanel(); fixture.requireEnabled(); // exercise final String text = "package io.t28.test;\n\nclass Foo {\n}\n"; application.invokeAndWait(() -> underTest.setPreviewText(text)); // verify final String actual = underTest.getPreviewText(); assertThat(actual) .overridingErrorMessage("Expected preview text to be <%s> but was <%s>", text, actual) .isEqualTo(text); }
/** * Returns the client property stored in this fixture's {@code JPanel}, under the given key. * * @param key the key to use to retrieve the client property. * @return the value of the client property stored under the given key, or {@code null} if the property was not found. * @throws NullPointerException if the given key is {@code null}. */ @Override @Nullable public Object clientProperty(@Nonnull Object key) { return driver().clientProperty(target(), key); }
public StartSocketListenerDialog clickStartSocketListener() { me().button("Start socket listener").click(); return new StartSocketListenerDialog(robot); }
@RunsInEDT @Override @Nonnull public JPanelFixture panel(@Nullable String name) { return new JPanelFixture(robot(), findByName(name, JPanel.class)); }
/** * Shows a pop-up menu at the given point using this fixture's {@code JPanel} as the invoker of the pop-up menu. * * @param p the given point where to show the pop-up menu. * @return a fixture that manages the displayed pop-up menu. * @throws IllegalStateException if {@link org.assertj.swing.core.Settings#clickOnDisabledComponentsAllowed()} is <code>false</code> and this * fixture's {@code JPanel} is disabled. * @throws IllegalStateException if this fixture's {@code JPanel} is not showing on the screen. * @throws org.assertj.swing.exception.ComponentLookupException if a pop-up menu cannot be found. */ @Override @Nonnull public JPopupMenuFixture showPopupMenuAt(@Nonnull Point p) { return new JPopupMenuFixture(robot(), driver().invokePopupMenu(target(), p)); } }
/** * Asserts that the toolTip in this fixture's {@code JPanel} matches the given regular expression pattern. * * @param pattern the regular expression pattern to match. * @return this fixture. * @throws NullPointerException if the given regular expression pattern is {@code null}. * @throws AssertionError if the toolTip in this fixture's {@code JPanel} does not match the given regular expression. */ @Override @Nonnull public JPanelFixture requireToolTip(@Nonnull Pattern pattern) { driver().requireToolTip(target(), pattern); return this; }
public ParseClipboardDialog clickParseClipboard(){ me().button("Parse clipboard").click(); return new ParseClipboardDialog(robot); }
@RunsInEDT @Override @Nonnull public JPanelFixture panel() { return new JPanelFixture(robot(), findByType(JPanel.class)); }
public OpenPanel clickMergeLogs(){ final JButtonFixture mergeLogs = me().button("Merge log files"); mergeLogs.click(); return new OpenPanel(frame,robot).waitFor(); }