Java

How to write effective unit tests

Jon Tirsen offers some advice for how to write good unit tests. Although his examples make use of JUnit, the popular testing library for Java, they apply to any kind of unit testing. ... (read more)

Editing OPML link directories with JOE

At first glance, the Java Outline Editor (JOE) looks like a suitable choice for editing OPML link directories and other outlines. The program supports the addition or deletion of any attributes to each outline item, enabling link directories to be created by adding type and url attributes (screenshot). It isn't as easy as using Radio, where you can hit CTRL-K or CMD-K to add a link to any title, but there may be a way to extend the functionality that I haven't found yet. Note: JOE has the same ... (read more)

Java.Com: Write once, Christina everywhere

For years, Java.Sun.Com has been Sun's official home page for the Java programming language, offering developer downloads, documentation, support, and lots of evangelization. The more obvious domain, Java.Com, was owned by a third party and no site was published there. At some point, Sun got its hands on the domain, as shown by the new Web site launched at Java.Com to sell consumers on the benefits of the language -- one of which is apparently Christina Aguilera. As Sun reveals, Java fulfills ... (read more)

With great parser comes great responsibility

On the OPML-DEV mailing list, Andrew Houghton confirms that undeclared entity declarations can prevent an XML file from being well-formed. Les Hill has sent me some code that solves this problem for an OPML browser written with Java that uses JDOM. I'll be posting more on it soon when I have time to try it out. He says that to read OPML, it "basically replaces the SAX parser with an almost identical parser that will recognize the XHTML entity set." Ouch. ... (read more)

Using OPML bookmarks in Mozilla and Netscape Navigator

I've released version 0.1 of OPML Link Publisher, a Java application that publishes an OPML link directory outline as a bookmarks.html file, which can be automatically loaded by Mozilla or Netscape Navigator and manually imported into Internet Explorer. I wrote the application because a Mozilla crash wiped out my bookmarks and I was tired of having bookmarks in several different browsers and other files. Radio UserLand's outliner can be used to create link directories (other outliners may ... (read more)

XOM class library simplifies Java XML processing

Linux Magazine has posted XOM: XML Made Simpler, my article from the March issue about an extremely well-designed new XML processing API for Java developed by Java and XML computer book author Elliotte Rusty Harold. The article was written with XOM version 1.0d8 -- subsequent versions have changed a few things that may affect the example programs. ... (read more)

Tim Bray offers an exceptional tip

In an essay on dynamic languages, Tim Bray ends with an interesting-but-controversial tip for handling Java exceptions that must be declared but can only result in a program shutdown: Catch them and throw a RuntimeException. ... (read more)

InformIT launches new technical weblogs

InformIT, a technology reference site created by seven computer publishing imprints, has begun offering weblogs devoted to several topics: .NET, C++, Certification, Flash, Java, Photoshop, SQL Server, and XML. Each weblog has a primary author and additional contributors (I'm one on the Java weblog). They're still new, so some changes may be made. I'd like to see RSS feeds and a less compact, more readable design. ... (read more)

Column: Using XML-RPC with Java

Linux Magazine has posted my January Java Matters column: an introduction to XML-RPC that demonstrates how to use the protocol with Apache XML-RPC, one of the great open-source Java libraries released by the Apache Project. ... (read more)Rafe Colburn is having some trouble with log4j, the Java class library from Apache Jakarta that supports logging. I wrote about log4j last August for Linux Magazine and was impressed with it, though I'm usually too lazy on my own programming to put it into use. ... (read more)