You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by sorel <jo...@geomatys.fr> on 2009/09/18 10:00:29 UTC

JCR test suite, how to use it ?

Hello,

I have made a simple implementation of a JCR repository using JackRabbit 
JCR commun module.
Now I would like to test if my implementation is correct with the 
JackRabbit JCR test suite, however
I haven't found how to configure the tests to use my repository.

A quick explication would be really helpfull. :)

johann sorel


Claus Köll (JIRA) a écrit :
>      [ https://issues.apache.org/jira/browse/JCR-769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Claus Köll updated JCR-769:
> ---------------------------
>
>     Status: Patch Available  (was: Open)
>
>   
>> Unable to login with two different Credentials to same workspace in one Transaction
>> -----------------------------------------------------------------------------------
>>
>>                 Key: JCR-769
>>                 URL: https://issues.apache.org/jira/browse/JCR-769
>>             Project: Jackrabbit Content Repository
>>          Issue Type: Bug
>>          Components: jackrabbit-core
>>    Affects Versions: 1.2.1
>>         Environment: Websphere 5.1.1 J2C Adapter
>>            Reporter: Claus Köll
>>            Assignee: Claus Köll
>>         Attachments: JCR769.patch, stacktrace.txt
>>
>>
>> I'm using the Jackrabbit 1.2.1 JCA adapter and trying to access in a SessionBean-Method with Container Transaction a Workspace with 2 different Credentials. 
>> The Method takes about 400ms to finish but no commit on TransactionContextr occurs (Debugging ..) only the prepare was called 2 times .
>> The Container hangs on the PostInvoke Method about 5 seconds and then i get a "javax.transaction.xa.XAException" 
>> with the Warn Message: Transaction rolled back because timeout expired
>> The code ..
>> Context ctx = new InitialContext(); 
>> Repository repository = (Repository) ctx.lookup("java:comp/env/jackrabbit"); 
>> Credentials credentials = new SimpleCredentials("user1", "password1".toCharArray()); 
>> Credentials credentials2 = new SimpleCredentials("user2", "password2".toCharArray()); 
>> Session session1 = repository.login(credentials, "default"); 
>> Session session2 = repository.login(credentials2, "default"); 
>> Session1 adds a node to the workspace .. and with the session2 i do nothing except the login !
>> If i make no second login the Method works fine.
>>     
>
>   


Re: JCR test suite, how to use it ?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Fri, Sep 18, 2009 at 3:08 PM, sorel <jo...@geomatys.fr> wrote:
> thanks for any details, samples or link about this.

See the JCR-RMI integration tests [1] for a simple test setup. You may
also want to check out how the test suite is run in jackrabbit-core or
jackrabbit-spi2jcr, but those setups are more complex than the JCR-RMI
one.

[1] https://svn.apache.org/repos/asf/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi-it/

BR,

Jukka Zitting

Re: JCR test suite, how to use it ?

Posted by sorel <jo...@geomatys.fr>.
Hi again,

I found out a piece of Javadoc explaining a part of what I'm trying to 
do in the RepositoryStub class :
/**
     * Creates and/or returns the configured <code>RepositryStub</code>
     * implementation.
     * <p>
     * The property file is located in the following sequence:
     * <ol>
     * <li>If the system property 
<code>-Djavax.jcr.tck.properties</code> is
     * set, then the accroding file is used as configuration.</li>
     * <li>If the system property 
<code>-Djavax.jcr.tck.properties</code> is
     * not set, then the TCK tries to load the file 
<code>repositoryStubImpl.properties</code>
     * as a resource from the ClassLoader of this 
<code>RepositryStub</code> class.</li>
     * </ol>
     * The properties are then overlayed with the the key / values from
     * <code>configuration</code> map.
     *
     * @param configuration a <code>Map</code> of additional 
configuration entries.
     * @return a <code>RepositoryStub</code> implementation.
     * @throws RepositoryStubException
     */

Problem is I have no idea what must be inside this file nor how to start 
testing.
For the moment I have an implementation of RepositryStub and a test case 
extending JCRtestcase but that's all.

thanks for any details, samples or link about this.




sorel a écrit :
> Hello,
>
> I have made a simple implementation of a JCR repository using 
> JackRabbit JCR commun module.
> Now I would like to test if my implementation is correct with the 
> JackRabbit JCR test suite, however
> I haven't found how to configure the tests to use my repository.
>
> A quick explication would be really helpfull. :)
>
> johann sorel
>