----------  Forwarded Message  ----------

Subject: Re: [Fwd: Re: apache bugzilla 39109 ... assignee very quite ...]
Date: Wednesday 30 August 2006 20:23
From: [EMAIL PROTECTED]
To: Rory Winston <[EMAIL PROTECTED]>

Yes you are right,

I made the test case pass here by adding the header as written eairler, and
 by changing the goodSamples processing as well.

What would it take to have a getGoodSamplesList, that should return a List
where each element is an array to test ?

It is not clear to me what the purpose of
 /* (non-Javadoc)
     * @see
org.apache.commons.net.ftp.parser.FTPParseTestFramework#testParseFieldsOnFile
() */
    public void testParseFieldsOnFile() throws Exception {
        FTPFile file = getParser().parseFTPEntry("Migrated
file1.I");
        assertNotNull("Could not parse entry.", file);
        assertTrue("Should have been a file.", file.isFile());
        assertEquals("file1.I", file.getName());

        FTPFile file2 = getParser().parseFTPEntry("PSMLC1 3390   2005/04/04 
 1 1  VB   27994 27998  PS  file2.I");
        assertNotNull("Could not parse entry.", file2);
        assertTrue("Should have been a file.", file2.isFile());
        assertEquals("file2.I", file2.getName());
    }

is this some sort of test that the parsed content is what is expected ?
Here is the same problem, that a complete list must be available, and the
preParse must be called.

With the new parser it is even possible to do the
    public void testParseFieldsOnDirectory() throws Exception
    {
    }

because the PO dataset organisations are now supported.

Give me a day or two, and I will make this work.

One thing about the latest Parser, it contains some less tested code, the JES
parser. It is something I would like to add as well, but I need some more
time to finish it off. When is your latest 'merge' window ?

Henrik

On Wednesday 30 August 2006 08:19, you wrote:
> Henrik
>
> I think I see the problem with the current setup.
>
> 1. Firstly, the parser needs to "initialize" itself via an FTP listing
> header line in preParse(), in order to set the isType flag and the
> parent class regex. As long as we have a way of explicitly setting this,
> we can get the class to work in a unit test.
> 2.Secondly, the current parser will never be able to parse a line such as:
>
> Migrated                                                file1.I
>
> Because as far as the parser is concerned, this is not a valid line, it is
> incomplete. The old parser used a much simpler regex that was able to
> handle lines like this, but the old parser simply extracted the last token
> (the filename) and used that. Your parser is able to extract more
> information - when it exists. If it is possible for a line such as the
> above to occur in practise (which I am assuming it is) then we need to be
> able to handle it as well.
>
> Also, the method parseFileList() expects to find a valid value for the
> "DSORG" header field. If it does not, it returns fakse from
> parseFileList(), faiing the parse. This will not work for lines where a
> "DSORG" value may not be present, so we would need a way of handling this
> as well.
>
> I think we are nearly there -if we can get these issues sorted, then we can
> look at getting this in to the next release.
>
> Thanks
> Rory

-------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to