jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Chen (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-262) In AbstractImportXmlTest, a bug in getUnusedUri() causes URI length to grow too quickly, causing test to fail when using ORM-PM
Date Wed, 26 Oct 2005 18:22:55 GMT
In AbstractImportXmlTest, a bug in getUnusedUri() causes URI length to grow too quickly, causing
test to fail when using ORM-PM
-------------------------------------------------------------------------------------------------------------------------------

         Key: JCR-262
         URL: http://issues.apache.org/jira/browse/JCR-262
     Project: Jackrabbit
        Type: Test
  Components: API  
    Versions: 1.0    
    Reporter: Joseph Chen
    Priority: Minor


Test fails when using ORM-PM because the URI exceeds the column size in the database.

Here is the current implementation:

    protected String getUnusedURI() throws RepositoryException {
        Set uris = new HashSet(Arrays.asList(nsp.getURIs()));
        String uri = TEST_URI;
        int i = 0;
        while (uris.contains(uri)) {
            uri += i++;
        }
        return uri;
    }

When running the test, the URI grows to become something like this:

When i=50,
"www.apache.org/jackrabbit/test/namespaceImportTest01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950"

Here is the proposed fix:

    protected String getUnusedURI() throws RepositoryException {
        Set uris = new HashSet(Arrays.asList(nsp.getURIs()));
        String uri = TEST_URI;
        int i = 0;
        while (uris.contains(uri)) {
            uri = TEST_URI + i++;
        }
        return uri;
    }

When i=50,
"www.apache.org/jackrabbit/test/namespaceImportTest50"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message