How to add unit tests to classes in dspace/modules/additions?

398 views
Skip to first unread message

Martin Walk

unread,
Nov 8, 2016, 8:42:07 AM11/8/16
to DSpace Technical Support
Hi,

I write curation tasks (for DSpace 6) that I add to dspace/modules/additions.
I want to add unit tests, of course. But I have problems to find the right place for the unit tests, or the right configuration for them to be run.

Here is what I tried and what error messages I get in IntelliJ. I also posted the question on Stackoverflow:

I want to set up unit tests for a curation task that i put in dspace/modules/additions. I use intelliJ IDEA and try to configure sources and tests folders. I wanted to use the following folder structure but could not get the configuration in intelliJ right.

 [] DSpace Source Folder
   [] dspace
     [] modules
        [] additions    
           [] src
              [] main
                 [] java
                    […]
              [] test
                 [] java
                    […]
        [] jspui
        [] oai
        [] rdf
        […] 

Is this structure reasonable?
How can I configure the folders in intelliJ's Project Structure so that it recognises my test folder?

If I try to mark it as "Test Source Folder" in IntelliJ's Project Structure I get the following error message:

Source root "/.../DSpace6/dspace/modules/additions/src/test" cannot be defined in module "dspace" because it belongs to content of nested module "additions"

Luiz dos Santos

unread,
Nov 8, 2016, 9:01:52 AM11/8/16
to Martin Walk, DSpace Technical Support
Hi Martin, 

   After you marked the java folder as test folder, as you said in the stackoverflow, did you try to refresh the project in IntelliJ?

Best 
Luiz
--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech+unsubscribe@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


--
Luiz Claudio Santos
http://luizclaudiosantos.me/

Martin Walk

unread,
Nov 8, 2016, 9:07:11 AM11/8/16
to DSpace Technical Support, marti...@ub.hu-berlin.de
Hi Luiz,

I cannot complete the operation of marking the java folder as test folder because the error message aborts the task.
Also I am not strictly tied to IntelliJ. I am also interested in a solution to configure everything outside of IntelliJ in a normal text editor. I guess it would be mainly a Maven problem then?

Best, Martin.
Reply all
Reply to author
Forward
0 new messages