[
https://issues.apache.org/jira/browse/NUTCH-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13707771#comment-13707771
]
Sebastian Nagel commented on NUTCH-1610:
----------------------------------------
Way 2 can not be used to run plugin unit tests. But way 1 works (see below). As
a precondition ant must have built all main classes because plugins use them.
We should add this important piece of information in the wiki (cf. [nutch
junit|http://wiki.apache.org/nutch/bin/nutch%20junit] which requires "ant
compile-core-test" to be executed before). Executing the "normal" build also
will check whether ant runs well. The error message points to missing ivy lib
(cf.
[1|http://stackoverflow.com/questions/12677816/ant-target-failing-antlib-or-ivy-issue]).
{code}
% pwd
.../nutch/branches/2.x
% ant
...
% cd src/plugin/index-basic
% ant test
...
test:
[echo] Testing plugin: index-basic
[junit] Running org.apache.nutch.indexer.basic.TestBasicIndexingFilter
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 1.185 sec
BUILD SUCCESSFUL
Total time: 7 seconds
{code}
> Can't run individual unit tests for plugins in nutch 2.x
> --------------------------------------------------------
>
> Key: NUTCH-1610
> URL: https://issues.apache.org/jira/browse/NUTCH-1610
> Project: Nutch
> Issue Type: Bug
> Components: test
> Affects Versions: 2.2.1
> Reporter: Brian
> Priority: Minor
>
> I can run "ant test" in the apache-nutch-2.2.1 directory but it runs all unit
> tests, and I just want to test a single plugin.
> Previous ways posted online for running a single unit test don't work
> including:
> 1) "ant test" in the plugin directory
> I get:
> "BUILD FAILED ... Problem: failed to create task or type
> antlib:org.apache.ivy.ant:settings"
> 2) using bin/nutch with the junit argument, e.g.:
> bin/nutch junit org.apache.nutch.indexer.basic.TestBasicIndexingFilter
> In runtime/local it says:
> Class not found "org.apache.nutch.indexer.basic.TestBasicIndexingFilter"
> In src it says:
> Error: Could not find or load main class junit.textui.TestRunner
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira