Here is a plug-in that formats code (Java, xml, etc) within html in a very nice way.
http://code.google.com/p/syntaxhighlighter/
This looks great. I'll be adding this functionality ASAP to handle code snippets.
<bean id="limaBean" class="com.example.LimaBeanImpl">
<bean class="org.springframework.web.context.support.ServletContextAttributeExporter">
<property name="attributes">
<map>
<entry key="limaBeanInServletContext">
<ref bean="limaBean">
</ref>
</entry></map>
</property>
</bean>
public class DocumentViewerServlet extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
LimaBean limaBean = getLimaBean();
limaBean.doSomething();
...
}
private DocumentService getLimaBean()
{
ServletContext servletContext = this.getServletContext();
return (LimaBean) servletContext
.getAttribute("limaBeanInServletContext");
}
}
public class VegetableServletTest extends TestCase
{
private VegetableServlet servlet = null;
private LimaBean fakeLimaBean = null;
protected void setUp() throws Exception
{
super.setUp();
servlet = new VegetableServlet();
fakeLimaBean = new FakeLimaBean();
MockServletConfig config = new MockServletConfig();
config.getServletContext().setAttribute("limaBeanInServletContext",
fakeLimaBean);
servlet.init(config);
}
}
Software is shipped with untested parts every day, and just because it's not entirely tested doesn't mean it's bad software or that the untested parts are "useless".
Agilists just don't understand the meaning of calculated risk.
Here's the thing. If you can't test it, you don't know that it works. If you don't know that it works, then it's useless.
Agile is not a silver bullet. Agile is not THE ANSWER. But Agile techniques, and especially TDD, are very powerful techniques to get software written well, and to increase the level of professionalism in our industry.