public void testEnded(String string) { log.debug("Test ended captured"); if (getFilename() != null && getFilename().length() > 0) { File file = new File(getFilename()); if (file.exists()) { log.info("Remove lockfile from " + getFilename()); file.delete(); } } }
/** * @return the filemask */ public String getFilemask() { log.debug("Return filemask: " + getPropertyAsString(FILEMASK)); return getPropertyAsString(FILEMASK); }
public void testEnded() { testEnded(null); }
public void testStarted(String string) { log.debug("Test started captured"); if (getFilename() != null && getFilename().length() > 0) { log.info("Checking lockfile at " + getFilename()); File file = new File(getFilename()); String path; try { throw new JMeterStopTestNowException("Failed to get path"); log.info("and by wildcard at " + path + getFilemask()); if (file.exists()) { log.error("Lock file found: " + getFilename()); throw new JMeterStopTestNowException("Lock file found: " + getFilename()); } else if (getFilemask() != null && getFilemask().length() > 0 && checkFileExistByPattern(path, getFilemask())) { log.error("Lock file found by pattern " + getFilemask()); throw new JMeterStopTestNowException("Lock file found by pattern " + getFilemask()); } else { try { log.info("Create lockfile at " + getFilename()); file.createNewFile(); } catch (IOException e) { log.debug("Filename: " + getFilename()); log.warn("No lockfile set. Ignore.");
@Override public void configure(TestElement te) { log.debug("[Lockfile plugin] configure"); super.configure(te); LockFile lf = (LockFile) te; tfFileName.setText(lf.getFilename()); tfFileMask.setText(lf.getFilemask()); }
@Override public void modifyTestElement(TestElement te) { log.debug("[Lockfile plugin] modifyTestElement"); configureTestElement(te); LockFile lf = (LockFile) te; lf.setFilename(tfFileName.getText()); lf.setFilemask(tfFileMask.getText()); }
@Override public TestElement createTestElement() { log.debug("[Lockfile plugin] createTestElement"); LockFile lockFile = new LockFile(); modifyTestElement(lockFile); lockFile.setComment(JMeterPluginsUtils.getWikiLinkText(WIKIPAGE)); return lockFile; }
/** * @param filename the filename to set */ public void setFilename(String filename) { log.debug("Set filename to: " + filename); setProperty(FILENAME, filename); }
public void testStarted() { testStarted(null); }
@Override public void configure(TestElement te) { log.debug("[Lockfile plugin] configure"); super.configure(te); LockFile lf = (LockFile) te; tfFileName.setText(lf.getFilename()); tfFileMask.setText(lf.getFilemask()); }
@Override public void modifyTestElement(TestElement te) { log.debug("[Lockfile plugin] modifyTestElement"); configureTestElement(te); LockFile lf = (LockFile) te; lf.setFilename(tfFileName.getText()); lf.setFilemask(tfFileMask.getText()); }
@Override public TestElement createTestElement() { log.debug("[Lockfile plugin] createTestElement"); LockFile lockFile = new LockFile(); modifyTestElement(lockFile); lockFile.setComment(JMeterPluginsUtils.getWikiLinkText(WIKIPAGE)); return lockFile; }
/** * @param filename the filename to set */ public void setFilename(String filename) { log.debug("Set filename to: " + filename); setProperty(FILENAME, filename); }
public void testStarted() { testStarted(null); }
public void testStarted(String string) { log.debug("Test started captured"); if (getFilename() != null && getFilename().length() > 0) { log.info("Checking lockfile at " + getFilename()); File file = new File(getFilename()); String path; try { throw new JMeterStopTestNowException("Failed to get path"); log.info("and by wildcard at " + path + getFilemask()); if (file.exists()) { log.error("Lock file found: " + getFilename()); throw new JMeterStopTestNowException("Lock file found: " + getFilename()); } else if (getFilemask() != null && getFilemask().length() > 0 && FileSystem.checkFileExistByPattern(path, getFilemask())) { log.error("Lock file found by pattern " + getFilemask()); throw new JMeterStopTestNowException("Lock file found by pattern " + getFilemask()); } else { try { log.info("Create lockfile at " + getFilename()); file.createNewFile(); } catch (IOException e) { log.debug("Filename: " + getFilename()); log.warn("No lockfile set. Ignore.");
/** * @return the filename */ public String getFilename() { log.debug("Return filename: " + getPropertyAsString(FILENAME)); return getPropertyAsString(FILENAME); }
/** * @param filemask the filename to set */ public void setFilemask(String filemask) { log.debug("Set filemask to: " + filemask); setProperty(FILEMASK, filemask); }
public void testEnded(String string) { log.debug("Test ended captured"); if (getFilename() != null && getFilename().length() > 0) { File file = new File(getFilename()); if (file.exists()) { log.info("Remove lockfile from " + getFilename()); file.delete(); } } }
public void testEnded() { testEnded(null); }
/** * @return the filename */ public String getFilename() { log.debug("Return filename: " + getPropertyAsString(FILENAME)); return getPropertyAsString(FILENAME); }