You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carsten Behring (Created) (JIRA)" <ji...@apache.org> on 2012/04/19 15:50:42 UTC
[jira] [Created] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
wicktTester.getLastResponseAsString() returns wrong result after starting a Component
-------------------------------------------------------------------------------------
Key: WICKET-4507
URL: https://issues.apache.org/jira/browse/WICKET-4507
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.5.5
Reporter: Carsten Behring
Attachments: quickstart.tgz
> This following test :
@Test
public void test() throws Exception {
WicketTester tester=new WicketTester();
tester.startComponentInPage(new Label("lableId", "content") {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("test","123");
}
});
tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
assertEquals("icket:id=\"lableId\" test=\"123
\">content",tester.getLastResponseAsString());
assertEquals("",tester.getResponse().getDocument());
}
see attached quickstart
--
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] [Assigned] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov reassigned WICKET-4507:
---------------------------------------
Assignee: Martin Grigorov
> wicktTester.getLastResponseAsString() returns wrong result after starting a Component
> -------------------------------------------------------------------------------------
>
> Key: WICKET-4507
> URL: https://issues.apache.org/jira/browse/WICKET-4507
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5
> Reporter: Carsten Behring
> Assignee: Martin Grigorov
> Attachments: WICKET-4507.patch, quickstart.tgz
>
>
> > This following test :
> @Test
> public void test() throws Exception {
> WicketTester tester=new WicketTester();
> tester.startComponentInPage(new Label("lableId", "content") {
> @Override
> protected void onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> tag.put("test","123");
> }
> });
> tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
> assertEquals("icket:id=\"lableId\" test=\"123
> \">content",tester.getLastResponseAsString());
> assertEquals("",tester.getResponse().getDocument());
> }
> exposes the wrong behaviour of test.getLastResponseAsString() after starting a component.
> It should return something such as "<span> .... </span>", bit it returns a string "cut in the middle" : cket:id=\"lableId\" test=\"123\">content
> see attached quickstart
--
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] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
Posted by "Christoph Leiter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christoph Leiter updated WICKET-4507:
-------------------------------------
Attachment: WICKET-4507.patch
> wicktTester.getLastResponseAsString() returns wrong result after starting a Component
> -------------------------------------------------------------------------------------
>
> Key: WICKET-4507
> URL: https://issues.apache.org/jira/browse/WICKET-4507
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5
> Reporter: Carsten Behring
> Attachments: WICKET-4507.patch, quickstart.tgz
>
>
> > This following test :
> @Test
> public void test() throws Exception {
> WicketTester tester=new WicketTester();
> tester.startComponentInPage(new Label("lableId", "content") {
> @Override
> protected void onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> tag.put("test","123");
> }
> });
> tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
> assertEquals("icket:id=\"lableId\" test=\"123
> \">content",tester.getLastResponseAsString());
> assertEquals("",tester.getResponse().getDocument());
> }
> exposes the wrong behaviour of test.getLastResponseAsString() after starting a component.
> It should return something such as "<span> .... </span>", bit it returns a string "cut in the middle" : cket:id=\"lableId\" test=\"123\">content
> see attached quickstart
--
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] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
Posted by "Carsten Behring (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Behring updated WICKET-4507:
------------------------------------
Attachment: quickstart.tgz
> wicktTester.getLastResponseAsString() returns wrong result after starting a Component
> -------------------------------------------------------------------------------------
>
> Key: WICKET-4507
> URL: https://issues.apache.org/jira/browse/WICKET-4507
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5
> Reporter: Carsten Behring
> Attachments: quickstart.tgz
>
>
> > This following test :
> @Test
> public void test() throws Exception {
> WicketTester tester=new WicketTester();
> tester.startComponentInPage(new Label("lableId", "content") {
> @Override
> protected void onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> tag.put("test","123");
> }
> });
> tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
> assertEquals("icket:id=\"lableId\" test=\"123
> \">content",tester.getLastResponseAsString());
> assertEquals("",tester.getResponse().getDocument());
> }
> see attached quickstart
--
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] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-4507.
-------------------------------------
Resolution: Fixed
Fix Version/s: 6.0.0-RC1
1.5.6
> wicktTester.getLastResponseAsString() returns wrong result after starting a Component
> -------------------------------------------------------------------------------------
>
> Key: WICKET-4507
> URL: https://issues.apache.org/jira/browse/WICKET-4507
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5
> Reporter: Carsten Behring
> Assignee: Martin Grigorov
> Fix For: 1.5.6, 6.0.0-RC1
>
> Attachments: WICKET-4507.patch, quickstart.tgz
>
>
> > This following test :
> @Test
> public void test() throws Exception {
> WicketTester tester=new WicketTester();
> tester.startComponentInPage(new Label("lableId", "content") {
> @Override
> protected void onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> tag.put("test","123");
> }
> });
> tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
> assertEquals("icket:id=\"lableId\" test=\"123
> \">content",tester.getLastResponseAsString());
> assertEquals("",tester.getResponse().getDocument());
> }
> exposes the wrong behaviour of test.getLastResponseAsString() after starting a component.
> It should return something such as "<span> .... </span>", bit it returns a string "cut in the middle" : cket:id=\"lableId\" test=\"123\">content
> see attached quickstart
--
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] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
Posted by "Christoph Leiter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259070#comment-13259070 ]
Christoph Leiter commented on WICKET-4507:
------------------------------------------
The current implementation of BaseWicketTester#getLastResponseAsString() returns just the body of a component if startComponentInPage() has been used. The surrounding markup of the page and the tag of the component get removed. Testing for attributes can't work that when only the body is rendered.
The JavaDoc of getLastResponseAsString isn't exactly clear what the intended behaviour is: "In case the processed component was not a Page then the automatically created page markup gets removed". I think the tag of the component itself shouldn't be removed.
I'll attach a patch which does just that.
> wicktTester.getLastResponseAsString() returns wrong result after starting a Component
> -------------------------------------------------------------------------------------
>
> Key: WICKET-4507
> URL: https://issues.apache.org/jira/browse/WICKET-4507
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5
> Reporter: Carsten Behring
> Attachments: quickstart.tgz
>
>
> > This following test :
> @Test
> public void test() throws Exception {
> WicketTester tester=new WicketTester();
> tester.startComponentInPage(new Label("lableId", "content") {
> @Override
> protected void onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> tag.put("test","123");
> }
> });
> tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
> assertEquals("icket:id=\"lableId\" test=\"123
> \">content",tester.getLastResponseAsString());
> assertEquals("",tester.getResponse().getDocument());
> }
> exposes the wrong behaviour of test.getLastResponseAsString() after starting a component.
> It should return something such as "<span> .... </span>", bit it returns a string "cut in the middle" : cket:id=\"lableId\" test=\"123\">content
> see attached quickstart
--
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] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
Posted by "Carsten Behring (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259263#comment-13259263 ]
Carsten Behring commented on WICKET-4507:
-----------------------------------------
I just tried the patch and wanted to confirm, that it would fix the problem for me.
> wicktTester.getLastResponseAsString() returns wrong result after starting a Component
> -------------------------------------------------------------------------------------
>
> Key: WICKET-4507
> URL: https://issues.apache.org/jira/browse/WICKET-4507
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5
> Reporter: Carsten Behring
> Attachments: WICKET-4507.patch, quickstart.tgz
>
>
> > This following test :
> @Test
> public void test() throws Exception {
> WicketTester tester=new WicketTester();
> tester.startComponentInPage(new Label("lableId", "content") {
> @Override
> protected void onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> tag.put("test","123");
> }
> });
> tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
> assertEquals("icket:id=\"lableId\" test=\"123
> \">content",tester.getLastResponseAsString());
> assertEquals("",tester.getResponse().getDocument());
> }
> exposes the wrong behaviour of test.getLastResponseAsString() after starting a component.
> It should return something such as "<span> .... </span>", bit it returns a string "cut in the middle" : cket:id=\"lableId\" test=\"123\">content
> see attached quickstart
--
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] (WICKET-4507)
wicktTester.getLastResponseAsString() returns wrong result after starting a
Component
Posted by "Carsten Behring (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Behring updated WICKET-4507:
------------------------------------
Description:
> This following test :
@Test
public void test() throws Exception {
WicketTester tester=new WicketTester();
tester.startComponentInPage(new Label("lableId", "content") {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("test","123");
}
});
tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
assertEquals("icket:id=\"lableId\" test=\"123
\">content",tester.getLastResponseAsString());
assertEquals("",tester.getResponse().getDocument());
}
exposes the wrong behaviour of test.getLastResponseAsString() after starting a component.
It should return something such as "<span> .... </span>", bit it returns a string "cut in the middle" : cket:id=\"lableId\" test=\"123\">content
see attached quickstart
was:
> This following test :
@Test
public void test() throws Exception {
WicketTester tester=new WicketTester();
tester.startComponentInPage(new Label("lableId", "content") {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("test","123");
}
});
tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
assertEquals("icket:id=\"lableId\" test=\"123
\">content",tester.getLastResponseAsString());
assertEquals("",tester.getResponse().getDocument());
}
see attached quickstart
> wicktTester.getLastResponseAsString() returns wrong result after starting a Component
> -------------------------------------------------------------------------------------
>
> Key: WICKET-4507
> URL: https://issues.apache.org/jira/browse/WICKET-4507
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5
> Reporter: Carsten Behring
> Attachments: quickstart.tgz
>
>
> > This following test :
> @Test
> public void test() throws Exception {
> WicketTester tester=new WicketTester();
> tester.startComponentInPage(new Label("lableId", "content") {
> @Override
> protected void onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> tag.put("test","123");
> }
> });
> tester.assertResultPage("icket:id=\"lableId\" test=\"123\">content");
> assertEquals("icket:id=\"lableId\" test=\"123
> \">content",tester.getLastResponseAsString());
> assertEquals("",tester.getResponse().getDocument());
> }
> exposes the wrong behaviour of test.getLastResponseAsString() after starting a component.
> It should return something such as "<span> .... </span>", bit it returns a string "cut in the middle" : cket:id=\"lableId\" test=\"123\">content
> see attached quickstart
--
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