zoukankan      html  css  js  c++  java
  • 多线程单元测试

    package com.qilu.test;

    import org.junit.Test;

    public class SimpleThread extends Thread {
    private int countDown = 5;
    private int threadNumber;
    private static int threadCount = 0;

    public SimpleThread() {
    threadNumber = ++threadCount;
    System.out.println("Making " + threadNumber);
    }
    @Test
    public void run() {
    while (true) {
    System.out
    .println("Thread " + threadNumber + "(" + countDown + ")");
    if (--countDown == 0)
    return;
    }
    }
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    for (int i = 0; i < 5; i++)
    new SimpleThread().start();
    System.out.println("All Threads Started");
    }


    }

    代码编写时间:45%

          测试时间:55%

  • 相关阅读:
    hdu-4283 You Are the One 区间dp,
    HDU
    HDU
    HDU
    SPOJ
    UESTC
    CodeForces
    HDU
    Git中文书籍
    zeng studio的项目窗口PHP Explorer
  • 原文地址:https://www.cnblogs.com/glmmm/p/4789006.html
Copyright © 2011-2022 走看看