[ 
https://issues.apache.org/jira/browse/NUTCH-1645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13882438#comment-13882438
 ] 

Sebastian Nagel commented on NUTCH-1645:
----------------------------------------

Ok, the core functionality of AdaptiveFetchSchedule is tested: when a page is 
re-fetched (1) increase the fetch interval if a page is found not modified (2) 
decrease it if the page has changed. To catch NUTCH-1564 by simulating many 
iterations of re-fetches would be nice (but maybe this could be also included 
into NUTCH-1502). The patch looks indeed much cleaner. Thanks! Some trivial 
improvements which could be made:
* comments/javadoc which explain what is tested are always useful
* instead of {{changed = 1}} a {{changed = FetchSchedule.STATUS_MODIFIED}} etc. 
would be more explicit and also explains which case is tested next
* both assertNotNull checks are redundant:
** never fails because calling {{setConf(conf)}} does the check implicitly 
(would throw a NPE):
{code}
    fs.setConf(conf);
    assertNotNull(fs);
{code}
** {{prepareWebpage()}} belongs to the test unit (needs not to be tested and a 
null-WebPage would cause the test to fail anyway):
{code}
    WebPage p = prepareWebpage();
    assertNotNull(p);
{code}
* {{testValues(...)}} resets the fetch interval of the WebPage: a method called 
"testValues" is not really expected to change the state of any of the passed 
values


> Junit Test Case for Adaptive Fetch Schedule class
> -------------------------------------------------
>
>                 Key: NUTCH-1645
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1645
>             Project: Nutch
>          Issue Type: Test
>    Affects Versions: 2.2.1
>            Reporter: Talat UYARER
>            Priority: Minor
>             Fix For: 2.3
>
>         Attachments: NUTCH-1645-v2.patch, NUTCH-1645-v3.patch, 
> NUTCH-1645-v4.patch, NUTCH-1645.patch
>
>
> Currently there is not Test Case for Adaptive Fetch Schedule. Junit test 
> Writes for its. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to