You need to enable JavaScript to view more than 15 articles by this author.
Mock Objects in Unit Tests
Publish Date: Jan. 12, 2005
Unit testing your code against a service or process that's either too expensive (commercial databases) or just not done yet is something you can deal with by simulating the other piece with a mock object. EasyMock can suffice in some cases, but it can only create mock objects for interfaces. Mocquer, based on the Dunamis project, can create mocks for classes, too. Lu Jian shows how it works.
Dynamic Delegation and Its Applications
Publish Date: Nov. 17, 2004
Proxy , introduced in Java 1.3, offers an interesting way to provide an interface's implementation at runtime, but there's more that can be done. Lu Jian shows how bytecode manipulation can be used to provide dynamic delegation, allowing you to provide runtime implementations of interfaces, abstract classes, and even concrete classes.
Unit Test Your Struts Application
Publish Date: Sep. 22, 2004
Consistent unit testing is an essential part of development, but web applications aren't necessarily well-suited to unit testing--how to you validate the "correctness" of a returned stream of text or HTML? Lu Jian has an answer in the form of StrutsUT, a Cactus-based library for unit testing Struts web apps.