Skip to content

Commit

Permalink
Merge branch 'feature-jcloud-store-7.4' into feature-jcloud-store-9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Buckingham committed Sep 5, 2024
2 parents bf4718d + e9c532b commit 8dc6567
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ protected BitstreamStorageServiceImpl() {

}

@Override
public void setIncomingExternal(int incoming) {
this.incoming = incoming;
}

@Override
public void afterPropertiesSet() throws Exception {
for (Map.Entry<Integer, BitStoreService> storeEntry : stores.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public InputStream retrieve(Context context, Bitstream bitstream)
/**
* Clone the given bitstream to a new bitstream with a new ID.
* Metadata of the given bitstream are also copied to the new bitstream.
*
*
* @param context
* DSpace context object
* @param bitstream
Expand Down Expand Up @@ -191,4 +191,11 @@ public void migrate(Context context, Integer assetstoreSource, Integer assetstor
@Nullable
Long getLastModified(Bitstream bitstream) throws IOException;


/**
* Sets the number for the incoming store
* @param incoming
*/
public void setIncomingExternal(int incoming);

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.dspace.content.service.BitstreamFormatService;
import org.dspace.services.ConfigurationService;
import org.dspace.services.factory.DSpaceServicesFactory;
import org.dspace.storage.bitstore.factory.StorageServiceFactory;
import org.dspace.storage.bitstore.service.BitstreamStorageService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -25,11 +27,14 @@
public class BitstreamJCloudBitstoreTest extends BitstreamTest {

protected BitstreamFormatService bitstreamFormatService = ContentServiceFactory.getInstance()
.getBitstreamFormatService();
.getBitstreamFormatService();

private final ConfigurationService configurationService
= DSpaceServicesFactory.getInstance().getConfigurationService();

protected BitstreamStorageService bitstreamService = StorageServiceFactory.getInstance()
.getBitstreamStorageService();


/**
* This method will be run before every test as per @Before. It will
Expand All @@ -41,7 +46,7 @@ public class BitstreamJCloudBitstoreTest extends BitstreamTest {
@Before
@Override
public void init() {
configurationService.setProperty("assetstore.index.primary", "2");
bitstreamService.setIncomingExternal(2);
super.init();
}

Expand All @@ -65,7 +70,7 @@ public void testGetStoreNumber() {
@After
@Override
public void destroy() {
configurationService.setProperty("assetstore.index.primary", "0");
bitstreamService.setIncomingExternal(0);
super.destroy();
}

Expand Down

0 comments on commit 8dc6567

Please sign in to comment.