为了账号安全,请及时绑定邮箱和手机立即绑定

executSeckill测试问题?

@Test
public void executeSeckill() throws Exception {
   long id = 1000;
   long phone = 13877093290L;
   String  md5 = "42d56fec120bf23e3af750569ca017c3";
   SeckillExcution seckillExcution = seckillService.executeSeckill(id,phone,md5);
   logger.info("SeckillExcution={}"+seckillExcution);

输出结果

18:14:52.931  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Creating a new SqlSession

18:14:52.935  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff]

18:14:52.940  [main]  DEBUG o.m.s.t.SpringManagedTransaction -  JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@616ac46a] will be managed by Spring

18:14:52.943  [main]  DEBUG o.s.dao.SeckillDao.reduceNumber -  ==>  Preparing: update seckill set number = number - 1 where seckill_id = ? and start_time <= ? and end_time >= ? and number > 0 

18:14:52.965  [main]  DEBUG o.s.dao.SeckillDao.reduceNumber -  ==> Parameters: 1001(Long), 2016-10-12 18:14:52.923(Timestamp), 2016-10-12 18:14:52.923(Timestamp)

18:14:52.973  [main]  DEBUG o.s.dao.SeckillDao.reduceNumber -  <==    Updates: 1

18:14:52.973  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff]

18:14:52.974  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff] from current transaction

18:14:52.974  [main]  DEBUG o.s.d.S.insertSuccessKilled -  ==>  Preparing: insert ignore into success_killed (seckill_id,user_phone) value (?,?) 

18:14:52.975  [main]  DEBUG o.s.d.S.insertSuccessKilled -  ==> Parameters: 1001(Long), 13877093293(Long)

18:14:52.983  [main]  DEBUG o.s.d.S.insertSuccessKilled -  <==    Updates: 1

18:14:52.983  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff]

18:14:52.984  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff] from current transaction

18:14:52.985  [main]  DEBUG o.s.d.S.queryByIdWithSeckill -  ==>  Preparing: select sk.seckill_id, sk.user_phone, sk.create_time, sk.state, s.seckill_id "seckill.seckill_id", s.name "seckill.name", s.number "seckill.number", s.start_time "seckill.start_time", s.end_time "seckill.end_time", s.create_time "seckill.create_time" from success_killed sk inner join seckill s on sk.seckill_id = s.seckill_id where sk.seckill_id = ? and sk.user_phone = ? 

18:14:52.985  [main]  DEBUG o.s.d.S.queryByIdWithSeckill -  ==> Parameters: 1001(Long), 13877093293(Long)

18:14:53.002  [main]  DEBUG o.s.d.S.queryByIdWithSeckill -  <==      Total: 1

18:14:53.006  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff]

18:14:53.007  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Transaction synchronization committing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff]

18:14:53.007  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff]

18:14:53.007  [main]  DEBUG org.mybatis.spring.SqlSessionUtils -  Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5b3f61ff]

18:14:53.098  [main]  INFO  o.seckill.service.SeckillServiceTest -  SeckillExcution={}org.seckill.dto.SeckillExcution@1672fe87

为什么SeckillExcution ={} 里面没有信息的? 

正在回答

1 回答

logger.info("SeckillExcution={}"+seckillExcution);
中间应该是逗号","   不是"+"号

0 回复 有任何疑惑可以回复我~
#1

搬砖工学编程 提问者

天! 习惯性的sout 写法了! 问题解决了 非常感谢!
2016-10-13 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Java高并发秒杀API之Service层
  • 参与学习       59897    人
  • 解答问题       137    个

Java实现高并发秒杀API,介绍秒杀业务Service层的设计和实现

进入课程

executSeckill测试问题?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信