Musings about this and that

June 30, 2008

Jazoon Presentation Online Available

Filed under: Uncategorized — ajesse @ 11:44 am
Tags: , , ,

At this years Jazoon I presented an introduction to JSFUnit. The presentation is now online.

Jazoon turned out to be, once more, a great conference. The presentations are held in movie-theaters with comfy seats and good acoustics. All over the place a free WLan is available. In the exhibition the speakers and other esperts from the sponsors are easily approachable. Those that were there, I think, will agree to this opinion. And those that were not there surely missed a nice conference and definitely should note the already published date of next years Jazoon.

See you next year in Zurich at Jazoon 2009

April 28, 2008

Jazoon 08 looming ahead

Filed under: JSF, JSFUnit, Unit Testing, UnitTest — ajesse @ 4:46 pm
Tags: , , ,

Time for the next big Java conference… the Jazoon 08.

I’m gonna talk about JSFUnit. It will be an introduction to this JSF testing framework (presentation info).

Hope to see you there and have a chat together… my company’s (Credit Suisse) booth seem to e close Netcetera’s, let’s hope their coffee is as great as last year (was a really good coffee, even by italian standards). From our coordinator I heard, that we will distribute our good chocolate goodies… That should make a good combo: good coffe and good chocolate.

March 14, 2008

JSF Days 08 - almost over

Filed under: JSF, JSFDays, JSFUnit, Selenium, Unit Testing — ajesse @ 3:44 pm

To all those that forgot to come to Vienna: You definitely missed something really great.

3 days with many important people in the JSF ecospace (Kito: good definition of that) in a very relaxed context. Irian did a great job to organize this second JSFDays in a perfect way, which definitely helps to create this friendly mood.

For those not yet used to be able to get in “touch” with the great names of JSF were pleasently surprised how easy those persons behind the names are. This feature is definitely something I like in the JSF ecosphere. Despite being a difficult environment (todays webapp-development,…) JSF brings along a bunch of nice guys that are very approachable and helpfull. A great community. And this you can really feel here in Vienna at the JSFDays.

Almost a pity those 3 days are almost over… It will be a long time till JSFDays 2009.

The presentations will be available through Irian’s website. As soon as this happens I will report back.


I did a presentation on Testing JSF applications and components. Although one of my laptops started to misbehave… it went quite well. I got some nice feedback, questions and hints and wait impatiently for the official feedback analysis.I concentrated on Selenium and JSFUnit.The preparation for this talk are also the reason for the long time since my last post… but it also gave me some input for further posts ;)

November 12, 2007

Simple walkthrough testcase using SeleniumTestCase

Filed under: JSF, Selenium, Unit Testing, UnitTest — ajesse @ 7:17 pm

After all the preparations its time to write some tests. Imagine a sample-application that contains a page per component from a component set. For our nightly build we want to know whether all pages work. So a first test would be to use the browser and click through all pages. Annoying and always the same. Calls for an automated test, doesn’t it?

@Test public void checkCatalog() {
  openAndWaitWebAppRoot();
  clickAndWait("link=CATALOG");
  assertPageTitleEquals("JSF Components Catalog");
  clickAndWait("link=CATALOG");
  clickAndWait("link=Layout components");
  assertPageTitleEquals("Layout components");
  clickAndWait("link=Layout");
  assertPageTitleEquals("Layout Component");
  clickAndWait("link=Container");
  assertPageTitleEquals("Container Configurator");
  clickAndWait("link=GroupBox");
  assertPageTitleEquals("GroupBox Component");
  clickAndWait("link=Tabbed Pane");
  assertPageTitleEquals("TabbedPane Component");
  clickAndWait("link=MessageArea");
  assertPageTitleEquals("MessagesArea Component");
};

Looks easy, doesn’t it? Looks and feels just like the instructions for a human tester. And that’s the writing test should be: simple.

Such a test can also survive a revamp of the menu-structure of the application, as long as the texts of the menu-items remain constant, the testcase, just like the human tester, still find the links to click on. Was very usefull when we did such a refactoring of the sample-application. Every now and then someone from teh team would do the “cvs update”-redeploy-”let the testuite run”-cycle and just report which areas needed some massaging.

New tricks for SeleniumControl and SeleniumTestCase

Filed under: JSF, Selenium, Unit Testing, UnitTest — ajesse @ 6:47 pm

Since the original post introducing SeleniumControl and SeleniumTestCase these two classes learned some more tricks.

The most annoying thing I noticed about that code was, that I had to trigger the SeleniumTestSuite to be able to run a testcase. So I added a simple method to SeleniumControl (isStarted() returning true if server != null) to allow a testcase to query for that and, in case of need, to start the SeleniumServer on its own. The TestCase class checks for this in its setupBeforeClass()-method…

Now I can start either a SeleniumTestSuite, which results in the server started only once for the whole testsuite, or a SeleniumTestCase, which starts the server just for that single testcase. At the beginning the restriction did not hurt, only with the evolution of the test-suite (about 125 tests so far…) this started to itch.

After a few testcases I also added a method to SeleniumTestCase to open the web-applications root:

public boolean openAndWaitWebAppRoot() {
boolean result = false;
try {
selenium.open(getWebAppRoot());
selenium.waitForPageToLoad(pageTimeOut);
result = true;
} catch (Throwable t) {
result = false;
System.err.println("--- received an exception: " + t);
}

return result;
}

public String getWebAppRoot() {
return testHost + testAppl;
}

November 6, 2007

Preparing your JSF webapp for testing

Filed under: JSF, Selenium, Unit Testing, UnitTest — ajesse @ 8:14 pm

Be it load&performance testing, be it unit-testing, it seems that all related tools have some problems with JSF’s dynamic ID-attributes.

With dynamic ID I want to indicate that the ID of a certain input-field or a button/link can change if

  • no fixed id is specified (id=…)
  • the page-structure changes (eg. conditionally rendered components in templates)
  • real page-changes (new requirements, refactorings)

I would say a testable JSF web-application has fixed ID’s for all input- and command-components. Pure output-components like h:outputText do not need a fixed ID.

So far this is the most important testability-criteria. Of course most things can be done otherwise. But it sure is more hassle. The load&performance test-tools are more dependent on the ID-attribute because it determines also the NAME-attribute. I consider the better testability more important than the minimal time-saving by not specifying the ID-attribute.

Selenium Toolkit (preparing to write Selenium Tests)

Filed under: Selenium, Unit Testing, UnitTest — ajesse @ 7:28 pm

What should you prepare when you want to write Selenium Tests in the form of Java JUnit tests?

I found that a few tools and urls can help to save your hair from getting too white:

October 25, 2007

Let’s meet in Vienna 2008

Filed under: JSF, JSFDays — ajesse @ 11:43 am

What started in 2006 in Munich as a improvised meeting has now it’s official successor. IRIAN Solutions Gmbh organizes the JSFDays 2008 in Vienna.

So let’s meet in Vienna next year in March. See you there.

October 16, 2007

JSF Usergroup CH - a Special Interest Group of JUGS

Filed under: JSF, JUGS, Usergroup — ajesse @ 2:39 am

Now it’s official the Swiss JSF Usergroup exists. It has been accepted as a SpecialInterestGroup under the JUGS (JavaUserGroupSwitzerland) umbrella.

The next steps will be to organize some presentations for a meeting … to be continued

October 5, 2007

A trip back to nature

Filed under: miscellaneous, outdoor, travel — ajesse @ 7:00 pm

The other we went for a little walk to a place that seems almost isolated from civilization, which is a difficult thing here in Switzerland. But once you have left behind the car and walked for 10 minutes in the moor landscape of Glaubenberg, you have to impression to be out there in the wilderness. check out the photographs I took. Every now and then you find traces of civilization like a nice restaurant or a alpine dairy, where they herd the cattle during summer and produce some of the best cheese of the world. OR those nice informative small projects… like this quiz/game, where you have a few questions that deal with the local and non-local flora. Or signposts like this one that shows you the names of the flowers you can find along the way.

Obviously the food you can eat at the Schwendi-Kaltbad restaurant is just great and after a little hike you can relish it even more. Sitting close to one of the three open fire cooking places in the log-cabin style restaurant, sipping some drink and waiting for the fine food is just a decent finish of a great day…

Gotta go there more often.

Next Page »

Blog at WordPress.com.