Merge branch 'feature-jcloud-store-7.4' into feature-jcloud-store-7.6

This commit is contained in:
Nathan Buckingham
2024-09-05 16:38:27 -04:00
3 changed files with 21 additions and 4 deletions

View File

@@ -90,6 +90,11 @@ public class BitstreamStorageServiceImpl implements BitstreamStorageService, Ini
}
@Override
public void setIncomingExternal(int incoming) {
this.incoming = incoming;
}
@Override
public void afterPropertiesSet() throws Exception {
for (Map.Entry<Integer, BitStoreService> storeEntry : stores.entrySet()) {

View File

@@ -144,7 +144,7 @@ public interface BitstreamStorageService {
/**
* 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
@@ -191,4 +191,11 @@ public interface BitstreamStorageService {
@Nullable
Long getLastModified(Bitstream bitstream) throws IOException;
/**
* Sets the number for the incoming store
* @param incoming
*/
public void setIncomingExternal(int incoming);
}

View File

@@ -13,6 +13,8 @@ import org.dspace.content.factory.ContentServiceFactory;
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;
@@ -25,11 +27,14 @@ import org.junit.Test;
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
@@ -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();
}
@@ -65,7 +70,7 @@ public class BitstreamJCloudBitstoreTest extends BitstreamTest {
@After
@Override
public void destroy() {
configurationService.setProperty("assetstore.index.primary", "0");
bitstreamService.setIncomingExternal(0);
super.destroy();
}