On Monday 19 February 2001 14:17, you wrote:
} You could create a set of JUnit test cases and have ant call them instead
 of } creating a specific ant task just for regex tests.  Other apache
 projects } are doing this ( velocity, turbine )

Could do.

What I want is a simple way for anyone to write a test scipt for 
1) A pattern eg \w, \w+, etc etc
2) A set of constants on a class eg EmailProcessingConstants.RE_USERNAME

The reason I wanted to make it a task is that everyone would have it available with 
ant.
And there are a lot of projects that use re's. Otherwise I would have to distribute 
the test.

I wiil have a look at what velocity and turbine have done. 

Basically the testing of re is not a project specific thing at the code level where 
the junit 
test comes in but a configurable thing like a xml script of tests.

I was looking at the ant source last night and its using some re anyway. Because they 
way they use
it lead very nicely into a testing task I think it would be suitable. At the moment 
they use an adapter to
abstract away a particular regexp implementation from ant. If someone chooses to use 
another package they
just have to implement the RegExpMatcher class. But how do they know it works 
properly. Here comes 
room for a nice test.


But I digress. I will have a look at JUnit, I should be using it anyway so Ill see. 
They code will look the 
same whether its wraped in JUnit or Ant anyway.

Michael

Reply via email to