cancel
Showing results for 
Search instead for 
Did you mean: 

running unit tests

smitchmor
Champ in-the-making
Champ in-the-making
I have downloaded & built alfresco 1.0.0 from source (on Windows XP).
In my investigations I have run into a few issues regarding web services,
which have led to more general questions regarding junit tests.

My first thought, was to attempt to run the WebService unit tests via
eclipse, but was unsure how to configure WebServiceBootstrapSystemTest
so the tests could be run properly.

Finally, I attempt a run 'ant test' for the entire source tree but found
a failed test at ISO8601DateFormatTest.java. After commenting this out I
get success until OfficeMetadataExtracterTest.java (see below for errors)

Has anyone else experiences such issues, or have good advices regarding
running the unit test to completion. Any input would be of assistance.

Thanks.

ISO8601DateFormatTest.java

    <failure message="expected:&lt;…7:01:03.456+01…&gt; but was:&lt;…2:01:
03.456-04…&gt;" type="junit.framework.ComparisonFailure">junit.framework.Compa
risonFailure: expected:&lt;…7:01:03.456+01…&gt; but was:&lt;…2:01:03.456-0
4…&gt;
        at org.alfresco.util.ISO8601DateFormatTest.testConversion(ISO8601DateFor
matTest.java:32)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
</failure>

    <error message="No quick.doc file found for test" type="java.io.FileNotFound
Exception">java.io.FileNotFoundException: No quick.doc file found for test
        at org.alfresco.repo.content.metadata.AbstractMetadataExtracterTest.extr
actFromExtension(AbstractMetadataExtracterTest.java:112)
        at org.alfresco.repo.content.metadata.OfficeMetadataExtracterTest.testWo
rdExtraction(OfficeMetadataExtracterTest.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
</error>
1 REPLY 1

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

In order to run the web service unit tests, as you have probably gathered, you first need to run the WebServiceBootstrapSystemTest.  This creates a node store and a couple of folders and documents that are then used by the web service tests.  This prevents your main SpacesStore being polluted with test results.  It doesn't require any additional configuration.

Once run, you should start the repository in the usual manner (as if you where going to access the UI).  With the repository still running you can now execute the web service unit tests by running the WebServiceSuiteSystemTest test suite.

Also you will find some further examples in the samples package, that also the require the repository to be running when they are executed.

Hope this helps,
Roy