/** Returns operator for label Project Folder * @return JLabelOperator */ public JLabelOperator lblProjectFolder() { if(_lblProjectFolder == null) { _lblProjectFolder = new JLabelOperator(this, "Project Folder:"); } return _lblProjectFolder; }
/** Tries to find null JComboBox in this dialog. * @return JComboBoxOperator */ public JComboBoxOperator cboServer() { if (_cboServer==null) { JLabelOperator jlo =new JLabelOperator(this, "Server:"); _cboServer = new JComboBoxOperator((JComboBox)jlo.getLabelFor()); } return _cboServer; }
/** Returns operator of libraries folder textfield * @return JTextOperator */ public JTextFieldOperator txtLibrariesFolder() { if(_txtLirariesFolder == null) { if ( lblWebPagesFolder().getLabelFor()!=null ) { _txtLirariesFolder = new JTextFieldOperator((JTextField)lblLibrariesFolder().getLabelFor()); } } return _txtLirariesFolder; }
@Test public void testUpdateErrorLabel() { panel.setError("This is a test error message!"); assertFalse(isBlank(error.getText())); final JTextFieldOperator tf = new JTextFieldOperator(frame); tf.setText("secret"); //tf.getQueueTool().waitEmpty(WAIT_EMPTY); assertTrue(isBlank(error.getText())); panel.setError("This is a test error message!"); assertFalse(isBlank(error.getText())); new JTabbedPaneOperator(frame).selectPage(AuthenticationPanel.AUTH_KEY_FILE); // select tab for key files new JButtonOperator(frame, KEY_FILE_CHOOSER).push(); // open file chooser final JFileChooserOperator fc = new TFileChooserOperator(frame); fc.chooseFile(NON_EXISTING_FILE); fc.getQueueTool().waitEmpty(WAIT_EMPTY); assertTrue(isBlank(error.getText())); }
/** Returns operator of project folder textfield * @return JTextOperator */ public JTextFieldOperator txtProjectFolder() { if(_txtProjectFolder == null) { if ( lblProjectFolder().getLabelFor()!=null ) { _txtProjectFolder = new JTextFieldOperator( (JTextField)lblProjectFolder().getLabelFor()); } } return _txtProjectFolder; }
@Test public void testPasswd() throws InterruptedException { final AesPbeParameters param = newPbeParameters(); // Check default. assertTrue(updateParam(param)); assertEquals(0, param.getPassword().length); assertTrue(isBlank(error.getText())); final String passwd = "secret"; new JPasswordFieldOperator(frame).setText(passwd); assertTrue(updateParam(param)); assertEquals(passwd, new String(param.getPassword())); assertTrue(isBlank(error.getText())); }
/** Tries to find "Context Path:" JLabel in this dialog. * @return JLabelOperator */ public JLabelOperator lblContextPath() { if (_lblContextPath==null) { _lblContextPath = new JLabelOperator(this, "Context Path:"); } return _lblContextPath; }
/** Returns operator of project location text field * @return JTextOperator */ public JTextFieldOperator txtLocation() { if(_txtLocation == null) { if (lblLocation().getLabelFor()!=null) { _txtLocation = new JTextFieldOperator( (JTextField)lblLocation().getLabelFor()); } } return _txtLocation; }
/** Tries to find null JComboBox in this dialog. * @return JComboBoxOperator */ public JComboBoxOperator cboJavaEEVersion() { if (_cboJavaEEVersion==null) { JLabelOperator jlo =new JLabelOperator(this, "Java EE Version:"); _cboJavaEEVersion = new JComboBoxOperator((JComboBox)jlo.getLabelFor()); } return _cboJavaEEVersion; }
@Test public void testKeyFile() throws InterruptedException { final SafePbeParameters<?, ?> param = newPbeParameters(); new JTabbedPaneOperator(frame).selectPage(AuthenticationPanel.AUTH_KEY_FILE); // select tab for key files new JButtonOperator(frame, KEY_FILE_CHOOSER).push(); // open file chooser JFileChooserOperator fc = new TFileChooserOperator(frame); fc.chooseFile(NON_EXISTING_FILE); fc.getQueueTool().waitEmpty(WAIT_EMPTY); assertTrue(isBlank(error.getText())); assertFalse(updateParam(param)); assertFalse(isBlank(error.getText())); new JButtonOperator(frame, KEY_FILE_CHOOSER).push(); // open file chooser fc = new TFileChooserOperator(frame); final List<File> files = Arrays.asList(fc.getFiles()); Collections.shuffle(files); for (final File file : files) { if (!file.isFile()) continue; fc.setSelectedFile(file); fc.approve(); // close file chooser if (updateParam(param)) { assertNotNull(param.getPassword()); assertTrue(isBlank(error.getText())); } else { assertFalse(isBlank(error.getText())); } return; } fc.cancel(); // close file chooser }
/** Tries to find "Add to Enterprise Application:" JLabel in this dialog. * @return JLabelOperator */ public JLabelOperator lblAddToEnterpriseApplication() { if (_lblAddToEnterpriseApplication==null) { _lblAddToEnterpriseApplication = new JLabelOperator(this, "Add to Enterprise Application:"); } return _lblAddToEnterpriseApplication; }
/** Returns operator of web pages folder textfield * @return JTextOperator */ public JTextFieldOperator txtWebPagesFolder() { if(_txtWebPagesFolder == null) { if ( lblWebPagesFolder().getLabelFor()!=null ) { _txtWebPagesFolder = new JTextFieldOperator((JTextField)lblWebPagesFolder().getLabelFor()); } } return _txtWebPagesFolder; }
@Test public void testPasswd() throws InterruptedException { final AesPbeParameters param = newPbeParameters(); // Check default. assertFalse(updateParam(param)); assertNull(param.getPassword()); assertFalse(isBlank(error.getText())); // Enter mismatching passwords. new JPasswordFieldOperator(frame, 0).setText("foofoofoo"); new JPasswordFieldOperator(frame, 1).setText("barbarbar"); assertFalse(updateParam(param)); assertNull(param.getPassword()); assertFalse(isBlank(error.getText())); // Enter matching passwords, too short. String passwd = "secret7"; // 7 chars is too short new JPasswordFieldOperator(frame, 0).setText(passwd); new JPasswordFieldOperator(frame, 1).setText(passwd); assertFalse(updateParam(param)); assertNull(param.getPassword()); assertFalse(isBlank(error.getText())); // Enter matching passwords, long enough. passwd = "secret78"; // min 8 chars is OK new JPasswordFieldOperator(frame, 0).setText(passwd); new JPasswordFieldOperator(frame, 1).setText(passwd); assertTrue(updateParam(param)); assertEquals(passwd, new String(param.getPassword())); assertTrue(isBlank(error.getText())); }
/** Tries to find "Server:" JLabel in this dialog. * @return JLabelOperator */ public JLabelOperator lblServer() { if (_lblServer==null) { _lblServer = new JLabelOperator(this, "Server:"); } return _lblServer; }
/** Returns operator of project location text field * @return JTextOperator */ public JTextFieldOperator txtProjectLocation() { if(_txtProjectLocation == null) { if ( lblProjectLocation().getLabelFor()!=null ) { _txtProjectLocation = new JTextFieldOperator((JTextField)lblProjectLocation().getLabelFor()); } } return _txtProjectLocation; }
/** Returns operator for label Location when creating project with * existing sources. * @return JLabelOperator */ public JLabelOperator lblLocation() { if(_lblLocation == null) { _lblLocation = new JLabelOperator(this, "Location:"); } return _lblLocation; }
/** Returns operator of project name textfield * @return JTextOperator */ public JTextFieldOperator txtProjectName() { if(_txtProjectName == null) { if ( lblProjectName().getLabelFor()!=null ) { _txtProjectName = new JTextFieldOperator( (JTextField)lblProjectName().getLabelFor()); } } return _txtProjectName; }
/** Tries to find "<html>There may be legal considerations when sharing server JAR files. Be sure to check the license for your server to make sure you can distribute server JAR files to other developers.</html>" WizardDescriptor$FixedHeightLabel in this dialog. * @return JLabelOperator */ public JLabelOperator lblSharingJARLicenseRemark() { if (_lblSharingJARLicenseRemark == null) { _lblSharingJARLicenseRemark = new JLabelOperator(this, "There may be legal considerations when sharing server JAR files"); } return _lblSharingJARLicenseRemark; }
/** Returns operator of project location text field * @return JTextOperator */ public JTextFieldOperator txtProjectLocation() { if(_txtProjectLocation == null) { if (lblProjectLocation().getLabelFor()!=null) { _txtProjectLocation = new JTextFieldOperator( (JTextField)lblProjectLocation().getLabelFor()); } } return _txtProjectLocation; }
/** Returns operator for label Project Name * @return JLabelOperator */ public JLabelOperator lblProjectName() { if(_lblProjectName == null) { _lblProjectName = new JLabelOperator(this, "Project Name:"); } return _lblProjectName; }