You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "Valerio Schiavoni (JIRA)" <ji...@apache.org> on 2014/07/10 10:57:04 UTC

[jira] [Created] (NUTCH-1814) TestMimeUtils#testBinaryFiles fails under Eclipse

Valerio Schiavoni created NUTCH-1814:
----------------------------------------

             Summary: TestMimeUtils#testBinaryFiles fails under Eclipse
                 Key: NUTCH-1814
                 URL: https://issues.apache.org/jira/browse/NUTCH-1814
             Project: Nutch
          Issue Type: Bug
         Environment: Eclipse Kepler Service Release 2
Build id: 20140224-0627
            Reporter: Valerio Schiavoni


Test TestMimeUtils#testBinaryFiles fails in finding the input test directory 'test-mime-util'. :

java.io.FileNotFoundException: ./test-mime-util/test.xlsx (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:146)
	at com.google.common.io.Files$1.getInput(Files.java:109)
	at com.google.common.io.Files$1.getInput(Files.java:106)
	at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:250)
	at com.google.common.io.Files.toByteArray(Files.java:204)
	at org.apache.nutch.util.TestMimeUtil.getMimeType(TestMimeUtil.java:82)
	at org.apache.nutch.util.TestMimeUtil.testBinaryFiles(TestMimeUtil.java:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

In my case, a simple fix is to change the initialisation of sampleDir from:

private File sampleDir = new File(System.getProperty("test.build.data", "."),
      "test-mime-util");

to

private File sampleDir = new File(System.getProperty("test.build.data", "."),
      "src/testresources/test-mime-util");



--
This message was sent by Atlassian JIRA
(v6.2#6252)