Package junit.framework

Examples of junit.framework.AssertionFailedError


        myContents.addAll(returnValues);
    }

    public Object getNext() {
        if (myContents.isEmpty()) {
            throw new AssertionFailedError(getClass().getName() + "[" + myName + "] was not setup with enough values");
        }
        return pop();
    }
View Full Code Here


    public void testMockAnnotatesAssertionFailedError()
            throws Throwable {
        final String originalMessage = "original message";

        Object arg = new AssertionFailedError(originalMessage);
        mockDispatcher.dispatchResult = arg;

        try {
            proxy.noArgVoidMethod();
        } catch (AssertionFailedError err) {
View Full Code Here

        mockDispatcher.verifyExpectations();
    }

    public void testVerifyFailuresIncludeMockName() {
        mockDispatcher.verifyFailure = new AssertionFailedError("verify failure");

        mockDispatcher.verifyCalls.setExpected(1);

        try {
            coreMock.verify();
View Full Code Here

    public void verify() {
        try {
            invocationDispatcher.verify();
        } catch (AssertionFailedError ex) {
            throw new AssertionFailedError(name + ": " + ex.getMessage());
        }
    }
View Full Code Here

    }
    return iterator.next();
  }

  static void fail(Throwable cause, Object message) {
    AssertionFailedError assertionFailedError =
        new AssertionFailedError(String.valueOf(message));
    assertionFailedError.initCause(cause);
    throw assertionFailedError;
  }
View Full Code Here

  
   public void assertMBeanFailed(ObjectName name, boolean registered) throws Exception
   {
      MBeanServer server = getServer();
      if (registered == false && server.isRegistered(name))
         throw new AssertionFailedError(name + " should not be registered after a failure");
      if (registered && server.isRegistered(name) == false)
         throw new AssertionFailedError(name + " should be registered after a failure");
   }
View Full Code Here

      if (expected != null)
      {
         try
         {
            deploy(url, true);
            throw new AssertionFailedError("Should have got a " + expected.getName());
         }
         catch (Throwable throwable)
         {
            AbstractSystemTest.checkThrowableDeep(expected, throwable);
            return Collections.emptyList();
View Full Code Here

   protected IncompleteDeploymentException assertInvalidDeployments() throws Exception
   {
      try
      {
         validate();
         throw new AssertionFailedError("Deployments should not be valid!");
      }
      catch (IncompleteDeploymentException expected)
      {
         log.debug("Got expected " + expected.getClass().getName());
         return expected;
View Full Code Here

   protected void assertInitialDeployFailure(URL url, ObjectName name, Class<? extends Throwable> expected) throws Exception
   {
      try
      {
         deploy(url, true);
         throw new AssertionFailedError("Should have got a " + expected.getName());
      }
      catch (Throwable t)
      {
         AbstractSystemTest.checkThrowableDeep(expected, t);
      }
View Full Code Here

         {
            Throwable problem = ctx.getProblem();
            if (e != null || expected != null)
            {
               if (expected != null && problem == null)
                  throw new AssertionFailedError("Did not get expected " + expected.getName() + " for " + ctx);
               if (expected == null && problem != null)
               {
                  if (problem instanceof Exception)
                     throw (Exception) problem;
                  if (problem instanceof Error)
                     throw (Error) problem;
                  throw new UndeclaredThrowableException(problem);
               }
               if (expected != null)
               {
                  AbstractSystemTest.checkThrowableDeep(expected, problem);
                  if (ServiceContext.FAILED != ctx.state)
                     throw new AssertionFailedError("Context is not in the FAILED state: " + ctx);
               }
            }
            return;
         }
      }
     
      throw new AssertionFailedError("Did not find " + name + " in incomplete deployments " + incomplete);
   }
View Full Code Here

TOP

Related Classes of junit.framework.AssertionFailedError

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.