This article presents a case study of the use of meta-programming in Java
compatibility testing. It shows how parts of the source code can be shared
between different products and modified to generate programs targeting
specific functions and describes the approach Sun Microsystems has used for
building Technology Compatibility Kits (TCK) for more than five years.
In modern Java TCKs, testing components for multiple products are stored in a
single repository not as pure Java language, but as XML files where code is
annotated with attributes called metadata. A set of tools is used to select
only tests that are applicable for a particular product and transform them
into final Java programs. These post-processing tools written in Java provide
a simple and efficient way to g... (more)