Hi Mark,

     Ok, to test other modules I have to extend AbstractUnitTest, in the
documentation (https://wiki.duraspace.org/display/DSPACE/DSpace+Testing),
they talk about dspace-test module, but this module is not available in
Dspace 6. What should be the best approach to use the test classes in
dspace-api as a dependency in other module? Copy, maven dependency?


Best
Luiz

On Wed, Jun 8, 2016 at 11:10 AM, Luiz dos Santos <[email protected]> wrote:

> Hi Mark,
>
>     It seems nice, I would like at least start to write some test to
> REST-API, so I should use the approach in dspace-api, right?
>
> Best
> Luiz
>
> On Wed, Jun 8, 2016 at 9:31 AM, Mark Wood <[email protected]> wrote:
>
>> On Tue, Jun 07, 2016 at 12:09:41PM -0500, Tim Donohue wrote:
>> > As far as I'm aware, that's just how a Maven test runs. It automatically
>> > will try to run tests in all modules, but it only will execute ones that
>> > it finds.  So, most modules will report that no tests were found.  I'm
>> > unaware of any way to change that behavior in Maven (if you know of one,
>> > let us know).
>>
>> That's right: phases 'test' and 'integration-test' (and several other
>> test-related phases) are part of the standard Maven lifecycle and will
>> be run unless suppressed somehow.  I think that we could selectively
>> disable these phases for projects that currently have no tests, but I
>> would rather that we started writing good tests for those projects.
>>
>> Some good work was started in dspace-api, which can be extended to
>> other projects without a lot of effort.  It just hasn't been done.
>> What we have now is frameworks with some quite useful tests included,
>> and a collection of newer tests that grows as individual developers
>> add to it for their own use.  I'm less familiar with the test setup in
>> dspace-services, which was developed separately.
>>
>> We could use some more mocking to make some of our unit tests more
>> lightweight (and a lot faster).
>>
>> > Also, be aware that we have Unit / Integration Tests disabled by default
>> > in our Maven POM settings.  So, to actually run tests, you need to apply
>> > a flag to enable them:
>> >
>> >   * "-Dmaven.test.skip=false" will enable Unit Tests to run (via Maven
>> >     Surefire Plugin)
>> >   * "-DskipITs=false" will enable Integration Tests to run (via Maven
>> >     Failsafe Plugin)
>>
>> Just to make things *really* confusing, I have the following in my
>> ~/.m2/settings.xml:
>>
>>  <profiles>
>>    <profile>
>>       <id>defaults</id>
>>       <properties>
>>          <maven.test.skip>false</maven.test.skip>
>>          <skipITs>false</skipITs>
>>       </properties>
>>    </profile>
>>  </profiles>
>>
>>  <activeProfiles>
>>     <activeProfile>defaults</activeProfile>
>>  </activeProfiles>
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/dspace-tech.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to