private void updatePath(String property, String sep, boolean cp) throws MalformedURLException { String userpath= JMeterUtils.getPropDefault(property,"");// $NON-NLS-1$ if (userpath.length() <= 0) { return; } log.info("{}={}", property, userpath); //$NON-NLS-1$ StringTokenizer tok = new StringTokenizer(userpath, sep); while(tok.hasMoreTokens()) { String path=tok.nextToken(); File f=new File(path); if (!f.canRead() && !f.isDirectory()) { log.warn("Can't read {}", path); } else { if (cp) { log.info("Adding to classpath and loader: {}", path); NewDriver.addPath(path); } else { log.info("Adding to loader: {}", path); NewDriver.addURL(path); } } } }
/** * {@inheritDoc} */ @Override public void testStarted() { if (getBasedir() != null && getBasedir().length() > 0) { try { FileServer.getFileServer().setBasedir(FileServer.getFileServer().getBaseDir() + getBasedir()); } catch (IllegalStateException e) { log.error("Failed to set file server base dir with {}", getBasedir(), e); } } // we set the classpath String[] paths = this.getTestPlanClasspathArray(); for (String path : paths) { try { NewDriver.addURL(path); log.info("added {} to classpath", path); } catch (MalformedURLException e) { // TODO Should we continue the test or fail ? log.error("Error adding {} to classpath", path, e); } } }