摘要: 本文讨论了实际工作中单元测试实践和测试驱动开发的感受和困惑,并试图通过研究业界实践来回答如下问题:为什么要进行单元测试,对谁进行单元测试,怎么进行单元测试。
阅读全文
posted @
2010-07-13 17:34 Justin Chen 阅读(2881) |
评论 (2) |
编辑 收藏
摘要: This message is a summary based on a very good article (http://www.ibm.com/developerworks/java/library/j-ts1.html?S_TACT=105AGX02&S_CMP=EDU) and focusing on common mistakes when implementing transactions in the Java platform. The original article is aimed to discuss Transaction Strategy. Here, we just want to discuss the common mistakes on transaction management.
阅读全文
posted @
2009-04-15 15:12 Justin Chen 阅读(2850) |
评论 (0) |
编辑 收藏
摘要: 从今天开始,本人将逐章翻译《剖析SQL Server执行计划(Dissecting SQL Server Execution Plans)》一书。该书是系列丛书《高性能SQL代码的艺术》的第一本,来源于http://www.infoq.com/news/2009/03/SQL- Performance。该书由SQL Server专家Grant Frltchey编写,并颇获好评。
阅读全文
posted @
2009-04-14 22:43 Justin Chen 阅读(2282) |
评论 (0) |
编辑 收藏
摘要: An Introduction to memcached - Improve Your Web Site Performance By Cache
阅读全文
posted @
2009-04-12 21:29 Justin Chen 阅读(2087) |
评论 (0) |
编辑 收藏
摘要: This article is a short summary on the interview with Werner Vogels, who is the CTO of Amazon.com.
阅读全文
posted @
2009-04-11 21:27 Justin Chen 阅读(838) |
评论 (0) |
编辑 收藏
摘要: This document is a summary or outline of Sun's document: Tuning Garbage collection with the 1.4.2 Hotspot JVM located here: http://java.sun.com/docs/hotspot/gc1.4.2/
阅读全文
posted @
2009-04-01 17:19 Justin Chen 阅读(1051) |
评论 (0) |
编辑 收藏
摘要: Mock test is a very good way to test unit of codes. However, Mock test need lots effort on creating mock object, creating input and output parameter, and creating AugumentMatcher, and also comparing the expected result and actual results (assertions). Using Unitils can Simplify most of the manual work required by Mock Test.
阅读全文
posted @
2009-03-30 22:30 Justin Chen 阅读(2000) |
评论 (1) |
编辑 收藏
摘要: Java Memory Management is one of the most important Java Core Techniques. It is worth for every developer to spend some time to learn how it works. It is also a very interesting topic. I try to provide an overview on Java Memory Management, so, some detailed are omitted in the slides, please see detailed by the Reference Links in the last page.
阅读全文
posted @
2009-03-26 09:47 Justin Chen 阅读(4662) |
评论 (11) |
编辑 收藏
摘要: JDBC has been used as the major Java Database Access technique for long time. However, JDBC access always need try-catch block and repeated JDBC codes, such as connection, statement and resultset. And recently, JDK 6.0 already released a simplified JDBC access approach. This article will introduce a similar and very simple design to reduce most of JDBC codes. You don't have to repeat the traditional JDBC codes template agan and again.
阅读全文
posted @
2009-03-20 10:07 Justin Chen 阅读(1999) |
评论 (2) |
编辑 收藏
摘要: This article is trying to summarize what' the JVM GC log and how can we use it to analyse memory issues.
阅读全文
posted @
2009-03-19 22:27 Justin Chen 阅读(8486) |
评论 (2) |
编辑 收藏
摘要: This article introduces three tools: P6Spy, IronTrackSQL and SQL Profiler (NOT SQL Server Profiler). Using these tools are very easy to log all SQL statements and show the detailed statistics results.
阅读全文
posted @
2009-03-14 21:06 Justin Chen 阅读(3523) |
评论 (0) |
编辑 收藏
摘要: An introduction on JTracert - Runtime Sequence Diagram Generator Tool
阅读全文
posted @
2009-03-11 22:42 Justin Chen 阅读(1751) |
评论 (0) |
编辑 收藏
摘要: In summary, we always met the performance result stability issue during performance testing. This article tries to explain why an java application will perform differently at different time, there are too many factors impacting this, and how can we get a more trustable results. This article is a first try to explain this topic, i hope more and more discussion will make us clearer.
阅读全文
posted @
2009-03-09 23:25 Justin Chen 阅读(1525) |
评论 (1) |
编辑 收藏
摘要: Open Source Reporting Tools in Java
阅读全文
posted @
2009-03-01 22:28 Justin Chen 阅读(675) |
评论 (0) |
编辑 收藏
摘要: Profiling Java Performance With Perf4j
阅读全文
posted @
2009-02-22 22:00 Justin Chen 阅读(2058) |
评论 (0) |
编辑 收藏
摘要: This article will have a simple introduction on new tool – Eclipse Memory Analyzer (previously called SAP memory analyzer) and how to use this tool to find some interesting memory issues.
阅读全文
posted @
2009-02-22 21:29 Justin Chen 阅读(5762) |
评论 (0) |
编辑 收藏
摘要: This message introduced the major JVM-Level problems on Java Development, such as Out of Memeory, Thread Lock etc.
阅读全文
posted @
2009-01-08 22:15 Justin Chen 阅读(3282) |
评论 (3) |
编辑 收藏
摘要: Recently, there are lots of discussion regarding to QA bottleneck in our release plan, or lack of communication between Dev and QA, i’d like to share my little experiences from my previous experiences. This article describes three major mindset changes and some practical skills to help the team achieve these principles
阅读全文
posted @
2008-12-10 13:39 Justin Chen 阅读(1411) |
评论 (1) |
编辑 收藏
摘要: An introduction to Java Bean Validation Framework and How to use Spring Bean Validation Framework without Spring MVC.
阅读全文
posted @
2008-12-01 11:48 Justin Chen 阅读(4793) |
评论 (1) |
编辑 收藏
摘要: This article is to explain how solr cache works
阅读全文
posted @
2008-11-11 15:05 Justin Chen 阅读(1712) |
评论 (0) |
编辑 收藏
The previous message only
explains how to create service, this message will describe how to
create client and invoke server side. Actually, JSR-311 only defined the server API,
so, each vendor will have different ideas on client. But one common way
is to use Apache Http Common Client lib. Please see following examples.
1. GET a customer
// Sent HTTP GET request to query customer info
System.out.println("Sent HTTP GET request to query customer info");
URL url = new URL("http://localhost:8080/vendor_search/services/customerservice/customers/123");
InputStream in = url.openStream();
System.out.println(getStringFromInputStream(in)); //NOTE, return an input stream, you need convert xml to Java Object by yourself
2. Use PUT to update a customer
System.out.println("Sent HTTP PUT request to update customer info");
Client client = new Client();
String inputFile = client.getClass().getResource("update_customer.txt").getFile();
File input = new File(inputFile);
PutMethod put = new PutMethod("http://localhost:8080/vendor_search/services/customerservice/customers");
RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
put.setRequestEntity(entity);
HttpClient httpclient = new HttpClient();
try {
int result = httpclient.executeMethod(put);
System.out.println("Response status code: " + result);
System.out.println("Response body: ");
System.out.println(put.getResponseBodyAsString());
} finally {
// Release current connection to the connection pool once you are
// done
put.releaseConnection();
}
3. Use POST to add a customer
System.out.println("Sent HTTP POST request to add customer");
inputFile = client.getClass().getResource("add_customer.txt").getFile();
input = new File(inputFile);
PostMethod post = new PostMethod("http://localhost:8080/vendor_search/services/customerservice/customers");
post.addRequestHeader("Accept" , "text/xml");
entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
httpclient = new HttpClient();
try {
int result = httpclient.executeMethod(post);
System.out.println("Response status code: " + result);
System.out.println("Response body: ");
System.out.println(post.getResponseBodyAsString());
} finally {
// Release current connection to the connection pool once you are
// done
post.releaseConnection();
}
So, for this way provided by Apach Common Http Client, the user still need think about the convention from XML to POJO. It is not so convenience. We will provide a utility class to simply this process.
posted @
2008-11-05 22:48 Justin Chen 阅读(1835) |
评论 (0) |
编辑 收藏
摘要: The first article of a series of implementing Restful web service with CXF. This one focus on a very simple service and how to config it in Tomcat container.
阅读全文
posted @
2008-11-05 18:24 Justin Chen 阅读(3498) |
评论 (1) |
编辑 收藏
摘要: This message gives us a brief introduction on Restful web service (All of these information comes from internet and i just re-organized them) and some thoughts on how can we apply this new architecture pattern into our common service services.
阅读全文
posted @
2008-11-05 10:43 Justin Chen 阅读(2093) |
评论 (3) |
编辑 收藏