mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-19 16:03:07 +00:00
DSpace refactored service api
This commit is contained in:
@@ -11,6 +11,9 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.BitstreamService;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.* ;
|
||||
import org.apache.log4j.Logger;
|
||||
@@ -27,6 +30,8 @@ public class ThumbnailTest extends AbstractUnitTest
|
||||
/** log4j category */
|
||||
private static final Logger log = Logger.getLogger(ThumbnailTest.class);
|
||||
|
||||
protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
|
||||
|
||||
/**
|
||||
* Bitstream instance for the tests, thumbnail copy
|
||||
*/
|
||||
@@ -58,11 +63,9 @@ public class ThumbnailTest extends AbstractUnitTest
|
||||
{
|
||||
//we have to create a new bitstream in the database
|
||||
File f = new File(testProps.get("test.bitstream").toString());
|
||||
thumb = Bitstream.create(context, new FileInputStream(f));
|
||||
context.commit();
|
||||
orig = Bitstream.create(context, new FileInputStream(f));
|
||||
context.commit();
|
||||
t = new Thumbnail(thumb, orig);
|
||||
thumb = bitstreamService.create(context, new FileInputStream(f));
|
||||
orig = bitstreamService.create(context, new FileInputStream(f));
|
||||
t = new Thumbnail(thumb, orig);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
log.error("IO Error in init", ex);
|
||||
|
Reference in New Issue
Block a user