Examples of FileServer


Examples of org.apache.jmeter.services.FileServer

  /* (non-Javadoc)
   * @see org.apache.jmeter.protocol.http.util.accesslog.TCLogParser#parse(org.apache.jmeter.testelement.TestElement, int)
   */
  public int parse(TestElement el, int parseCount) {
    FileServer fileServer = FileServer.getFileServer();
    fileServer.reserveFile(FILENAME);
    try {
      return parse(fileServer, el, parseCount);
    } catch (Exception exception) {
      log.error("Problem creating samples", exception);
    }
View Full Code Here

Examples of org.apache.jmeter.services.FileServer

   * (non-Javadoc)
   *
   * @see org.apache.jmeter.engine.event.LoopIterationListener#iterationStart(org.apache.jmeter.engine.event.LoopIterationEvent)
   */
  public void iterationStart(LoopIterationEvent iterEvent) {
    FileServer server = FileServer.getFileServer();
    if (vars == null) {
      server.reserveFile(getFilename());
      vars = JOrphanUtils.split(getVariableNames(), ",");
    }
    try {
      String delim = getDelimiter();
      if (delim.equals("\\t"))
        delim = "\t";// Make it easier to enter a Tab
      String[] lineValues = JOrphanUtils.split(server.readLine(getFilename()), delim,false);
      for (int a = 0; a < vars.length && a < lineValues.length; a++) {
        this.getThreadContext().getVariables().put(vars[a], lineValues[a]);
      }
    } catch (IOException e) {
      log.error("Failed to read file: " + getFilename());
View Full Code Here

Examples of org.dtk.util.FileServer

   * contained within app.
   * @throws Exception
   */
  @Test
  public void test_AnalyseWebApplicationWithNoCustomModules() throws Exception {
    FileServer fs = FileServer.spawn(testPort, "sample_apps/amd/local_dtk_with_only_dtk_reqs");   
   
    HttpResponse response = generateHTMLFormPost("url", validWebAddress);   
    assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode())
   
    Map<String, Object> jsonResponse = extractJsonFromHTMLEncodedResponse(response);
   
    compareUnsortedModuleLists(Arrays.asList("dojo.parser", "dijit.form.Button", "dojox.grid.EnhancedGrid"),
      (List<String>) jsonResponse.get("requiredDojoModules"));
    assertEquals(Collections.EMPTY_LIST, (List<String>) jsonResponse.get("availableModules"));   
    assertEquals(Collections.EMPTY_LIST, (List) jsonResponse.get("packages"));
   
    fs.stop();       
  }
View Full Code Here

Examples of org.dtk.util.FileServer

   
    fs.stop();       
  }
 
  public void testAnalyseWebApplicationFromDirectory(String directoryPath) throws Exception {
    FileServer fs = FileServer.spawn(testPort, directoryPath);   
   
    HttpResponse response = generateHTMLFormPost("url", validWebAddress);   
    assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode())
    verifyWebApplicationDependencies(response);
   
    fs.stop();
 
View Full Code Here

Examples of org.dtk.util.FileServer

   * and response body contains an empty module list.
   * @throws Exception
   */
  @Test
  public void test_AnalyseWebApplicationWithNoDependencies() throws Exception {
    FileServer fs = FileServer.spawn(testPort, "sample_pages/amd/local_with_no_deps");   
   
    HttpResponse response = generateHTMLFormPost("url", validWebAddress);   
    assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode())
   
    Map<String, Object> jsonResponse = extractJsonFromHTMLEncodedResponse(response);
   
    assertEquals(Collections.EMPTY_LIST, (List<String>) jsonResponse.get("requiredDojoModules"));
    assertEquals(Collections.EMPTY_LIST, (List<String>) jsonResponse.get("availableModules"));
   
    fs.stop();
  }
View Full Code Here

Examples of org.one.stone.soup.server.http.FileServer

      if(showDirectoryListings!=null)
      {
        directoryListings = new Boolean(showDirectoryListings).booleanValue();
      }

      router = new HttpFileRouter(name,new FileServer(new File(root),new File(page404),indexPage,getMimeTypes()),directoryListings);
    }   
    else if(type.equals("http-ajax-service"))
    {
      String root = xServiceDefinition.getAttributeValueByName("root");
      String page404 = xServiceDefinition.getAttributeValueByName("404-file");
      String indexPage = xServiceDefinition.getAttributeValueByName("index-page");

      router = new AjaxRouter(name,new FileServer(new File(root),new File(page404),indexPage,getMimeTypes()));
    }
    else if(type.equals("http-inversion-router"))
    {
      String root = xServiceDefinition.getAttributeValueByName("root");
      String page404 = xServiceDefinition.getAttributeValueByName("404-file");
      String indexPage = xServiceDefinition.getAttributeValueByName("index-page");
     
      router = new HttpInversionRouter(name,new FileServer(new File(root),new File(page404),indexPage,getMimeTypes()));
    }
    else if(type.equals("http-tunnel-service"))
    {
      String root = xServiceDefinition.getAttributeValueByName("root");
      String page404 = xServiceDefinition.getAttributeValueByName("404-file");
      String indexPage = xServiceDefinition.getAttributeValueByName("index-page");
     
      router = new HttpTunnelRouter(name,new FileServer(new File(root),new File(page404),indexPage,getMimeTypes()));
    }
    else if(type.equals("http-load-balance-service"))
    {
      HttpLoadBalancingRouter balancingRouter = new HttpLoadBalancingRouter(name,server.getFileServer());
      router = balancingRouter;
View Full Code Here

Examples of org.serviceconnector.server.FileServer

      scmpCommandException.setMessageType(getKey());
      throw scmpCommandException;
    }
    SCMPMessage reply = null;
    try {
      FileServer fileServer = fileService.getServer();
      reply = fileServer.serverGetFileList(fileService.getPath(), fileService.getGetFileListScriptName(),
          message.getServiceName(), oti);
    } catch (Exception e) {
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.GET_FILE_LIST_FAILED,
          "Error occured in get file list on SC.");
      scmpCommandException.setMessageType(getKey());
View Full Code Here

Examples of org.serviceconnector.server.FileServer

      FileService fileService = (FileService) abstractService;
      // create file session
      FileSession fileSession = new FileSession(sessionInfo, ipAddressList, fileService.getPath(),
          fileService.getUploadFileScriptName(), fileService.getGetFileListScriptName());
      fileSession.setService(fileService);
      FileServer fileServer = fileService.allocateFileServerAndCreateSession(fileSession);
      // add server to session
      fileSession.setServer(fileServer);
      fileSession.setSessionTimeoutMillis(eciInMillis * basicConf.getEchoIntervalMultiplier());
      // finally add file session to the registry
      this.sessionRegistry.addSession(fileSession.getId(), fileSession);
View Full Code Here

Examples of org.serviceconnector.server.FileServer

    double otiOnSCSeconds = (otiOnSCMillis / Constants.SEC_TO_MILLISEC_FACTOR);
    this.sessionRegistry.resetSessionTimeout(session, (otiOnSCSeconds + session.getSessionTimeoutMillis()));
    SCMPMessage reply = null;
    try {
      String remoteFileName = message.getHeader(SCMPHeaderAttributeKey.REMOTE_FILE_NAME);
      FileServer fileServer = session.getFileServer();
      reply = fileServer.serverUploadFile(session, message, remoteFileName, oti);
    } catch (Exception e) {
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.FILE_UPLOAD_FAILED,
          "Error occured in file server on SC.");
      scmpCommandException.setMessageType(getKey());
      throw scmpCommandException;
View Full Code Here

Examples of org.serviceconnector.server.FileServer

    SCMPMessage reply = null;
    try {
      String remoteFileName = message.getHeader(SCMPHeaderAttributeKey.REMOTE_FILE_NAME);

      FileServer fileServer = session.getFileServer();
      reply = fileServer.serverDownloadFile(session, message, remoteFileName, oti);
    } catch (Exception e) {
      reply = new SCMPMessage();
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.FILE_DOWNLOAD_FAILED,
          "Error occured in file server on SC.");
      scmpCommandException.setMessageType(getKey());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.