You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.7 KiB
53 lines
1.7 KiB
package ${domain}.wsys;
|
|
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import ${domain}.frame.auth.Token;
|
|
import ${domain}.frame.utils.MapperUtil;
|
|
import ${domain}.module.wsys.mgr.SequenceManager;
|
|
import ${domain}.module.wsys.req.SequenceNextRequest;
|
|
import ${domain}.module.wsys.rsp.SequenceNextResponse;
|
|
|
|
/**
|
|
* SequenceTest - - 序列测试用例
|
|
*
|
|
* @author wangbing
|
|
* @version 0.0.1
|
|
* @since 2020-06-25
|
|
*/
|
|
@RunWith(SpringRunner.class)
|
|
@SpringBootTest
|
|
@Transactional
|
|
public class SequenceTest {
|
|
|
|
@Autowired
|
|
private Token token;
|
|
|
|
@Autowired
|
|
private SequenceManager sequenceManager;
|
|
|
|
@Test
|
|
public void testGet() {
|
|
SequenceNextRequest request = new SequenceNextRequest();
|
|
request.setSeqName("测试");
|
|
request.setSeqNote("测试");
|
|
request.setSeqPrefix("CS");
|
|
request.setMaxValue(999);
|
|
request.setByYear(true);
|
|
request.setByMonth(false);
|
|
request.setByDate(false);
|
|
|
|
for (int i = 0; i < 1000; i++) {
|
|
SequenceNextResponse response = sequenceManager.next(request, token);
|
|
System.out.println("=================================================================================");
|
|
System.out.println(response.getSequence());
|
|
if (response.hasError()) System.err.println(MapperUtil.toJson(response));
|
|
System.out.println("=================================================================================");
|
|
}
|
|
}
|
|
}
|