review (S) for 6891770: JSR 292 API needs initial unit tests

John Rose John.Rose at Sun.COM
Thu Oct 15 01:47:19 PDT 2009


Here is the first JUnit-based test for JSR 292:
   http://cr.openjdk.java.net/~jrose/6891770/webrev.00

I have marked this review as small (S) because there is little or no  
need to look at the details of the unit test, as an API test.   
(Although you may if you like!)

The important thing is the "@test" comment which links it into the  
jtreg regression suite in the JDK.

The test is a backport of the corresponding test  
'MethodHandlesTest.java' in the following mlvm patch:
   http://hg.openjdk.java.net/mlvm/mlvm/jdk/file/tip/indy.tests.patch

To backport it for the present purpose, I simply removed test cases  
that do not pass on the JDK7 M3 version of the JSR 292 RI, which is  
what is in the JDK7 repo. at this moment.  (There is more to come soon!)

This unit test passes fully, both the full version in the mlvm patch  
repo (running on a JDK7 with those patches), and the abbreviated  
version (running on the present unpatched JDK7).

This test is known to work on i386 platforms.  It automatically senses  
other platforms and excludes itself.  See the method named  
'checkImplementedPlatform'.  (There are tracking bugs filed for JSR  
292 on those platforms.)

In order to successfully run this unit test, jtreg must be upgraded  
(to 4.1, including JUnit support).  This means that some nightly and  
pre-integration jtreg runs are likely to show this new test failing,  
in an uninteresting way.  I have verified that this happens in a clean  
way with jtreg 4.0, and that the other unit tests will run correctly.   
The error looks like this:
   test result: Error. Bad action for script: junit

The new test may appear to fail in nightly and pre-integration  
testing, until the upgraded test harness is accepted and installed by  
SQE.  (It is not clear whether this will happen, because the selection  
of tests might not include java.dyn.)  Independently of this push, I  
am working with them on the appropriate upgrades and test inclusions.

-- John


More information about the hotspot-compiler-dev mailing list