[ 
https://issues.apache.org/jira/browse/JCR-1419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Klimetschek updated JCR-1419:
---------------------------------------

    Attachment: jackrabbit-core.test-for-1400.patch

Fixed the problem, now runs under mvn test. The trick was to get the JAR file 
path via the classes itself:

/**
 * Returns the path to the JAR file that a certain class is located in. This 
only works
 * if the classloader loaded this class from a JAR file.
 */
public static final String getJarFileForClass(Class clazz) {
        // eg. /org/apache/derby/drda/NetworkServerControl.class
        String classResource = "/" + clazz.getCanonicalName().replace(".", "/") 
+ ".class";
        // eg. 
jar:file:/Users/alex/.m2/repository/org/apache/derby/derbynet/10.2.1.6/derbynet-10.2.1.6.jar!/org/apache/derby/drda/NetworkServerControl.class
        String fullResourceURL = clazz.getResource(classResource).toString();
        // eg. 
/Users/alex/.m2/repository/org/apache/derby/derbynet/10.2.1.6/derbynet-10.2.1.6.jar
        return fullResourceURL.replaceFirst("jar:file:([^!]+).*", "$1");
}

See o.a.j.core.persistence.ext.ExternalDerbyProcess

> Add test for database auto-reconnection (1.3 branch)
> ----------------------------------------------------
>
>                 Key: JCR-1419
>                 URL: https://issues.apache.org/jira/browse/JCR-1419
>             Project: Jackrabbit
>          Issue Type: Test
>          Components: jackrabbit-core, test
>            Reporter: Alexander Klimetschek
>             Fix For: 1.3.4
>
>         Attachments: jackrabbit-core.test-for-1400.patch
>
>
> Create a unit test for the database auto-reconnect feature in the 1.3 branch 
> (JCR-1400).
> A test for the original feature JCR-940 in the trunk/1.4 needs a separate 
> issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to