Package junit.framework

Examples of junit.framework.AssertionFailedError


        " Component: " + component);
    }

    if (throwException && res.wasFailed())
    {
      throw new AssertionFailedError(res.getMessage());
    }
    return res;
  }
View Full Code Here


            Proxies.enhanceResponse(resp1)).once();

        expect(
            mockBackend.execute(eq(route), isA(HttpRequestWrapper.class),
                isA(HttpClientContext.class), (HttpExecutionAware) isNull())).andThrow(
            new AssertionFailedError("Should have reused cached 304 response")).anyTimes();

        replayMocks();
        impl.execute(route, req1, context, null);
        final HttpResponse result = impl.execute(route, req2, context, null);
        verifyMocks();
View Full Code Here

        }

        if (map.isEmpty())
            return;

        throw new AssertionFailedError(
            "Unexpected attribute(s) " + map + " in element " + e.getElementName() + ".");
    }
View Full Code Here

  }

  private void assertInException(Exception e, String text) throws Throwable {
    String message = extractExceptionMessage(e);
    if (!(message.contains(text))) {
      throw new AssertionFailedError("Wrong text in message "
                                         + "\"" + message + "\""
                                         + " expected \"" + text + "\"")
          .initCause(e);
    }
  }
View Full Code Here

  private String extractExceptionMessage(Exception e) throws Throwable {
    assertNotNull("Null Exception", e);
    String message = e.getMessage();
    if (message == null) {
      throw new AssertionFailedError("Empty text in exception " + e)
          .initCause(e);
    }
    return message;
  }
View Full Code Here

  private void assertNotInException(Exception e, String text)
      throws Throwable{
    String message = extractExceptionMessage(e);
    if (message.contains(text)) {
      throw new AssertionFailedError("Wrong text in message "
                                         + "\"" + message + "\""
                                         + " did not expect \"" + text + "\"")
          .initCause(e);
    }
  }
View Full Code Here

        NetUtils.wrapException("desthost", DEST_PORT,
                               "localhost", LOCAL_PORT,
                               e);
    LOG.info(wrapped.toString(), wrapped);
    if(!(wrapped.getClass().equals(expectedClass))) {
      throw new AssertionFailedError("Wrong exception class; expected "
                                         + expectedClass
                                         + " got " + wrapped.getClass() + ": " + wrapped).initCause(wrapped);
    }
    return wrapped;
  }
View Full Code Here

        context.makeReadOnly();

        try
        {
            context.put( "key1", "" );
            throw new AssertionFailedError( "You are not allowed to change a value after it has been made read only" );
        }
        catch ( IllegalStateException ise )
        {
            assertTrue( "Value is null", "value1".equals( context.get( "key1" ) ) );
        }
View Full Code Here

    protected void setUp()
        throws Exception
    {
        super.setUp();
        reportEntry = new SimpleReportEntry( this.getClass().getName(), "StatelessXMLReporterTest",
                                             new LegacyPojoStackTraceWriter( "", "", new AssertionFailedError() ), 17 );
        stats = new TestSetStats( false, true );
    }
View Full Code Here

        " Component: " + component);
    }

    if (throwException && res.wasFailed())
    {
      throw new AssertionFailedError(res.getMessage());
    }
    return res;
  }
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.