@Test public void testActionPerformed_err1() { System.out.println("actionPerformed err 1"); ActionEvent e = null; JTextArea info = new JTextArea(); JTextField fname = new JTextField(basedir + "/nofile"); CheckConsistencyAction instance = new CheckConsistencyAction(fname, info); instance.actionPerformed(e); System.out.println(info.getText()); assertEquals(Color.red, info.getForeground()); }
public void actionPerformed(ActionEvent e) { infoArea.setText(""); infoArea.setForeground(Color.black); final String fname = filename.getText(); File f = new File(fname); if (!f.exists()) { reportError("File '" + fname + "' was not found"); return; } int cnt = 0; try { RawRequestSourcePreProcessor preproc = new RawRequestSourcePreProcessor(); preproc.testStarted(); preproc.setFileName(fname); preproc.setVarName("test"); preproc.setRewindOnEOF(false); while (true) { preproc.process(); cnt++; } } catch (RuntimeEOFException ex) { reportOk("File seems to be OK."); infoArea.setForeground(Color.decode("0x00009900")); } catch (RuntimeException ex) { log.debug("Runtime Exception", ex); reportError(ex.toString()+" "+JMeterPluginsUtils.getStackTrace(ex)); } reportOk("Parsed " + cnt + " requests in " + fname); }
CheckConsistencyAction implements ActionListener { public void actionPerformed(ActionEvent e) { infoArea.setText(""); infoArea.setForeground(Color.black); final String fname = filename.getText(); File f = new File(fname); if (!f.exists()) { reportError("File '" + fname + "' was not found"); return; } int cnt = 0; try { RawRequestSourcePreProcessor preproc = new RawRequestSourcePreProcessor(); preproc.testStarted(); preproc.setFileName(fname); preproc.setVarName("test"); preproc.setRewindOnEOF(false); while (true) { preproc.process(); cnt++; } } catch (RuntimeEOFException ex) { reportOk("File seems to be OK."); infoArea.setForeground(Color.decode("0x00009900")); } catch (RuntimeException ex) { log.debug("Runtime Exception", ex); reportError(ex.toString()+" "+JMeterPluginsUtils.getStackTrace(ex)); } reportOk("Parsed " + cnt + " requests in " + fname); } }
CheckConsistencyAction implements ActionListener { public void actionPerformed(ActionEvent e) { infoArea.setText(""); infoArea.setForeground(Color.black); final String fname = filename.getText(); File f = new File(fname); if (!f.exists()) { reportError("File '" + fname + "' was not found"); return; } int cnt = 0; try { RawRequestSourcePreProcessor preproc = new RawRequestSourcePreProcessor(); preproc.testStarted(); preproc.setFileName(fname); preproc.setVarName("test"); preproc.setRewindOnEOF(false); while (true) { preproc.process(); cnt++; } } catch (RuntimeEOFException ex) { reportOk("File seems to be OK."); infoArea.setForeground(Color.decode("0x00009900")); } catch (RuntimeException ex) { log.debug("Runtime Exception", ex); reportError(ex.toString()+" "+JMeterPluginsUtils.getStackTrace(ex)); } reportOk("Parsed " + cnt + " requests in " + fname); } CheckConsistencyAction(JTextField field, JTextArea checkInfo); }
CheckConsistencyAction implements ActionListener { public void actionPerformed(ActionEvent e) { infoArea.setText(""); infoArea.setForeground(Color.black); final String fname = filename.getText(); File f = new File(fname); if (!f.exists()) { reportError("File '" + fname + "' was not found"); return; } int cnt = 0; try { RawRequestSourcePreProcessor preproc = new RawRequestSourcePreProcessor(); preproc.testStarted(); preproc.setFileName(fname); preproc.setVarName("test"); preproc.setRewindOnEOF(false); while (true) { preproc.process(); cnt++; } } catch (RuntimeEOFException ex) { reportOk("File seems to be OK."); infoArea.setForeground(Color.decode("0x00009900")); } catch (RuntimeException ex) { log.debug("Runtime Exception", ex); reportError(ex.toString()+" "+JMeterPluginsUtils.getStackTrace(ex)); } reportOk("Parsed " + cnt + " requests in " + fname); } CheckConsistencyAction(JTextField field, JTextArea checkInfo); void actionPerformed(ActionEvent e); }
CheckConsistencyAction implements ActionListener { public void actionPerformed(ActionEvent e) { infoArea.setText(""); infoArea.setForeground(Color.black); final String fname = filename.getText(); File f = new File(fname); if (!f.exists()) { reportError("File '" + fname + "' was not found"); return; } int cnt = 0; try { RawRequestSourcePreProcessor preproc = new RawRequestSourcePreProcessor(); preproc.testStarted(); preproc.setFileName(fname); preproc.setVarName("test"); preproc.setRewindOnEOF(false); while (true) { preproc.process(); cnt++; } } catch (RuntimeEOFException ex) { reportOk("File seems to be OK."); infoArea.setForeground(Color.decode("0x00009900")); } catch (RuntimeException ex) { log.debug("Runtime Exception", ex); reportError(ex.toString()+" "+JMeterPluginsUtils.getStackTrace(ex)); } reportOk("Parsed " + cnt + " requests in " + fname); } CheckConsistencyAction(JTextField field, JTextArea checkInfo); void actionPerformed(ActionEvent e);  }