db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew McIntyre <mcintyr...@gmail.com>
Subject Re: Using JDK 1.4 features in tests
Date Fri, 22 Jul 2005 23:22:00 GMT
On 7/22/05, David Van Couvering <David.Vancouvering@sun.com> wrote:
> Thanks, Andrew.  I was trying to add some functionality to look for a
> pattern in a string, using java.util.regex.  In general this test is
> intended to be run in JDK 1.3, and potentially (I'm not sure) in J2ME.
> So, am I not allowed to use 1.4 features in these "generic" tests that
> are intended for use across JVMs?  Sounds like it... Sigh...

Well, I won't stop you from using 1.4 features in your tests, but I
suspect you may have a rather difficult time getting them to run
properly in JDK 1.3 or J2ME. ;-)

Here's the good news: we already require that the jakarta-oro classes
be available to run the tests. It would be the first instance that I
know of a test using the oro classes and not just the test harness,
but they're there and they do pattern matching.

Intead of:

Pattern.matches("my(reg|ex)",  charsequence);

import org.apache.oro.text.perl.Perl5Util, and do:

Perl5Util p5u = new Perl5Util();
Perl5Util.matches("my(reg|ex)", "myinputstring");

Javadoc is available online:



View raw message