Archive for the ‘Java’ Category

Familiar Reports for Regulated Industries


Web application testing for regulated industries often involves auditors, who are not developers, to confirm the testing results.  We developed Toffee so that non-developers can read the automated test results and quickly understand them.

We have personal experience of the challenges of incorporating automated testing into the computer system validation process for regulated industries.  Before we built Toffee, we wrote our automated tests in Java using Selenium.  After writing a large suite of automated tests that validated one of our client’s applications, we turned over the results to their auditor.  The auditor came back to us and explained that our results did not help her because, understandably, she did not know what any of the Java meant.  We ended up sitting down with her and explaining each line of code.

It quickly became apparent that describing lines of code was not a tenable exercise for regulated industry web testing.  We think auditors should not have to become developers, so instead we made Toffee to allow auditors or any non-developer to read automated tests.

After Toffee runs a test, it generates a report that conforms to the traditional web testing style used in manual/paper tests.  The report has five columns for each test step which state the action taken, the expected result, the actual result, the verdict, and if applicable the screenshot evidence.

If the test uses screenshot evidence, a picture is taken for each step.  We discussed this in a prior post called  Automatic Screenshots: Evidence Gathering Made Easy.  Each screenshot is included in the report appendix with a reference number, so all the information is in one place.  This makes it easy for an auditor to quickly evaluate the test.

We realized that non-developers are regularly a part of web testing, so we made Toffee to be user friendly for everyone regardless of their programming knowledge.

 For more information about Toffee, visit, or feel free to contact us with questions at

Integrating Joda-Time and Freemarker

One nice aspect of the Freemarker template engine is the way that it intelligently displays typed model data. Dates, for example, are presented in a human-readable format which can be controlled in the view using Freemarker builtins. This works well, and is good for helping view concerns stay in the view code. However, one difficulty with this feature is that Freemarker doesn’t understand all domain types out of the box. joda-time DateTime objects are a good example, and this article shows how to teach Freemarker how to render that type of value.

Continue Reading…

Sencha Package Management Using Sonatype Nexus

In this post I will explain how to use Sonatype Nexus Repository Manager as your Sencha Package repository.

If you use Sencha Touch or ExtJS for development, Sencha has provided a tool called Sencha Cmd which “is a cross-platform command line tool that provides many automated tasks around the full life-cycle of your applications from generating a new project to deploying an application to production.” One of the new features is the ability to have “packages”. If you come from the Java world like I do a package is the equivalent to a JAR library file. A re-usable block of code that can be versioned and stored for others to use. Sencha Package Manager is designed to solve two basic problems: consumption and distribution.

Continue Reading…

Securing ExtJS Using Java

While trying to teach myself Sencha ExtJS MVC framework, I decided to use Java as the server side language for the REST services that would support the application.   I also thought it would be a good time to exercise what I have learned from working with other web frameworks and try and apply those same principles.  Much to my surprise, when looking around for articles on ‘Securing ExtJS’ I could not find exactly what I was looking for.

Continue Reading…

Middle School Math, Reverse Polish Notation, and Software Design

One of the things I remember most about middle school math class is that I went through it in a perpetual state of disorganization. During one particularly bad spell, I lost two calculators within a week. The loss, and the reaction of my parents, drove me to try to fix the problem once and for all. My plan was simple: buy an expensive calculator with the hope that it’d serve as an incentive to keep track of my stuff. The next weekend, I took weeks of allowance money to the local Service Merchandise and bought a new HP-11C pocket calculator. Almost 30 years later, I still have both the calculator and a fascination for its unusual Reverse Polish Notation (RPN) user interface. Over those decades, I’ve also found out that RPN provides a good way to explore a number of fundamental ideas in the field of software design.

Continue Reading…

Logging the Boundaries of TestNG Test Methods with Log Messages

Posted Sep 5 2013 by in Java with 0 Comments

For a variety of reasons (some good, some bad) I tend to fall into the school of developers that debugs primarily with log messages and printf statements. (What can I say… It works for me.) As part of this style of working, I’ve developed a quick mechanism for instrumenting TestNG to print a log message at the beginning and ending of each test method that it executes. This makes it easier to make sense of the other log messages that get issued during a test cycle.

Continue Reading…

Clojure Closures In Java

As part of a team conversation this morning, I worked up a quick Java translation of some more-interesting-than-it-looks Clojure code. It’s a good example of how lexical closures map to objects.

The code we started out with was this:

(defn make-adder [x]
  (let [y x]
    (fn [z] (+ y z))))

(def add2 (make-adder 2))

(add2 4)

What this code does is define and return a new type of function that adds values to the constant x. In Java, it looks like this: Continue Reading…

Announcing the Open Source Ernie Report Generator


KSM Technology Partners is pleased to announce the alpha release of Ernie, an open source asynchronous report generator based on the Eclipse BIRT framework.  You can find it on GitHub at  There is also an Ernie support forum on Google Groups for the community to ask questions and offer feedback.

For developers, Ernie provides both Scala and Java APIs for:

  • building and maintaining a catalog of reusable BIRT report definitions;
  • running parameterized reports asynchronously to create jobs;
  • interrogating the status of enqueued jobs; and
  • accessing report results in PDF, CSV, or HTML format.

For integrators, Ernie provides a JEE .war implementation that can be deployed standalone, and controlled via a RESTful API. Continue Reading…

Why is Traditional Java I/O Uninterruptable?

Posted Jul 22 2013 by in Java with 0 Comments

One of the best things about writing code in the Java ecosystem is that so much of the underlying platform is open source. This makes it easy to get good answers to questions about how the platform actually works. To illustrate, I’ll walk through the JVM code to show why Java I/O isn’t interruptable. This will explain why threads performing Java I/O can’t be interrupted.

The core issue with interrupting a Java thread performing I/O is that the underlying system call is uninterruptable. Let’s see why that is, for a FileInputStream. Continue Reading…

Custom EHCache Sizing Engines

Posted Jul 10 2013 by in Java with 0 Comments

One of the ways that EHCache can be configured is to put a bound on the maximum amount of memory a cache can consume. To do this, EHCache needs to be able to compute the size of the cache, which implies that it can compute the size of object graphs contained within the cache. The usual way it does this is to traverse the object graph of each key/value pair in the cache, estimate the size of each component object within the graph, and then add them all up to get a total for the key/value pair.  By doing this for each cached key/value pair, EHCache can estimate the overall memory footprint of a cache and enforce a memory bound by evicting objects, if necessary. Continue Reading…