Methods Summary |
---|
protected java.lang.String[] | getBadListing()
return (getBadListings()[0]);
|
protected abstract java.lang.String[][] | getBadListings()Method getBadListing.
Implementors must provide multiple listing that contains failures and
must force the composite parser to switch the FtpEntryParser
|
protected java.lang.String[] | getGoodListing()
return (getGoodListings()[0]);
|
protected abstract java.lang.String[][] | getGoodListings()Method getGoodListing.
Implementors must provide multiple listing that passes and
must force the composite parser to switch the FtpEntryParser
|
public void | testBadListing()
String badsamples[][] = getBadListings();
for (int i = 0; i < badsamples.length; i++)
{
FTPFileEntryParser parser = getParser();
for (int j = 0; j < badsamples[i].length; j++)
{
String test = badsamples[i][j];
FTPFile f = parser.parseFTPEntry(test);
assertNull("Should have Failed to parse " + test,
f);
doAdditionalBadTests(test, f);
}
}
|
public void | testConsistentListing()
String goodsamples[][] = getGoodListings();
for (int i = 0; i < goodsamples.length; i++)
{
FTPFileEntryParser parser = getParser();
for (int j = 0; j < goodsamples[i].length; j++)
{
String test = goodsamples[i][j];
FTPFile f = parser.parseFTPEntry(test);
assertNotNull("Failed to parse " + test,
f);
doAdditionalGoodTests(test, f);
}
}
|
public void | testInconsistentListing()
String goodsamples[][] = getGoodListings();
FTPFileEntryParser parser = getParser();
for (int i = 0; i < goodsamples.length; i++)
{
String test = goodsamples[i][0];
FTPFile f = parser.parseFTPEntry(test);
switch (i)
{
case 0:
assertNotNull("Failed to parse " + test, f);
break;
case 1:
assertNull("Should have failed to parse " + test, f);
break;
}
}
|