Package com.google.caliper.config

Examples of com.google.caliper.config.InvalidConfigurationException


      this.resultFile = new File(config.options().get("file"));
      logger.finer("found an output file in the configuration");
    } else if (config.options().containsKey("dir")) {
      File dir = new File(config.options().get("dir"));
      if (dir.isFile()) {
        throw new InvalidConfigurationException("specified a directory, but it's a file");
      }
      this.resultFile = new File(dir, createFileName(benchmarkClass.name()));
      logger.finer("found an output directory in the configuration");
    } else {
      this.resultFile =
View Full Code Here


      logger.info("No api key specified. Uploading results anonymously.");
    } else {
      try {
        apiKey = Optional.of(UUID.fromString(apiKeyString));
      } catch (IllegalArgumentException e) {
        throw new InvalidConfigurationException(String.format(
            "The specified API key (%s) is not valid. API keys are UUIDs and should look like %s.",
                apiKeyString, new UUID(0L0L)));
      }
    }
    this.apiKey = apiKey;

    @Nullable String urlString = resultProcessorConfig.options().get("url");
    if (Strings.isNullOrEmpty(urlString)) {
      logger.info("No upload URL was specified. Results will not be uploaded.");
      this.uploadUri = Optional.absent();
    } else {
      try {
        this.uploadUri = Optional.of(new URI(urlString).resolve(POST_PATH));
      } catch (URISyntaxException e) {
        throw new InvalidConfigurationException(urlString + " is an invalid upload url", e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.google.caliper.config.InvalidConfigurationException

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.