Skip to content

Commit

Permalink
code optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxueli committed Apr 20, 2022
1 parent 3abdfc6 commit 0931df7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.xxl.job.admin.service.LoginService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.util.LinkedMultiValueMap;
Expand All @@ -13,6 +15,7 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;

public class JobInfoControllerTest extends AbstractSpringMvcTest {
private static Logger logger = LoggerFactory.getLogger(JobInfoControllerTest.class);

private Cookie cookie;

Expand Down Expand Up @@ -41,7 +44,7 @@ public void testAdd() throws Exception {
.cookie(cookie)
).andReturn();

System.out.println(ret.getResponse().getContentAsString());
logger.info(ret.getResponse().getContentAsString());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.xxl.job.admin.core.scheduler.MisfireStrategyEnum;
import com.xxl.job.admin.core.scheduler.ScheduleTypeEnum;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
Expand All @@ -12,6 +14,7 @@

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class XxlJobInfoDaoTest {
private static Logger logger = LoggerFactory.getLogger(XxlJobInfoDaoTest.class);

@Resource
private XxlJobInfoDao xxlJobInfoDao;
Expand All @@ -20,9 +23,9 @@ public class XxlJobInfoDaoTest {
public void pageList(){
List<XxlJobInfo> list = xxlJobInfoDao.pageList(0, 20, 0, -1, null, null, null);
int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, -1, null, null, null);
System.out.println(list);
System.out.println(list_count);

logger.info("", list);
logger.info("", list_count);

List<XxlJobInfo> list2 = xxlJobInfoDao.getJobsByGroup(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.xxl.job.admin.core.util.I18nUtil;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;

/**
Expand All @@ -11,12 +13,13 @@
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class I18nUtilTest {
private static Logger logger = LoggerFactory.getLogger(I18nUtilTest.class);

@Test
public void test(){
System.out.println(I18nUtil.getString("admin_name"));
System.out.println(I18nUtil.getMultString("admin_name", "admin_name_full"));
System.out.println(I18nUtil.getMultString());
logger.info(I18nUtil.getString("admin_name"));
logger.info(I18nUtil.getMultString("admin_name", "admin_name_full"));
logger.info(I18nUtil.getMultString());
}

}

0 comments on commit 0931df7

Please sign in to comment.