Category Archives: Java

Unit testing private methods using reflection (and other solutions)

When it comes to unit testing you might find yourself wanting to test private methods. Here’s four solutions, some much better than others. 1. Don’t test private methods (refactor!) If you find yourself needing to test private methods, you’re code is trying to tell you something – listen up! Unit tests should test the behavior… Read More »

Solved: Digester.getParser: org.xml.sax. SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic

I ran into a nice little problem trying to get richfaces deployed on Oracle’s OC4J: [text] Digester.getParser: org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128) at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185) at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138) … snip … [/text] From a little bit of googling, I found several people running into this problem or something very similar. Frustratingly, not a whole lot of solutions. One… Read More »

MediaWiki bot using JWBF (Java)

One of the nice things about Java is there seems to be a friendly (or at least relatively friendly) API for everything. Java Wiki Bot Framework (JWBF) is a Java framework for working with wikis running MediaWiki (the wiki software used by Wikipedia and all the other Wikimedia Foundation projects). A little off subject: who… Read More »