YOUR FEEDBACK
James Nelson wrote: Thanks for the posting, which we are hoping will solve our software issue with t...


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


Java Annotations + Compiler API + Annotation Processing = Remarkable Results
Effective Development of Java Conformance Tests Meta-Programming

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 generate testing components that match specific product needs.

Here we'll illustrate Sun's approach by providing examples of test storage formats and the processing scheme used by the conversion tools. We'll also draw a comparison with Sun's former approach, which used Perl for test generation, and explain why Sun moved to the XML-based methodology.

TCKs
The international community develops and evolves Java technology specifications using the Java Community Process (JCP). The JCP produces high-quality specifications in Internet time, using an inclusive consensus-building approach that produces a specification; a reference implementation that demonstrates that the specification can be implemented; and a technology compatibility kit, or TCK, a suite of tests, tools, and documentation used to test implementations for compliance with the specification.

There are as many TCKs as there are Java technologies, and these technologies might be deeply intertwined despite their differences. For example, both the Java Platform Standard Edition (SE) and the Java Platform Micro Edition (ME) include the Java Virtual Machine (JVM) and the java.lang package, so most tests written for the Java SE VM can be reused to test the Java ME VM.

Each separate TCK has its own requirements for tests such as performance targets or maximum memory size. As a rule, the kernel of the test is the same across TCKs, but the test might take different forms. For example, for Java SE several tests can be combined in one class; while for Java ME, due to a restriction on class file size, each test case should be put in its own class.

Sun Microsystems has a long history of successful TCK development. During the past 10 years, about 100 TCKs with millions of tests were shipped. This success would have been impossible without effective reuse or sharing of tests between TCKs. At the heart of the approach applied at Sun for TCK development is meta-programming, which implies that sources are generated from metadata.

This article describes how this approach is implemented. Even though the area of conformance testing is narrow, the underlying principles can be generalized:

  • All tests are stored as templates, not as tests to be included in the product.
  • Each test is represented as code with attributes (meta information).
  • Templates are stored in a single repository shared across different TCKs.
  • Tests applicable for a particular technology are selected by attributes at the TCK build stage based on selection criteria set by the TCK.
  • All TCKs use the same tools for extracting test sources from templates, but tools can be customized according to particular TCK needs.
  • All TCKs abide by the general policy regulating the rules for writing tests.
TCK Structure
Each TCK product consists of the following components:
  • Test Monitor: Tool for test configuration and execution
  • Tests: Programs returning either a passed or failed status
  • Libraries: Code shared by tests
  • Product Documentation

    Each test consists of:

  • Test sources: Java source code and data files
  • Class files: Compiled sources
  • Test descriptions: HTML files that consist of Test Monitor instructions showing how to execute tests, links to test sources and data files, and human-readable test documentation
The minimal test unit is a method or Test Case. Test Cases with similar functionality are combined in one class or Test Group. Listing 1 provides a sample fragment of the test source code.

Some tests require arguments be passed or some action performed prior to execution. This information is specified in the Test Description and stored in an HTML file. The Test Monitor reads the Test Description and runs the test according to the instructions. Besides execution instructions, the HTML file contains test documentation, which lets one understand what the test checks for and how without reading the sources.

Here is a sample fragment of an HTML file:

Test Specifications and Descriptions for Applet
       * public Applet()
       * public void start() List of tested methods
       * public void stop()
public Applet() (See Table 1 and Table 2)


About Dmitry Fazunenko
Dmitry Fazunenko is a lead TCK programmer at Sun Microsystems Inc. His expertise is in developing Technology Compatibility Kits for Java SE platforms. He has been working in this area for a decade and during the past six years, he has focused on developing and improving techniques for effective test development.

YOUR FEEDBACK
ecommerce software wrote: Actually, NetBeans appear to be a really powerful piece.
One Way Link Building wrote: Flex is simply awesome. The only drawback is that the widget library (even in version 2) is a bit small. Hope that changes soon.
MICR wrote: Yeah, I'm not a big fan of Adobe Flex...Flash or Java will do for now.
Yakov Fain wrote: With your modest requirements, use BlazeDS, which is an open source scaled-down version of LCDS and it implements AMF. If you'll use it with Clear Data Builder, your code development cycle will dramatically shorten. Read this article: http://flex.sys-con.com/read/552632.htm
Jalal Ul Deen wrote: Hi, I am new to flex/RIA. I am exploring different design choices especially in client server communication. On client side we will be using Flash based RIA (using Actions scripts). There will be some simple forms (like for login, registration, payments etc) and some simple reports including with several graphs and charts. Each chart might have 1000 to 1500 data points etc. There are not video or audio content as such. On server side we have Servlets, java API and some EJB’s to provide the business logic and real time prices/content (price update is usually every 10 seconds) /data. Some of the content will be static as well. I have following questions in my mind. Is it worth it to use RTMP/AMF channels for the followings? 1. For simple forms processing (Mapping Actions scripts classes to Java classes). Like to display/retrieve/update data for/from registration forms. a....
Yakov Fain wrote: You do not need FDS to connect to your JSPs, just use HTTPService without proxy, for example: http://flexblog.faratasystems.com/?p=79 You can also connect to your POJO using OpenAMF - an open source implementation of the AMF) protocol. We use it in one of the versions of our Web Reporter ClearBI.
Flex2WithoutFDS wrote: I have searched high and low for a resource describing how to use FLex2 without FDS and keeping the pojo beans as a backend server. In other words, how do I configure my jsps to add mx tags and display flex fragments using standard getters and settings in my java beans without going through FDS?
Victor Rasputnis wrote: Balu, The note is quite cryptic. Please feel free to contact us at support@faratasystems.com. Kind Regards, Victor
balu wrote: hi.. i have one problem, that is in my flash project is not open through tomcat server. In flash i am loding xml.what can i do for accessing my swf.
Sally wrote: Thanks for your reply, Victor. Yes, it's the configuration problem and now I've figured it out. Thanks.
Victor Rasputnis wrote: Sally, Must be the configuration issue. Feel free to contact me my faratasystems.com e-mail and I will help you out. Kind Regards, Victor Rasputnis
Sally wrote: Hi, There is an error: Couldn't establish a connection to "Portfolio", when I try to run this example. I copied the code exactly. What's the reason for this error?
Praveen wrote: Hi, I could not make much use of this article since midway it just wanders from actually giving us an insight into the integration. I get a few listings containing codes ... but am not able to figure out what goes where! I have been workin with flash using flash remoting and WSAD for the IDE. But I could not get any further after the first page.
Victor Rasputnis wrote: Vitaliy, Thank you for your feedback. Let me start with one "platform" statement: Flex is the application server solution with service oriented client layer built on top of the Flash Player. Now, I will jump to the point where you started agreeing with us and from there will walk through the list of concerns all the way back. <<4. Flash has no threads, no thread management.>> I find this rather hard to justify as it is. Multithreading capabilities are implemented in browsers as well as in the Flash Player. You may question, however the level at which these capabilities are available to a programmer. After all, the beauty of XMLHTTPRequest is that it is asynchronous, isn't it? Otherwise we'd be saying JAX instead of AJAX :). Similarly, the same asynchrony has been available with Flash Remoting since 2002 or 2003, if I am not mistaken. Here is the link just for...
Vitaly Sazanovich wrote: Hello, I have been working both with Java Swing and ActionScript while creating gui. Here are my observations that defy your statements in the article. 1. "Imagine the amount of Java code you'd need to write to achieve the same functionality." - WRONG, there are a number of Java XUL implementations (http://www.google.com/search?hl=en&q=java+xul&btnG=Google+Search) Swixml is one of my favorite (www.swixml.org/). 2. "...but we wouldn't have to worry about routing all events to the event-dispatch queue." - WRONG, in Java you use listeners and handler functions to attach to the gui events, events are routed automatically. Creating custom events in ActionScript would take just as much effort as in Java (or probably less, since it has Observer,Observable and other utility classes in the rt library, unlike Flash). Now the drawbacks of using Flash (components v.2) over...
Changi wrote: Forgot about Flex. I have run through and test the product from the very beginning to the end. This product is seriously handicapped. I would suggest you either to use Flash directly, use Java or even the new Microsoft Expression Interactive Designer based on .Net framework
SYS-CON Italy News Desk wrote: A typical Java developer knows that when you need to develop a GUI for a Java application, Swing is the tool. Eclipse SWT also has a number of followers, but the majority of people use Java Swing. For the past 10 years, it was a given that Swing development wouldn't be easy; you have to master working with the event-dispatch thread, GridBaglayout, and the like. Recently, the NetBeans team created a nice GUI designer called Matisse, which was also ported to MyEclipse. Prior to Matisse, JBuilder had the best Swing designer, but it was too expensive. Now a good designer comes with NetBeans for free.
LATEST JAVA STORIES & POSTS
Three-letter acronyms (TLAs) are hardly new in Information Technology: EAI, ESB, SOA, BPM, BAM, ETL, MDM; the list goes on and on. This article is about yet another three-letter acronym, EDA, which stands for Event-Driven Architecture. EDA is not a brand new technology, but rathe...
Furthering its dedication to providing Java developers productivity with choice, Oracle announced the Oracle Enterprise Pack for Eclipse, a new component of Oracle Fusion Middleware. This release marks the first free Eclipse 3.4 environment to support Oracle WebLogic Server 10g R...
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted...
Red Hat CTO Brian Stevens, Citrix CTO Simon Crosby, Egenera CTO Pete Manca, Allen Stewart, Group Manager, Windows Virtualization at Microsoft, and Brian Duckering, Sr. Director of Products and Alliances at Symantec were the top industry executives who joined Jeremy Geelan in the ...
Government intervention and direction has long been critical to the development of the computer industry. The Internet, after all, was derived from the ARPANET, developed in the early 1970s from a U.S. government-sponsored research project by the Advanced Research Projects Agency...
Commercial systems are developed with a huge range of performance requirements and we are concerned in this article with the small number of systems where absolute maximum performance is demanded either in terms of execution speed or available memory. We'll discuss the role of be...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

SPONSORED BY INFRAGISTICS
There are many forces that influence technological evolution. After a decade of building enterprise ...
2008 is going to be an important year for Rich Internet Applications. Most organizations are deliver...
The OpenAjax Alliance is developing an Ajax industry wishlist for future browsers, using a dedicated...
In every field of design one of the first things students do is learn from the work of others. They ...
Infragistics announced the availability of two Community Technology Preview (CTP) User Interface (UI...
The YUI development team has released version 2.5.2; you can download the new release from SourceFor...
ADS BY GOOGLE
BREAKING JAVA NEWS

SpringSource, a leading provider of infrastructure software and the company behind ...