You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Kevin Lin (Created) (JIRA)" <ji...@apache.org> on 2011/12/05 10:53:40 UTC
[jira] [Created] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
------------------------------------------------------------------------------------------------
Key: TAP5-1770
URL: https://issues.apache.org/jira/browse/TAP5-1770
Project: Tapestry 5
Issue Type: Bug
Components: tapestry-test
Affects Versions: 5.3
Reporter: Kevin Lin
I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at java.lang.String.substring(String.java:1904)
at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
...
At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
--------------------
private void setupRequestFromURI(String URI)
{
String linkPath = stripContextFromPath(URI);
int comma = linkPath.indexOf('?');
String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
request.clear().setPath(path);
if (comma > 0)
decodeParametersIntoRequest(path.substring(comma + 1));
}
--------------------
The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
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] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Steve Eynon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447435#comment-13447435 ]
Steve Eynon commented on TAP5-1770:
-----------------------------------
It'd be nice if it was fixed (esp as it's only a 4 character variable name change!) as currently it's a patch I have to apply to every project.
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Taha Hafeez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taha Hafeez resolved TAP5-1770.
-------------------------------
Resolution: Fixed
Fix Version/s: 5.3
5.4
Thanks Steve Eynon
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
> Assignee: Taha Hafeez
> Fix For: 5.4, 5.3
>
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Serge Eby (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447406#comment-13447406 ]
Serge Eby commented on TAP5-1770:
---------------------------------
Can someone look into this trivial fix?
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Taha Hafeez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taha Hafeez reassigned TAP5-1770:
---------------------------------
Assignee: Taha Hafeez
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
> Assignee: Taha Hafeez
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Serge Eby (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447406#comment-13447406 ]
Serge Eby commented on TAP5-1770:
---------------------------------
Can someone look into this trivial fix?
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Steve Eynon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447435#comment-13447435 ]
Steve Eynon commented on TAP5-1770:
-----------------------------------
It'd be nice if it was fixed (esp as it's only a 4 character variable name change!) as currently it's a patch I have to apply to every project.
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Taha Hafeez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taha Hafeez reassigned TAP5-1770:
---------------------------------
Assignee: Taha Hafeez
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
> Assignee: Taha Hafeez
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Taha Hafeez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taha Hafeez resolved TAP5-1770.
-------------------------------
Resolution: Fixed
Fix Version/s: 5.3
5.4
Thanks Steve Eynon
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
> Assignee: Taha Hafeez
> Fix For: 5.4, 5.3
>
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447459#comment-13447459 ]
Hudson commented on TAP5-1770:
------------------------------
Integrated in tapestry-trunk-freestyle #932 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/932/])
TAP5-1770: Fixed 'String index out of range' in PageTester while testing pages with request/events (Revision 4a0780f6e16c71d90042c447875e77060fe62775)
Result = FAILURE
tawus :
Files :
* atlassian-ide-plugin.xml
* tapestry-core/src/test/groovy/org/apache/tapestry5/test/PageTesterTest.java
* tapestry-core/src/test/conf/testng.xml
* tapestry-core/src/main/java/org/apache/tapestry5/test/PageTester.java
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
> Assignee: Taha Hafeez
> Fix For: 5.3, 5.4
>
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1770) PageTester causes
StringIndexOutOfBoundsException for any page request path with query
parameter
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447459#comment-13447459 ]
Hudson commented on TAP5-1770:
------------------------------
Integrated in tapestry-trunk-freestyle #932 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/932/])
TAP5-1770: Fixed 'String index out of range' in PageTester while testing pages with request/events (Revision 4a0780f6e16c71d90042c447875e77060fe62775)
Result = FAILURE
tawus :
Files :
* atlassian-ide-plugin.xml
* tapestry-core/src/test/groovy/org/apache/tapestry5/test/PageTesterTest.java
* tapestry-core/src/test/conf/testng.xml
* tapestry-core/src/main/java/org/apache/tapestry5/test/PageTester.java
> PageTester causes StringIndexOutOfBoundsException for any page request path with query parameter
> ------------------------------------------------------------------------------------------------
>
> Key: TAP5-1770
> URL: https://issues.apache.org/jira/browse/TAP5-1770
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-test
> Affects Versions: 5.3
> Reporter: Kevin Lin
> Assignee: Taha Hafeez
> Fix For: 5.3, 5.4
>
>
> I was running a web test using the latest source code from testify on a T5.3 application. And I get the following exception for any tests that contains a request/event:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)
> at org.apache.tapestry5.test.PageTester.setupRequestFromURI(PageTester.java:345)
> at org.apache.tapestry5.test.PageTester.setupRequestFromLink(PageTester.java:331)
> at org.apache.tapestry5.test.PageTester.runComponentEventRequest(PageTester.java:313)
> at org.apache.tapestry5.test.PageTester.clickLinkAndReturnResponse(PageTester.java:264)
> ...
> At bit digging through the code shows that there is mostly a coding bug in org.apache.tapestry5.test.PageTester#setupRequestFromURI() (PageTester.java:345):
> --------------------
> private void setupRequestFromURI(String URI)
> {
> String linkPath = stripContextFromPath(URI);
> int comma = linkPath.indexOf('?');
> String path = comma < 0 ? linkPath : linkPath.substring(0, comma);
> request.clear().setPath(path);
> if (comma > 0)
> decodeParametersIntoRequest(path.substring(comma + 1));
> }
> --------------------
> The path variable is the URL path with the event parameters (?xxx) stripped, trying to substring it again cause the IndexOutOfBounds exception. The correct variable to pass should instead be: linkPath. A comparison with the same class file confirms my findings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira