|
|
@@ -1,6 +1,5 @@
|
|
|
package com.uas.eis;
|
|
|
|
|
|
-import com.uas.eis.dao.BaseDao;
|
|
|
import com.uas.eis.service.DataDealService;
|
|
|
import com.uas.eis.service.SaleReturnService;
|
|
|
import com.uas.eis.service.SaleService;
|
|
|
@@ -10,6 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+import java.util.concurrent.CountDownLatch;
|
|
|
+
|
|
|
@RunWith(SpringRunner.class)
|
|
|
@SpringBootTest(classes = {UasEisApplication.class})
|
|
|
public class UasEisApplicationTests {
|
|
|
@@ -22,11 +24,23 @@ public class UasEisApplicationTests {
|
|
|
private DataDealService dataDealService;
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Test
|
|
|
public void contextLoads() {
|
|
|
- for(int i =0 ; i<10000 ;i++){
|
|
|
- dataDealService.EDCDataDeal("helo"+i);
|
|
|
+ final CountDownLatch countDownLatch = new CountDownLatch(10);
|
|
|
+ Date date1 =new Date();
|
|
|
+ System.out.println("主线程开始---");
|
|
|
+
|
|
|
+ try {
|
|
|
+ for(int i =0 ; i<10 ;i++){
|
|
|
+ dataDealService.EDCDataDeal("helo"+i,countDownLatch);
|
|
|
+ }
|
|
|
+ countDownLatch.await();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
+ System.out.println("用时:"+(new Date().getTime()-date1.getTime()));
|
|
|
|
|
|
}
|
|
|
|