Examples of Failure


Examples of org.junit.runner.notification.Failure

            notifier.fireTestStarted(asDescription(test));
        }

        // Implement junit.framework.TestListener
        public void addError(Test test, Throwable e) {
            Failure failure = new Failure(asDescription(test), e);
            notifier.fireTestFailure(failure);
        }
View Full Code Here

Examples of org.junit.runner.notification.Failure

    }

    private void runCause(Throwable child, RunNotifier notifier) {
        Description description = describeCause(child);
        notifier.fireTestStarted(description);
        notifier.fireTestFailure(new Failure(description, child));
        notifier.fireTestFinished(description);
    }
View Full Code Here

Examples of org.junit.runner.notification.Failure

    public void addFailure(Throwable targetException) {
        if (targetException instanceof MultipleFailureException) {
            addMultipleFailureException((MultipleFailureException) targetException);
        } else {
            notifier.fireTestFailure(new Failure(description, targetException));
        }
    }
View Full Code Here

Examples of org.junit.runner.notification.Failure

            addFailure(each);
        }
    }

    public void addFailedAssumption(AssumptionViolatedException e) {
        notifier.fireTestAssumptionFailed(new Failure(description, e));
    }
View Full Code Here

Examples of org.junit.runner.notification.Failure

                iocClientTestCase.setName(method.getName());
                JUnitShell.runTest(iocClientTestCase, result);
              }
            }
            catch (GenerationException e) {
              notifier.fireTestFailure(new Failure(description, e));
            }
            catch (InvocationTargetException e) {
              notifier.fireTestFailure(new Failure(description, e.getTargetException()));
              return;
            }
            catch (Throwable e) {
              notifier.fireTestFailure(new Failure(description, e));
              return;
            }

            notifier.fireTestRunFinished(new Result());

            if (!result.wasSuccessful()) {
              notifier.fireTestFailure(new Failure(description, null));
            }
            else {
              notifier.fireTestFinished(description);
            }
          }
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.Failure

    return result;
  }

  private static Result<IValue> callWith(List<AbstractFunction> candidates, Type[] argTypes, IValue[] argValues, Map<String, IValue> keyArgValues, boolean mustSucceed) {
    AbstractFunction failed = null;
    Failure failure = null;

    for (AbstractFunction candidate : candidates) {
      if ((candidate.hasVarArgs() && argValues.length >= candidate.getArity() - 1)
          || candidate.getArity() == argValues.length
          || candidate.hasKeywordArgs()) {
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.Failure

      __eval.setCurrentAST(this);
      __eval.notifyAboutSuspension(this);
     
      if (!this.getTarget().isEmpty()) {
        throw new Failure(Names.name(this.getTarget().getName()));
      }

      throw new Failure();

    }
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.Failure

      return true;
    }
       
    @Override
    public Result<IValue> call(Type[] argTypes, IValue[] argValues, Map<String, IValue> keyArgValues) {
      Failure f1 = null;
      try {
        try {
          return getRight().call(argTypes, argValues, keyArgValues);
        } catch(MatchFailed e) {
          // try another one
        } catch(Failure e) {
          // try another one
        }
         return getLeft().call(argTypes, argValues, keyArgValues);
      }
      catch (MatchFailed e) {
        List<AbstractFunction> candidates = Arrays.<AbstractFunction>asList((AbstractFunction) getLeft(), (AbstractFunction) getRight());
        throw new ArgumentsMismatch("+ composition", candidates, argTypes, ctx.getCurrentAST());
      }
      catch(Failure f2) {
        throw new Failure("Both functions in the '+' composition have failed:\n "
                  + getLeft().toString() + ",\n" + getRight().toString());
      }
    }
View Full Code Here

Examples of org.xadoop.servlet.actions.results.Failure

    // get required parameters
    PostRequest postReq = new PostRequest();
    try {
      postReq.parse(req, null, false);
    } catch (Exception e) {
      return new Failure(e.getMessage());
    }
    String username = postReq.getFormField(LoginPage.USERNAME);
    String enteredPw = postReq.getFormField(LoginPage.PASSWORD);
    if (username == null) {
      return new Failure("No username given.");
    }
    if (username.length() > 40) {
      return new Failure("Too long username entered.");
    }
    if (enteredPw == null) {
      return new Failure("No password given.");
    }

    // lookup user
    HttpSession session = req.getSession();
    ServletContext ctx = session.getServletContext();
    XadoopConfig config = (XadoopConfig) ctx.getAttribute(XadoopConstants.CTX_CONFIG);
    HashMap<String, String> userMap = config.getUserMap();
    String storedPw = userMap.get(username);
    if (storedPw != null) {
      if (storedPw.equals(enteredPw)) {

        // store login in session and return success (null)
        session.setAttribute(SessionAttrs.USERNAME, username);
        return new Success("");
      } else {
        return new Failure("Wrong password for user " + username + " entered.");
      }
    } else {
      return new Failure("Username does not exist.");
    }
  }
View Full Code Here

Examples of rocks.xmpp.core.tls.model.Failure

    }

    @Test
    public void unmarshalFailure() throws XMLStreamException, JAXBException {
        String xml = "<failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>";
        Failure failure = unmarshal(xml, Failure.class);
        Assert.assertNotNull(failure);
    }
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.