Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2118

dspace test error when changing assetstore path in dspace.cfg

    XMLWordPrintable

    Details

    • Attachments:
      0
    • Comments:
      3
    • Documentation Status:
      Not Required

      Description

      It appears that if you change the assetstore.dir setting in dspace.cfg to anything other than the default, a number of tests will fail. Steps to reproduce: do a clean clone of dspace/dspace:master, and then change the assetstore.dir path (I used "/tmp"). Then, run mvn test -Dmaven.test.skip=false. In the excerpt of my test run below, I start off with what I think is a pretty good clue. My annotations are marked with ####.

            1. First, the clue: I think "fileweaver" is combining dspace.cfg and the testing dspace.cfg. We should see if we can figure out how to tell fileweaver to leave the assetstore path alone, otherwise we're not testing the correct thing.
            1. Keep reading you'll see the test errors towards the end. The tests are looking in the wrong place, and thus throwing FileNotFoundException.

      [INFO] — fileweaver:1.0:weave (edit-dspace-cfg) @ dspace-api —
      [INFO] Wove /home/vagrant/dspace-src/dspace-api/target/testing/dspace.cfg.woven from 2 parts.
      [INFO] 1 files woven.
      [INFO]
      [INFO] — maven-antrun-plugin:1.7:run (default) @ dspace-api —
      [INFO] Executing tasks

      main:
      [copy] Copying 1 file to /home/vagrant/dspace-src/dspace-api/target/testing/dspace/config
      [INFO] Executed tasks
      [INFO]
      [INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ dspace-api —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — maven-surefire-plugin:2.17:test (default-test) @ dspace-api —
      [INFO] Surefire report directory: /home/vagrant/dspace-src/dspace-api/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running org.dspace.authenticate.IPMatcherTest
      Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.747 sec - in org.dspace.authenticate.IPMatcherTest
      Running org.dspace.eperson.EPersonTest
      Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.51 sec - in org.dspace.eperson.EPersonTest
      Running org.dspace.eperson.PasswordHashTest
      Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.505 sec - in org.dspace.eperson.PasswordHashTest
      Running org.dspace.statistics.util.TestLocationUtils
      Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.028 sec - in org.dspace.statistics.util.TestLocationUtils
      Running org.dspace.statistics.util.SpiderDetectorTest
      Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.784 sec - in org.dspace.statistics.util.SpiderDetectorTest
      Running org.dspace.content.MetadataValueTest
      Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.883 sec - in org.dspace.content.MetadataValueTest
      Running org.dspace.content.authority.DSpaceControlledVocabularyTest
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.121 sec - in org.dspace.content.authority.DSpaceControlledVocabularyTest
      Running org.dspace.content.BitstreamTest
      Tests run: 38, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.528 sec <<< FAILURE! - in org.dspace.content.BitstreamTest
      testRegister(org.dspace.content.BitstreamTest) Time elapsed: 0.023 sec <<< ERROR!

            1. Here it is, the test is looking in the wrong place
              java.io.FileNotFoundException: /tmp/ConstitutionofIreland.pdf (No such file or directory)
              at java.io.FileInputStream.open(Native Method)
              at java.io.FileInputStream.<init>(FileInputStream.java:146)
              at edu.sdsc.grid.io.local.LocalFileInputStream.open(LocalFileInputStream.java:171)
              at edu.sdsc.grid.io.GeneralFileInputStream.<init>(GeneralFileInputStream.java:145)
              at edu.sdsc.grid.io.local.LocalFileInputStream.<init>(LocalFileInputStream.java:139)
              at edu.sdsc.grid.io.FileFactory.newFileInputStream(FileFactory.java:630)
              at org.dspace.storage.bitstore.BitstreamStorageManager.register(BitstreamStorageManager.java:413)
              at org.dspace.content.Bitstream.register(Bitstream.java:238)
              at org.dspace.content.BitstreamTest.testRegister(BitstreamTest.java:146)

      Running org.dspace.content.ItemTest
      Tests run: 84, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.657 sec - in org.dspace.content.ItemTest
      Running org.dspace.content.BundleTest
      Tests run: 34, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.378 sec <<< FAILURE! - in org.dspace.content.BundleTest
      testRegisterBitstreamAuth(org.dspace.content.BundleTest) Time elapsed: 0.066 sec <<< ERROR!

            1. and again, looking in the wrong place

      java.io.FileNotFoundException: /tmp/ConstitutionofIreland.pdf (No such file or directory)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.<init>(FileInputStream.java:146)
      at edu.sdsc.grid.io.local.LocalFileInputStream.open(LocalFileInputStream.java:171)
      at edu.sdsc.grid.io.GeneralFileInputStream.<init>(GeneralFileInputStream.java:145)
      at edu.sdsc.grid.io.local.LocalFileInputStream.<init>(LocalFileInputStream.java:139)
      at edu.sdsc.grid.io.FileFactory.newFileInputStream(FileFactory.java:630)
      at org.dspace.storage.bitstore.BitstreamStorageManager.register(BitstreamStorageManager.java:413)
      at org.dspace.content.Bitstream.register(Bitstream.java:238)
      at org.dspace.content.Bundle.registerBitstream(Bundle.java:408)
      at org.dspace.content.BundleTest.testRegisterBitstreamAuth(BundleTest.java:341)

        Attachments

          Activity

            People

            Assignee:
            hardyoyo Hardy Pottinger
            Reporter:
            hardyoyo Hardy Pottinger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: