当前位置: 首页>>代码示例>>Java>>正文


Java TestCase.fail方法代码示例

本文整理汇总了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;

    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:19,代码来源:Shootme.java

示例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( );
}
 
开发者ID:u2032,项目名称:wall-t,代码行数:19,代码来源:ApiControllerTest.java

示例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( );
}
 
开发者ID:u2032,项目名称:wall-t,代码行数:17,代码来源:ApiControllerTest.java

示例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;

    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:18,代码来源:Shootme.java

示例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;
    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:17,代码来源:Shootist.java

示例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;

    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:20,代码来源:Shootme.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:LexerTestUtilities.java

示例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");


    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:32,代码来源:Shootme.java

示例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;
    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:14,代码来源:Proxy.java

示例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");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:28,代码来源:CtxExpiredTest.java

示例11: processTimeout

import junit.framework.TestCase; //导入方法依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
    logger.error("Timeout occured");
    TestCase.fail("unexpected event");
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:5,代码来源:Proxy.java

示例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 + "\"");
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:LexerTestUtilities.java

示例13: processDialogTerminated

import junit.framework.TestCase; //导入方法依赖的package包/类
public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) {
    TestCase.fail("unexpected event");
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:4,代码来源:Proxy.java

示例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();
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:6,代码来源:TestHarness.java

示例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");

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:7,代码来源:Shootist.java


注:本文中的junit.framework.TestCase.fail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。