Example usage for java.lang InterruptedException printStackTrace

List of usage examples for java.lang InterruptedException printStackTrace

Introduction

In this page you can find the example usage for java.lang InterruptedException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

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

Usage

From source file:uk.ac.kcl.it.BiolarkPKPartitionWithoutScheduling.java

@Test
@DirtiesContext/*from w  w  w .j  a  v a 2 s .  c  o  m*/
public void biolarkTest() {
    jobLauncher.launchJob();
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    assertEquals(75, testUtils.countOutputDocsInES());
    assertEquals(75, dbmsTestUtils.countRowsInOutputTable());
}

From source file:uk.ac.kcl.it.GATEPKPartitionWithoutScheduling.java

@Test
@DirtiesContext/*  w w  w  . j a  v  a  2s. co  m*/
public void gatePipelineTest() {
    jobLauncher.launchJob();
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    assertEquals(100, testUtils.countOutputDocsInES());
    assertEquals(100, dbmsTestUtils.countRowsInOutputTable());
}

From source file:com.interacciones.mxcashmarketdata.driver.queue.QueueWriteFile.java

public void ReadQueue(ConcurrentLinkedQueue<String> msgQueue) {
    LOGGER.debug("Reading from queue... Sizing " + msgQueue.size());

    while (true) {
        Iterator<String> it = msgQueue.iterator();

        while (it.hasNext()) {
            String msg = (String) it.next();
            //messageProcessing.receive(msg.toString());
            msgQueue.poll();/*from w w w  .j av  a 2s  . c  om*/
        }

        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
            LOGGER.error("Error: " + e.getMessage());
        }
    }
}

From source file:de.betterform.agent.web.upload.UploadListener.java

public void bytesRead(int bytesRead) {
    totalBytesRead = totalBytesRead + bytesRead;
    updateUploadInfo("progress");

    try {/*  w ww  .  j a  v  a  2s . c om*/
        Thread.sleep(delay);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:jp.ambrosoli.http.server.action.IndexAction.java

@Execute(validator = false, urlPattern = "timeout/{to}")
public String timeout() {
    try {//www .j a  v a  2 s  .com
        Thread.sleep(Long.valueOf(this.to));
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    ResponseUtil.getResponse().setStatus(200);
    return null;
}

From source file:com.apress.prospringintegration.channels.prioritychannel.PriorityTicketReceiver.java

public void handleTicketMessage() {
    Message<?> ticketMessage = null;

    while (true) {
        ticketMessage = channel.receive(RECEIVE_TIMEOUT);
        if (ticketMessage != null) {
            handleTicket((Ticket) ticketMessage.getPayload());
        } else {/*from  w w  w .j  a  v  a  2s.c o  m*/
            try {
                /** Handle some other tasks **/

                Thread.sleep(1000);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }
        }
    }
}

From source file:uk.ac.kcl.it.BasicConfigurerdStartPkPartitionWithScheduling.java

@Test
@DirtiesContext/* ww w .  j a  v  a2  s .co m*/
public void basicConfigurerdStartPkPartitionWithSchedulingTest() {
    testUtils.insertFreshDataIntoBasicTableAfterDelay(env.getProperty("tblInputDocs"), 15000);
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    //note, in this test, we upsert documents, overriding existng ones. hence why ther ate 75 in the index and 150
    //in the db
    assertEquals(75, testUtils.countOutputDocsInES());
    assertEquals(150, dbmsTestUtils.countRowsInOutputTable());

}

From source file:uk.ac.kcl.it.BasicPkPartitionWithScheduling.java

@Test
@DirtiesContext/*w  w w . j  a  v  a2  s  .com*/
public void basicPkPartitionWithSchedulingTest() {
    testUtils.insertFreshDataIntoBasicTableAfterDelay(env.getProperty("tblInputDocs"), 15000);

    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    //note, in this test, we upsert documents, overriding existng ones. hence why ther ate 75 in the index and 150
    //in the db
    assertEquals(75, testUtils.countOutputDocsInES());
    assertEquals(150, dbmsTestUtils.countRowsInOutputTable());
}

From source file:uk.ac.kcl.testservices.DocmanReaderWithoutSchedulingTests.java

@Test
@DirtiesContext//from  ww  w .ja  v  a 2  s .  com
public void docmanReaderTest() {
    jobLauncher.launchJob();
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    assertEquals(2, testUtils.countOutputDocsInES());
    assertEquals(2, dbmsTestUtils.countRowsInOutputTable());

    String testString = testUtils.getStringInEsDoc("1");

    assertTrue(testString.contains("The patients name is Bart Davidson"));
    assertTrue(testUtils.getStringInEsDoc("2").contains("The patients name is David Harleyson"));

}

From source file:Model.NewsModel.java

public String getLatestNews() {
    HandleOnAnotherThread handleOnAnotherThread = new HandleOnAnotherThread();

    try {//from   w ww . j a  v  a 2 s  .  c  o m
        String answer = handleOnAnotherThread.execute().get();
        return answer;
    } catch (InterruptedException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    } catch (ExecutionException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    }
    return null;
}