Several Unit test fixes. Add a Mock Indexer for Solr. Add a language for primary test Eperson. Do better context cleanup. Improve fail messages with actual errors.

This commit is contained in:
Tim Donohue
2013-10-23 13:58:10 -05:00
parent d76ebbdb0b
commit 82a413511c
10 changed files with 68 additions and 21 deletions

View File

@@ -58,12 +58,12 @@ public class BitstreamTest extends AbstractDSpaceObjectTest
}
catch (IOException ex) {
log.error("IO Error in init", ex);
fail("SQL Error in init");
fail("SQL Error in init: " + ex.getMessage());
}
catch (SQLException ex)
{
log.error("SQL Error in init", ex);
fail("SQL Error in init");
fail("SQL Error in init: " + ex.getMessage());
}
}
@@ -128,6 +128,8 @@ public class BitstreamTest extends AbstractDSpaceObjectTest
{
File f = new File(testProps.get("test.bitstream").toString());
Bitstream created = Bitstream.create(context, new FileInputStream(f));
context.commit();
//the item created by default has no name nor type set
assertThat("testCreate 0", created.getFormat().getMIMEType(), equalTo("application/octet-stream"));
assertThat("testCreate 1", created.getName(), nullValue());