Examples of Result


Examples of ninja.Result

            allRequestsMeter.mark();

            try {

                Result result = route.getFilterChain().next(context);

                resultHandler.handleResult(result, context);

            } catch (Exception exception) {

                if (exception instanceof BadRequestException) {

                    badRequests.mark();

                } else {

                    internalServerErrors.mark();

                }

                Result result = onException(context, exception);
                renderErrorResultAndCatchAndLogExceptions(result, context);

            }

        } else {
            // throw a 404 "not found" because we did not find the route
            routesNotFound.mark();

            Result result = getNotFoundResult(context);
            renderErrorResultAndCatchAndLogExceptions(result, context);
        }

        activeRequests.dec();
    }
View Full Code Here

Examples of nl.nuggit.moltest.model.Result

  private static void initResults() {
    int r = 0;
    int a = 0;
    try (Scanner scanner = new Scanner(resultsFile)) {
      Result result = null;
      while (scanner.hasNextLine()) {
        String line = scanner.nextLine().trim();
        if (line.startsWith(RESULT)) {
          result = new Result(line);
          results.add(result);
          r++;
        } else if (line.startsWith(ANSWER)) {
          if (result == null) {
            throw new IllegalArgumentException(String.format("Found %s without %s: %s", ANSWER, RESULT, line));
          }
          Answer answer = new Answer(line);
          result.getAnswers().add(answer);
          a++;
        }
      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
View Full Code Here

Examples of org.adbcj.Result

  public void testRollback() throws Exception {
    Connection connection = connectionManager.connect().get();
    try {
      // Clear out updates table
      Result result = connection.executeUpdate("DELETE FROM updates").get();
      assertNotNull(result);

      // Make sure updates is empty
      ResultSet rs = connection.executeQuery("SELECT id FROM updates").get();
      assertNotNull(rs);
      assertEquals(rs.size(), 0);

      connection.beginTransaction();

      // Insert a row
      result = connection.executeUpdate("INSERT INTO updates (id) VALUES (1)").get();
      assertNotNull(result);
      assertEquals(result.getAffectedRows(), Long.valueOf(1));

      // Make sure we can select the row
      rs = connection.executeQuery("SELECT id FROM updates").get();
      assertNotNull(rs);
      assertEquals(rs.size(), 1);
View Full Code Here

Examples of org.akka.essentials.supervisor.example1.MyActorSystem.Result

  @Test
  public void successTest() throws Exception {
    supervisor.tell(Integer.valueOf(8));

    Integer result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    assert result.equals(Integer.valueOf(8));
  }
View Full Code Here

Examples of org.akka.essentials.supervisor.example2.MyActorSystem2.Result

  @Test
  public void successTest() throws Exception {
    supervisor.tell(Integer.valueOf(8));

    Integer result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    assert result.equals(Integer.valueOf(8));
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ConditionalWriter.Result

          }

          ArrayList<ByteSequence> changed = new ArrayList<ByteSequence>(numRows);
          Iterator<Result> results = cw.write(mutations.iterator());
          while (results.hasNext()) {
            Result result = results.next();
            changed.add(new ArrayByteSequence(result.getMutation().getRow()));
          }

          Collections.sort(changes);
          Collections.sort(changed);
View Full Code Here

Examples of org.apache.ambari.server.api.services.Result

   // Get a result from this query.
  private Result getResult(Resource parentResource)
      throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException {

    Result result = new ResultImpl(true);
    Resource.Type resourceType = getResourceDefinition().getType();
    TreeNode<Resource> tree = result.getResultTree();

    if (isCollectionResource()) {
      tree.setProperty("isCollection", "true");
    }
View Full Code Here

Examples of org.apache.aurora.scheduler.updater.StateEvaluator.Result

      if (stateMachine.getState() == IDLE) {
        stateMachine.transition(WORKING);
        statusChanges.add(WORKING);
      }

      Result result = evaluator.evaluate(actualState);
      if (result == Result.SUCCEEDED) {
        stateMachine.transition(SUCCEEDED);
        statusChanges.add(SUCCEEDED);
      } else if (result == Result.FAILED) {
        stateMachine.transition(FAILED);
        statusChanges.add(FAILED);
      }

      return new SideEffect(result.getAction(), statusChanges.build());
    }
View Full Code Here

Examples of org.apache.felix.scrplugin.Result

            generator.setOptions(options);
            generator.setProject(project);

            this.removePossiblyStaleFiles(scanner.getSources(), options);

            final Result result = generator.execute();
            this.setServiceComponentHeader(options);

            if ( !this.updateProjectResources() ) {
                this.setIncludeResourceHeader(options);
            }
            this.cleanUpDeletedSources(scanner.getDeletedSources(), options);

            this.refreshMessages(result.getProcessedSourceFiles());
            this.updateBuildContext(result);

        } catch (final SCRDescriptorException sde) {
            throw new MojoExecutionException(sde.getSourceLocation() + " : " + sde.getMessage(), sde);
        } catch (final SCRDescriptorFailureException sdfe) {
View Full Code Here

Examples of org.apache.geronimo.messaging.Result

        }
        if ( null == reference ) {
            throw new IllegalArgumentException("Unknown Reference.");
        }
        aRequest.setTarget(reference);
        Result result = aRequest.execute();
        if ( result.isSuccess() ) {
            return result.getResult();
        } else {
            throw result.getThrowable();
        }
    }
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.