Friday, September 4, 2009

HtmlUnit 2.6 is out

It is always a pleasure to announce a new release of HtmlUnit.

The main enhancements of this release:

  • Use cache for all kinds of (cacheable) content

  • Fix many issues with (de)serialization

  • Add a mechanism to save complete page along with images

  • Add support for Proxy Auto-Config

  • Better support for XHTML pages

  • And as usual, various bug fixes

You can download it here, enjoy!

Sunday, August 30, 2009

The Pontiac that was Allergic to Vanilla Ice Cream

For the engineers among us who understand that the obvious is not always the solution, and that the facts, no matter how implausible, are still the facts ...

A complaint was received by the Pontiac Division of General Motors:
"This is the second time I have written you, and I don't blame you for not answering me, because I kind of sounded crazy, but it is a fact that we have a tradition in our family of ice cream for dessert after dinner each night. But the kind of ice cream varies so, every night, after we've eaten, the whole family votes on which kind of ice cream we should have and I drive down to the store to get it. It's also a fact that I recently purchased a new Pontiac and since then my trips to the store have created a problem. You see, every time I buy vanilla ice cream, when I start back from the store my car won't start. If I get any other kind of ice cream, the car starts just fine. I want you to know I'm serious about this question, no matter how silly it sounds: 'What is there about a Pontiac that makes it not start when I get vanilla ice cream, and easy to start whenever I get any other kind?'"

The Pontiac President was understandably skeptical about the letter, but sent an engineer to check it out anyway. The latter was surprised to be greeted by a successful, obviously well-educated man in a fine neighborhood. He had arranged to meet the man just after dinner time, so the two hopped into the car and drove to the ice cream store. It was vanilla ice cream that night and, sure enough, after they came back to the car, it wouldn't start.

The engineer returned for three more nights. The first night, the man got chocolate. The car started. The second night, he got strawberry. The car started. The third night he ordered vanilla. The car failed to start.

Now the engineer, being a logical man, refused to believe that this man's car was allergic to vanilla ice cream. He arranged, therefore, to continue his visits for as long as it took to solve the problem. And toward this end he began to take notes: he jotted down all sorts of data, time of day, type of gas used, time to drive back and forth, etc.

In a short time, he had a clue: the man took less time to buy vanilla than any other flavor. Why? The answer was in the layout of the store.

Vanilla, being the most popular flavor, was in a separate case at the front of the store for quick pickup. All the other flavors were kept in the back of the store at a different counter where it took considerably longer to find the flavor and get checked out.

Now the question for the engineer was why the car wouldn't start when it took less time. Once time became the problem -- not the vanilla ice cream -- the engineer quickly came up with the answer: vapor lock. It was happening every night, but the extra time taken to get the other flavors allowed the engine to cool down sufficiently to start. When the man got vanilla, the engine was still too hot for the vapor lock to dissipate.

Moral of the story: even insane-looking problems are sometimes real.

Monday, July 20, 2009

Eclipse Galileo Property Testers complete list

During extending Eclipse, you may encounter Property Testers, for example in Launch shortcuts extension point.

I wanted to have a list of all Property Testers already defined, in order not to reinvent the wheel. A small program was made to list all testers found in a specified Eclipse folder.

For reference, Galileo Property Testers are:

buildpathReference, contextlaunch, extendsClass, extendsInterface, hasMethod, hasMethodWithAnnotation, hasProjectNature, hasTypeWithAnnotation, isContainer, isPackageFragment, isPackageFragmentRoot, matchesContentType, projectNature, areBreakpointTypesAvailable, bundleState, canCreateWatchExpression, canLaunchAsJUnit, consoleTypeTest, contentGenerator, contentTypeId, done, editable, extension, fileMarker, getAvailableBreakpointType, getModelIdentifier, hasFilters, hasGroups, hasMain, hasTypeOnClasspath, inArchive, inExternalArchive, inSourceFolder, isActivityEnabled, isBundleInstalled, isCategoryEnabled, isInJavaProject, isInJavaProjectWithNature, isManaged, isMultiStrata, isOnClasspath, isPerspectiveOpen, isTerminatedOrDisconnected, isTest, languageName, launchable, matchesPattern, message, name, open, path, persistentProperty, priority, processTypeTest, product, projectNature, projectOption, projectPersistentProperty, projectSessionProperty, quickFix, readOnly, refactoringPropertiesEnabled, resourceType, reuseEditor, sessionProperty, severity, superType, and type.

You can also list the associated namespace, type, class, and jar or folder location using the snippet here.

Wednesday, June 24, 2009

Eclipse Galileo is out

Eclipse team releases at committed date, always! This year, Eclipse 3.5 version contains 33 projects.

As you would expect, it contains various enhancements and new features, I think below are the most important ones:
  • PHP Package: another major language added to the constellations

  • Memory Analyser: a java heap analyzer to easily find memory leaks

  • Xtext: you define your own 'language', and a parser and IDE editor are created for you


Enjoy the best IDE here.

Sunday, June 21, 2009

HtmlUnit now supports Proxy Auto-Config

A previously requested feature, Proxy Auto-Config, is now supported in the latest snapshot of HtmlUnit.

As testing requires proxy server with related configurations, the team appreciates testing the feature in the wild.

You can get latest snapshot from here.

The typical usage is webClient.getProxyConfig().setProxyAutoConfigUrl("http://proxy_auto_config.url");

As always, enjoy!

Thursday, June 11, 2009

2009 JavaOne HtmlUnit technical session online content

2009 JavaOne conference website now has the online version of the technical session "HtmlUnit: An Efficient Approach to Testing Web Applications TS-4238", which was presented by Daniel Gredler and I.

You can view the PDF presentation here.

Saturday, June 6, 2009

James Gosling's Toy Show

As JavaOne has finished, I guess the best general session was the last one. James Gosling really brought some nice ideas:

  • Reading the data from Wii Remote camera and control projector image accordingly

  • Open source microfinance web application that helps the needy in undeveloped countries (mifos.org)

  • Seriously agressive image analysis, that has medical usage

  • Football robots done by high school teams

  • A printer application that automatically marks the answer sheets, done by two Hungarian students

  • Satellite stations monitoring

  • Other cool stuff


If you haven't already, watch this.