See below.
>> > RE.REPLACE_WITH_ESCAPES could not be resolved. Please send me your new
>> > RE.java. Easiest for me would be, if you send all your source files
>>
>> This is part of the fix which is not integrated yet, so you can just
>> remove/comment out
>> tests which use this flag.
> Yes, I did that. I have still problems running the tests and I didn't look
> in this deeper yet.
>> > Using JUnit the way you described is easy.
> Thanks for your good support here.
>> > I had MUCH more time to spend
>> > to get the source files. If the test works, I will refactor a little
> and
>> >would like to discuss it with you.
>>
>> I'm sorry for that.
> Well, that is my fault to spend much time to get the source files. I am
> still a newbie with this handling.
> Now I would like to discuss the interface to junit, for the tests. If you
> give me your complete source code, I could implement it and give it back
> to you.
The sources I have are the sources from the cvs plus the diffs I've
sent you. So you already have complete source code.
> ------------------------------------------------------------------------------
> How about a default implementation of the interface RETestCaseEnv? Maybe
> the naming could be better.
> public class RETestCaseEnvImpl implements RETestCaseEnv
> {
> /**
> * number in automated test
> */
> private int testCount = 0; // public getTestNo() is needed ???
I think it is a good idea to know the exact number of tests.
> public int getNextTestNo()
> {
> return ++this.testCount;
> }
> public void fail(StringBuffer log, String s)
> {
> System.out.print(log.toString());
Perhaps we should also count number of failed tests.
> }
> public RECompiler getCompiler()
> {
> return new RECompiler();
I think we should use REDebugCompiler.
> }
> public void say(String s)
> {
> System.out.println(s);
> }
> public boolean shouldShowSuccesses()
> {
> return false;
> }
> }
> Than for JUnit (in the first step) I only need:
> import junit.framework.TestCase;
> import org.apache.regexp.RETestCaseEnvImpl;
> public class JUnitEnv extends RETestCaseEnvImpl
> {
> public void fail(StringBuffer log, String string)
> {
> super.fail(log, string);
> TestCase.fail(string);
> }
> }
> With this solution a little refactor for RETest could be done. The Env
> could be held as instance varaiable and the testCount could be accessed
> through the Env.
I don't see any reason to do this. The point of our changes is to
make possible to test regexp library from JUnit for people who want
this. But I don't think that JUnit will be default testing framework
for this package. So, I think we should make minimum changes in
RETest.
> For running the TestCases with JUnit:
> public class RETestJUnit extends TestCase
> {
> public void test() throws FileNotFoundException, IOException
> {
> this.testFilename("docs/RETest.txt");
> }
> public void testFilename(String testInput)
> throws FileNotFoundException, IOException
> {
> BufferedReader br = new BufferedReader(new
> FileReader(testInput));
> try
> {
> // While input is available, parse lines
> while (br.ready())
> {
> Runnable testcase = RETest.getNextTestCase(new
> JUnitEnv(), br);
> if (testcase != null) {
> testcase.run();
> }
> }
> }
> finally
> {
> br.close();
> }
> }
> }
Looks fine ;)
> How about refactoring RETest in this way, that there is a public method
> which has a filename and an Env as Argument? Than reading this file could
> be done in RETest and this class could be more lighter.
I don't think that current implementation is too heavy. So there is
no reason to make such changes :)
With best regards, Oleg.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]