Package org.ngrinder.script.handler

Examples of org.ngrinder.script.handler.ScriptHandler


   */
  public void doTest(final PerfTest perfTest) {
    SingleConsole singleConsole = null;
    try {
      singleConsole = startConsole(perfTest);
      ScriptHandler prepareDistribution = perfTestService.prepareDistribution(perfTest);
      GrinderProperties grinderProperties = perfTestService.getGrinderProperties(perfTest, prepareDistribution);
      startAgentsOn(perfTest, grinderProperties, checkCancellation(singleConsole));
      distributeFileOn(perfTest, checkCancellation(singleConsole));

      singleConsole.setReportPath(perfTestService.getReportFileDirectory(perfTest));
View Full Code Here


    FileEntry scriptEntry = checkNotNull(
        fileEntryService.getOne(user,
            checkNotEmpty(perfTest.getScriptName(), "perfTest should have script name"),
            getSafe(perfTest.getScriptRevision())), "script should exist");
    // Get all files in the script path
    ScriptHandler handler = scriptHandlerFactory.getHandler(scriptEntry);

    ProcessingResultPrintStream processingResult = new ProcessingResultPrintStream(new ByteArrayOutputStream());
    handler.prepareDist(perfTest.getId(), user, scriptEntry, perfTestDistDirectory, config.getControllerProperties(),
        processingResult);
    LOGGER.info("File write is completed in {}", perfTestDistDirectory);
    if (!processingResult.isSuccess()) {
      File logDir = new File(getLogFileDirectory(perfTest), "distribution_log.txt");
      try {
View Full Code Here

    if (StringUtils.isEmpty(testUrl)) {
      testUrl = StringUtils.defaultIfBlank(testUrl, "http://please_modify_this.com");
    } else {
      name = UrlUtils.getHost(testUrl);
    }
    ScriptHandler scriptHandler = fileEntryService.getScriptHandler(scriptType);
    FileEntry entry = new FileEntry();
    entry.setPath(fileName);
    if (scriptHandler instanceof ProjectHandler) {
      if (!fileEntryService.hasFileEntry(user, PathUtils.join(path, fileName))) {
        fileEntryService.prepareNewEntry(user, path, fileName, name, testUrl, scriptHandler,
View Full Code Here

        checkNotEmpty(scriptEntry.getContent(), "scriptEntity content should be provided");
      }
      checkNotNull(user, "user should be provided");
      // String result = checkSyntaxErrors(scriptEntry.getContent());

      ScriptHandler handler = scriptHandlerFactory.getHandler(scriptEntry);
      if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_VALIDATION_SYNTAX_CHECK)) {
        String result = handler.checkSyntaxErrors(scriptEntry.getPath(), scriptEntry.getContent());
        LOGGER.info("Perform Syntax Check by {} for {}", user.getUserId(), scriptEntry.getPath());
        if (result != null) {
          return result;
        }
      }
      File scriptDirectory = config.getHome().getScriptDirectory(user);
      FileUtils.deleteDirectory(scriptDirectory);
      Preconditions.checkTrue(scriptDirectory.mkdirs(), "Script directory {} creation is failed.");

      ProcessingResultPrintStream processingResult = new ProcessingResultPrintStream(new ByteArrayOutputStream());
      handler.prepareDist(0L, user, scriptEntry, scriptDirectory, config.getControllerProperties(), processingResult);
      if (!processingResult.isSuccess()) {
        return new String(processingResult.getLogByteArray());
      }
      File scriptFile = new File(scriptDirectory, FilenameUtils.getName(scriptEntry.getPath()));
View Full Code Here

TOP

Related Classes of org.ngrinder.script.handler.ScriptHandler

Copyright © 2018 www.massapicom. 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.