This is an automated email from the ASF dual-hosted git repository.

adelbene pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/master by this push:
     new 915873e  Remove usage of deprecated method from test example
     new 67b71e9  Merge pull request #367 from jmewes/docs/update-component
915873e is described below

commit 915873ea688067418c1c0b95a957c9879184dc69
Author: Jan Mewes <jan.me...@ks-plus.org>
AuthorDate: Sat Jun 1 13:54:14 2019 +0200

    Remove usage of deprecated method from test example
    
    The method `BaseWicketTester#startComponent(Component)` was removed in 
Wicket 7.0.0. See WICKET-5097
---
 wicket-user-guide/src/main/asciidoc/testing/testing_1.adoc | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/wicket-user-guide/src/main/asciidoc/testing/testing_1.adoc 
b/wicket-user-guide/src/main/asciidoc/testing/testing_1.adoc
index 5ac6a00..27dadfa 100644
--- a/wicket-user-guide/src/main/asciidoc/testing/testing_1.adoc
+++ b/wicket-user-guide/src/main/asciidoc/testing/testing_1.adoc
@@ -100,7 +100,7 @@ public void testDisableDatePickerWithButton(){
 
 === Testing components in isolation
 
-Method _startComponent(Component)_ can be used to test a component in 
isolation without having to create a container page for this purpose. The 
target component is rendered and both its methods _onInitialize()_ and 
_onBeforeRender()_ are executed. In the test case from project 
_CustomFormComponentPanel_ we used this method to check if our custom form 
component correctly renders its internal label:
+Method _startComponentInPage(Component)_ can be used to test a component in 
isolation. The target component is rendered in an automatically generated page 
and both _onInitialize()_ and _onBeforeRender()_ are executed. In the test case 
from project _CustomFormComponentPanel_ we used this method to check if our 
custom form component correctly renders its internal label:
 
 [source,java]
 ----
@@ -108,16 +108,14 @@ Method _startComponent(Component)_ can be used to test a 
component in isolation
 @Test
 public void testCustomPanelContainsLabel(){
        TemperatureDegreeField field = new TemperatureDegreeField("field", 
Model.of(0.00));
-       //Use standard JUnit class Assert       
-       Assert.assertNull(field.get("mesuramentUnit"));         
-       tester.startComponent(field);           
+       //Use standard JUnit class Assert
+       Assert.assertNull(field.get("mesuramentUnit"));
+       tester.startComponentInPage(field);
        Assert.assertNotNull(field.get("mesuramentUnit"));
 }
 //...
 ----
 
-If test requires a page we can use _startComponentInPage(Component)_ which 
automatically generates a page for our component.
-
 === Testing the response
 
 _WicketTester_ allows us to access to the last response generated during 
testing with method _getLastResponse()_. The returned value is an instance of 
class MockHttpServletResponse that provides helper methods to extract 
information from mocked request.

Reply via email to