Examples of YamlParser


Examples of by.stub.yaml.YamlParser

         final String errorMessage = String.format("%s request on URI %s was empty", request.getMethod(), request.getRequestURI());
         HandlerUtils.configureErrorResponse(wrapper, HttpStatus.NO_CONTENT_204, errorMessage);
         return;
      }

      final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataStore.getYamlParentDirectory(), FileUtils.constructReader(put));
      final StubHttpLifecycle newStubHttpLifecycle = stubHttpLifecycles.get(0);
      dataStore.updateStubHttpLifecycleByIndex(stubIndexToUpdate, newStubHttpLifecycle);

      wrapper.setStatus(HttpStatus.CREATED_201);
      wrapper.addHeader(HttpHeaders.LOCATION, newStubHttpLifecycle.getRequest().getUrl());
View Full Code Here

Examples of by.stub.yaml.YamlParser

            ANSITerminal.info(String.format("\nConfiguration scan detected change in %s\n", dataStore.getDataYaml().getAbsolutePath()));

            try {
               lastModified = currentFileModified;
               final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataYaml.getParent(), FileUtils.constructReader(dataYaml));

               dataStore.resetStubHttpLifecycles(stubHttpLifecycles);
               ANSITerminal.ok(String.format("%sSuccessfully performed live refresh of YAML configuration from: %s%s",
                  "\n",
                  dataYaml.getAbsolutePath(),
View Full Code Here

Examples of by.stub.yaml.YamlParser

         return;
      }

      try {

         final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataStore.getDataYaml(), FileUtils.constructReader(post));

         dataStore.resetStubHttpLifecycles(stubHttpLifecycles);

         response.setStatus(HttpStatus.CREATED_201);
         response.getWriter().println("Configuration created successfully");
View Full Code Here

Examples of by.stub.yaml.YamlParser


      Log.setLog(new EmptyLogger());

      final File dataYamlFile = new File(dataYamlFilename);
      final List<StubHttpLifecycle> httpLifecycles = new YamlParser().parse(dataYamlFile, FileUtils.constructReader(dataYamlFile));

      System.out.println();

      final DataStore dataStore = new DataStore(dataYamlFile, httpLifecycles);
      final JettyFactory jettyFactory = new JettyFactory(commandLineArgs, dataStore);
View Full Code Here

Examples of by.stub.yaml.YamlParser

            ANSITerminal.info(String.format("\nExternal file scan detected change in %s\n", offendingFilename));

            try {
               final List<StubHttpLifecycle> stubHttpLifecycles =
                  new YamlParser().parse(stubbedDataManager.getYamlParentDirectory(), FileUtils.constructReader(stubbedDataManager.getDataYaml()));

               stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);
               ANSITerminal.ok(String.format("%sSuccessfully performed live refresh of main YAML with external files from: %s%s",
                  "\n",
                  stubbedDataManager.getDataYaml(),
View Full Code Here

Examples of by.stub.yaml.YamlParser

            ANSITerminal.info(String.format("\nMain YAML scan detected change in %s\n", stubbedDataManager.getYamlAbsolutePath()));

            try {
               mainYamlLastModified = currentFileModified;
               final List<StubHttpLifecycle> stubHttpLifecycles = new YamlParser().parse(dataYaml.getParent(), FileUtils.constructReader(dataYaml));

               stubbedDataManager.resetStubHttpLifecycles(stubHttpLifecycles);
               ANSITerminal.ok(String.format("%sSuccessfully performed live refresh of main YAML file from: %s%s",
                  "\n",
                  dataYaml.getAbsolutePath(),
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.yaml.YAMLParser

    try {
      if (byteSource.isEmpty()) {
        node = JsonNodeFactory.instance.objectNode();
      } else {
        try (InputStream inputStream = configurationSource.getByteSource().openBufferedStream()) {
          YAMLParser yamlParser = yamlFactory.createParser(inputStream);
          node = objectMapper.readTree(yamlParser);
        }
      }
      return build(configurationClass, node);
    } catch (IOException ex) {
View Full Code Here

Examples of com.google.jstestdriver.config.YamlParser

        .setPort(8082)
        .build();
    jstd.startServer();
    startLatch.await(10, TimeUnit.SECONDS);
    assertTrue(testServerListener.serverStarted);
    Configuration configuration = new UserConfigurationSource(new File("./jsTestDriver.conf")).parse(new BasePaths(new File(".")), new YamlParser());
    jstd.getTestCasesFor(configuration);
    jstd.stopServer();
    stopLatch.await(10, TimeUnit.SECONDS);
    assertTrue(testServerListener.serverStopped);
  }
View Full Code Here

Examples of com.google.jstestdriver.config.YamlParser

    catch (IOException e) {
      throw new ExecutionException("Cannot read JsTestDriver configuration file " + configVirtualFile.getPath());
    }
    Reader reader = new InputStreamReader(new ByteArrayInputStream(content), Charset.defaultCharset());
    try {
      YamlParser yamlParser = new YamlParser();
      ParsedConfiguration parsedConfiguration = (ParsedConfiguration) yamlParser.parse(reader, dirBasePaths);
      JstdConfigParsingUtils.wipeCoveragePlugin(parsedConfiguration);
      return JstdConfigParsingUtils.resolveConfiguration(parsedConfiguration);
    }
    catch (Exception e) {
      String message = "Malformed JsTestDriver configuration file " + configVirtualFile.getPath();
View Full Code Here

Examples of com.google.jstestdriver.config.YamlParser

  /**
   * @param configurationSource
   */
  public JsTestDriverBuilder setConfigurationSource(ConfigurationSource source) {
    setDefaultConfiguration(source.parse(basePaths, new YamlParser()));
    return this;
  }
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.