本文整理汇总了Java中junit.framework.TestCase.fail方法的典型用法代码示例。如果您正苦于以下问题:Java TestCase.fail方法的具体用法?Java TestCase.fail怎么用?Java TestCase.fail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类junit.framework.TestCase
的用法示例。
在下文中一共展示了TestCase.fail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createProvider
import junit.framework.TestCase; //导入方法依赖的package包/类
public SipProvider createProvider() {
try {
ListeningPoint lp = sipStack.createListeningPoint(myAddress,
myPort, transport);
sipProvider = sipStack.createSipProvider(lp);
logger.info("provider " + sipProvider);
logger.info("sipStack = " + sipStack);
return sipProvider;
} catch (Exception ex) {
logger.error(ex);
TestCase.fail(unexpectedException);
return null;
}
}
示例2: requestLastBuildStatus_callback_registers_exception_on_ack_future
import junit.framework.TestCase; //导入方法依赖的package包/类
@Test
public void requestLastBuildStatus_callback_registers_exception_on_ack_future( ) throws Exception {
// Setup
final BuildTypeData bt1 = new BuildTypeData( "bt1", "btName", "pname", "pId" );
when( _mockRequestController.sendRequest( getApiVersion( ), "builds/?locator=buildType:bt1,running:any,count:" + ApiController.MAX_BUILDS_TO_CONSIDER, BuildList.class ) )
.thenReturn( Futures.immediateFailedFuture( new RuntimeException( "Unexpected test exception" ) ) );
// Exercise
final ListenableFuture<Void> ackFuture = _apiController.requestLastBuildStatus( bt1 );
// Verify
try {
ackFuture.get( );
} catch ( ExecutionException e ) {
if ( e.getCause( ).getClass( ) == RuntimeException.class && e.getCause( ).getMessage( ).equals( "Unexpected test exception" ) )
return;
}
TestCase.fail( );
}
示例3: requestQueuedBuilds_callback_registers_exception_on_ack_future
import junit.framework.TestCase; //导入方法依赖的package包/类
@Test
public void requestQueuedBuilds_callback_registers_exception_on_ack_future( ) throws Exception {
// Setup
when( _mockRequestController.sendRequest( getApiVersion( ), "buildQueue", QueuedBuildList.class ) )
.thenReturn( Futures.immediateFailedFuture( new RuntimeException( "Unexpected test exception" ) ) );
// Exercise
final ListenableFuture<Void> ackFuture = _apiController.requestQueuedBuilds( );
// Verify
try {
ackFuture.get( );
} catch ( ExecutionException e ) {
if ( e.getCause( ).getClass( ) == RuntimeException.class && e.getCause( ).getMessage( ).equals( "Unexpected test exception" ) )
return;
}
TestCase.fail( );
}
示例4: createProvider
import junit.framework.TestCase; //导入方法依赖的package包/类
public SipProvider createProvider() {
try {
ListeningPoint lp = sipStack.createListeningPoint(myAddress, myPort, transport);
sipProvider = sipStack.createSipProvider(lp);
logger.info("provider " + sipProvider);
logger.info("sipStack = " + sipStack);
return sipProvider;
} catch (Exception ex) {
logger.error(ex);
TestCase.fail(unexpectedException);
return null;
}
}
示例5: createSipProvider
import junit.framework.TestCase; //导入方法依赖的package包/类
public SipProvider createSipProvider() {
try {
listeningPoint = sipStack.createListeningPoint(host, port, "udp");
logger.info("listening point = " + host + " port = " + port);
logger.info("listening point = " + listeningPoint);
sipProvider = sipStack.createSipProvider(listeningPoint);
return sipProvider;
} catch (Exception ex) {
logger.error(unexpectedException, ex);
ex.printStackTrace();
TestCase.fail(unexpectedException);
return null;
}
}
示例6: createProvider
import junit.framework.TestCase; //导入方法依赖的package包/类
public SipProvider createProvider() {
try {
ListeningPoint lp = sipStack.createListeningPoint(myAddress,
myPort, transport);
sipProvider = sipStack.createSipProvider(lp);
logger.info("provider " + sipProvider);
logger.info("sipStack = " + sipStack);
return sipProvider;
} catch (Exception ex) {
logger.error(ex);
TestCase.fail(unexpectedException);
return null;
}
}
示例7: assertConsistency
import junit.framework.TestCase; //导入方法依赖的package包/类
public static void assertConsistency(TokenHierarchy<?> hi) {
String error = LexerApiPackageAccessor.get().tokenHierarchyOperation(hi).checkConsistency();
if (error != null) {
TestCase.fail("\n\n!!!!!->->->->->-> CONSISTENCY ERROR in Token Hierarchy <-<-<-<-<-<-!!!!!!!\n" +
error + "\n\nINCONSISTENT TOKEN HIERARCHY:\n" + hi);
}
}
示例8: processBye
import junit.framework.TestCase; //导入方法依赖的package包/类
/**
* Process the bye request.
*/
public void processBye(RequestEvent requestEvent,
ServerTransaction serverTransactionId) {
Request request = requestEvent.getRequest();
try {
logger.info("shootme: got a bye sending OK.");
logger.info("shootme: dialog = " + requestEvent.getDialog());
if ( requestEvent.getDialog() != null ) {
logger.info("shootme: dialogState = " + requestEvent.getDialog().getState());
Response response = protocolObjects.messageFactory.createResponse(200, request);
if ( serverTransactionId != null) {
serverTransactionId.sendResponse(response);
}
logger.info("shootme: dialogState = " + requestEvent.getDialog().getState());
this.byeSeen = true;
} else {
logger.info("Dropping stray request " + request );
}
} catch (Exception ex) {
ex.printStackTrace();
logger.error("Unexpected exception",ex);
TestCase.fail("Unexpected exception");
}
}
示例9: createSipProvider
import junit.framework.TestCase; //导入方法依赖的package包/类
public SipProvider createSipProvider() {
try {
ListeningPoint listeningPoint = sipStack.createListeningPoint(host, port, transport);
sipProvider = sipStack.createSipProvider(listeningPoint);
return sipProvider;
} catch (Exception ex) {
logger.error(unexpectedException, ex);
TestCase.fail(unexpectedException);
return null;
}
}
示例10: processRequest
import junit.framework.TestCase; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestEvent) {
try {
Request request = requestEvent.getRequest();
if (request.getMethod().equals(Request.INVITE)) {
if (requestEvent.getServerTransaction() == null) {
ServerTransactionExt serverTransaction = (ServerTransactionExt) this.provider
.getNewServerTransaction(request);
Response tryingResponse = messageFactory
.createResponse(100, request);
serverTransaction.sendResponse(tryingResponse);
}
} else if (request.getMethod().equals(Request.CANCEL)) {
ServerTransaction stx = requestEvent.getServerTransaction();
Response okResponse = messageFactory.createResponse(200,
request);
stx.sendResponse(okResponse);
}
} catch (Exception ex) {
logger.error("Unexpected exception", ex);
TestCase.fail("Unexpected exception");
}
}
示例11: processTimeout
import junit.framework.TestCase; //导入方法依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
logger.error("Timeout occured");
TestCase.fail("unexpected event");
}
示例12: assertTextEquals
import junit.framework.TestCase; //导入方法依赖的package包/类
public static void assertTextEquals(String message, CharSequence expected, CharSequence actual) {
if (!textEquals(expected, actual)) {
TestCase.fail(messagePrefix(message) +
" expected:\"" + expected + "\" but was:\"" + actual + "\"");
}
}
示例13: processDialogTerminated
import junit.framework.TestCase; //导入方法依赖的package包/类
public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) {
TestCase.fail("unexpected event");
}
示例14: fail
import junit.framework.TestCase; //导入方法依赖的package包/类
public static void fail() {
logFailure("Unknown reason for failure. Check logs for more info.");
new Exception().printStackTrace();
TestCase.fail();
}
示例15: processIOException
import junit.framework.TestCase; //导入方法依赖的package包/类
public void processIOException(IOExceptionEvent exceptionEvent) {
logger.error("IOException happened for " + exceptionEvent.getHost()
+ " port = " + exceptionEvent.getPort());
TestCase.fail("Unexpected exception");
}