You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (Created) (JIRA)" <ji...@apache.org> on 2012/02/17 14:50:00 UTC

[jira] [Created] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Replace illegal characters from test name when creating the failure folder
--------------------------------------------------------------------------

                 Key: DERBY-5620
                 URL: https://issues.apache.org/jira/browse/DERBY-5620
             Project: Derby
          Issue Type: Improvement
          Components: Test
    Affects Versions: 10.9.0.0
            Reporter: Kristian Waagan
            Assignee: Kristian Waagan
            Priority: Minor


Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Kristian Waagan (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan closed DERBY-5620.
----------------------------------


Closing.
                
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.9.0.0
>
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff, derby-5620-2a-alphanum.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Kristian Waagan (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-5620:
-----------------------------------

    Attachment: derby-5620-2a-alphanum.diff

Thanks, Dag.
Something along the lines of patch 2a?

BTW, this code must be CDC/J2ME compatible.
                
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff, derby-5620-2a-alphanum.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210397#comment-13210397 ] 

Dag H. Wanvik commented on DERBY-5620:
--------------------------------------

Thanks for fixing this! Why not just replace all non-identifier characters with underscore or dash? 
                
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Kristian Waagan (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan resolved DERBY-5620.
------------------------------------

          Resolution: Fixed
       Fix Version/s: 10.9.0.0
    Issue & fix info:   (was: Patch Available)

Thanks, Dag :)

Committed patch 2a to trunk with revision 1291657.
                
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.9.0.0
>
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff, derby-5620-2a-alphanum.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Kristian Waagan (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210283#comment-13210283 ] 

Kristian Waagan commented on DERBY-5620:
----------------------------------------

It could be argued that the way to solve this is to do nothing, let runBare fail when/if the test fails, and then change the test name. The reason why I consider another solutions is that using "special characters" in the test name may be nice when dynamically generating test cases.
As an example, I was using "client 10.1.3.1 <> server 10.8.2.2" as the name of the test case.
                
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13212278#comment-13212278 ] 

Dag H. Wanvik commented on DERBY-5620:
--------------------------------------

Looks good to me. +1
                
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff, derby-5620-2a-alphanum.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Kristian Waagan (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-5620:
-----------------------------------

    Issue & fix info: Patch Available
    
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5620) Replace illegal characters from test name when creating the failure folder

Posted by "Kristian Waagan (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-5620:
-----------------------------------

    Attachment: derby-5620-1a-replace_illegal_fs_chars.diff

Attaching patch 1a, which replaces a set of characters from the string returned by TestCase.getName().

I suspect the list isn't exhaustive, but it may already include characters that are allowed in some file system. The point here is just to make sure the directory creation works. In my case it failed due to putting '<>' in a test name (compatibility test).
More characters that should go in?
Is there perhaps a method in the Java-API that will remove illegal chars?

Patch ready for review.
                
> Replace illegal characters from test name when creating the failure folder
> --------------------------------------------------------------------------
>
>                 Key: DERBY-5620
>                 URL: https://issues.apache.org/jira/browse/DERBY-5620
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5620-1a-replace_illegal_fs_chars.diff
>
>
> Since the name of a JUnit test case can be any string, it should be sanitized and bad characters should be replaced with a valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira