Example usage for javax.naming TimeLimitExceededException printStackTrace

List of usage examples for javax.naming TimeLimitExceededException printStackTrace

Introduction

In this page you can find the example usage for javax.naming TimeLimitExceededException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:SearchTimeLimit.java

public static void printSearchEnumeration(NamingEnumeration srhEnum) {
    int count = 0;
    try {/* w ww .  jav a2 s.c  o  m*/
        while (srhEnum.hasMore()) {
            SearchResult sr = (SearchResult) srhEnum.next();
            System.out.println(">>>" + sr.getName());
            ++count;
        }
        System.out.println("number of answers: " + count);
    } catch (TimeLimitExceededException e) {
        System.out.println("search took more than " + timeout + "ms");
    } catch (NamingException e) {
        e.printStackTrace();
    }
}

From source file:com.symbian.driver.core.controller.tasks.BuildTaskTest.java

private void runTestDoBeforeBuild() {

    BuildTask lBuildTask = new BuildTask((ExecuteFactory) iExecuteFactoryMock.proxy(),
            (TDConfig) iTDConfig.proxy());

    try {/* w  w  w. ja v a 2  s  .c  o m*/
        lBuildTask.doBeforeBuild(iCWD, true);
    } catch (TimeLimitExceededException lTimeLimitExceededException) {
        lTimeLimitExceededException.printStackTrace();
        fail();
    } catch (IOException lIOException) {
        lIOException.printStackTrace();
        fail();
    } catch (ParseException lParseException) {
        lParseException.printStackTrace();
        fail();
    }
}

From source file:com.symbian.driver.core.controller.tasks.BuildTaskTest.java

public void testDoBuild_RBuild_NoAbldBat() {
    if (!iAbldBat.delete()) {
        fail();//from  w w  w .j  a v  a2s .  c  o m
    }

    String lPlatform = "armv5";
    String lVariant = "udeb";

    iTDConfig.expects(once()).method("getPreference").with(eq(TDConfig.PLATFORM)).will(returnValue(lPlatform));

    iTDConfig.expects(once()).method("getPreference").with(eq(TDConfig.VARIANT)).will(returnValue(lVariant));

    iExecuteFactoryMock.expects(exactly(2)).method("createExecuteOnHost")
            .with(isA(File.class), isA(String.class)).will(returnValue(iIExecuteOnHostMock.proxy()));

    iIExecuteOnHostMock.expects(exactly(2)).method("doTask").with(eq(true), ANYTHING);

    String[] lFiles = { "testexecute.exe", "testexecute.dll", "file.map", "noensense.blah" };
    String lReturnGetOutput = "";
    for (int i = 0; i < lFiles.length; i++) {
        lReturnGetOutput += "epoc32\\RELEASE\\" + lPlatform.toUpperCase() + "\\" + lVariant.toUpperCase() + "\\"
                + lFiles[i] + "\n";
    }

    iIExecuteOnHostMock.expects(exactly(2)).method("getOutput").will(returnValue(lReturnGetOutput));

    BuildTask lBuildTask = new BuildTask((ExecuteFactory) iExecuteFactoryMock.proxy(),
            (TDConfig) iTDConfig.proxy());

    try {

        Vector lTransferVector = lBuildTask.doBuild(iCWD, true, "mmp");

        if (lTransferVector == null || lTransferVector.size() != 1
                || ((File) lTransferVector.get(0)).getAbsolutePath().indexOf(lFiles[0]) == -1) {
            fail();
        }

    } catch (TimeLimitExceededException lTimeLimitExceededException) {
        lTimeLimitExceededException.printStackTrace();
        fail();
    } catch (IOException e) {
        e.printStackTrace();
        fail();
    } catch (ParseException e) {
        e.printStackTrace();
        fail();
    }
}