Run Integration Test with specific configuration

14 views
Skip to first unread message

Istvan Vig

unread,
Sep 28, 2022, 4:15:12 AM9/28/22
to DSpace Developers
Hello!
I would like to create an integration test for the version 7.4. And I would like to run this test in the way where the org.dspace.identifier.VersionedHandleIdentifierProviderWithCanonicalHandles is uncommented in the identifier-service.xml:
```XML
    <bean id="org.dspace.identifier.HandleIdentifierProvider" class="org.dspace.identifier.VersionedHandleIdentifierProviderWithCanonicalHandles" scope="singleton"> <property name="configurationService" ref="org.dspace.services.ConfigurationService"/> </bean>
```
However, I do not know how should I set up the test env. in order to use this versioning option. I copied the identifier-service.xml into the folders dspace-api/src/test/data/dspaceFolder/config/spring/api and dspace-server-webapp/src/test/data/dspaceFolder/config/spring/api with the uncommented lines. Then I ran the test and I then checked the file dspace-server-webapp/target/testing/dspace/config/spring/api/identifier-service.xml and found that the uncommented lines are there.

But when I run the integration test and print out the generated handles I see the default versioning functionality. So it seems that the test does not use the VersionedHandleIdentifierProviderWithCanonicalHandles class as I expected.

Could you please someone support me on how should I set up the integration test in order to use the canonical handles version? Is there any function in the test environment to modify this configuration at load time (like the configuration service)? Thanks!

Mark H. Wood

unread,
Sep 28, 2022, 7:48:11 AM9/28/22
to dspace...@googlegroups.com
On Wed, Sep 28, 2022 at 01:15:12AM -0700, Istvan Vig wrote:
> Hello!
> I would like to create an integration test for the version 7.4. And I would
> like to run this test in the way where the
> org.dspace.identifier.VersionedHandleIdentifierProviderWithCanonicalHandles
> is uncommented in the identifier-service.xml:
> ```XML
> <bean id="org.dspace.identifier.HandleIdentifierProvider"
> class="org.dspace.identifier.VersionedHandleIdentifierProviderWithCanonicalHandles"
> scope="singleton"> <property name="configurationService"
> ref="org.dspace.services.ConfigurationService"/> </bean>
> ```
> However, I do not know how should I set up the test env. in order to use
> this versioning option. I copied the identifier-service.xml into the
> folders *dspace-api/src/test/data/dspaceFolder/config/spring/api* and *dspace-server-webapp/src/test/data/dspaceFolder/config/spring/api
> *with the uncommented lines. Then I ran the test and I then checked the
> file
> *dspace-server-webapp/target/testing/dspace/config/spring/api/identifier-service.xml*
> and found that the uncommented lines are there.
>
> But when I run the integration test and print out the generated handles I
> see the default versioning functionality. So it seems that the test does
> not use the VersionedHandleIdentifierProviderWithCanonicalHandles class as
> I expected.

The test environment is packed up during the assembly phase, and
unpacked into the test directory tree during testing. I find that,
when I change anything in the test environment, I have to 'mvn clean
install' before running tests, so that the changed environment can be
retrieved from my local repository.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc
Reply all
Reply to author
Forward
0 new messages