Commit f881b38e authored by 赵啸非's avatar 赵啸非

异常日志前端展示添加

parent ee4d021a
package producer;
import cn.hutool.core.util.IdUtil;
import com.mortals.xhx.ManagerApplication;
import com.mortals.xhx.base.system.message.MessageProducer;
import com.mortals.xhx.module.biz.model.BizLogEntity;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 = ManagerApplication.class)
@Slf4j
public class ProducerTest {
@Autowired
private MessageProducer producer;
@Test
public void testSyncSend() {
//for (int i)
while (true){
BizLogEntity bizLogEntity = new BizLogEntity();
bizLogEntity.initAttrValue();
bizLogEntity.setTraceID(IdUtil.fastSimpleUUID());
bizLogEntity.setLogTime(new Date());
producer.syncBizSend(bizLogEntity);
log.info("[testSyncSend][发送编号:[{}] 发送成功]", bizLogEntity.getTraceID());
}
}
}
//package producer;
//
//
//import cn.hutool.core.util.IdUtil;
//import com.mortals.xhx.ManagerApplication;
//import com.mortals.xhx.base.system.message.MessageProducer;
//import com.mortals.xhx.module.biz.model.BizLogEntity;
//import lombok.extern.slf4j.Slf4j;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//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 = ManagerApplication.class)
//@Slf4j
//public class ProducerTest {
//
// @Autowired
// private MessageProducer producer;
//
// @Test
// public void testSyncSend() {
//
////for (int i)
// while (true){
// BizLogEntity bizLogEntity = new BizLogEntity();
// bizLogEntity.initAttrValue();
// bizLogEntity.setTraceID(IdUtil.fastSimpleUUID());
// bizLogEntity.setLogTime(new Date());
// producer.syncBizSend(bizLogEntity);
// log.info("[testSyncSend][发送编号:[{}] 发送成功]", bizLogEntity.getTraceID());
// }
//
// }
//
//}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment