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:MainClass.java

public void run() {
    int sum = 0;// w  w  w . ja  va  2s .c  o  m

    for (int i = 1; i <= 10; i++) {
        try {
            Thread.sleep(1000);
            buffer.set(i);
            sum += i;
            System.out.printf("\t%2d\n", sum);
        } catch (InterruptedException exception) {
            exception.printStackTrace();
        }
    }
    System.out.printf("\n%s\n%s\n", "Producer done producing.", "Terminating Producer.");
}

From source file:com.ctrip.infosec.rule.rabbitmq.RabbitMqMessageSenderTest.java

@Test
@Ignore// w  w  w .  ja  va 2 s .c  om
public void testSend() throws IOException {

    System.out.println("send");
    RiskFact fact = ReadFactFile.getFact("cp0027004.json");
    byte[] b = JSON.toJSONString(fact).getBytes(Charset.forName("UTF-8"));
    for (int i = 0; i < 1000; i++) {
        ruleEngineTemplate.convertAndSend("0031", b);
        System.out.println("??  " + i);
    }
    try {
        Thread.sleep(10000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:org.balloon_project.overflight.task.importer.Importer.java

public void waitUntilFinished() {
    executorPool.shutdown();/*from   w ww.  j a  va2s .  com*/
    try {
        executorPool.awaitTermination(60, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

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

@Test
@DirtiesContext/*www .j a v a  2s  .  c om*/
public void basicTimestampPartitionWithSchedulingTest() {
    testUtils.insertFreshDataIntoBasicTableAfterDelay(env.getProperty("tblInputDocs"), 15000, 76, 150, false);
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    //note, in this test, we upsert documents, overriding existng ones. hence why there are 75 in the index and 150
    //in the db
    assertEquals(150, testUtils.countOutputDocsInES());
    assertEquals(150, dbmsTestUtils.countRowsInOutputTable());
}

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

@Test
@DirtiesContext/*from www.  j  av a  2  s  .c o m*/
public void basicTimestampPartitionWithSchedulingTest() {
    testUtils.insertFreshDataIntoBasicTableAfterDelay(env.getProperty("tblInputDocs"), 15000, 5, 8, false);
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    //note, in this test, we upsert documents, overriding existng ones. hence why there are 75 in the index and 150
    //in the db
    assertEquals(8, testUtils.countOutputDocsInES());
    assertEquals(8, dbmsTestUtils.countRowsInOutputTable());
}

From source file:io.renren.modules.job.task.TestTask.java

public void test(String params) {
    logger.info("?test?" + params);

    try {//from  www. ja v  a  2s.com
        Thread.sleep(1000L);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }

    SysUserEntity user = sysUserService.selectById(1L);
    System.out.println(ToStringBuilder.reflectionToString(user));

}

From source file:com.galenframework.ide.devices.commands.DeviceInjectSourceCommand.java

@Override
public CommandExecutionResult execute(Device device, DeviceExecutor deviceExecutor, String taskId,
        Settings settings, String reportStoragePath) throws Exception {
    ((JavascriptExecutor) device.getDriver())
            .executeScript(//w ww . ja va  2  s. c  o  m
                    "var source = arguments[0]; " + "function injectBody() {" + "document.write(source);"
                            + "setTimeout('window.stop();', 10000);" + "}; setTimeout(injectBody, 10);",
                    originSource);
    try {
        //TODO Make a better way to wait for injected source
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }

    return CommandExecutionResult.passed();
}

From source file:de.zib.gndms.infra.configlet.C3MDSConfigletSoloTest.java

@Test
public void testC3MDS() {
    Log log = LogFactory.getLog("test");
    HashMap<String, String> configMap = Maps.newHashMap();
    configMap.put("delay", "10000");
    configMap.put("initialDelay", "1000");
    configMap.put("mdsUrl", "http://c3grid-gt.e-technik.uni-dortmund.de:8080/webmds/webmds?info=indexinfo");

    C3MDSConfiglet configlet = new C3MDSConfiglet();
    configlet.init(log, "c3mds", configMap);
    // configlet.run();

    try {/*from  w  w w . j  av  a2 s  .c o  m*/
        Thread.sleep(23000L);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    configlet.shutdown();
}

From source file:com.github.nettybook.ch7.junit.TelnetServerV3.java

public void start() {
    EventLoopGroup bossGroup = new NioEventLoopGroup(1);
    EventLoopGroup workerGroup = new NioEventLoopGroup();

    try {// w  ww  .  j  av a 2  s .  co  m
        ServerBootstrap b = new ServerBootstrap();
        b.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class)
                .childHandler(new TelnetServerInitializerV3());

        ChannelFuture future = b.bind(address).sync();

        future.channel().closeFuture().sync();
    } catch (InterruptedException e) {
        e.printStackTrace();
    } finally {
        bossGroup.shutdownGracefully();
        workerGroup.shutdownGracefully();
    }
}

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

@Test
@DirtiesContext/*w w w. ja  va 2  s. co m*/
public void basicConfigurerdStartPkPartitionWithSchedulingTest() {
    testUtils.insertFreshDataIntoBasicTableAfterDelay(env.getProperty("tblInputDocs"), 15000, 76, 150, false);
    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(150, testUtils.countOutputDocsInES());
    assertEquals(150, dbmsTestUtils.countRowsInOutputTable());

}