提交 bc404eb6 编写于 作者: C Calvin

little updates

上级 06b41be5
...@@ -40,7 +40,7 @@ import com.google.common.collect.Maps; ...@@ -40,7 +40,7 @@ import com.google.common.collect.Maps;
@RequestMapping(value = "/task") @RequestMapping(value = "/task")
public class TaskController { public class TaskController {
private static final int PAGE_SIZE = 3; private static final String PAGE_SIZE = "3";
private static Map<String, String> sortTypes = Maps.newLinkedHashMap(); private static Map<String, String> sortTypes = Maps.newLinkedHashMap();
static { static {
...@@ -52,12 +52,14 @@ public class TaskController { ...@@ -52,12 +52,14 @@ public class TaskController {
private TaskService taskService; private TaskService taskService;
@RequestMapping(value = "") @RequestMapping(value = "")
public String list(@RequestParam(value = "sortType", defaultValue = "auto") String sortType, public String list(@RequestParam(value = "page", defaultValue = "1") int pageNumber,
@RequestParam(value = "page", defaultValue = "1") int pageNumber, Model model, ServletRequest request) { @RequestParam(value = "page.size", defaultValue = PAGE_SIZE) int pageSize,
@RequestParam(value = "sortType", defaultValue = "auto") String sortType, Model model,
ServletRequest request) {
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_"); Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
Long userId = getCurrentUserId(); Long userId = getCurrentUserId();
Page<Task> tasks = taskService.getUserTask(userId, searchParams, pageNumber, PAGE_SIZE, sortType); Page<Task> tasks = taskService.getUserTask(userId, searchParams, pageNumber, pageSize, sortType);
model.addAttribute("tasks", tasks); model.addAttribute("tasks", tasks);
model.addAttribute("sortType", sortType); model.addAttribute("sortType", sortType);
......
...@@ -23,7 +23,7 @@ import com.google.common.cache.LoadingCache; ...@@ -23,7 +23,7 @@ import com.google.common.cache.LoadingCache;
/** /**
* 本地缓存演示,使用GuavaCache. * 本地缓存演示,使用GuavaCache.
* *
* @author hzl7652 * @author calvin
*/ */
@ContextConfiguration(locations = { "/applicationContext.xml" }) @ContextConfiguration(locations = { "/applicationContext.xml" })
public class GuavaCacheDemo extends SpringTransactionalTestCase { public class GuavaCacheDemo extends SpringTransactionalTestCase {
......
...@@ -456,7 +456,6 @@ ...@@ -456,7 +456,6 @@
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>${logback.version}</version> <version>${logback.version}</version>
<scope>runtime</scope>
</dependency> </dependency>
<!-- log4j 实际调用slf4j --> <!-- log4j 实际调用slf4j -->
......
...@@ -53,6 +53,9 @@ public abstract class BenchmarkBase { ...@@ -53,6 +53,9 @@ public abstract class BenchmarkBase {
onFinish(); onFinish();
} }
/**
* Must be invoked after each thread finish the prepare job, return the startTime.
*/
protected Date onThreadStart() { protected Date onThreadStart() {
startLock.countDown(); startLock.countDown();
//wait for all threads ready //wait for all threads ready
...@@ -64,6 +67,9 @@ public abstract class BenchmarkBase { ...@@ -64,6 +67,9 @@ public abstract class BenchmarkBase {
return new Date(); return new Date();
} }
/**
* Must be invoked after the loop finish.
*/
protected void onThreadFinish(Date threadStartTime) { protected void onThreadFinish(Date threadStartTime) {
// notify test finish // notify test finish
finishLock.countDown(); finishLock.countDown();
...@@ -74,13 +80,13 @@ public abstract class BenchmarkBase { ...@@ -74,13 +80,13 @@ public abstract class BenchmarkBase {
} }
/** /**
* Override to do some data prepare job. * Override to do some global data prepare job.
*/ */
protected void onStart() { protected void onStart() {
} }
/** /**
* Override to do some data cleanup and verify job. * Override to do some global data cleanup and verify job.
*/ */
protected void onFinish() { protected void onFinish() {
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册