Re: Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread Sven Meier

Hard to tell, the code looks fine to me :/

Have fun
Sven


On 01.06.20 15:09, leodali83 wrote:

Hello Sven,
actually it helps a bit, some error feedback messages related to the 2 input
fields on which I set the value just after instantiation of FormTester
disappered.

Therefore, test fails again signaling the second dropdown (e.g.
"secondDropDownSelect") is required, which actually it is.

After instantiating again FormTester, code looks like this:
...

FormTester formTester = 
wicketTester.newFormTester("detailsForm");
formTester.select("firstDropDownSelect", 0);
wicketTester.executeAjaxEvent("detailsForm:firstDropDownSelect",
"change");

formTester = wicketTester.newFormTester("detailsForm");
formTester.setValue("codice", "001");
formTester.setValue("matricola", "123456");
formTester.select("status", 0);
formTester.setValue("maxValoreTotalizzatore", "");
formTester.select("secondDropDownSelect", 0);

LocalDate tomorrow = LocalDate.now().plusDays(1);
String tomorrowAsString =
tomorrow.format(DateTimeFormatter.ofPattern("dd/MM/"));
formTester.setValue("scadenzaCertificatoMid:dateWrapper:date",
tomorrowAsString);

formTester.submit("save");
   
...


Sounds a bit strange. Is it losing again my request?

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread leodali83
Hello Sven,
actually it helps a bit, some error feedback messages related to the 2 input
fields on which I set the value just after instantiation of FormTester
disappered.

Therefore, test fails again signaling the second dropdown (e.g.
"secondDropDownSelect") is required, which actually it is.

After instantiating again FormTester, code looks like this:
...

FormTester formTester = 
wicketTester.newFormTester("detailsForm");
formTester.select("firstDropDownSelect", 0);
wicketTester.executeAjaxEvent("detailsForm:firstDropDownSelect",
"change");

formTester = wicketTester.newFormTester("detailsForm");
formTester.setValue("codice", "001");
formTester.setValue("matricola", "123456");
formTester.select("status", 0);
formTester.setValue("maxValoreTotalizzatore", "");
formTester.select("secondDropDownSelect", 0);

LocalDate tomorrow = LocalDate.now().plusDays(1);
String tomorrowAsString =
tomorrow.format(DateTimeFormatter.ofPattern("dd/MM/"));
formTester.setValue("scadenzaCertificatoMid:dateWrapper:date",
tomorrowAsString);

formTester.submit("save");
  
...

Sounds a bit strange. Is it losing again my request?

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread Sven Meier

Hi,

you have to use a new FormTester instance after executing the Ajax event:

...
    formTester = tester.newFormTester(path)
    formTester.select("field1", ""); // required field
    formTester.select("field2", ""); // required field
    .
    formTester.select("firstDropDownSelect", 0);
wicketTester.executeAjaxEvent("detailsForm:firstDropDownSelect","change");
    formTester.select("secondDropDownSelect", 0);

    formTester = tester.newFormTester(path);
    formTester.submit()
...

Executing a request (e.g. via executeAjaxEvent) 'consumes' the current 
request and WicketTester sets up a new 'empty' request.


A new FormTester will fill the parameters of that new request with the 
current state of your components.


Hope this helps
Sven



Hi,

you have to use a new FormTester instance after executing the Ajax event:

...
    formTester = tester.newFormTester(path)
    formTester.select("field1", ""); // required field
    formTester.select("field2", ""); // required field
    .
    formTester.select("firstDropDownSelect", 0);
wicketTester.executeAjaxEvent("detailsForm:firstDropDownSelect","change");
    formTester.select("secondDropDownSelect", 0);

    formTester = tester.newFormTester(path)
    formTester.submit()
...

Executing a request (e.g. via executeAjaxEvent) 'consumes' the current 
request and a new one is set up by WicketTester.


Otherwise the values of the form




On 01.06.20 09:59, leodali83 wrote:

Hello everybody,
I'm developing a web application built on Wicket 8.

Now i'm testing a form containing 2 DropDownChoice, the selection of the
first one should refresh elements to be choose on the second through the
Ajax "change" event.
When i submit my form and I test feedback messages displayed during the
process, the form seems to have lost all the other field setted before the 2
drop downs below:

...
 formTester.select("field1", ""); // required field
 formTester.select("field2", ""); // required field
 .
formTester.select("firstDropDownSelect", 0);
wicketTester.executeAjaxEvent("detailsForm:firstDropDownSelect",
"change");
formTester.select("secondDropDownSelect", 0);
...

The Wicket Tester fails the test stating "field1" and "field2" are required
fields, although I setted it correctly... :/

If I try the same behaviour interactively, it works fine.

What am I missing from my test?

Thanks in advance for any suggestions,
Leonardo

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread leodali83
Hello everybody,
I'm developing a web application built on Wicket 8.

Now i'm testing a form containing 2 DropDownChoice, the selection of the
first one should refresh elements to be choose on the second through the
Ajax "change" event.
When i submit my form and I test feedback messages displayed during the
process, the form seems to have lost all the other field setted before the 2
drop downs below:

...
formTester.select("field1", ""); // required field
formTester.select("field2", ""); // required field
.
formTester.select("firstDropDownSelect", 0);
wicketTester.executeAjaxEvent("detailsForm:firstDropDownSelect",
"change");
formTester.select("secondDropDownSelect", 0);
...

The Wicket Tester fails the test stating "field1" and "field2" are required
fields, although I setted it correctly... :/

If I try the same behaviour interactively, it works fine.

What am I missing from my test?

Thanks in advance for any suggestions,
Leonardo

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test errors after upgrading to Wicket 8.7.0

2020-01-10 Thread Francesco Chicchiriccò
Worked like a charm, thanks!

https://github.com/apache/syncope/commit/f5f0bf05cd88e8d5ab6e682f7e1bb6f3c3249c82#diff-1b179dcf722c88b5094875ab9d08d6e3R65

Regards.

On 2020/01/10 13:02:20, Martin Grigorov  wrote: 
> On Fri, Jan 10, 2020 at 2:55 PM Francesco Chicchiriccò 
> wrote:
> 
> > On 2020/01/10 12:24:49, Martin Grigorov  wrote:
> > > Hi Francesco,
> > >
> > > This was a bug in Wicket, a security related one.
> > > You will need to fix your code.
> > >
> > > The change should look something like this:
> > >
> > >
> > > -   tester.getRequest().setParameter("select",
> > > page.option1.getValue());
> > > -   tester.getRequest().setParameter("text", "text is
> > required");
> > > -   tester.submitForm(page.form);
> > > +   final FormTester formTester2 =
> > tester.newFormTester("form");
> > > +   formTester2.setValue("select", "option1");
> > > +   formTester2.setValue("text", "text is required");
> > > +   formTester2.submit();
> > >
> > > from
> > >
> > https://gitbox.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=0c19cf8;hp=3d8f8b306a92cee71020a633be1d347177d7b7fc
> >
> > Thanks Martin.
> >
> > As I can see from above, you have a Form instance, which we don't have in
> > [2].
> >
> > Moreover, the problem only occurs with MockWebRequest, not with regular
> > operations (e.g. HttpServletRequest), hence I'd need to introduce a Form
> > only to let tests pass...
> >
> > Is there any way to let WicketTester use a different implementation then
> > MockWebRequest?
> >
> 
> This is how we resolve the method:
> 
> +   protected List getParameterValues(String inputName)
> +   {
> +   String method = Form.METHOD_POST;
> +   final Form form = findParent(Form.class);
> +   final Request request = getRequest();
> +   if (getRequest().getContainerRequest() instanceof
> HttpServletRequest)
> +   {
> +   method = ((HttpServletRequest)
> getRequest().getContainerRequest()).getMethod();
> +   }
> +   else if (form != null)
> +   {
> +   method = form.getMethod();
> +   }
> 
> Try with:
> tester.getRequest().setMethod("get");
> tester.getRequest().setParameter("select", page.option1.getValue());
> ...
> 
> 
> > Regards.
> >
> > > On Fri, Jan 10, 2020 at 9:31 AM Francesco Chicchiriccò <
> > ilgro...@apache.org>
> > > wrote:
> > >
> > > > Hi there,
> > > > it seems we have some issues with Wicket Tester, after upgrading to
> > 8.7.0
> > > > from 8.6.1.
> > > >
> > > > In particular, due to the change [1] for WICKET-6708, we have found
> > that
> > > > MockWebRequest is not behaving as expected; no troubles occur instead
> > > > during normal operations with HttpServletRequest.
> > > >
> > > > The test failures occur because MockWebRequest's method is (correctly)
> > set
> > > > to POST but parameters are submitted with URL, when using
> > DropDownChoice
> > > > with onChange behavior [2].
> > > >
> > > > Of course, such situation was fine with code prior to [1] but not
> > working
> > > > anymore: I have verified that expected submit parameters are part of
> > URL,
> > > > hence are available as getQueryParameters() but getPostParameters() is
> > > > invoked instead.
> > > >
> > > > FYI, one of failing test cases in [3].
> > > >
> > > > Please let me know if this is a bug with MockWebRequest or whether we
> > have
> > > > to update our test code, thanks.
> > > >
> > > > Regards.
> > > >
> > > > [1]
> > https://github.com/apache/wicket/commit/9c3129517a15c37cc90fb27a697868a825940aa0#diff-51cf2faf6078497df77cc6d995dd1b98R763
> > > > [2]
> > https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractLogsPanel.java#L71
> > > > [3]
> > https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/test/java/org/apache/syncope/fit/console/LogsITCase.java#L57
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test errors after upgrading to Wicket 8.7.0

2020-01-10 Thread Martin Grigorov
On Fri, Jan 10, 2020 at 2:55 PM Francesco Chicchiriccò 
wrote:

> On 2020/01/10 12:24:49, Martin Grigorov  wrote:
> > Hi Francesco,
> >
> > This was a bug in Wicket, a security related one.
> > You will need to fix your code.
> >
> > The change should look something like this:
> >
> >
> > -   tester.getRequest().setParameter("select",
> > page.option1.getValue());
> > -   tester.getRequest().setParameter("text", "text is
> required");
> > -   tester.submitForm(page.form);
> > +   final FormTester formTester2 =
> tester.newFormTester("form");
> > +   formTester2.setValue("select", "option1");
> > +   formTester2.setValue("text", "text is required");
> > +   formTester2.submit();
> >
> > from
> >
> https://gitbox.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=0c19cf8;hp=3d8f8b306a92cee71020a633be1d347177d7b7fc
>
> Thanks Martin.
>
> As I can see from above, you have a Form instance, which we don't have in
> [2].
>
> Moreover, the problem only occurs with MockWebRequest, not with regular
> operations (e.g. HttpServletRequest), hence I'd need to introduce a Form
> only to let tests pass...
>
> Is there any way to let WicketTester use a different implementation then
> MockWebRequest?
>

This is how we resolve the method:

+   protected List getParameterValues(String inputName)
+   {
+   String method = Form.METHOD_POST;
+   final Form form = findParent(Form.class);
+   final Request request = getRequest();
+   if (getRequest().getContainerRequest() instanceof
HttpServletRequest)
+   {
+   method = ((HttpServletRequest)
getRequest().getContainerRequest()).getMethod();
+   }
+   else if (form != null)
+   {
+   method = form.getMethod();
+   }

Try with:
tester.getRequest().setMethod("get");
tester.getRequest().setParameter("select", page.option1.getValue());
...


> Regards.
>
> > On Fri, Jan 10, 2020 at 9:31 AM Francesco Chicchiriccò <
> ilgro...@apache.org>
> > wrote:
> >
> > > Hi there,
> > > it seems we have some issues with Wicket Tester, after upgrading to
> 8.7.0
> > > from 8.6.1.
> > >
> > > In particular, due to the change [1] for WICKET-6708, we have found
> that
> > > MockWebRequest is not behaving as expected; no troubles occur instead
> > > during normal operations with HttpServletRequest.
> > >
> > > The test failures occur because MockWebRequest's method is (correctly)
> set
> > > to POST but parameters are submitted with URL, when using
> DropDownChoice
> > > with onChange behavior [2].
> > >
> > > Of course, such situation was fine with code prior to [1] but not
> working
> > > anymore: I have verified that expected submit parameters are part of
> URL,
> > > hence are available as getQueryParameters() but getPostParameters() is
> > > invoked instead.
> > >
> > > FYI, one of failing test cases in [3].
> > >
> > > Please let me know if this is a bug with MockWebRequest or whether we
> have
> > > to update our test code, thanks.
> > >
> > > Regards.
> > >
> > > [1]
> https://github.com/apache/wicket/commit/9c3129517a15c37cc90fb27a697868a825940aa0#diff-51cf2faf6078497df77cc6d995dd1b98R763
> > > [2]
> https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractLogsPanel.java#L71
> > > [3]
> https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/test/java/org/apache/syncope/fit/console/LogsITCase.java#L57
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Test errors after upgrading to Wicket 8.7.0

2020-01-10 Thread Francesco Chicchiriccò
On 2020/01/10 12:24:49, Martin Grigorov  wrote: 
> Hi Francesco,
> 
> This was a bug in Wicket, a security related one.
> You will need to fix your code.
> 
> The change should look something like this:
> 
> 
> -   tester.getRequest().setParameter("select",
> page.option1.getValue());
> -   tester.getRequest().setParameter("text", "text is required");
> -   tester.submitForm(page.form);
> +   final FormTester formTester2 = tester.newFormTester("form");
> +   formTester2.setValue("select", "option1");
> +   formTester2.setValue("text", "text is required");
> +   formTester2.submit();
> 
> from
> https://gitbox.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=0c19cf8;hp=3d8f8b306a92cee71020a633be1d347177d7b7fc

Thanks Martin.

As I can see from above, you have a Form instance, which we don't have in [2].

Moreover, the problem only occurs with MockWebRequest, not with regular 
operations (e.g. HttpServletRequest), hence I'd need to introduce a Form only 
to let tests pass...

Is there any way to let WicketTester use a different implementation then 
MockWebRequest?

Regards.

> On Fri, Jan 10, 2020 at 9:31 AM Francesco Chicchiriccò 
> wrote:
> 
> > Hi there,
> > it seems we have some issues with Wicket Tester, after upgrading to 8.7.0
> > from 8.6.1.
> >
> > In particular, due to the change [1] for WICKET-6708, we have found that
> > MockWebRequest is not behaving as expected; no troubles occur instead
> > during normal operations with HttpServletRequest.
> >
> > The test failures occur because MockWebRequest's method is (correctly) set
> > to POST but parameters are submitted with URL, when using DropDownChoice
> > with onChange behavior [2].
> >
> > Of course, such situation was fine with code prior to [1] but not working
> > anymore: I have verified that expected submit parameters are part of URL,
> > hence are available as getQueryParameters() but getPostParameters() is
> > invoked instead.
> >
> > FYI, one of failing test cases in [3].
> >
> > Please let me know if this is a bug with MockWebRequest or whether we have
> > to update our test code, thanks.
> >
> > Regards.
> >
> > [1] 
> > https://github.com/apache/wicket/commit/9c3129517a15c37cc90fb27a697868a825940aa0#diff-51cf2faf6078497df77cc6d995dd1b98R763
> > [2] 
> > https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractLogsPanel.java#L71
> > [3] 
> > https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/test/java/org/apache/syncope/fit/console/LogsITCase.java#L57

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test errors after upgrading to Wicket 8.7.0

2020-01-10 Thread Martin Grigorov
Hi Francesco,

This was a bug in Wicket, a security related one.
You will need to fix your code.

The change should look something like this:


-   tester.getRequest().setParameter("select",
page.option1.getValue());
-   tester.getRequest().setParameter("text", "text is required");
-   tester.submitForm(page.form);
+   final FormTester formTester2 = tester.newFormTester("form");
+   formTester2.setValue("select", "option1");
+   formTester2.setValue("text", "text is required");
+   formTester2.submit();

from
https://gitbox.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=0c19cf8;hp=3d8f8b306a92cee71020a633be1d347177d7b7fc


On Fri, Jan 10, 2020 at 9:31 AM Francesco Chicchiriccò 
wrote:

> Hi there,
> it seems we have some issues with Wicket Tester, after upgrading to 8.7.0
> from 8.6.1.
>
> In particular, due to the change [1] for WICKET-6708, we have found that
> MockWebRequest is not behaving as expected; no troubles occur instead
> during normal operations with HttpServletRequest.
>
> The test failures occur because MockWebRequest's method is (correctly) set
> to POST but parameters are submitted with URL, when using DropDownChoice
> with onChange behavior [2].
>
> Of course, such situation was fine with code prior to [1] but not working
> anymore: I have verified that expected submit parameters are part of URL,
> hence are available as getQueryParameters() but getPostParameters() is
> invoked instead.
>
> FYI, one of failing test cases in [3].
>
> Please let me know if this is a bug with MockWebRequest or whether we have
> to update our test code, thanks.
>
> Regards.
>
> [1]
> https://github.com/apache/wicket/commit/9c3129517a15c37cc90fb27a697868a825940aa0#diff-51cf2faf6078497df77cc6d995dd1b98R763
> [2]
> https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractLogsPanel.java#L71
> [3]
> https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/test/java/org/apache/syncope/fit/console/LogsITCase.java#L57
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Test errors after upgrading to Wicket 8.7.0

2020-01-09 Thread Francesco Chicchiriccò
Hi there,
it seems we have some issues with Wicket Tester, after upgrading to 8.7.0 from 
8.6.1.

In particular, due to the change [1] for WICKET-6708, we have found that 
MockWebRequest is not behaving as expected; no troubles occur instead during 
normal operations with HttpServletRequest.

The test failures occur because MockWebRequest's method is (correctly) set to 
POST but parameters are submitted with URL, when using DropDownChoice with 
onChange behavior [2].

Of course, such situation was fine with code prior to [1] but not working 
anymore: I have verified that expected submit parameters are part of URL, hence 
are available as getQueryParameters() but getPostParameters() is invoked 
instead.

FYI, one of failing test cases in [3].

Please let me know if this is a bug with MockWebRequest or whether we have to 
update our test code, thanks.

Regards.

[1] 
https://github.com/apache/wicket/commit/9c3129517a15c37cc90fb27a697868a825940aa0#diff-51cf2faf6078497df77cc6d995dd1b98R763
[2] 
https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractLogsPanel.java#L71
[3] 
https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/test/java/org/apache/syncope/fit/console/LogsITCase.java#L57

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: wicket-core and util OSGI wiring problem with junit.framework (provided test environment and fix)

2018-09-05 Thread SUBRA
Duplicate 

http://apache-wicket.1842946.n4.nabble.com/wicket-core-and-util-OSGI-wiring-problem-with-junit-framework-with-test-environment-td4680840.html

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



wicket-core and util OSGI wiring problem with junit.framework (provided test environment and fix)

2018-09-05 Thread Subrahmanyam Sistha
Hi Team, 

Issue related to wicket-core and wicket -util bundle import junit packages. 

Regarding the issue, https://issues.apache.org/jira/browse/WICKET-6509
created and closed. 

But the solution is not working. 

Please find the attachments contains the sample environment and .swf(open in
IE) files contains the execution steps 

osgi.zip <http://apache-wicket.1842946.n4.nabble.com/file/t375895/osgi.zip>  

add the following bundles wicket-core  to the bundle directory in unzipped
osgi.zip file 

wicket-core-8.jar
<http://apache-wicket.1842946.n4.nabble.com/file/t375895/wicket-core-8.jar>  

(due to upload limit exceeded adding wicket-core separately to bundle
folder)



Steps for execution:

1. Unzip the osgi.zip 

2. Go to bundles folder and paste wicket-core-8.jar rename to
wicket-core-8.0.0.jar

3. back and go to bin folder 

4. Open folder in cmd prompt and run osgi.example.bat 

5. OSGI Framework started 

6. Open command prompt and execute telnet localhost 

7. type ps, shows list of bundles 

8. start wicket-core bundle, by using command start wicket-core ID 

org.osgi.framework.BundleException: Unable to resolve org.apache.wicket.core
[11](R 11.0): missing requirement [org.apache.wicket.core [11](R 11.0)]
osgi.wiring.package; (osgi.wiring.package=junit.framework) Unresolved
requirements: [[org.apache.wicket.core [11](R 11.0)] osgi.wiring.package;
(osgi.wiring.package=junit.framework)] 



Follow the video 

Test Environment execution video 
Issue.swf
<http://apache-wicket.1842946.n4.nabble.com/file/t375895/Issue.swf>  

manifest video 
Reason.swf
<http://apache-wicket.1842946.n4.nabble.com/file/t375895/Reason.swf>  

Fix:

following videos contains the fix 

Contains Fix 
Fix.swf <http://apache-wicket.1842946.n4.nabble.com/file/t375895/Fix.swf>  

After Fix Test Environment and Manifest file 
afterfix.swf
<http://apache-wicket.1842946.n4.nabble.com/file/t375895/afterfix.swf>  

Let me know for more information. I would like to create a Pull Request 

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: wicket-core and util OSGI wiring problem with junit framework with test environment

2018-09-05 Thread Martin Grigorov
Hi,

Please open a new ticket and send a Pull Request!
Thank you!

On Wed, Sep 5, 2018 at 6:49 PM SUBRA  wrote:

> Hi Team,
>
> Issue related to wicket-core and wicket -util bundle import junit
> packages.
>
> Regarding the issue, https://issues.apache.org/jira/browse/WICKET-6509
> created and closed.
>
> But the solution is not working.
>
> Please find the attachments contains the sample environment and .swf(open
> in
> IE) files contains the execution steps
>
> osgi.zip <http://apache-wicket.1842946.n4.nabble.com/file/t375090/osgi.zip>
>
>
> add the following bundles wicket-core and wicket-extensions to the bundle
> directory in unzipped osgi.zip file
>
> wicket-core-8.jar
> <http://apache-wicket.1842946.n4.nabble.com/file/t375090/wicket-core-8.jar>
>
>
> wicket-extensions-8.jar
> <
> http://apache-wicket.1842946.n4.nabble.com/file/t375090/wicket-extensions-8.jar>
>
>
> *Steps for execution:*
>
> 1. Unzip the osgi.zip
>
> 2. Go to bundles folder and paste wicket-core-8.jar and
> wicket-extensions-8.jar and rename to
>
> wicket-core-8.0.0.jar and wicket-extensions-8.0.0.jar
>
> 3. back and go to bin folder
>
> 4. Open folder in cmd prompt and run osgi.example.bat
>
> 5. OSGI Framework started
>
> 6. Open command prompt and execute *telnet localhost *
>
> 7. type ps, shows list of bundles
>
> 8. execute wicket-core bundle, by using start wicket-core ID
>
> org.osgi.framework.BundleException: Unable to resolve
> org.apache.wicket.core
> [11](R 11.0): missing requirement [org.apache.wicket.core [11](R 11.0)]
> osgi.wiring.package; (osgi.wiring.package=junit.framework) Unresolved
> requirements: [[org.apache.wicket.core [11](R 11.0)] osgi.wiring.package;
> (osgi.wiring.package=junit.framework)]
>
>
>
> Follow the video
>
> Test Environment execution video
> Issue.swf
> <http://apache-wicket.1842946.n4.nabble.com/file/t375090/Issue.swf>
>
> manifest video
> Reason.swf
> <http://apache-wicket.1842946.n4.nabble.com/file/t375090/Reason.swf>
>
> *Fix:*
>
> following videos contains the fix
>
> Contains Fix
> Fix.swf <http://apache-wicket.1842946.n4.nabble.com/file/t375090/Fix.swf>
>
>
> After Fix Test Environment and Manifest file
> afterfix.swf
> <http://apache-wicket.1842946.n4.nabble.com/file/t375090/afterfix.swf>
>
> Let me know for more information. I would like to create a Pull Request
>
>
>
>
>
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


wicket-core and util OSGI wiring problem with junit framework with test environment

2018-09-05 Thread SUBRA
Hi Team,

Issue related to wicket-core and wicket -util bundle import junit packages. 

Regarding the issue, https://issues.apache.org/jira/browse/WICKET-6509
created and closed.

But the solution is not working. 

Please find the attachments contains the sample environment and .swf(open in
IE) files contains the execution steps

osgi.zip <http://apache-wicket.1842946.n4.nabble.com/file/t375090/osgi.zip>  

add the following bundles wicket-core and wicket-extensions to the bundle
directory in unzipped osgi.zip file

wicket-core-8.jar
<http://apache-wicket.1842946.n4.nabble.com/file/t375090/wicket-core-8.jar>  

wicket-extensions-8.jar
<http://apache-wicket.1842946.n4.nabble.com/file/t375090/wicket-extensions-8.jar>
  

*Steps for execution:*

1. Unzip the osgi.zip

2. Go to bundles folder and paste wicket-core-8.jar and
wicket-extensions-8.jar and rename to 

wicket-core-8.0.0.jar and wicket-extensions-8.0.0.jar

3. back and go to bin folder 

4. Open folder in cmd prompt and run osgi.example.bat

5. OSGI Framework started

6. Open command prompt and execute *telnet localhost *

7. type ps, shows list of bundles

8. execute wicket-core bundle, by using start wicket-core ID

org.osgi.framework.BundleException: Unable to resolve org.apache.wicket.core
[11](R 11.0): missing requirement [org.apache.wicket.core [11](R 11.0)]
osgi.wiring.package; (osgi.wiring.package=junit.framework) Unresolved
requirements: [[org.apache.wicket.core [11](R 11.0)] osgi.wiring.package;
(osgi.wiring.package=junit.framework)]



Follow the video

Test Environment execution video
Issue.swf
<http://apache-wicket.1842946.n4.nabble.com/file/t375090/Issue.swf>  

manifest video
Reason.swf
<http://apache-wicket.1842946.n4.nabble.com/file/t375090/Reason.swf>  

*Fix:*

following videos contains the fix

Contains Fix 
Fix.swf <http://apache-wicket.1842946.n4.nabble.com/file/t375090/Fix.swf>  

After Fix Test Environment and Manifest file
afterfix.swf
<http://apache-wicket.1842946.n4.nabble.com/file/t375090/afterfix.swf>  

Let me know for more information. I would like to create a Pull Request






--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: What should I use to perform the crawler test?

2018-01-26 Thread Gabriel Landon
Hi Sokab,

I usually use Selenium with a "By" class using the wicketPath.

Here's the code I use :
WicketBy.java
  

Regards,
Gabriel

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



What should I use to perform the crawler test?

2018-01-24 Thread Sokab
Hi everyone. I have to write a crowler test for wicket application (wildfly
server). Do You think Jsoup is enough?I tried to log in to my application to
use Jsoup, for example the code on this page
http://www.scrapingauthority.com/2016/08/16/web-scraping-in-java-with-jsoup/
but I had many problems, because I did not have a reaction. Should I use
something else like Selenium and do not use Jsoup? I apologize for my
question but I really do not know what to use. I need to check where in my
application are errors after entering a link or search for a text. Thanks
for any help.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-24 Thread Tobias Soloschenko
Aww ;-) But yes those values were just to nice to be true ;-)

kind regards

Tobias

> Am 24.03.2017 um 08:50 schrieb Martin Grigorov <mgrigo...@apache.org>:
> 
> It was too good to be true :-)
> 
> TechEmpower said that they've had some mistake in the way they executed the
> tests and this led to these good numbers.
> After fixing the errors the difference between round 13 and 14 are:
> 
> Framework  Test Type Old RPS   New RPSChange in RPS
> Old Rank   New RankChange in Rank
> 
> wicket   json  328,388  339,015
>  +3.2%39   41   -2
> wicket   plaintext   335,404  344,897
> +2.8%62   65   -3
> wicket   db 38,498 44,699
>+16.1%  92   83   +9
> wicket   query36,635 43,500
>   +18.7% 78   65 +13
> wicket   update  18,724 24,017
>   +28.3% 50   35 +15
> wicket   fortune  24,363 23,641
>-3.0%   76   94  -18
> 
> https://www.techempower.com/benchmarks/previews/round14/r13-vs-r14p1.1.html
> 
> Everything looks normal!
> 
> Happy Friday! :-)
> 
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Mar 23, 2017 at 4:12 PM, Martin Grigorov <mgrigo...@apache.org>
> wrote:
> 
>> There won't be a difference.
>> There is only one page in these tests and it is stateless, i.e. it is not
>> stored.
>> 
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>> 
>> On Thu, Mar 23, 2017 at 3:01 PM, Martin Makundi <martin.makundi@
>> koodaripalvelut.com> wrote:
>> 
>>> Would be interesting to run this performance test Wicket with speed patch
>>> #6177
>>> 
>>> https://issues.apache.org/jira/browse/WICKET-6177
>>> 
>>> 2017-03-23 15:58 GMT+02:00 Marcel Barbosa Pinto <marcel.po...@gmail.com>:
>>> 
>>>> That is really good!
>>>> 
>>>> On Thu, Mar 23, 2017 at 5:47 AM, Andrea Del Bene <an.delb...@gmail.com>
>>>> wrote:
>>>> 
>>>>> Great!
>>>>> 
>>>>> On Wed, Mar 22, 2017 at 11:28 PM, Tobias Soloschenko <
>>>>> tobiassolosche...@googlemail.com> wrote:
>>>>> 
>>>>>> "New" does not mean better. :-)
>>>>>> 
>>>>>> kind regards
>>>>>> 
>>>>>> Tobias
>>>>>> 
>>>>>>> Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <
>>>>>> martijn.dasho...@gmail.com>:
>>>>>>> 
>>>>>>> WOW
>>>>>>> 
>>>>>>>> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <
>>>>> mgrigo...@apache.org>
>>>>>> wrote:
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> Somehow Wicket finished at 3rd position at the last preview run
>>> of
>>>>>>>> TechEmpower framework tests :-)
>>>>>>>> https://www.techempower.com/benchmarks/previews/round14/#
>>>>>> section=data-r14=ph=json
>>>>>>>> 
>>>>>>>> At plaintext test we are at #18:
>>>>>>>> https://www.techempower.com/benchmarks/previews/round14/#
>>>>>> section=data-r14=ph=plaintext
>>>>>>>> 
>>>>>>>> Too bad that the new MySQL JDBC driver v.6 failed at their
>>> servers,
>>>>>>>> otherwise I'd expect good results there too.
>>>>>>>> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
>>>>>>>> 
>>>>>>>> Wicket 7.6.0 performs ~300% better than Round 13!
>>>>>>>> https://www.techempower.com/benchmarks/previews/round14/
>>>>>> r13-vs-r14p1.html
>>>>>>>> 
>>>>>>>> The improvements come from
>>>>>>>> https://github.com/TechEmpower/FrameworkBenchmarks/commit/
>>>>>> 54152ceb735cf63351537556aa316dfd29202af4
>>>>>>>> - custom root request mapper
>>>>>>>> - reduced the response size to the minimum
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Once again the reactive frameworks are slower than the good old
>>>>> Wicket!
>>>>>> :-)
>>>>>>>> 
>>>>>>>> Martin Grigorov
>>>>>>>> Wicket Training and Consulting
>>>>>>>> https://twitter.com/mtgrigorov
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Become a Wicket expert, learn from the best:
>>>> http://wicketinaction.com
>>>>>>> 
>>>>>>> 
>>>> -
>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>> 
>>>>>> 
>>>>>> 
>>> -
>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> 
>>>> Marcel Barbosa Pinto
>>>> 55 11 98255 8288
>>>> 
>>> 
>> 
>> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-24 Thread Martin Grigorov
It was too good to be true :-)

TechEmpower said that they've had some mistake in the way they executed the
tests and this led to these good numbers.
After fixing the errors the difference between round 13 and 14 are:

Framework  Test Type Old RPS   New RPSChange in RPS
 Old Rank   New RankChange in Rank

wicket   json  328,388  339,015
  +3.2%39   41   -2
wicket   plaintext   335,404  344,897
+2.8%62   65   -3
wicket   db 38,498 44,699
+16.1%  92   83   +9
wicket   query36,635 43,500
   +18.7% 78   65 +13
wicket   update  18,724 24,017
   +28.3% 50   35 +15
wicket   fortune  24,363 23,641
-3.0%   76   94  -18

https://www.techempower.com/benchmarks/previews/round14/r13-vs-r14p1.1.html

Everything looks normal!

Happy Friday! :-)


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Mar 23, 2017 at 4:12 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> There won't be a difference.
> There is only one page in these tests and it is stateless, i.e. it is not
> stored.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Mar 23, 2017 at 3:01 PM, Martin Makundi <martin.makundi@
> koodaripalvelut.com> wrote:
>
>> Would be interesting to run this performance test Wicket with speed patch
>> #6177
>>
>> https://issues.apache.org/jira/browse/WICKET-6177
>>
>> 2017-03-23 15:58 GMT+02:00 Marcel Barbosa Pinto <marcel.po...@gmail.com>:
>>
>> > That is really good!
>> >
>> > On Thu, Mar 23, 2017 at 5:47 AM, Andrea Del Bene <an.delb...@gmail.com>
>> > wrote:
>> >
>> > > Great!
>> > >
>> > > On Wed, Mar 22, 2017 at 11:28 PM, Tobias Soloschenko <
>> > > tobiassolosche...@googlemail.com> wrote:
>> > >
>> > > > "New" does not mean better. :-)
>> > > >
>> > > > kind regards
>> > > >
>> > > > Tobias
>> > > >
>> > > > > Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <
>> > > > martijn.dasho...@gmail.com>:
>> > > > >
>> > > > > WOW
>> > > > >
>> > > > >> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <
>> > > mgrigo...@apache.org>
>> > > > wrote:
>> > > > >> Hi,
>> > > > >>
>> > > > >> Somehow Wicket finished at 3rd position at the last preview run
>> of
>> > > > >> TechEmpower framework tests :-)
>> > > > >> https://www.techempower.com/benchmarks/previews/round14/#
>> > > > section=data-r14=ph=json
>> > > > >>
>> > > > >> At plaintext test we are at #18:
>> > > > >> https://www.techempower.com/benchmarks/previews/round14/#
>> > > > section=data-r14=ph=plaintext
>> > > > >>
>> > > > >> Too bad that the new MySQL JDBC driver v.6 failed at their
>> servers,
>> > > > >> otherwise I'd expect good results there too.
>> > > > >> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
>> > > > >>
>> > > > >> Wicket 7.6.0 performs ~300% better than Round 13!
>> > > > >> https://www.techempower.com/benchmarks/previews/round14/
>> > > > r13-vs-r14p1.html
>> > > > >>
>> > > > >> The improvements come from
>> > > > >> https://github.com/TechEmpower/FrameworkBenchmarks/commit/
>> > > > 54152ceb735cf63351537556aa316dfd29202af4
>> > > > >> - custom root request mapper
>> > > > >> - reduced the response size to the minimum
>> > > > >>
>> > > > >>
>> > > > >> Once again the reactive frameworks are slower than the good old
>> > > Wicket!
>> > > > :-)
>> > > > >>
>> > > > >> Martin Grigorov
>> > > > >> Wicket Training and Consulting
>> > > > >> https://twitter.com/mtgrigorov
>> > > > >
>> > > > >
>> > > > >
>> > > > > --
>> > > > > Become a Wicket expert, learn from the best:
>> > http://wicketinaction.com
>> > > > >
>> > > > > 
>> > -
>> > > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > > > > For additional commands, e-mail: users-h...@wicket.apache.org
>> > > > >
>> > > >
>> > > > 
>> -
>> > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > > > For additional commands, e-mail: users-h...@wicket.apache.org
>> > > >
>> > > >
>> > >
>> >
>> >
>> >
>> > --
>> >
>> > Marcel Barbosa Pinto
>> > 55 11 98255 8288
>> >
>>
>
>


Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-23 Thread Martin Grigorov
There won't be a difference.
There is only one page in these tests and it is stateless, i.e. it is not
stored.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Mar 23, 2017 at 3:01 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Would be interesting to run this performance test Wicket with speed patch
> #6177
>
> https://issues.apache.org/jira/browse/WICKET-6177
>
> 2017-03-23 15:58 GMT+02:00 Marcel Barbosa Pinto <marcel.po...@gmail.com>:
>
> > That is really good!
> >
> > On Thu, Mar 23, 2017 at 5:47 AM, Andrea Del Bene <an.delb...@gmail.com>
> > wrote:
> >
> > > Great!
> > >
> > > On Wed, Mar 22, 2017 at 11:28 PM, Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com> wrote:
> > >
> > > > "New" does not mean better. :-)
> > > >
> > > > kind regards
> > > >
> > > > Tobias
> > > >
> > > > > Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <
> > > > martijn.dasho...@gmail.com>:
> > > > >
> > > > > WOW
> > > > >
> > > > >> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <
> > > mgrigo...@apache.org>
> > > > wrote:
> > > > >> Hi,
> > > > >>
> > > > >> Somehow Wicket finished at 3rd position at the last preview run of
> > > > >> TechEmpower framework tests :-)
> > > > >> https://www.techempower.com/benchmarks/previews/round14/#
> > > > section=data-r14=ph=json
> > > > >>
> > > > >> At plaintext test we are at #18:
> > > > >> https://www.techempower.com/benchmarks/previews/round14/#
> > > > section=data-r14=ph=plaintext
> > > > >>
> > > > >> Too bad that the new MySQL JDBC driver v.6 failed at their
> servers,
> > > > >> otherwise I'd expect good results there too.
> > > > >> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
> > > > >>
> > > > >> Wicket 7.6.0 performs ~300% better than Round 13!
> > > > >> https://www.techempower.com/benchmarks/previews/round14/
> > > > r13-vs-r14p1.html
> > > > >>
> > > > >> The improvements come from
> > > > >> https://github.com/TechEmpower/FrameworkBenchmarks/commit/
> > > > 54152ceb735cf63351537556aa316dfd29202af4
> > > > >> - custom root request mapper
> > > > >> - reduced the response size to the minimum
> > > > >>
> > > > >>
> > > > >> Once again the reactive frameworks are slower than the good old
> > > Wicket!
> > > > :-)
> > > > >>
> > > > >> Martin Grigorov
> > > > >> Wicket Training and Consulting
> > > > >> https://twitter.com/mtgrigorov
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Become a Wicket expert, learn from the best:
> > http://wicketinaction.com
> > > > >
> > > > > 
> > -
> > > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > > > For additional commands, e-mail: users-h...@wicket.apache.org
> > > > >
> > > >
> > > > 
> -
> > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > > For additional commands, e-mail: users-h...@wicket.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> > --
> >
> > Marcel Barbosa Pinto
> > 55 11 98255 8288
> >
>


Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-23 Thread Martin Makundi
Would be interesting to run this performance test Wicket with speed patch
#6177

https://issues.apache.org/jira/browse/WICKET-6177

2017-03-23 15:58 GMT+02:00 Marcel Barbosa Pinto <marcel.po...@gmail.com>:

> That is really good!
>
> On Thu, Mar 23, 2017 at 5:47 AM, Andrea Del Bene <an.delb...@gmail.com>
> wrote:
>
> > Great!
> >
> > On Wed, Mar 22, 2017 at 11:28 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> > > "New" does not mean better. :-)
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > > > Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <
> > > martijn.dasho...@gmail.com>:
> > > >
> > > > WOW
> > > >
> > > >> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <
> > mgrigo...@apache.org>
> > > wrote:
> > > >> Hi,
> > > >>
> > > >> Somehow Wicket finished at 3rd position at the last preview run of
> > > >> TechEmpower framework tests :-)
> > > >> https://www.techempower.com/benchmarks/previews/round14/#
> > > section=data-r14=ph=json
> > > >>
> > > >> At plaintext test we are at #18:
> > > >> https://www.techempower.com/benchmarks/previews/round14/#
> > > section=data-r14=ph=plaintext
> > > >>
> > > >> Too bad that the new MySQL JDBC driver v.6 failed at their servers,
> > > >> otherwise I'd expect good results there too.
> > > >> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
> > > >>
> > > >> Wicket 7.6.0 performs ~300% better than Round 13!
> > > >> https://www.techempower.com/benchmarks/previews/round14/
> > > r13-vs-r14p1.html
> > > >>
> > > >> The improvements come from
> > > >> https://github.com/TechEmpower/FrameworkBenchmarks/commit/
> > > 54152ceb735cf63351537556aa316dfd29202af4
> > > >> - custom root request mapper
> > > >> - reduced the response size to the minimum
> > > >>
> > > >>
> > > >> Once again the reactive frameworks are slower than the good old
> > Wicket!
> > > :-)
> > > >>
> > > >> Martin Grigorov
> > > >> Wicket Training and Consulting
> > > >> https://twitter.com/mtgrigorov
> > > >
> > > >
> > > >
> > > > --
> > > > Become a Wicket expert, learn from the best:
> http://wicketinaction.com
> > > >
> > > > 
> -
> > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > > For additional commands, e-mail: users-h...@wicket.apache.org
> > > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> >
>
>
>
> --
>
> Marcel Barbosa Pinto
> 55 11 98255 8288
>


Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-23 Thread Marcel Barbosa Pinto
That is really good!

On Thu, Mar 23, 2017 at 5:47 AM, Andrea Del Bene <an.delb...@gmail.com>
wrote:

> Great!
>
> On Wed, Mar 22, 2017 at 11:28 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > "New" does not mean better. :-)
> >
> > kind regards
> >
> > Tobias
> >
> > > Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <
> > martijn.dasho...@gmail.com>:
> > >
> > > WOW
> > >
> > >> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <
> mgrigo...@apache.org>
> > wrote:
> > >> Hi,
> > >>
> > >> Somehow Wicket finished at 3rd position at the last preview run of
> > >> TechEmpower framework tests :-)
> > >> https://www.techempower.com/benchmarks/previews/round14/#
> > section=data-r14=ph=json
> > >>
> > >> At plaintext test we are at #18:
> > >> https://www.techempower.com/benchmarks/previews/round14/#
> > section=data-r14=ph=plaintext
> > >>
> > >> Too bad that the new MySQL JDBC driver v.6 failed at their servers,
> > >> otherwise I'd expect good results there too.
> > >> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
> > >>
> > >> Wicket 7.6.0 performs ~300% better than Round 13!
> > >> https://www.techempower.com/benchmarks/previews/round14/
> > r13-vs-r14p1.html
> > >>
> > >> The improvements come from
> > >> https://github.com/TechEmpower/FrameworkBenchmarks/commit/
> > 54152ceb735cf63351537556aa316dfd29202af4
> > >> - custom root request mapper
> > >> - reduced the response size to the minimum
> > >>
> > >>
> > >> Once again the reactive frameworks are slower than the good old
> Wicket!
> > :-)
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >> https://twitter.com/mtgrigorov
> > >
> > >
> > >
> > > --
> > > Become a Wicket expert, learn from the best: http://wicketinaction.com
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 

Marcel Barbosa Pinto
55 11 98255 8288


Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-23 Thread Andrea Del Bene
Great!

On Wed, Mar 22, 2017 at 11:28 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> "New" does not mean better. :-)
>
> kind regards
>
> Tobias
>
> > Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <
> martijn.dasho...@gmail.com>:
> >
> > WOW
> >
> >> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <mgrigo...@apache.org>
> wrote:
> >> Hi,
> >>
> >> Somehow Wicket finished at 3rd position at the last preview run of
> >> TechEmpower framework tests :-)
> >> https://www.techempower.com/benchmarks/previews/round14/#
> section=data-r14=ph=json
> >>
> >> At plaintext test we are at #18:
> >> https://www.techempower.com/benchmarks/previews/round14/#
> section=data-r14=ph=plaintext
> >>
> >> Too bad that the new MySQL JDBC driver v.6 failed at their servers,
> >> otherwise I'd expect good results there too.
> >> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
> >>
> >> Wicket 7.6.0 performs ~300% better than Round 13!
> >> https://www.techempower.com/benchmarks/previews/round14/
> r13-vs-r14p1.html
> >>
> >> The improvements come from
> >> https://github.com/TechEmpower/FrameworkBenchmarks/commit/
> 54152ceb735cf63351537556aa316dfd29202af4
> >> - custom root request mapper
> >> - reduced the response size to the minimum
> >>
> >>
> >> Once again the reactive frameworks are slower than the good old Wicket!
> :-)
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >
> >
> >
> > --
> > Become a Wicket expert, learn from the best: http://wicketinaction.com
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-22 Thread Tobias Soloschenko
"New" does not mean better. :-)

kind regards

Tobias

> Am 22.03.2017 um 23:09 schrieb Martijn Dashorst <martijn.dasho...@gmail.com>:
> 
> WOW
> 
>> On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <mgrigo...@apache.org> 
>> wrote:
>> Hi,
>> 
>> Somehow Wicket finished at 3rd position at the last preview run of
>> TechEmpower framework tests :-)
>> https://www.techempower.com/benchmarks/previews/round14/#section=data-r14=ph=json
>> 
>> At plaintext test we are at #18:
>> https://www.techempower.com/benchmarks/previews/round14/#section=data-r14=ph=plaintext
>> 
>> Too bad that the new MySQL JDBC driver v.6 failed at their servers,
>> otherwise I'd expect good results there too.
>> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
>> 
>> Wicket 7.6.0 performs ~300% better than Round 13!
>> https://www.techempower.com/benchmarks/previews/round14/r13-vs-r14p1.html
>> 
>> The improvements come from
>> https://github.com/TechEmpower/FrameworkBenchmarks/commit/54152ceb735cf63351537556aa316dfd29202af4
>> - custom root request mapper
>> - reduced the response size to the minimum
>> 
>> 
>> Once again the reactive frameworks are slower than the good old Wicket! :-)
>> 
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
> 
> 
> 
> -- 
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket is #3 in the JSON perf test by TechEmpower

2017-03-22 Thread Martijn Dashorst
WOW

On Wed, Mar 22, 2017 at 10:12 PM, Martin Grigorov <mgrigo...@apache.org> wrote:
> Hi,
>
> Somehow Wicket finished at 3rd position at the last preview run of
> TechEmpower framework tests :-)
> https://www.techempower.com/benchmarks/previews/round14/#section=data-r14=ph=json
>
> At plaintext test we are at #18:
> https://www.techempower.com/benchmarks/previews/round14/#section=data-r14=ph=plaintext
>
> Too bad that the new MySQL JDBC driver v.6 failed at their servers,
> otherwise I'd expect good results there too.
> https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603
>
> Wicket 7.6.0 performs ~300% better than Round 13!
> https://www.techempower.com/benchmarks/previews/round14/r13-vs-r14p1.html
>
> The improvements come from
> https://github.com/TechEmpower/FrameworkBenchmarks/commit/54152ceb735cf63351537556aa316dfd29202af4
> - custom root request mapper
> - reduced the response size to the minimum
>
>
> Once again the reactive frameworks are slower than the good old Wicket! :-)
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket is #3 in the JSON perf test by TechEmpower

2017-03-22 Thread Martin Grigorov
Hi,

Somehow Wicket finished at 3rd position at the last preview run of
TechEmpower framework tests :-)
https://www.techempower.com/benchmarks/previews/round14/#section=data-r14=ph=json

At plaintext test we are at #18:
https://www.techempower.com/benchmarks/previews/round14/#section=data-r14=ph=plaintext

Too bad that the new MySQL JDBC driver v.6 failed at their servers,
otherwise I'd expect good results there too.
https://github.com/TechEmpower/FrameworkBenchmarks/pull/2603

Wicket 7.6.0 performs ~300% better than Round 13!
https://www.techempower.com/benchmarks/previews/round14/r13-vs-r14p1.html

The improvements come from
https://github.com/TechEmpower/FrameworkBenchmarks/commit/54152ceb735cf63351537556aa316dfd29202af4
- custom root request mapper
- reduced the response size to the minimum


Once again the reactive frameworks are slower than the good old Wicket! :-)

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


Re: Test Page renders with Nested Panel

2017-02-14 Thread David Beer
Hi

Thanks for the link I will look into this further separately. See if I can
do something Similar for Java EE and @EJB etc.

On 14 February 2017 at 09:12, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi,
>
> I thought you want to use Spring (because the branch name mentions it).
> You can do the same with Java EE.
> If you use CDI then take a look at
> https://github.com/apache/wicket/tree/master/wicket-cdi-
> 1.1/src/test/java/org/apache/wicket/cdi
> I have no idea how to test @EJB and @Stateless. I haven't used those since
> very long time.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Feb 13, 2017 at 11:39 PM, David Beer <david.m.b...@gmail.com>
> wrote:
>
> > Hi Martin
> >
> > Thanks for the PR. So the solution is to remove JavaEE EJB references
> > rather than to use them and test them. Understand Spring doesn't care
> about
> > EJB but and vice versa. I am only using spring for the security layer and
> > JavaEE for everything else.
> >
> > So does @SpringBean just convert the EJB to a spring bean.
> >
> > So the only other way to test the EJB approach is to pass a mock value to
> > the constructor and have it check if the value is null as the container
> > will Inject the value.
> >
> > David
> >
> >
> > On 13 February 2017 at 21:20, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> > > https://github.com/dmbeer/wicket-7-spring-security/pull/1
> > > There you go!
> > >
> > > I've removed/commented out the Java EE stuff.
> > > Spring doesn't care about @EJB/@Stateless. As JavaEE doesn't care about
> > > @Component & Co.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Mon, Feb 13, 2017 at 10:05 PM, David Beer <david.m.b...@gmail.com>
> > > wrote:
> > >
> > > > Hi Martin
> > > >
> > > > It appears there was an error when I tried to push the code. I am
> > trying
> > > to
> > > > test AdminPage, and failing to inject the mock from the application
> > > > context.
> > > >
> > > > AdminPage
> > > > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > > > wicket-7-test-spring-security/src/main/java/com/copperarrow/
> > > > pages/AdminPage.java
> > > > AdmingPageTest
> > > > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > > > wicket-7-test-spring-security/src/test/java/com/copperarrow/
> > > > pages/AdminPageTest.java
> > > > UserAccountDataProvider
> > > > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > > > wicket-7-test-spring-security/src/main/java/com/copperarrow/
> > > > model/dataproviders/UserAccountDataProvider.java
> > > >
> > > > This fails unable to attach container because UserDAO is always null
> > even
> > > > though I have added it to the applicationmock context.
> > > >
> > > >
> > > >
> > > > On 13 February 2017 at 19:57, Martin Grigorov <mgrigo...@apache.org>
> > > > wrote:
> > > >
> > > > > Hi David,
> > > > >
> > > > > Please give more information what is not working.
> > > > > There are 3 tests and all pass.
> > > > > I have no idea where to look for a problem.
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Sat, Feb 11, 2017 at 11:12 PM, David Beer <
> david.m.b...@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > Hi Martin
> > > > > >
> > > > > > Thanks for the pointers some left over code from refactoring. I
> > have
> > > > > > created an example project located here
> > > > > > <https://github.com/dmbeer/wicket-7-spring-security/tree/
> > > > > > wicket-7-test-spring-security>
> > > > > > under branch wicket-7-test-spring-security. I am still struggling
> > to
> > > > get
> > > > > > the mocked DAO injected. Any pointers welcome or even a PR if not
> > too
> > > > > much
> > > > > > trouble or example somewhere.
> > > > > >
>

Re: Test Page renders with Nested Panel

2017-02-14 Thread Martin Grigorov
Hi,

I thought you want to use Spring (because the branch name mentions it).
You can do the same with Java EE.
If you use CDI then take a look at
https://github.com/apache/wicket/tree/master/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi
I have no idea how to test @EJB and @Stateless. I haven't used those since
very long time.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Feb 13, 2017 at 11:39 PM, David Beer <david.m.b...@gmail.com> wrote:

> Hi Martin
>
> Thanks for the PR. So the solution is to remove JavaEE EJB references
> rather than to use them and test them. Understand Spring doesn't care about
> EJB but and vice versa. I am only using spring for the security layer and
> JavaEE for everything else.
>
> So does @SpringBean just convert the EJB to a spring bean.
>
> So the only other way to test the EJB approach is to pass a mock value to
> the constructor and have it check if the value is null as the container
> will Inject the value.
>
> David
>
>
> On 13 February 2017 at 21:20, Martin Grigorov <mgrigo...@apache.org>
> wrote:
>
> > https://github.com/dmbeer/wicket-7-spring-security/pull/1
> > There you go!
> >
> > I've removed/commented out the Java EE stuff.
> > Spring doesn't care about @EJB/@Stateless. As JavaEE doesn't care about
> > @Component & Co.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Feb 13, 2017 at 10:05 PM, David Beer <david.m.b...@gmail.com>
> > wrote:
> >
> > > Hi Martin
> > >
> > > It appears there was an error when I tried to push the code. I am
> trying
> > to
> > > test AdminPage, and failing to inject the mock from the application
> > > context.
> > >
> > > AdminPage
> > > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > > wicket-7-test-spring-security/src/main/java/com/copperarrow/
> > > pages/AdminPage.java
> > > AdmingPageTest
> > > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > > wicket-7-test-spring-security/src/test/java/com/copperarrow/
> > > pages/AdminPageTest.java
> > > UserAccountDataProvider
> > > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > > wicket-7-test-spring-security/src/main/java/com/copperarrow/
> > > model/dataproviders/UserAccountDataProvider.java
> > >
> > > This fails unable to attach container because UserDAO is always null
> even
> > > though I have added it to the applicationmock context.
> > >
> > >
> > >
> > > On 13 February 2017 at 19:57, Martin Grigorov <mgrigo...@apache.org>
> > > wrote:
> > >
> > > > Hi David,
> > > >
> > > > Please give more information what is not working.
> > > > There are 3 tests and all pass.
> > > > I have no idea where to look for a problem.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Sat, Feb 11, 2017 at 11:12 PM, David Beer <david.m.b...@gmail.com
> >
> > > > wrote:
> > > >
> > > > > Hi Martin
> > > > >
> > > > > Thanks for the pointers some left over code from refactoring. I
> have
> > > > > created an example project located here
> > > > > <https://github.com/dmbeer/wicket-7-spring-security/tree/
> > > > > wicket-7-test-spring-security>
> > > > > under branch wicket-7-test-spring-security. I am still struggling
> to
> > > get
> > > > > the mocked DAO injected. Any pointers welcome or even a PR if not
> too
> > > > much
> > > > > trouble or example somewhere.
> > > > >
> > > > > Thanks
> > > > >
> > > > > David
> > > > >
> > > > > On 10 February 2017 at 07:46, Martin Grigorov <
> mgrigo...@apache.org>
> > > > > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > >
> > > > > > On Fri, Feb 10, 2017 at 12:08 AM, David Beer <
> > david.m.b...@gmail.com
> > > >
> > > > > > wrote:
> > > > > >
> > > > > > > Hi Guys
> > > > > > >
> > > > > > > I am new to WicketTester and testing pages here. I am also
> > getting
> &g

Re: Test Page renders with Nested Panel

2017-02-13 Thread David Beer
Hi Martin

Thanks for the PR. So the solution is to remove JavaEE EJB references
rather than to use them and test them. Understand Spring doesn't care about
EJB but and vice versa. I am only using spring for the security layer and
JavaEE for everything else.

So does @SpringBean just convert the EJB to a spring bean.

So the only other way to test the EJB approach is to pass a mock value to
the constructor and have it check if the value is null as the container
will Inject the value.

David


On 13 February 2017 at 21:20, Martin Grigorov <mgrigo...@apache.org> wrote:

> https://github.com/dmbeer/wicket-7-spring-security/pull/1
> There you go!
>
> I've removed/commented out the Java EE stuff.
> Spring doesn't care about @EJB/@Stateless. As JavaEE doesn't care about
> @Component & Co.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Feb 13, 2017 at 10:05 PM, David Beer <david.m.b...@gmail.com>
> wrote:
>
> > Hi Martin
> >
> > It appears there was an error when I tried to push the code. I am trying
> to
> > test AdminPage, and failing to inject the mock from the application
> > context.
> >
> > AdminPage
> > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > wicket-7-test-spring-security/src/main/java/com/copperarrow/
> > pages/AdminPage.java
> > AdmingPageTest
> > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > wicket-7-test-spring-security/src/test/java/com/copperarrow/
> > pages/AdminPageTest.java
> > UserAccountDataProvider
> > https://github.com/dmbeer/wicket-7-spring-security/blob/
> > wicket-7-test-spring-security/src/main/java/com/copperarrow/
> > model/dataproviders/UserAccountDataProvider.java
> >
> > This fails unable to attach container because UserDAO is always null even
> > though I have added it to the applicationmock context.
> >
> >
> >
> > On 13 February 2017 at 19:57, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> > > Hi David,
> > >
> > > Please give more information what is not working.
> > > There are 3 tests and all pass.
> > > I have no idea where to look for a problem.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Sat, Feb 11, 2017 at 11:12 PM, David Beer <david.m.b...@gmail.com>
> > > wrote:
> > >
> > > > Hi Martin
> > > >
> > > > Thanks for the pointers some left over code from refactoring. I have
> > > > created an example project located here
> > > > <https://github.com/dmbeer/wicket-7-spring-security/tree/
> > > > wicket-7-test-spring-security>
> > > > under branch wicket-7-test-spring-security. I am still struggling to
> > get
> > > > the mocked DAO injected. Any pointers welcome or even a PR if not too
> > > much
> > > > trouble or example somewhere.
> > > >
> > > > Thanks
> > > >
> > > > David
> > > >
> > > > On 10 February 2017 at 07:46, Martin Grigorov <mgrigo...@apache.org>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > >
> > > > > On Fri, Feb 10, 2017 at 12:08 AM, David Beer <
> david.m.b...@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > Hi Guys
> > > > > >
> > > > > > I am new to WicketTester and testing pages here. I am also
> getting
> > > back
> > > > > > into wicket slowly.
> > > > > >
> > > > > > I have a page which currently simply adds a panel (more to come),
> > the
> > > > > panel
> > > > > > contains a DataTable. I am not interested in the content of the
> > table
> > > > > just
> > > > > > that the page renders with an empty table.
> > > > > >
> > > > > > MyPage -> MyPanel -> Adds a DataTable, using dataproviders.
> > > > > >
> > > > > > The problem is that when I do tester.startPage(MyPage.class) it
> > tries
> > > > to
> > > > > > add the data table and fails unless data provider size is set to
> 0.
> > > > > >
> > > > > > MyPage Code
> > > > > >
> > > > > > public class MyPage extends BasePage {
> > > > > >
> &g

Re: Test Page renders with Nested Panel

2017-02-13 Thread Martin Grigorov
https://github.com/dmbeer/wicket-7-spring-security/pull/1
There you go!

I've removed/commented out the Java EE stuff.
Spring doesn't care about @EJB/@Stateless. As JavaEE doesn't care about
@Component & Co.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Feb 13, 2017 at 10:05 PM, David Beer <david.m.b...@gmail.com> wrote:

> Hi Martin
>
> It appears there was an error when I tried to push the code. I am trying to
> test AdminPage, and failing to inject the mock from the application
> context.
>
> AdminPage
> https://github.com/dmbeer/wicket-7-spring-security/blob/
> wicket-7-test-spring-security/src/main/java/com/copperarrow/
> pages/AdminPage.java
> AdmingPageTest
> https://github.com/dmbeer/wicket-7-spring-security/blob/
> wicket-7-test-spring-security/src/test/java/com/copperarrow/
> pages/AdminPageTest.java
> UserAccountDataProvider
> https://github.com/dmbeer/wicket-7-spring-security/blob/
> wicket-7-test-spring-security/src/main/java/com/copperarrow/
> model/dataproviders/UserAccountDataProvider.java
>
> This fails unable to attach container because UserDAO is always null even
> though I have added it to the applicationmock context.
>
>
>
> On 13 February 2017 at 19:57, Martin Grigorov <mgrigo...@apache.org>
> wrote:
>
> > Hi David,
> >
> > Please give more information what is not working.
> > There are 3 tests and all pass.
> > I have no idea where to look for a problem.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Sat, Feb 11, 2017 at 11:12 PM, David Beer <david.m.b...@gmail.com>
> > wrote:
> >
> > > Hi Martin
> > >
> > > Thanks for the pointers some left over code from refactoring. I have
> > > created an example project located here
> > > <https://github.com/dmbeer/wicket-7-spring-security/tree/
> > > wicket-7-test-spring-security>
> > > under branch wicket-7-test-spring-security. I am still struggling to
> get
> > > the mocked DAO injected. Any pointers welcome or even a PR if not too
> > much
> > > trouble or example somewhere.
> > >
> > > Thanks
> > >
> > > David
> > >
> > > On 10 February 2017 at 07:46, Martin Grigorov <mgrigo...@apache.org>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > >
> > > > On Fri, Feb 10, 2017 at 12:08 AM, David Beer <david.m.b...@gmail.com
> >
> > > > wrote:
> > > >
> > > > > Hi Guys
> > > > >
> > > > > I am new to WicketTester and testing pages here. I am also getting
> > back
> > > > > into wicket slowly.
> > > > >
> > > > > I have a page which currently simply adds a panel (more to come),
> the
> > > > panel
> > > > > contains a DataTable. I am not interested in the content of the
> table
> > > > just
> > > > > that the page renders with an empty table.
> > > > >
> > > > > MyPage -> MyPanel -> Adds a DataTable, using dataproviders.
> > > > >
> > > > > The problem is that when I do tester.startPage(MyPage.class) it
> tries
> > > to
> > > > > add the data table and fails unless data provider size is set to 0.
> > > > >
> > > > > MyPage Code
> > > > >
> > > > > public class MyPage extends BasePage {
> > > > >
> > > > > private NotificationPanel notificationPanel;
> > > > > private BootstrapDefaultDataTable<UserAccount, String> userTable;
> > > > >
> > > >
> > > > This is not used/needed.
> > > >
> > > >
> > > > >
> > > > > public MyPage() {
> > > > > notificationPanel = new NotificationPanel("notification");
> > > > > notificationPanel.setOutputMarkupId(true);
> > > > > notificationPanel.hideAfter(Duration.seconds(2));
> > > > > add(notificationPanel);
> > > > > add(new MyPanel("users-table-panel"));
> > > > > }
> > > > > }
> > > > >
> > > > > MyPanel code
> > > > >
> > > > > public class MyPanel extends Panel {
> > > > >
> > > > > private NotificationPanel notificationPanel;
> > > > > private BootstrapDefaultDataTable<UserAccount, String>
> > userTab

Re: Test Page renders with Nested Panel

2017-02-13 Thread David Beer
Hi Martin

It appears there was an error when I tried to push the code. I am trying to
test AdminPage, and failing to inject the mock from the application context.

AdminPage
https://github.com/dmbeer/wicket-7-spring-security/blob/wicket-7-test-spring-security/src/main/java/com/copperarrow/pages/AdminPage.java
AdmingPageTest
https://github.com/dmbeer/wicket-7-spring-security/blob/wicket-7-test-spring-security/src/test/java/com/copperarrow/pages/AdminPageTest.java
UserAccountDataProvider
https://github.com/dmbeer/wicket-7-spring-security/blob/wicket-7-test-spring-security/src/main/java/com/copperarrow/model/dataproviders/UserAccountDataProvider.java

This fails unable to attach container because UserDAO is always null even
though I have added it to the applicationmock context.



On 13 February 2017 at 19:57, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi David,
>
> Please give more information what is not working.
> There are 3 tests and all pass.
> I have no idea where to look for a problem.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Sat, Feb 11, 2017 at 11:12 PM, David Beer <david.m.b...@gmail.com>
> wrote:
>
> > Hi Martin
> >
> > Thanks for the pointers some left over code from refactoring. I have
> > created an example project located here
> > <https://github.com/dmbeer/wicket-7-spring-security/tree/
> > wicket-7-test-spring-security>
> > under branch wicket-7-test-spring-security. I am still struggling to get
> > the mocked DAO injected. Any pointers welcome or even a PR if not too
> much
> > trouble or example somewhere.
> >
> > Thanks
> >
> > David
> >
> > On 10 February 2017 at 07:46, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > >
> > > On Fri, Feb 10, 2017 at 12:08 AM, David Beer <david.m.b...@gmail.com>
> > > wrote:
> > >
> > > > Hi Guys
> > > >
> > > > I am new to WicketTester and testing pages here. I am also getting
> back
> > > > into wicket slowly.
> > > >
> > > > I have a page which currently simply adds a panel (more to come), the
> > > panel
> > > > contains a DataTable. I am not interested in the content of the table
> > > just
> > > > that the page renders with an empty table.
> > > >
> > > > MyPage -> MyPanel -> Adds a DataTable, using dataproviders.
> > > >
> > > > The problem is that when I do tester.startPage(MyPage.class) it tries
> > to
> > > > add the data table and fails unless data provider size is set to 0.
> > > >
> > > > MyPage Code
> > > >
> > > > public class MyPage extends BasePage {
> > > >
> > > > private NotificationPanel notificationPanel;
> > > > private BootstrapDefaultDataTable<UserAccount, String> userTable;
> > > >
> > >
> > > This is not used/needed.
> > >
> > >
> > > >
> > > > public MyPage() {
> > > > notificationPanel = new NotificationPanel("notification");
> > > > notificationPanel.setOutputMarkupId(true);
> > > > notificationPanel.hideAfter(Duration.seconds(2));
> > > > add(notificationPanel);
> > > > add(new MyPanel("users-table-panel"));
> > > > }
> > > > }
> > > >
> > > > MyPanel code
> > > >
> > > > public class MyPanel extends Panel {
> > > >
> > > > private NotificationPanel notificationPanel;
> > > > private BootstrapDefaultDataTable<UserAccount, String>
> userTable;
> > > >
> > > >
> > > > public UsersTablePanel(String id) {
> > > > super(id);
> > > > notificationPanel = new NotificationPanel("notification");
> > >
> > >
> > > This looks the same as in the page. Maybe one should be removed ?!
> > >
> > >
> > > > notificationPanel.setOutputMarkupId(true);
> > > > notificationPanel.hideAfter(Duration.seconds(2));
> > > > add(notificationPanel);
> > > > usersTable();
> > > > }
> > > >
> > > > private void usersTable() {
> > > > List<IColumn<UserAccount, String>> columns = new
> ArrayList<>();
> > > > columns.add(new PropertyColumn<>(Model.of("First Name"),
> &

Re: Test Page renders with Nested Panel

2017-02-13 Thread Martin Grigorov
Hi David,

Please give more information what is not working.
There are 3 tests and all pass.
I have no idea where to look for a problem.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, Feb 11, 2017 at 11:12 PM, David Beer <david.m.b...@gmail.com> wrote:

> Hi Martin
>
> Thanks for the pointers some left over code from refactoring. I have
> created an example project located here
> <https://github.com/dmbeer/wicket-7-spring-security/tree/
> wicket-7-test-spring-security>
> under branch wicket-7-test-spring-security. I am still struggling to get
> the mocked DAO injected. Any pointers welcome or even a PR if not too much
> trouble or example somewhere.
>
> Thanks
>
> David
>
> On 10 February 2017 at 07:46, Martin Grigorov <mgrigo...@apache.org>
> wrote:
>
> > Hi,
> >
> >
> > On Fri, Feb 10, 2017 at 12:08 AM, David Beer <david.m.b...@gmail.com>
> > wrote:
> >
> > > Hi Guys
> > >
> > > I am new to WicketTester and testing pages here. I am also getting back
> > > into wicket slowly.
> > >
> > > I have a page which currently simply adds a panel (more to come), the
> > panel
> > > contains a DataTable. I am not interested in the content of the table
> > just
> > > that the page renders with an empty table.
> > >
> > > MyPage -> MyPanel -> Adds a DataTable, using dataproviders.
> > >
> > > The problem is that when I do tester.startPage(MyPage.class) it tries
> to
> > > add the data table and fails unless data provider size is set to 0.
> > >
> > > MyPage Code
> > >
> > > public class MyPage extends BasePage {
> > >
> > > private NotificationPanel notificationPanel;
> > > private BootstrapDefaultDataTable<UserAccount, String> userTable;
> > >
> >
> > This is not used/needed.
> >
> >
> > >
> > > public MyPage() {
> > > notificationPanel = new NotificationPanel("notification");
> > > notificationPanel.setOutputMarkupId(true);
> > > notificationPanel.hideAfter(Duration.seconds(2));
> > > add(notificationPanel);
> > > add(new MyPanel("users-table-panel"));
> > > }
> > > }
> > >
> > > MyPanel code
> > >
> > > public class MyPanel extends Panel {
> > >
> > > private NotificationPanel notificationPanel;
> > > private BootstrapDefaultDataTable<UserAccount, String> userTable;
> > >
> > >
> > > public UsersTablePanel(String id) {
> > > super(id);
> > > notificationPanel = new NotificationPanel("notification");
> >
> >
> > This looks the same as in the page. Maybe one should be removed ?!
> >
> >
> > > notificationPanel.setOutputMarkupId(true);
> > > notificationPanel.hideAfter(Duration.seconds(2));
> > > add(notificationPanel);
> > > usersTable();
> > > }
> > >
> > > private void usersTable() {
> > > List<IColumn<UserAccount, String>> columns = new ArrayList<>();
> > > columns.add(new PropertyColumn<>(Model.of("First Name"),
> > > "firstName", "firstName"));
> > > columns.add(new PropertyColumn<>(Model.of("Last Name"),
> > > "lastName"));
> > > columns.add(new PropertyColumn<>(Model.of("Email Address"),
> > > "email"));
> > > columns.add(new PropertyColumn<>(Model.of("Username"),
> > > "userName"));
> > >
> > > userTable = new BootstrapDefaultDataTable<>("users-table",
> > > columns,
> > > new DataProvider(), 20);
> > >
> >
> > Here you create a new DataProvider.
> > Does it use some service (Spring, EJB, Guice,...) to load the items ?!
> >
> >
> > > userTable.add(new TableBehavior().hover().bordered());
> > > add(userTable);
> > > }
> > > }
> > >
> > > MyPageTest Code
> > >
> > > public class AdminViewPageTest extends WicketApplicationTest {
> > >
> > > private WicketTester tester;
> > >
> > > private UsersDataProvider usersDataProvider;
> > >
> > > private AdminViewPage adminViewPage;
> > >
> > > @Before
> > > public void setUp() throws Exception {
> > > super.setUp();
> > > usersDataProvider = mock(UsersDataProvider.class);
> > > adminViewPage = new AdminViewPage();
> > > doNothing().when(usersDataProvider).checkDAO();
> > > when(usersDataProvider.size()).thenReturn(0L);
> > >
> >
> > This usersDataProvider is not really used by UsersTablePanel.java because
> > it creates its own one (new DataProvider()). So the mocking doesn't
> really
> > help.
> >
> >
> > > tester = getTester();
> > > tester.startPage(adminViewPage);
> > > }
> > >
> > > @Test
> > > public void renderSuccessfully() throws Exception {
> > > tester.assertRenderedPage(AdminViewPage.class);
> > > }
> > >
> > > }
> > >
> > > Any pointers would be great.
> > >
> >
> > Usually the DataProviders use some service to load the items and this
> > service is injected (Spring, CDI, ...).
> > Then in your tests you need to provide Dependency Injection context that
> > provides mocked service. This way Wicket will used the mock for the tests
> > and the real service when running the application.
> >
> >
> > >
> > > Thanks
> > >
> > > David
> > >
> >
>


Re: Test Page renders with Nested Panel

2017-02-11 Thread David Beer
Hi Martin

Thanks for the pointers some left over code from refactoring. I have
created an example project located here
<https://github.com/dmbeer/wicket-7-spring-security/tree/wicket-7-test-spring-security>
under branch wicket-7-test-spring-security. I am still struggling to get
the mocked DAO injected. Any pointers welcome or even a PR if not too much
trouble or example somewhere.

Thanks

David

On 10 February 2017 at 07:46, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi,
>
>
> On Fri, Feb 10, 2017 at 12:08 AM, David Beer <david.m.b...@gmail.com>
> wrote:
>
> > Hi Guys
> >
> > I am new to WicketTester and testing pages here. I am also getting back
> > into wicket slowly.
> >
> > I have a page which currently simply adds a panel (more to come), the
> panel
> > contains a DataTable. I am not interested in the content of the table
> just
> > that the page renders with an empty table.
> >
> > MyPage -> MyPanel -> Adds a DataTable, using dataproviders.
> >
> > The problem is that when I do tester.startPage(MyPage.class) it tries to
> > add the data table and fails unless data provider size is set to 0.
> >
> > MyPage Code
> >
> > public class MyPage extends BasePage {
> >
> > private NotificationPanel notificationPanel;
> > private BootstrapDefaultDataTable<UserAccount, String> userTable;
> >
>
> This is not used/needed.
>
>
> >
> > public MyPage() {
> > notificationPanel = new NotificationPanel("notification");
> > notificationPanel.setOutputMarkupId(true);
> > notificationPanel.hideAfter(Duration.seconds(2));
> > add(notificationPanel);
> > add(new MyPanel("users-table-panel"));
> > }
> > }
> >
> > MyPanel code
> >
> > public class MyPanel extends Panel {
> >
> > private NotificationPanel notificationPanel;
> > private BootstrapDefaultDataTable<UserAccount, String> userTable;
> >
> >
> > public UsersTablePanel(String id) {
> > super(id);
> > notificationPanel = new NotificationPanel("notification");
>
>
> This looks the same as in the page. Maybe one should be removed ?!
>
>
> > notificationPanel.setOutputMarkupId(true);
> > notificationPanel.hideAfter(Duration.seconds(2));
> > add(notificationPanel);
> > usersTable();
> > }
> >
> > private void usersTable() {
> > List<IColumn<UserAccount, String>> columns = new ArrayList<>();
> > columns.add(new PropertyColumn<>(Model.of("First Name"),
> > "firstName", "firstName"));
> > columns.add(new PropertyColumn<>(Model.of("Last Name"),
> > "lastName"));
> > columns.add(new PropertyColumn<>(Model.of("Email Address"),
> > "email"));
> > columns.add(new PropertyColumn<>(Model.of("Username"),
> > "userName"));
> >
> > userTable = new BootstrapDefaultDataTable<>("users-table",
> > columns,
> > new DataProvider(), 20);
> >
>
> Here you create a new DataProvider.
> Does it use some service (Spring, EJB, Guice,...) to load the items ?!
>
>
> > userTable.add(new TableBehavior().hover().bordered());
> > add(userTable);
> > }
> > }
> >
> > MyPageTest Code
> >
> > public class AdminViewPageTest extends WicketApplicationTest {
> >
> > private WicketTester tester;
> >
> > private UsersDataProvider usersDataProvider;
> >
> > private AdminViewPage adminViewPage;
> >
> > @Before
> > public void setUp() throws Exception {
> > super.setUp();
> > usersDataProvider = mock(UsersDataProvider.class);
> > adminViewPage = new AdminViewPage();
> > doNothing().when(usersDataProvider).checkDAO();
> > when(usersDataProvider.size()).thenReturn(0L);
> >
>
> This usersDataProvider is not really used by UsersTablePanel.java because
> it creates its own one (new DataProvider()). So the mocking doesn't really
> help.
>
>
> > tester = getTester();
> > tester.startPage(adminViewPage);
> > }
> >
> > @Test
> > public void renderSuccessfully() throws Exception {
> > tester.assertRenderedPage(AdminViewPage.class);
> > }
> >
> > }
> >
> > Any pointers would be great.
> >
>
> Usually the DataProviders use some service to load the items and this
> service is injected (Spring, CDI, ...).
> Then in your tests you need to provide Dependency Injection context that
> provides mocked service. This way Wicket will used the mock for the tests
> and the real service when running the application.
>
>
> >
> > Thanks
> >
> > David
> >
>


Re: Test Page renders with Nested Panel

2017-02-09 Thread Martin Grigorov
Hi,


On Fri, Feb 10, 2017 at 12:08 AM, David Beer <david.m.b...@gmail.com> wrote:

> Hi Guys
>
> I am new to WicketTester and testing pages here. I am also getting back
> into wicket slowly.
>
> I have a page which currently simply adds a panel (more to come), the panel
> contains a DataTable. I am not interested in the content of the table just
> that the page renders with an empty table.
>
> MyPage -> MyPanel -> Adds a DataTable, using dataproviders.
>
> The problem is that when I do tester.startPage(MyPage.class) it tries to
> add the data table and fails unless data provider size is set to 0.
>
> MyPage Code
>
> public class MyPage extends BasePage {
>
> private NotificationPanel notificationPanel;
> private BootstrapDefaultDataTable<UserAccount, String> userTable;
>

This is not used/needed.


>
> public MyPage() {
> notificationPanel = new NotificationPanel("notification");
> notificationPanel.setOutputMarkupId(true);
> notificationPanel.hideAfter(Duration.seconds(2));
> add(notificationPanel);
> add(new MyPanel("users-table-panel"));
> }
> }
>
> MyPanel code
>
> public class MyPanel extends Panel {
>
> private NotificationPanel notificationPanel;
> private BootstrapDefaultDataTable<UserAccount, String> userTable;
>
>
> public UsersTablePanel(String id) {
> super(id);
> notificationPanel = new NotificationPanel("notification");


This looks the same as in the page. Maybe one should be removed ?!


> notificationPanel.setOutputMarkupId(true);
> notificationPanel.hideAfter(Duration.seconds(2));
> add(notificationPanel);
> usersTable();
> }
>
> private void usersTable() {
> List<IColumn<UserAccount, String>> columns = new ArrayList<>();
> columns.add(new PropertyColumn<>(Model.of("First Name"),
> "firstName", "firstName"));
> columns.add(new PropertyColumn<>(Model.of("Last Name"),
> "lastName"));
> columns.add(new PropertyColumn<>(Model.of("Email Address"),
> "email"));
> columns.add(new PropertyColumn<>(Model.of("Username"),
> "userName"));
>
> userTable = new BootstrapDefaultDataTable<>("users-table",
> columns,
> new DataProvider(), 20);
>

Here you create a new DataProvider.
Does it use some service (Spring, EJB, Guice,...) to load the items ?!


> userTable.add(new TableBehavior().hover().bordered());
> add(userTable);
> }
> }
>
> MyPageTest Code
>
> public class AdminViewPageTest extends WicketApplicationTest {
>
> private WicketTester tester;
>
> private UsersDataProvider usersDataProvider;
>
> private AdminViewPage adminViewPage;
>
> @Before
> public void setUp() throws Exception {
> super.setUp();
> usersDataProvider = mock(UsersDataProvider.class);
> adminViewPage = new AdminViewPage();
> doNothing().when(usersDataProvider).checkDAO();
> when(usersDataProvider.size()).thenReturn(0L);
>

This usersDataProvider is not really used by UsersTablePanel.java because
it creates its own one (new DataProvider()). So the mocking doesn't really
help.


> tester = getTester();
> tester.startPage(adminViewPage);
> }
>
> @Test
> public void renderSuccessfully() throws Exception {
> tester.assertRenderedPage(AdminViewPage.class);
> }
>
> }
>
> Any pointers would be great.
>

Usually the DataProviders use some service to load the items and this
service is injected (Spring, CDI, ...).
Then in your tests you need to provide Dependency Injection context that
provides mocked service. This way Wicket will used the mock for the tests
and the real service when running the application.


>
> Thanks
>
> David
>


Test Page renders with Nested Panel

2017-02-09 Thread David Beer
Hi Guys

I am new to WicketTester and testing pages here. I am also getting back
into wicket slowly.

I have a page which currently simply adds a panel (more to come), the panel
contains a DataTable. I am not interested in the content of the table just
that the page renders with an empty table.

MyPage -> MyPanel -> Adds a DataTable, using dataproviders.

The problem is that when I do tester.startPage(MyPage.class) it tries to
add the data table and fails unless data provider size is set to 0.

MyPage Code

public class MyPage extends BasePage {

private NotificationPanel notificationPanel;
private BootstrapDefaultDataTable<UserAccount, String> userTable;

public MyPage() {
notificationPanel = new NotificationPanel("notification");
notificationPanel.setOutputMarkupId(true);
notificationPanel.hideAfter(Duration.seconds(2));
add(notificationPanel);
add(new MyPanel("users-table-panel"));
}
}

MyPanel code

public class MyPanel extends Panel {

private NotificationPanel notificationPanel;
private BootstrapDefaultDataTable<UserAccount, String> userTable;


public UsersTablePanel(String id) {
super(id);
notificationPanel = new NotificationPanel("notification");
notificationPanel.setOutputMarkupId(true);
notificationPanel.hideAfter(Duration.seconds(2));
add(notificationPanel);
usersTable();
}

private void usersTable() {
List<IColumn<UserAccount, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(Model.of("First Name"),
"firstName", "firstName"));
columns.add(new PropertyColumn<>(Model.of("Last Name"),
"lastName"));
columns.add(new PropertyColumn<>(Model.of("Email Address"),
"email"));
columns.add(new PropertyColumn<>(Model.of("Username"), "userName"));

userTable = new BootstrapDefaultDataTable<>("users-table", columns,
new DataProvider(), 20);
userTable.add(new TableBehavior().hover().bordered());
add(userTable);
}
}

MyPageTest Code

public class AdminViewPageTest extends WicketApplicationTest {

private WicketTester tester;

private UsersDataProvider usersDataProvider;

private AdminViewPage adminViewPage;

@Before
public void setUp() throws Exception {
super.setUp();
usersDataProvider = mock(UsersDataProvider.class);
adminViewPage = new AdminViewPage();
doNothing().when(usersDataProvider).checkDAO();
when(usersDataProvider.size()).thenReturn(0L);
tester = getTester();
tester.startPage(adminViewPage);
}

@Test
public void renderSuccessfully() throws Exception {
tester.assertRenderedPage(AdminViewPage.class);
}

}

Any pointers would be great.

Thanks

David


Silk Test for wicket appplication

2017-01-17 Thread durairaj t
Unable to run the recorded Silk Test scripts in the Silk Test tool and
getting the following message in the scripts.


 "id81_hf_0" := ""  , // hidden,
unchanged, value: ""

 "idf_hf_0"  := ""  , // hidden,
unchanged, value: ""


"id81_hf_0", "idf_hf_0"  are wicket dynamically generated component ID, the
load test is failing wherever wicket handling the component id's.



Do we need to do anything to handle the components ID for the Silk Test?


Any Help?


Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-31 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 30. März 2016 um 15:54 schrieben Sie:

> Please create a patch / Pull Request and a ticket.

https://issues.apache.org/jira/browse/WICKET-6133

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Tobias Soloschenko
I also think that this are bugs of the tests. The specific test receive a 
different locale then the environment and so different resources are compared. 
You can see it in the Base64 encoded image test.

kind regards

Tobias

> Am 30.03.2016 um 15:45 schrieb Martin Grigorov <mgrigo...@apache.org>:
> 
> If I try to build Wicket 7.x with de_DE locale the build fails at
> wicket-core:
> 
> Failed tests:
> 
> MinifiedAwareResourceReferenceTest.minifiedResourceAvailable:61->Assert.assertEquals:144->Assert.assertEquals:115
> expected: but was:
> 
> ResouceBundleTest.concatBundle:48->Assert.assertEquals:144->Assert.assertEquals:115
> expected: but was:
> 
> ResourceReferenceLocatingTest.locateMinifiedJavaScriptResourceReference:214->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.min.js"
> but: was "// b_de.js"
> 
> ResourceReferenceLocatingTest.locateMinifiedPackageResourceReference:223->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.min.js"
> but: was "// b_de.js"
> 
> ResourceReferenceLocatingTest.locateNonMinifiedJavaScriptResourceReference:196->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.js"
> but: was "// b_de.js"
> 
> ResourceReferenceLocatingTest.locateNonMinifiedPackageResourceReference:205->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.js"
> but: was "// b_de.js"
> 
> CssUrlReplacerTest.base64EncodedImage:153->Assert.assertThat:923->Assert.assertThat:956
> Expected: a string containing ".class {background-image:
> url(data:image/gif;base64,R0lGODlh1wATAXAAACH5BAEAAP8ALADXA"
> but: was ".class {background-image:
> url(data:image/gif;base64,R0lGODlhUAB4ANUAANbX1hQSEXV0c/f.
> 
> 
> Sigh.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Wed, Mar 30, 2016 at 2:52 PM, Thorsten Schöning <tschoen...@am-soft.de>
> wrote:
> 
>> Guten Tag Thorsten Schöning,
>> am Mittwoch, 30. März 2016 um 14:16 schrieben Sie:
>> 
>>> "mvn --version" should provide all requested info:
>> 
>> No change even with a more current version of Maven:
>> 
>>> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
>> 2015-11-10T17:41:47+01:00)
>>> Maven home: C:\Program Files\Apache Software Foundation\Maven\bin\..
>>> Java version: 1.7.0_80, vendor: Oracle Corporation
>>> Java home: C:\Program Files\Java\jdk1.7.0_80\jre
>>> Default locale: de_DE, platform encoding: Cp1252
>>> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"
>> 
>> The test doesn't even seem to be very platform or locale dependent to
>> me. I don't use a more current JDK 8 because that already fails during
>> compiling or tests in wicket-util. Not sure how to read the output...
>> 
>> Mit freundlichen Grüßen,
>> 
>> Thorsten Schöning
>> 
>> --
>> Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
>> AM-SoFT IT-Systeme  http://www.AM-SoFT.de/
>> 
>> Telefon...05151-  9468- 55
>> Fax...05151-  9468- 88
>> Mobil..0178-8 9468- 04
>> 
>> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
>> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 30. März 2016 um 15:45 schrieben Sie:

> If I try to build Wicket 7.x with de_DE locale the build fails at
> wicket-core:

Not on Windows BTW, I'm building on Ubuntu and Windows and the
wicket-spring problem is currently only on Windows, while the
wicket-core one is only in my Ubuntu. :-)

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Martin Grigorov
Please create a patch / Pull Request and a ticket.
Thank you!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 30, 2016 at 3:49 PM, Thorsten Schöning <tschoen...@am-soft.de>
wrote:

> Guten Tag Thorsten Schöning,
> am Mittwoch, 30. März 2016 um 14:52 schrieben Sie:
>
> > No change even with a more current version of Maven:
>
> I have the feeling that the error is non deterministic somehow,
> because yesterday after upgrading 7.3.0.0 I was so damn sure that the
> error didn't occur anymore, that I removed skipping of the tests from
> my shell script invoking the build. Today the test is failing the
> whole morning.
>
> Now after upgrading Maven I additionally tried without a .m2 folder
> and the tests pass. Another execution directly afterwards with the
> same commands and such, only a present .m2 folder now, the test fails
> for every invocation. So I deleted the .m2 folder again and the tests
> pass now. Executed again with the available .m2 folder and the tests
> fail, pass(!), fail, fail...
>
> This test is buggy, at least "ConfigContextWithGenerics.getStrings"
> doesn't make sense compared to the other method and field names.
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
> AM-SoFT IT-Systeme  http://www.AM-SoFT.de/
>
> Telefon...05151-  9468- 55
> Fax...05151-  9468- 88
> Mobil..0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Martin Grigorov
If I try to build Wicket 7.x with de_DE locale the build fails at
wicket-core:

Failed tests:

MinifiedAwareResourceReferenceTest.minifiedResourceAvailable:61->Assert.assertEquals:144->Assert.assertEquals:115
expected: but was:

ResouceBundleTest.concatBundle:48->Assert.assertEquals:144->Assert.assertEquals:115
expected: but was:

ResourceReferenceLocatingTest.locateMinifiedJavaScriptResourceReference:214->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
TestCase [locale=null, style=null, variation=null, extension=null]
Expected: is "// b.min.js"
 but: was "// b_de.js"

ResourceReferenceLocatingTest.locateMinifiedPackageResourceReference:223->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
TestCase [locale=null, style=null, variation=null, extension=null]
Expected: is "// b.min.js"
 but: was "// b_de.js"

ResourceReferenceLocatingTest.locateNonMinifiedJavaScriptResourceReference:196->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
TestCase [locale=null, style=null, variation=null, extension=null]
Expected: is "// b.js"
 but: was "// b_de.js"

ResourceReferenceLocatingTest.locateNonMinifiedPackageResourceReference:205->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
TestCase [locale=null, style=null, variation=null, extension=null]
Expected: is "// b.js"
 but: was "// b_de.js"

CssUrlReplacerTest.base64EncodedImage:153->Assert.assertThat:923->Assert.assertThat:956
Expected: a string containing ".class {background-image:
url(data:image/gif;base64,R0lGODlh1wATAXAAACH5BAEAAP8ALADXA"
 but: was ".class {background-image:
url(data:image/gif;base64,R0lGODlhUAB4ANUAANbX1hQSEXV0c/f.


Sigh.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 30, 2016 at 2:52 PM, Thorsten Schöning <tschoen...@am-soft.de>
wrote:

> Guten Tag Thorsten Schöning,
> am Mittwoch, 30. März 2016 um 14:16 schrieben Sie:
>
> > "mvn --version" should provide all requested info:
>
> No change even with a more current version of Maven:
>
> > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
> 2015-11-10T17:41:47+01:00)
> > Maven home: C:\Program Files\Apache Software Foundation\Maven\bin\..
> > Java version: 1.7.0_80, vendor: Oracle Corporation
> > Java home: C:\Program Files\Java\jdk1.7.0_80\jre
> > Default locale: de_DE, platform encoding: Cp1252
> > OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"
>
> The test doesn't even seem to be very platform or locale dependent to
> me. I don't use a more current JDK 8 because that already fails during
> compiling or tests in wicket-util. Not sure how to read the output...
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
> AM-SoFT IT-Systeme  http://www.AM-SoFT.de/
>
> Telefon...05151-  9468- 55
> Fax...05151-  9468- 88
> Mobil..0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Mittwoch, 30. März 2016 um 14:52 schrieben Sie:

> No change even with a more current version of Maven:

I have the feeling that the error is non deterministic somehow,
because yesterday after upgrading 7.3.0.0 I was so damn sure that the
error didn't occur anymore, that I removed skipping of the tests from
my shell script invoking the build. Today the test is failing the
whole morning.

Now after upgrading Maven I additionally tried without a .m2 folder
and the tests pass. Another execution directly afterwards with the
same commands and such, only a present .m2 folder now, the test fails
for every invocation. So I deleted the .m2 folder again and the tests
pass now. Executed again with the available .m2 folder and the tests
fail, pass(!), fail, fail...

This test is buggy, at least "ConfigContextWithGenerics.getStrings"
doesn't make sense compared to the other method and field names.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Martin Grigorov
But wicket-spring passes even with de_DE.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 30, 2016 at 3:45 PM, Martin Grigorov <mgrigo...@apache.org>
wrote:

> If I try to build Wicket 7.x with de_DE locale the build fails at
> wicket-core:
>
> Failed tests:
>
> MinifiedAwareResourceReferenceTest.minifiedResourceAvailable:61->Assert.assertEquals:144->Assert.assertEquals:115
> expected: but was:
>
> ResouceBundleTest.concatBundle:48->Assert.assertEquals:144->Assert.assertEquals:115
> expected: but was:
>
> ResourceReferenceLocatingTest.locateMinifiedJavaScriptResourceReference:214->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.min.js"
>  but: was "// b_de.js"
>
> ResourceReferenceLocatingTest.locateMinifiedPackageResourceReference:223->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.min.js"
>  but: was "// b_de.js"
>
> ResourceReferenceLocatingTest.locateNonMinifiedJavaScriptResourceReference:196->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.js"
>  but: was "// b_de.js"
>
> ResourceReferenceLocatingTest.locateNonMinifiedPackageResourceReference:205->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
> TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.js"
>  but: was "// b_de.js"
>
> CssUrlReplacerTest.base64EncodedImage:153->Assert.assertThat:923->Assert.assertThat:956
> Expected: a string containing ".class {background-image:
> url(data:image/gif;base64,R0lGODlh1wATAXAAACH5BAEAAP8ALADXA"
>  but: was ".class {background-image:
> url(data:image/gif;base64,R0lGODlhUAB4ANUAANbX1hQSEXV0c/f.
>
>
> Sigh.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Mar 30, 2016 at 2:52 PM, Thorsten Schöning <tschoen...@am-soft.de>
> wrote:
>
>> Guten Tag Thorsten Schöning,
>> am Mittwoch, 30. März 2016 um 14:16 schrieben Sie:
>>
>> > "mvn --version" should provide all requested info:
>>
>> No change even with a more current version of Maven:
>>
>> > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
>> 2015-11-10T17:41:47+01:00)
>> > Maven home: C:\Program Files\Apache Software Foundation\Maven\bin\..
>> > Java version: 1.7.0_80, vendor: Oracle Corporation
>> > Java home: C:\Program Files\Java\jdk1.7.0_80\jre
>> > Default locale: de_DE, platform encoding: Cp1252
>> > OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"
>>
>> The test doesn't even seem to be very platform or locale dependent to
>> me. I don't use a more current JDK 8 because that already fails during
>> compiling or tests in wicket-util. Not sure how to read the output...
>>
>> Mit freundlichen Grüßen,
>>
>> Thorsten Schöning
>>
>> --
>> Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
>> AM-SoFT IT-Systeme  http://www.AM-SoFT.de/
>>
>> Telefon...05151-  9468- 55
>> Fax...05151-  9468- 88
>> Mobil..0178-8 9468- 04
>>
>> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
>> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Mittwoch, 30. März 2016 um 14:16 schrieben Sie:

> "mvn --version" should provide all requested info:

No change even with a more current version of Maven:

> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
> 2015-11-10T17:41:47+01:00)
> Maven home: C:\Program Files\Apache Software Foundation\Maven\bin\..
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

The test doesn't even seem to be very platform or locale dependent to
me. I don't use a more current JDK 8 because that already fails during
compiling or tests in wicket-util. Not sure how to read the output...

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 30. März 2016 um 12:42 schrieben Sie:

> The tests pass successfully here and at the CI server.
> Which version of JDK and Maven do you use? What is the system locale ?

"mvn --version" should provide all requested info:

> Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 
> 17:22:22+0200)
> Maven home: C:\Program Files (x86)\Apache Maven\bin\..
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test with IMarkupResourceStreamProvider and using IMarkupResourceStreamProvider for input

2016-03-30 Thread Martin Grigorov
Hi,

On Wed, Mar 30, 2016 at 11:08 AM, andre seame  wrote:

> Hello,
>
> 1°) According the advices of this mailing list, I try to use
> IMarkupResourceStreamProvider as described in
>
> https://ci.apache.org/projects/wicket/guide/7.x/guide/single.html#advanced_5
>
> When using something like:
>
> public class AutoMarkupGenPanel extends Panel implements
> IMarkupResourceStreamProvider
>  {
> public AutoMarkupGenPanel(String id, IModel model)
>   {
> super(id, model);
> }
>
> @Override
> public IResourceStream getMarkupResourceStream(MarkupContainer
> container,
> Class containerClass)
>{
> String markup = "Panel markup";
> StringResourceStream resourceStream = new
> StringResourceStream(markup);
> return resourceStream;
> }
> }
> I get :
> Last cause: Expected to find  in associated markup file.
> Markup: org.apache.wicket.util.resource.StringResourceStream@761796f3
> :
>
> Misunderstanding or bug in documentation?
>

Bug in the documentation.


>
> 2°) If I change the markup to: String markup = " my dynamic
> code ";
> It is OK.
>
> If I declare class AutoMarkupGenPanel extends Panel as class
> AutoMarkupGenPanel extends Label, it does not work. It seems just as
> getMarkupResourceStream is not called.
>

Label is not MarkupContainer, it is a WebComponent. So it depends on its
parent to provide its markup.
It is a bit confusing, I see, but this is how it works.


>
>
> 3°) I want to have is :  />";
>
> It fails:
>
> Root cause:
>
> Unable to find component with id 'dateTo' in [InputText [Component id =
> after]]
> Expected:
> 'filterForm:tableWithFilterForm:topToolbars:toolbars:3:headers:6:header:panel:after:dateTo'.
> Found with similar names: 'filterForm:dateTo'
>

It seems you add the Panel directly to the "filterForm", while you should
add it much deeper in its hierarchy.


>  MarkupStream: [markup =
> org.apache.wicket.util.resource.StringResourceStream@3055f58b:
> 
> , index = 1,
> current =  '' (line 0, column 0)]
>  at
> org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526)
>
> Is it possible to use IMarkupResourceStreamProvider  in this use case ?
>
>
> Thanks for any idea or pointers.
>
> PHL.
>
>


Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Martin Grigorov
Hi,

The tests pass successfully here and at the CI server.
Which version of JDK and Maven do you use? What is the system locale ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 30, 2016 at 12:05 PM, Thorsten Schöning <tschoen...@am-soft.de>
wrote:

> Hi all,
>
> I try to build 7.3.0.0-SNAPSHOT from source, but there's at least the
> following failing test. Skipping the tests builds OK and the results
> seem to work, but that shouldn't be necessary, right?
>
> [...]
> > Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.398
> sec - in org.apache.wicket.spring.injection.annot.SpringBeanTest
> > Running
> org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest
> > Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.557
> sec <<< FAILURE! - in
> org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTestlistField(org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest)
> > Time elapsed: 0.072 sec  <<< FAILURE!
> > java.lang.AssertionError: expected:<3> but was:<1>
> > at org.junit.Assert.fail(Assert.java:88)
> > at org.junit.Assert.failNotEquals(Assert.java:834)
> > at org.junit.Assert.assertEquals(Assert.java:645)
> > at org.junit.Assert.assertEquals(Assert.java:631)
> > at
> org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest.listField(SpringBeanWithGenericsTest.java:143)
> [...]
>
> The mentioned line is the last one of the following quote:
>
> > @Test
> > public void listField() throws Exception
> > {
> > AnnotatedListField page =
> > tester.startPage(new AnnotatedListField());
> >
> > assertNotNull(page.getStringsList());
> > assertEquals(3, page.getStringsList().size());
>
> I've found the following commit, which introduced "getStringsList":
>
>
> https://github.com/apache/wicket/commit/f0340a3ef62a18df14badb26acee01bf102b9a2c
>
> The interesting part for me about that commit is that
> "ConfigContextWithGenerics.getStrings" in the same file was NOT
> changed as well. So I renamed to .stringsList and that did have an
> effect, now another test is failing instead:
>
> > Failed tests:
> >
>  
> SpringBeanWithGenericsTest.listField:147->Assert.assertThat:923->Assert.assert
> > That:956
> > Expected: is <3>
> >  but: was <1>
>
> The only 1 element list in the class is "myList", so I guess that
> "arrayListStrings" can't be found properly as well, only this time not
> because of a wrong name, but maybe signature problems.
>
> In the end, this test seems broken to me... Any further ideas, should
> I file a bug? Thanks!
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
> AM-SoFT IT-Systeme  http://www.AM-SoFT.de/
>
> Telefon...05151-  9468- 55
> Fax...05151-  9468- 88
> Mobil..0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Hi all,

I try to build 7.3.0.0-SNAPSHOT from source, but there's at least the
following failing test. Skipping the tests builds OK and the results
seem to work, but that shouldn't be necessary, right?

[...]
> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.398 sec - 
> in org.apache.wicket.spring.injection.annot.SpringBeanTest
> Running org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest
> Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.557 sec <<< 
> FAILURE! - in 
> org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTestlistField(org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest)
> Time elapsed: 0.072 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<3> but was:<1>
> at org.junit.Assert.fail(Assert.java:88)
> at org.junit.Assert.failNotEquals(Assert.java:834)
> at org.junit.Assert.assertEquals(Assert.java:645)
> at org.junit.Assert.assertEquals(Assert.java:631)
> at 
> org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest.listField(SpringBeanWithGenericsTest.java:143)
[...]

The mentioned line is the last one of the following quote:

> @Test
> public void listField() throws Exception
> {
> AnnotatedListField page =
> tester.startPage(new AnnotatedListField());
>
> assertNotNull(page.getStringsList());
> assertEquals(3, page.getStringsList().size());

I've found the following commit, which introduced "getStringsList":

https://github.com/apache/wicket/commit/f0340a3ef62a18df14badb26acee01bf102b9a2c

The interesting part for me about that commit is that
"ConfigContextWithGenerics.getStrings" in the same file was NOT
changed as well. So I renamed to .stringsList and that did have an
effect, now another test is failing instead:

> Failed tests:
>   
> SpringBeanWithGenericsTest.listField:147->Assert.assertThat:923->Assert.assert
> That:956
> Expected: is <3>
>  but: was <1>

The only 1 element list in the class is "myList", so I guess that
"arrayListStrings" can't be found properly as well, only this time not
because of a wrong name, but maybe signature problems.

In the end, this test seems broken to me... Any further ideas, should
I file a bug? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Test with IMarkupResourceStreamProvider and using IMarkupResourceStreamProvider for input

2016-03-30 Thread andre seame
Hello,

1°) According the advices of this mailing list, I try to use 
IMarkupResourceStreamProvider as described in
https://ci.apache.org/projects/wicket/guide/7.x/guide/single.html#advanced_5

When using something like:

public class AutoMarkupGenPanel extends Panel implements 
IMarkupResourceStreamProvider
 {
public AutoMarkupGenPanel(String id, IModel model)
  {
super(id, model);
}

@Override
public IResourceStream getMarkupResourceStream(MarkupContainer 
container,
Class containerClass)
   {
String markup = "Panel markup";
StringResourceStream resourceStream = new 
StringResourceStream(markup);
return resourceStream;
}
}
I get :
Last cause: Expected to find  in associated markup file. Markup: 
org.apache.wicket.util.resource.StringResourceStream@761796f3:

Misunderstanding or bug in documentation?

2°) If I change the markup to: String markup = " my dynamic code 
";
It is OK.

If I declare class AutoMarkupGenPanel extends Panel as class AutoMarkupGenPanel 
extends Label, it does not work. It seems just as getMarkupResourceStream is 
not called.


3°) I want to have is : ";

It fails:

Root cause:

Unable to find component with id 'dateTo' in [InputText [Component id = after]]
Expected: 
'filterForm:tableWithFilterForm:topToolbars:toolbars:3:headers:6:header:panel:after:dateTo'.
Found with similar names: 'filterForm:dateTo'
 MarkupStream: [markup = 
org.apache.wicket.util.resource.StringResourceStream@3055f58b: 

, index = 1, current =  
'' (line 0, column 0)]
 at 
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526)

Is it possible to use IMarkupResourceStreamProvider  in this use case ?


Thanks for any idea or pointers.

PHL.



Re: How to test drop down by changing value multiple times?

2016-01-29 Thread bilguun
Thank you Martin, 

Yeah, that was absolutely one that I needed. It works great now!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673468p4673473.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to test drop down by changing value multiple times?

2016-01-28 Thread Martin Grigorov
Hi,

You need to submit after the selection: formTester.submit().

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 28, 2016 at 9:44 PM, bilguun <ariunboldbilig...@gmail.com>
wrote:

> Hi, I am testing Drop down by selecting different values couple of times.
> Here is my code:
>
> FormTester formTester = tester.newFormTester("panel:form");
> // 0 - 2014; 1 - 2015; 2 - 2016
> formTester.select("year", 1);
> tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
> "$2,115");
> //
>
> formTester.select("year", 2);
> tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
> "$2,115");
>
> In this case, second one should be failed because of that it supposed to
> show $2,116 instead of $2,115 but it's not. I guess second select("year",
> 2)
> is not working. Do you have any idea how to do this kind of test?
>
> Thank you
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673467.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: How to test drop down by changing value multiple times?

2016-01-28 Thread Sven Meier

Hi,

do you have an ajaxBehavior on the year selector?

Because FormTester#select() won't trigger it, you'll have to submit the 
form.


Regards
Sven


On 28.01.2016 21:44, bilguun wrote:

Hi, I am testing Drop down by selecting different values couple of times.
Here is my code:

FormTester formTester = tester.newFormTester("panel:form");
// 0 - 2014; 1 - 2015; 2 - 2016
formTester.select("year", 1);
tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
"$2,115");
//

formTester.select("year", 2);
tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
"$2,115");

In this case, second one should be failed because of that it supposed to
show $2,116 instead of $2,115 but it's not. I guess second select("year", 2)
is not working. Do you have any idea how to do this kind of test?

Thank you

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673467.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to test drop down by changing value multiple times?

2016-01-28 Thread bilguun
Hi, I am testing Drop down by selecting different values couple of times.
Here is my code:

FormTester formTester = tester.newFormTester("panel:form");
// 0 - 2014; 1 - 2015; 2 - 2016
formTester.select("year", 1);
tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
"$2,115");
//

formTester.select("year", 2);
tester.assertLabel("panel:form:subAccounts:0:accounts:0:budgeted",
"$2,115");

In this case, second one should be failed because of that it supposed to
show $2,116 instead of $2,115 but it's not. I guess second select("year", 2)
is not working. Do you have any idea how to do this kind of test?

Thank you

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-test-drop-down-by-changing-value-multiple-times-tp4673467.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Jsession Test Question

2015-12-10 Thread Lois GreeneHernandez
Hi All,

Is it possible to write a unit test or a pojo that tests an request url for the 
presence of a jsessionid?  My application Is java/wicket.  Our test system is 
testNG and wicket tester.

Thanks

Lois


Re: Jsession Test Question

2015-12-10 Thread Richard W. Adams
The short answer is no. The session ID is not part of the URL.

The long answer is, you can test for the session ID if you have access to 
the HTTP request object.




From:   Lois GreeneHernandez <lgreenehernan...@knoa.com>
To: "users@wicket.apache.org" <users@wicket.apache.org>
Date:   12/10/2015 01:50 PM
Subject:Jsession Test Question



This email originated from outside of the company.  Please use discretion 
if opening attachments or clicking on links.

Hi All,

Is it possible to write a unit test or a pojo that tests an request url 
for the presence of a jsessionid?  My application Is java/wicket.  Our 
test system is testNG and wicket tester.

Thanks

Lois



**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


RE: Jsession Test Question

2015-12-10 Thread Ephraim Rosenfeld
I would have to do further research, but some ideas:
*   This example shows how to simulate putting a URL in browser, which is 
helpful for mounted pages: 
https://ci.apache.org/projects/wicket/guide/6.x/guide/testing.html#testing_1<https://ci.apache.org/projects/wicket/guide/6.x/guide/testing.html%23testing_1>
*   The 
WicketTester<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/util/tester/BaseWicketTester.html>
 class has some useful methods, like getHttpSession, getLastRequest, 
getLastResponse. These may allow you to find some information regarding the URL

I would try the latter first, just printing out what the request and response 
data have.

- Ephraim

-Original Message-
From: Lois GreeneHernandez [mailto:lgreenehernan...@knoa.com]
Sent: Thursday, December 10, 2015 2:51 PM
To: users@wicket.apache.org
Subject: Jsession Test Question

Hi All,

Is it possible to write a unit test or a pojo that tests an request url for the 
presence of a jsessionid?  My application Is java/wicket.  Our test system is 
testNG and wicket tester.

Thanks

Lois



Re: Jsession Test Question

2015-12-10 Thread Martin Grigorov
Hi,

WicketTester *simulates* a browser and a web server.
In a normal setup the web server (like Tomcat) generates and encodes the
jsessionid in the url.
WicketTester creates a Wicket Session for the test(s) and there is no need
of transferring jsessionid in the url/cookie.
You can use tester.executeUrl(";jsessionid=123456") and assert for it
in your server code by using getWebRequest().getUrl().toString() but this
is very artificial.

In your application code you can use
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getRequestedSessionId()
and
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#isRequestedSessionIdFromURL()
Maybe WicketTester should add support for those.
Currently the code in MockHttpServletRequest looks like:


/**
 * Check whether session id is from a cookie. Always returns true.
 *
 * @return Always true
 */
@Override
public boolean isRequestedSessionIdFromCookie()
{
   return true;
}

/**
 * Check whether session id is from a url rewrite. Always returns false.
 *
 * @return Always false
 */
@Override
public boolean isRequestedSessionIdFromUrl()
{
   return false;
}



Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 10, 2015 at 8:50 PM, Lois GreeneHernandez <
lgreenehernan...@knoa.com> wrote:

> Hi All,
>
> Is it possible to write a unit test or a pojo that tests an request url
> for the presence of a jsessionid?  My application Is java/wicket.  Our test
> system is testNG and wicket tester.
>
> Thanks
>
> Lois
>


Wicket page test 3.0.1 is now available (for Wicket 7.0 and 6.x)

2015-08-26 Thread Kent Tong
Dear all,

Wicket page test 3.0.1 is now available. It now works with Wicket 7 (and
6.x) and can reliably wait for the loading of the response page.

It is a library allowing you to unit test your Wicket pages easily,
supporting AJAX and Javascript without changes to your pages.

It's available from maven central. Check out the tutorial at
http://wicketpagetest.sourceforge.net to get started!

-- 
Kent Tong
IT author and consultant, child education coach


Re: Wicket 6 - test ajax component.

2015-07-22 Thread gump lee
Thanks for your reply. I would try to use other testing method to test my
component.
On Jul 21, 2015 4:47 PM, andrea del bene an.delb...@gmail.com wrote:

 Hi,

 I don't think it's possible to send a specific key as this requires
 JavaScript code to be executed. But you can test AJAX events:

 //simulate an AJAX click event
 tester.executeAjaxEvent(label, click);


 See 'Testing AJAX events' in the userguide for more details.

 Andrea.

 On 20/07/2015 16:27, gump lee wrote:

 Dear All,

 Is it possible to write a unit test with WicketTester which I need to send
 Enter key to an AJAX component?


 Best regards,
 Gump



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket 6 - test ajax component.

2015-07-21 Thread andrea del bene

Hi,

I don't think it's possible to send a specific key as this requires 
JavaScript code to be executed. But you can test AJAX events:


//simulate an AJAX click event
tester.executeAjaxEvent(label, click);


See 'Testing AJAX events' in the userguide for more details.

Andrea.

On 20/07/2015 16:27, gump lee wrote:

Dear All,

Is it possible to write a unit test with WicketTester which I need to send
Enter key to an AJAX component?


Best regards,
Gump




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket 6 - test ajax component.

2015-07-20 Thread gump lee
Dear All,

Is it possible to write a unit test with WicketTester which I need to send
Enter key to an AJAX component?


Best regards,
Gump


Wicket page test 3.0.0 is now available (for Wicket 6.x)

2015-02-23 Thread Kent Tong
Dear all,

Wicket page test 3.0.0 is now available. It now works with Wicket 6.x and
Selenium 2. It is a library allowing you to unit test your Wicket pages
easily, supporting AJAX and Javascript without changes to your pages.

It's available from maven central. Check out the tutorial at
http://wicketpagetest.sourceforge.net to get started!

-- 
Kent Tong
IT author and consultant, TipTec Development


Re: Wicket page test 3.0.0 is now available (for Wicket 6.x)

2015-02-23 Thread Tobias Soloschenko
Thanks for sharing the information!

kind regards

Tobias

 Am 24.02.2015 um 07:08 schrieb Kent Tong kent.tong...@gmail.com:
 
 Dear all,
 
 Wicket page test 3.0.0 is now available. It now works with Wicket 6.x and
 Selenium 2. It is a library allowing you to unit test your Wicket pages
 easily, supporting AJAX and Javascript without changes to your pages.
 
 It's available from maven central. Check out the tutorial at
 http://wicketpagetest.sourceforge.net to get started!
 
 -- 
 Kent Tong
 IT author and consultant, TipTec Development

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RenderStrategy REDIRECT_TO_RENDER lets fail Test with startComponentInPage

2014-08-20 Thread Dirk Forchel
Hi,
after I have changed the RenderStrategy from REDIRECT_TO_BUFFER to
REDIRECT_TO_RENDER one of our tests fails. Actually I could not figure out
why the markup is not found although it is created, but the test fails with
a MarkupNotFoundException. I'm wondering why?

Here is the stacktrace:

org.apache.wicket.markup.MarkupNotFoundException: Can not determine Markup.
Component is not yet connected to a parent. [Page class =
org.apache.wicket.util.tester.BaseWicketTester$StartComponentInPage, id = 0,
render count = 1]
at org.apache.wicket.Component.getMarkup(Component.java:749)
at
org.apache.wicket.util.tester.BaseWicketTester$StartComponentInPage.getMarkup(BaseWicketTester.java:1453)
at org.apache.wicket.Component.internalRender(Component.java:2309)
at org.apache.wicket.Component.render(Component.java:2272)
at org.apache.wicket.Page.renderPage(Page.java:1024)
at
org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:122)
at
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:221)
at
org.apache.wicket.util.tester.BaseWicketTester$LastPageRecordingPageRendererProvider$1.respond(BaseWicketTester.java:2657)
at
org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
at
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:654)
at
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:712)
at
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:593)
at
org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:818)
at
org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:835)
at
org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1387)
at
org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1317)
at org.foo.StatelessTest.testComponents(StatelessTest.java:97)


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RenderStrategy-REDIRECT-TO-RENDER-lets-fail-Test-with-startComponentInPage-tp4667101.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: RenderStrategy REDIRECT_TO_RENDER lets fail Test with startComponentInPage

2014-08-20 Thread Martin Grigorov
Hi,

Can you reproduce this in a quickstart ?
If YES then please attach it to a ticket in JIRA and I'll take a look.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


On Wed, Aug 20, 2014 at 11:06 AM, Dirk Forchel dirk.forc...@exedio.com
wrote:

 Hi,
 after I have changed the RenderStrategy from REDIRECT_TO_BUFFER to
 REDIRECT_TO_RENDER one of our tests fails. Actually I could not figure out
 why the markup is not found although it is created, but the test fails with
 a MarkupNotFoundException. I'm wondering why?

 Here is the stacktrace:

 org.apache.wicket.markup.MarkupNotFoundException: Can not determine Markup.
 Component is not yet connected to a parent. [Page class =
 org.apache.wicket.util.tester.BaseWicketTester$StartComponentInPage, id =
 0,
 render count = 1]
 at org.apache.wicket.Component.getMarkup(Component.java:749)
 at

 org.apache.wicket.util.tester.BaseWicketTester$StartComponentInPage.getMarkup(BaseWicketTester.java:1453)
 at org.apache.wicket.Component.internalRender(Component.java:2309)
 at org.apache.wicket.Component.render(Component.java:2272)
 at org.apache.wicket.Page.renderPage(Page.java:1024)
 at

 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:122)
 at

 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:221)
 at

 org.apache.wicket.util.tester.BaseWicketTester$LastPageRecordingPageRendererProvider$1.respond(BaseWicketTester.java:2657)
 at

 org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
 at

 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
 at

 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
 at

 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
 at

 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
 at

 org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:654)
 at

 org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:712)
 at

 org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:593)
 at

 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:818)
 at

 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:835)
 at

 org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1387)
 at

 org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1317)
 at org.foo.StatelessTest.testComponents(StatelessTest.java:97)


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/RenderStrategy-REDIRECT-TO-RENDER-lets-fail-Test-with-startComponentInPage-tp4667101.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: RenderStrategy REDIRECT_TO_RENDER lets fail Test with startComponentInPage

2014-08-20 Thread Dirk Forchel
Yes I can, the quickstart is already attached (see above).

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RenderStrategy-REDIRECT-TO-RENDER-lets-fail-Test-with-startComponentInPage-tp4667101p4667103.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



TDD - End to End acceptance test - how to set form field values

2014-06-02 Thread lucast
Dear Forum,

I'm trying to (retro) fit TDD into my Wicket project (Wicket Spring
Hibernate) after reading growing object-oriented software guided by tests
by Steve Freeman and Nat Pryce.

One of the first thing the book suggest is to write an acceptance test for
each feature.

The simple feature I want to test is a user login.

Here are my steps to take:
1 create organisation
2 create user
   2.a set username
   2.b set password
   2.c set email
   2.d set organisation
3 start application
4 render login page
5 populate username and password fields
6 assert successful login

I am following the example from  Wicket's Wiki Spring Unit Testing the Proxy
Approach
https://cwiki.apache.org/confluence/display/WICKET/Spring#Spring-UnitTestingtheProxyApproach
 
. 

So far, I can render the login page and assert the form components.

How do I set the form username and password before calling
WicketTester.submitForm()?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TDD-End-to-End-acceptance-test-how-to-set-form-field-values-tp4666093.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: TDD - End to End acceptance test - how to set form field values

2014-06-02 Thread Martin Grigorov
Hi,


On Mon, Jun 2, 2014 at 1:33 PM, lucast lucastol...@hotmail.com wrote:

 Dear Forum,

 I'm trying to (retro) fit TDD into my Wicket project (Wicket Spring
 Hibernate) after reading growing object-oriented software guided by tests
 by Steve Freeman and Nat Pryce.

 One of the first thing the book suggest is to write an acceptance test for
 each feature.

 The simple feature I want to test is a user login.

 Here are my steps to take:
 1 create organisation
 2 create user
2.a set username
2.b set password
2.c set email
2.d set organisation
 3 start application
 4 render login page
 5 populate username and password fields
 6 assert successful login

 I am following the example from  Wicket's Wiki Spring Unit Testing the
 Proxy
 Approach
 
 https://cwiki.apache.org/confluence/display/WICKET/Spring#Spring-UnitTestingtheProxyApproach
 
 .

 So far, I can render the login page and assert the form components.

 How do I set the form username and password before calling
 WicketTester.submitForm()?


FormTester formTester = tester.newFormTester(formId);
formTester.setValue(relative:path:to:textFieldId, John);
formTester.setValue(relative:path:to:passwordId, secret)
formTester.submit()



 Thanks in advance,
 Lucas

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/TDD-End-to-End-acceptance-test-how-to-set-form-field-values-tp4666093.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket CDI application junit test

2014-04-17 Thread Duke
Hi Stepan!
Do you try DeltaSpike yourself? I try to run cdi in tests just like in  this
guide
http://struberg.wordpress.com/2012/03/27/unit-testing-strategies-for-cdi-based-projects/
 
. And weld-se is failed in a simple test debuuging on a cdiContainer.boot();
with many WELD-001409 exceptions, like this:
Testcase: LoginPageTest:Caused an ERROR
Exception List with 5 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous
dependencies for type DeltaSpikeContextExtension with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private
org.apache.deltaspike.core.impl.scope.conversation.GroupedConversationArtifactProducer.deltaSpikeContextExtension
  at
org.apache.deltaspike.core.impl.scope.conversation.GroupedConversationArtifactProducer.deltaSpikeContextExtension(GroupedConversationArtifactProducer.java:0)
  Possible dependencies: 
  - Extension [class
org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension] with
qualifiers [@Default];
jar:file:/C:/projects/WebApplication1/lib/DeltaSpike-0.6/deltaspike-core-impl-0.6.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@25[org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension@1571a74],
  - org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider$Hk2Bean@52b341

Can you show me the right way to find a solution? Where I may make mistakes?

PS I use NB8.0, GF4.0.1 with weld upgraded to 2.0.5Final, Ecipselink-2.5.2
and wicket 6.14 with wicket-cdi 1.1 module.

Best regards,
Andrey

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665459.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket CDI application junit test

2014-04-15 Thread Martin Grigorov
Hi,

See https://issues.apache.org/jira/browse/WICKET-5264

Martin Grigorov
Wicket Training and Consulting


On Tue, Apr 15, 2014 at 6:29 AM, Duke warlock9...@gmail.com wrote:

 Hi all.
 Tried to build simple example with EntityManager injection:

 public class LoginPage extends BasePage {

 @Inject EntityManager em;
 ...
 }

 public class Application extends WebApplication {
 @Override
 protected void init() {
 super.init();
 new CdiConfiguration().configure(this);
 }
 }

 It fails on new CdiConfiguration().configure(this); with message:
 Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-70
 Simple
 bean [EnhancedAnnotatedTypeImpl]  class
 org.apache.wicket.markup.html.panel.FeedbackPanel$1 cannot be a non-static
 inner class
 at

 org.jboss.weld.injection.producer.BasicInjectionTarget.checkType(BasicInjectionTarget.java:81)
 at

 org.jboss.weld.injection.producer.BasicInjectionTarget.init(BasicInjectionTarget.java:69)
 at

 org.jboss.weld.injection.producer.BeanInjectionTarget.init(BeanInjectionTarget.java:52)
 at

 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:95)
 at

 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:78)

 If I comment line with configuring of CdiConfiguration, all injections are
 nulls ((
 What I am doing wrong?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665402.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket CDI application junit test

2014-04-15 Thread Duke
Thanks Martin, I read WICKET-5264, but I don't understand... I havn't any
injections in anonymous inner classes in my code. I try to inject
EntityManager in public class LoginPage.
If I remove any injections, fail remains. It disappers only if I remove 
{ new CdiConfiguration().configure(this); } in Application.init(), but my
injections are nulls in this case.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665412.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket CDI application junit test

2014-04-15 Thread Martin Grigorov
Hi,

The ticket and its related ticket (
https://issues.apache.org/jira/browse/WICKET-5226) explain that using CDI
1.0 in container that supports CDI 1.1 leads to these errors.
wicket-cdi integration tries to process all components (even Wicket's own
ones) for CDI annotations.

If you use a container that supports CDI 1.1 (like JBoss WildFly, Glassfish
4.x, etc.) then use wicket-cdi-1.1 module.
Another solution is to upgrade WELD to a newer version. 2.1.2 has the fix I
believe.

Check Wicket mail archives for this error. There is better explanation
about the problem by Emond.

Martin Grigorov
Wicket Training and Consulting


On Tue, Apr 15, 2014 at 11:49 AM, Duke warlock9...@gmail.com wrote:

 Thanks Martin, I read WICKET-5264, but I don't understand... I havn't any
 injections in anonymous inner classes in my code. I try to inject
 EntityManager in public class LoginPage.
 If I remove any injections, fail remains. It disappers only if I remove
 { new CdiConfiguration().configure(this); } in Application.init(), but my
 injections are nulls in this case.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665412.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket CDI application junit test

2014-04-15 Thread Duke
I'm sorry, I did not immediately explained. 
At first I tried to create tests for an existing application that uses
wicket-cdi 1.0 and Glassfish 3.1.2. I did not succeed because of
'javax.naming.NamingException: Lookup failed for 'java:comp/BeanManager''. 
Then I think that with wicket-cdi1.1 it will be easer to write tests, and
later I will whatever migrate to glassfish4.0. Thats why I try to create a
simple test application with wicket-cdi 1.1 from wicket v6.14 and
Glassfish4.0, to understand what is necessary to do in migration.
Can't build this simple application yet. It fails without any injections,
even I try to use at least one anonymous class. I must write a code without
any anonymous classes? Or what can I do?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665415.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket CDI application junit test

2014-04-15 Thread Duke
Found some info in mail archives. I will try to upgrade gf4 with weld 2.1.x
as I read. Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665416.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket CDI application junit test

2014-04-14 Thread Duke
Hi all.
Tried to build simple example with EntityManager injection:

public class LoginPage extends BasePage {

@Inject EntityManager em;
...
}

public class Application extends WebApplication {
@Override
protected void init() {
super.init(); 
new CdiConfiguration().configure(this);
}
}

It fails on new CdiConfiguration().configure(this); with message:
Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-70 Simple
bean [EnhancedAnnotatedTypeImpl]  class
org.apache.wicket.markup.html.panel.FeedbackPanel$1 cannot be a non-static
inner class
at
org.jboss.weld.injection.producer.BasicInjectionTarget.checkType(BasicInjectionTarget.java:81)
at
org.jboss.weld.injection.producer.BasicInjectionTarget.init(BasicInjectionTarget.java:69)
at
org.jboss.weld.injection.producer.BeanInjectionTarget.init(BeanInjectionTarget.java:52)
at
org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:95)
at
org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:78)

If I comment line with configuring of CdiConfiguration, all injections are
nulls ((
What I am doing wrong?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665402.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket CDI application junit test

2014-04-11 Thread Stephan Schrader
Hi,

maybe you can use DeltaSpike to get the BeanManager reference:
http://deltaspike.apache.org/core.html#beanmanagerprovider

Stephan


2014-04-11 5:30 GMT+02:00 Duke warlock9...@gmail.com:

 Hi everyone.
 I'm trying to write some tests for my wicket-cdi application. But I can't
 init wicket WebApplication, resulting:

  javax.naming.NamingException: Lookup failed for 'java:comp/BeanManager' in

 SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
 java.naming.factory.url.pkgs=com.sun.enterprise.naming,

 java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl}
 [Root exception is javax.naming.NamingException: Invocation exception: Got
 null ComponentInvocation ]
 in WebAdminApplication.java row:
 manager = (BeanManager)new
 InitialContext().lookup(java:comp/BeanManager);

 LoginPageTest.java
 public class LoginPageTest {
 private static WicketTester tester;
 @BeforeClass
 public static void setUpClass() {
 tester = new WicketTester(new WebAdminApplication());
 }
 @AfterClass
 public static void tearDownClass() {
 }
 @Test
 public void testRenderLoginPage() {
 LoginPage p = tester.startPage(LoginPage.class);
 tester.assertRenderedPage(LoginPage.class);
 ...
 }
 }

 WebAdminApplication.java
 public class WebAdminApplication extends WebApplication {
 protected void init() {
 super.init();
 BeanManager manager = null;
 try {
 manager = (BeanManager)new
 InitialContext().lookup(java:comp/BeanManager);
 } catch (NamingException ex) {
 logger.error(Error while creating BeanManager. Error text:
 {},
 ex.toString());
 }
 new CdiConfiguration(manager).configure(this);
 ...
 }
 }

 How I can get BeanManager for tests?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket CDI application junit test

2014-04-11 Thread Duke
Thanks, Stephan. I will try to use DeltaSpike with wicket-cdi1.0 in tests.

PS Maybe using wicket-cdi1.1 version will be more easy and it will not need
any additional libraries?
PPS I don't understand about wicket-cdi 1.1 version. Will it work correctly
with glassfish 4.0? I tryed cdi1.0, but it don't work. Then I found an issue
about this problem.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665371.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket CDI application junit test

2014-04-11 Thread David Beer
Hi

See my earlier thread on CDI 1.1. A lot the problems related to 1.1 come
from not setting your beans.xml file up correctly for your environment. In
General CDI 1.0 is for EE 6 and 1.1 is for EE 7. This is why 1.0 has
dificulties with GF 4 as it is designed for Java EE 7. If you get a
stacktrace use the first part to search, there are lots of answers out
there. 1.1 is quite different.


On 11 April 2014 10:31, Duke warlock9...@gmail.com wrote:

 Thanks, Stephan. I will try to use DeltaSpike with wicket-cdi1.0 in tests.

 PS Maybe using wicket-cdi1.1 version will be more easy and it will not need
 any additional libraries?
 PPS I don't understand about wicket-cdi 1.1 version. Will it work correctly
 with glassfish 4.0? I tryed cdi1.0, but it don't work. Then I found an
 issue
 about this problem.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665371.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket CDI application junit test

2014-04-11 Thread Duke
Found your thread, David :) Many thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665373.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket CDI application junit test

2014-04-10 Thread Duke
Hi everyone.
I'm trying to write some tests for my wicket-cdi application. But I can't
init wicket WebApplication, resulting:

 javax.naming.NamingException: Lookup failed for 'java:comp/BeanManager' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl}
[Root exception is javax.naming.NamingException: Invocation exception: Got
null ComponentInvocation ]
in WebAdminApplication.java row:
manager = (BeanManager)new InitialContext().lookup(java:comp/BeanManager);

LoginPageTest.java
public class LoginPageTest {
private static WicketTester tester;
@BeforeClass
public static void setUpClass() {
tester = new WicketTester(new WebAdminApplication());
}
@AfterClass
public static void tearDownClass() {
}
@Test
public void testRenderLoginPage() {
LoginPage p = tester.startPage(LoginPage.class);
tester.assertRenderedPage(LoginPage.class);
...
}
}

WebAdminApplication.java
public class WebAdminApplication extends WebApplication {
protected void init() {
super.init();
BeanManager manager = null;
try {
manager = (BeanManager)new
InitialContext().lookup(java:comp/BeanManager);
} catch (NamingException ex) {
logger.error(Error while creating BeanManager. Error text: {},
ex.toString());
}
new CdiConfiguration(manager).configure(this);
...
}
}

How I can get BeanManager for tests?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Running a TestNG test suite from a wicket page

2013-12-04 Thread Martin Dietze
On Mon, December 02, 2013, Paul Bors wrote:

 Have you considered Mockito to mock your POJOs for the test data and
 methods?
 I use that in conjunction with TestNG and then start the wicket app
 providing it mocked DAOs and POJOs.

I've got pretty strong feelings about such frameworks, bluntly
speaking, I consider them harmful. They look like a cool thing
on first glance, but if you've got complex test cases in your
business logic you end up recording complex sequences of mocked
service responses and end up with write-only test code. People
who use them for their code may have different experience, but
since I usually work on large projects in teams of 2-5 people
I've far too often had to understand and repair broken tests 
that were made unnecessarily complex due to the use of Eazymock
or Mockito.

Just for completeness I'm repeating once again what I already
wrote about it a little before in this thread:

 I really don't like mocking services and DAOs at all, because in
 complex application this sooner or later leads you to testing
 against your particular implementation rather than your code's
 contract. In particular when mocking frameworks are used, this
 very easily leads to write-only test code. I've seen this on too
 many occasions and no longer believe that this is a wise
 approach.

 Also one needs to consider that many applications are pretty
 much data-driven (e.g. my system uses a document-based data
 model with nearly 100 different object variants), and loading
 and
 interpreting both schema and data is a crucial piece of the
 application and needs thorough testing, and you really want to
 do this on the real thing rather than on mocked services.

But actually I wanted to report my progress on this issue here,
since this might be of interest for others, too. I succeded with
my approach and implemented my first tests yesterday. My setup
is like this:

1. For testing, I deploy my test librariees into WEB-INF/lib,
so that they can be used within the running webapp. Also I create
a JAR file from all my integration tests and deploy it into the
same location. 

2. I create a wicket page and mount it somewhere (e.g. /test), 
make sure that it cannot be accessed in production environments :)

3. In that page, I locate the JAR with my tests:

| @Nonnull
| public static File getJarForClassName( String packageAndClassName ) {
| URL url = ReflectionUtil.class.getClassLoader().getResource( 
packageAndClassName );
| if ( url == null ) {
| throw new IllegalStateException( Unable to resolve resource  + 
packageAndClassName );
| }
| if ( !jar.equals( url.getProtocol() ) ) {
| throw new IllegalStateException( Wrong protocol for  + 
packageAndClassName + :  + url.getProtocol() );
| }
| String path = url.getPath();
| if ( path == null ) {
| throw new IllegalStateException( No path for  + packageAndClassName 
);
| }
| int delimPos = path.indexOf( '!' );
| if ( delimPos = 0 ) {
| throw new IllegalStateException( Cannot extract JAR path for  + 
packageAndClassName + :  + path );
| }
| String jarPath = path.substring( file:.length(), delimPos );
| File result = new File( jarPath );
| if ( !result.isFile() ) {
| throw new IllegalStateException( Something's wrong, no valid file 
for  + packageAndClassName + :  + jarPath );
| }
| return result;
| }

4. Then I set up TestNG in onConfigure():

| TestNG testNG = new TestNG();
| testNG.setTestJar( jarFile.getAbsolutePath() );
| testNG.setExcludedGroups( EXCLUDED_TEST_GROUPS );
| testNG.setGroups( INCLUDED_TEST_GROUPS );
| testNG.setOutputDirectory( outputDir.getAbsolutePath() );
| @SuppressWarnings( rawtypes )
| ListClass reporterList = Collections.Class singletonList( 
HTMLReporter.class );
| testNG.setListenerClasses( reporterList );
| int result = 0;
| try {
| testNG.run();
| result = testNG.getStatus();
| } catch ( TestNGException ex ) {
| LOG.error( Exception caught, ex );
| error( ex.getMessage() );
| result = 1;
| }

5. If the result is not 0, I throw an IllegalStateException,
so that my ANT build fails:

| if ( result != 0 ) {
| throw new IllegalStateException( tests failed );
| }

6. Since my tests may run for a while i increase the 
timeout before wicket throws a pagemap-locked exception
in the constructor:

|  if ( !TIMEOUT_FOR_TEST_PAGE.equals( 
VrmsApplication.get().getRequestCycleSettings().getTimeout() ) ) {
|  VrmsApplication.get().getRequestCycleSettings().setTimeout( 
TIMEOUT_FOR_TEST_PAGE );
|  }

7. In ANT I create a test target like this:

| target name=test-integration 
depends=check-wget,compile-tests,glassfish-start-if-necessary,glassfish-test-deploy
| antcall target=run-test-integration/antcall
| /target
| 
| target name=run-test-integration
| exec executable=wget failonerror=true
| arg line=-O /dev/null --quiet http://localhost:8080/test; /
| /exec
| /target

Now testing the business logic has

Re: Running a TestNG test suite from a wicket page

2013-12-02 Thread Paul Bors
Have you considered Mockito to mock your POJOs for the test data and
methods?
I use that in conjunction with TestNG and then start the wicket app
providing it mocked DAOs and POJOs.


On Sun, Dec 1, 2013 at 5:23 PM, Martin Dietze d...@fh-wedel.de wrote:

 On Sun, December 01, 2013, Martin Grigorov wrote:

  In this case you may want to use Selenium/WebDriver tests.
  Or any kind of robot that will execute your test scenarios against a
  running web application.


 I am using geb for frontend tests. However frontend tests do not
 really help when testing complex cases within the business logic.
 As I wrote, one would normally create a test data generator to fill
 an in-memory database with stuff that you can rely on when
 running your tests. However due to the fact that this is a JEE
 application in which infrastructure like the database message
 queues etc. are provided by the container (glassfish) I would
 like to run tests against anonymised productive data.

 Thus I start the application within its JEE container with a fresh
 set of test data in the database and then run the test suite by
 wget-ing a page which runs my TestNG tests which have thus
 access to all those resources. As mentioned before, I am dealing
 with pre-spring/guice legacy code here, thus this is simply a
 pragmatic approach. In an ideal world I would not have to do
 this :)

 Cheers,

 M'bert

 --
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+=
 * Free Speech Online!!! Support the Blue Ribbon Campaign! *

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Running a TestNG test suite from a wicket page

2013-12-01 Thread Martin Dietze
On Sat, November 30, 2013, Martin Grigorov wrote:

 Usually when running (WicketTester) tests people provide mock
 implementations of the external services like MQ, DB, ...
 It is much easier to return some mock data, either good data or broken, to
 your application and verify that it behaves correctly in both situations.

I really don't like mocking services and DAOs at all, because in
complex application this sooner or later leads you to testing
against your particular implementation rather than your code's
contract. In particular when mocking frameworks are used, this
very easily leads to write-only test code. I've seen this on too
many occasions and no longer believe that this is a wise
approach.

Also one needs to consider that many applications are pretty
much data-driven (e.g. my system uses a document-based data
model with nearly 100 different object variants), and loading and
interpreting both schema and data is a crucial piece of the
application and needs thorough testing, and you really want to
do this on the real thing rather than on mocked services. 

If I were to start such a project today I'd rely on IOC
frameworks like Spring or Guice trying to keep my modules' 
dependencies under control, so that I can write test data
generators for all the scenarios I need to test. However in a
legacy project this is not always an option because a
pre-spring/guice architecture may lead to practically every
module technically depending on the complete business logic, 
so that one would have to pretty much mock it all which will
make the test code even more unmaintainable. In my case I'm fine
using anonymized production data based on which I can write
tests not relying on particular objects in the database but on
classes of data that will be there instead.

Now that's *why* I chose that approach. Still, if anybody has
any experience with this kind of thing, I'd be happy to benefit
from it :)

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Hlade's Law: If you have a difficult task, give it to a lazy person;
   they will find an easier way to do it. 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Running a TestNG test suite from a wicket page

2013-12-01 Thread Martin Grigorov
Hi,

In this case you may want to use Selenium/WebDriver tests.
Or any kind of robot that will execute your test scenarios against a
running web application.

In case you know/like JavaScript I'd recommend you:
http://wicketinaction.com/2012/11/javascript-based-functional-testing/
We use such tests for testing several Wicket Examples applications:
https://github.com/apache/wicket/tree/master/wicket-examples/src/main/webapp/js-test


On Sun, Dec 1, 2013 at 5:09 PM, Martin Dietze d...@fh-wedel.de wrote:

 On Sat, November 30, 2013, Martin Grigorov wrote:

  Usually when running (WicketTester) tests people provide mock
  implementations of the external services like MQ, DB, ...
  It is much easier to return some mock data, either good data or broken,
 to
  your application and verify that it behaves correctly in both situations.

 I really don't like mocking services and DAOs at all, because in
 complex application this sooner or later leads you to testing
 against your particular implementation rather than your code's
 contract. In particular when mocking frameworks are used, this
 very easily leads to write-only test code. I've seen this on too
 many occasions and no longer believe that this is a wise
 approach.

 Also one needs to consider that many applications are pretty
 much data-driven (e.g. my system uses a document-based data
 model with nearly 100 different object variants), and loading and
 interpreting both schema and data is a crucial piece of the
 application and needs thorough testing, and you really want to
 do this on the real thing rather than on mocked services.

 If I were to start such a project today I'd rely on IOC
 frameworks like Spring or Guice trying to keep my modules'
 dependencies under control, so that I can write test data
 generators for all the scenarios I need to test. However in a
 legacy project this is not always an option because a
 pre-spring/guice architecture may lead to practically every
 module technically depending on the complete business logic,
 so that one would have to pretty much mock it all which will
 make the test code even more unmaintainable. In my case I'm fine
 using anonymized production data based on which I can write
 tests not relying on particular objects in the database but on
 classes of data that will be there instead.

 Now that's *why* I chose that approach. Still, if anybody has
 any experience with this kind of thing, I'd be happy to benefit
 from it :)

 Cheers,

 M'bert

 --
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+=
 Hlade's Law: If you have a difficult task, give it to a lazy person;
they will find an easier way to do it.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Running a TestNG test suite from a wicket page

2013-12-01 Thread Martin Dietze
On Sun, December 01, 2013, Martin Grigorov wrote:

 In this case you may want to use Selenium/WebDriver tests.
 Or any kind of robot that will execute your test scenarios against a
 running web application.


I am using geb for frontend tests. However frontend tests do not
really help when testing complex cases within the business logic. 
As I wrote, one would normally create a test data generator to fill
an in-memory database with stuff that you can rely on when
running your tests. However due to the fact that this is a JEE
application in which infrastructure like the database message
queues etc. are provided by the container (glassfish) I would
like to run tests against anonymised productive data. 

Thus I start the application within its JEE container with a fresh
set of test data in the database and then run the test suite by
wget-ing a page which runs my TestNG tests which have thus
access to all those resources. As mentioned before, I am dealing
with pre-spring/guice legacy code here, thus this is simply a
pragmatic approach. In an ideal world I would not have to do
this :)

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
* Free Speech Online!!! Support the Blue Ribbon Campaign! *

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Running a TestNG test suite from a wicket page

2013-11-30 Thread Martin Grigorov
Hi,

Usually when running (WicketTester) tests people provide mock
implementations of the external services like MQ, DB, ...
It is much easier to return some mock data, either good data or broken, to
your application and verify that it behaves correctly in both situations.


On Fri, Nov 29, 2013 at 7:10 PM, Martin Dietze d...@fh-wedel.de wrote:

 As in my project a number of resources are only available within
 the running web application (e.g. message queues and DB access
 are provided by the Glassfish application server), I would like
 to run a TestNG suite from a wicket page, thus allowing me to
 test pieces of the code that depend on those (and other
 resources).

 I've taken a brief look at the TestNG command line interface,
 and it seems like doing what is being done in TestNG.main should
 more or less work. Rather ugly, but seemingly without
 alternative, I need to have TestNG in my webapp's CLASSPATH.
 The test classes I package into a JAR that I deploy with the
 webapp when I want to run the tests. Still I need to configure
 TestNG to load all tests from that JAR specifically, and I
 haven't yet figured out how to do this.

 Just thought that I might not be the first trying this, so if
 there's anyone out there who has some experience with it, I'd
 greatly appreciate some hint.

 Cheers,

 M'bert

 --
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+=
 That's right, yelled Vroomfondel, we demand rigidly defined areas of
 doubt and uncertainty!  -- Douglas Adams

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Running a TestNG test suite from a wicket page

2013-11-29 Thread Martin Dietze
As in my project a number of resources are only available within
the running web application (e.g. message queues and DB access
are provided by the Glassfish application server), I would like
to run a TestNG suite from a wicket page, thus allowing me to
test pieces of the code that depend on those (and other
resources).

I've taken a brief look at the TestNG command line interface,
and it seems like doing what is being done in TestNG.main should
more or less work. Rather ugly, but seemingly without
alternative, I need to have TestNG in my webapp's CLASSPATH. 
The test classes I package into a JAR that I deploy with the
webapp when I want to run the tests. Still I need to configure
TestNG to load all tests from that JAR specifically, and I
haven't yet figured out how to do this.

Just thought that I might not be the first trying this, so if
there's anyone out there who has some experience with it, I'd
greatly appreciate some hint.

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
That's right, yelled Vroomfondel, we demand rigidly defined areas of 
doubt and uncertainty!  -- Douglas Adams

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test based on AbstractWicketTest fails with No RequestCycle is currently set

2013-09-09 Thread Martin Dietze
On Sat, September 07, 2013, Martin Grigorov wrote:

  com.mycompany.request.WicketContainerChecker.onInstantiation(WicketContainerChecker.java:48)
 
 
 What is this doing ?
 Does it start a new thread by chance ?
 Or doing something like: ThreadContext.detach() /
 ThreadContext.setRequestCycle(null)

No, nothing of that kind. It's just a helper to make sure noone
uses Ajax on components which are added to the markup as
wicket:container wicket:id=../wicket:container
The code goes like this:

| public class WicketContainerChecker implements 
IComponentInstantiationListener {
| private static final Behavior BEHAVIOR = new Behavior() {
| private static final long serialVersionUID = 1L;
| 
| @Override
| public void onComponentTag( final Component component, final 
ComponentTag tag ) {
| if ( tag instanceof WicketTag  container.equals( 
tag.getName() )  component.getOutputMarkupId() ) {
| throw new IllegalStateException( Component  + component +  
requests a markup id ( + component.getMarkupId() + ) but is attached to  + 
tag
| + ! This will not work in deployment mode! );
| }
| }
| };
| 
| @Override
| public void onInstantiation( Component component ) {
| component.add( BEHAVIOR );
| }
| }

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
WE ARE THE BORG - RESISTANCE IS VOLTAGE DIVIDED BY CURRENT!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test based on AbstractWicketTest fails with No RequestCycle is currently set

2013-09-09 Thread Martin Dietze
On Mon, September 09, 2013, Martin Dietze wrote:

 No, nothing of that kind. It's just a helper to make sure noone
 uses Ajax on components which are added to the markup as
 wicket:container wicket:id=../wicket:container

OK, that one is solved, too. After replacing the Application
used in this test by the one created to solve the other problem
(related to the resources for JS and CSS), this problem
disappeared. Obviously the problem I saw in the stack trace 
was misleading here.

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Ed is the standard text editor.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test based on AbstractWicketTest fails with No RequestCycle is currently set

2013-09-07 Thread Martin Grigorov
On Fri, Sep 6, 2013 at 7:41 PM, Martin Dietze d...@fh-wedel.de wrote:

 On Fri, September 06, 2013, Martin Grigorov wrote:

  2. #testAddingAndSwitchingFields
 
  you look at the wrong test
  we cannot help you when we have the wrong source given

 Yes, sorry, I picked the wrong stacktrace, however they're all
 identical anyway. The method 'testAddingAndSwitchingFields'
 starts the same way as 'testRender':

 |public void testAddingAndSwitchingFields( final int numberOfFields,
 final ListString switchButtonPaths, final ListString expectedFieldOrder
 ) {
 |final FeedbackFormSpec formSpec =
 FeedbackFormSpecTestFactory.createEmpty();
 |this.tester.startPage( new FeedbackFormSpecEditorTestPage(
 formSpec ) );
 |// ...

 I.e., the stacktrace below is exactly the same from the moment
 I instanciate the test page, and the super constructor is
 called.

 Here's the stacktrace again:

 org.apache.wicket.WicketRuntimeException: No RequestCycle is currently set!
 org.apache.wicket.Component.getRequest(Component.java:1803)
 org.apache.wicket.markup.html.WebPage.dirty(WebPage.java:318)
 org.apache.wicket.Page.dirty(Page.java:249)
 org.apache.wicket.Page.componentStateChanging(Page.java:926)
 org.apache.wicket.Component.addStateChange(Component.java:3527)
 org.apache.wicket.Behaviors.add(Behaviors.java:55)
 org.apache.wicket.Component.add(Component.java:4511)

 com.mycompany.request.WicketContainerChecker.onInstantiation(WicketContainerChecker.java:48)


What is this doing ?
Does it start a new thread by chance ?
Or doing something like: ThreadContext.detach() /
ThreadContext.setRequestCycle(null)



 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)

 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)

 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)

 org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
 org.apache.wicket.Component.init(Component.java:683)
 org.apache.wicket.MarkupContainer.init(MarkupContainer.java:121)
 org.apache.wicket.Page.init(Page.java:168)
 org.apache.wicket.Page.init(Page.java:132)
 org.apache.wicket.markup.html.WebPage.init(WebPage.java:76)

 com.mycompany.ui.components.types.FeedbackFormSpecEditorTestPage.init(FeedbackFormSpecEditorTestPage.java:38)

 com.mycompany.ui.components.types.FeedbackFormSpecEditorTest.testAddingAndSwitchingFields(FeedbackFormSpecEditorTest.java:80)

 M'bert

 --
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+=
 I am not in a hurry. I prefer to cross the town.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Test based on AbstractWicketTest fails with No RequestCycle is currently set

2013-09-06 Thread Martin Grigorov
Hi,


On Fri, Sep 6, 2013 at 3:36 PM, Martin Dietze d...@fh-wedel.de wrote:

 I am currently trying to repair some old tests (which I did not
 even write myself) based on AbstractWicketTest and WicketTester.
 At the moment all tests derived from AbstractWicketTest or using
 TestNGWicketTester fail with some exception inside Wicket.

 Since I am rather unfamiliar with the wicket test infrastructure,
 I'd like to ask here, if the stuff below rings any bell with
 anyone of you? Did I forget something fundamental? A missing
 RequestCycle seems rather fundamental to me, i.e. I'd expect
 the testing infrastructure to take care that there is one, or
 am I mistaken here?

 The one based on AbstractWicketTest basically tries to render a
 page and check for some exception etc., it's code is rather
 simplish:

 |public void testRender( final FeedbackFormSpec formSpec ) {


1. #testRender


 |this.tester.startPage( new FeedbackFormSpecEditorTestPage(
 formSpec ) );
 |this.tester.assertRenderedPage(
 FeedbackFormSpecEditorTestPage.class );
 |this.tester.dumpPage();
 |}

 I get this stacktrace:

 org.apache.wicket.WicketRuntimeException: No RequestCycle is currently set!
 org.apache.wicket.Component.getRequest(Component.java:1803)
 org.apache.wicket.markup.html.WebPage.dirty(WebPage.java:318)
 org.apache.wicket.Page.dirty(Page.java:249)
 org.apache.wicket.Page.componentStateChanging(Page.java:926)
 org.apache.wicket.Component.addStateChange(Component.java:3527)
 org.apache.wicket.Behaviors.add(Behaviors.java:55)
 org.apache.wicket.Component.add(Component.java:4511)

 com.mycompany.request.WicketContainerChecker.onInstantiation(WicketContainerChecker.java:48)

 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)

 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)

 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)

 org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
 org.apache.wicket.Component.init(Component.java:683)
 org.apache.wicket.MarkupContainer.init(MarkupContainer.java:121)
 org.apache.wicket.Page.init(Page.java:168)
 org.apache.wicket.Page.init(Page.java:132)
 org.apache.wicket.markup.html.WebPage.init(WebPage.java:76)

 com.mycompany.ui.components.types.FeedbackFormSpecEditorTestPage.init(FeedbackFormSpecEditorTestPage.java:38)

 com.mycompany.ui.components.types.FeedbackFormSpecEditorTest.testAddingAndSwitchingFields(FeedbackFormSpecEditorTest.java:80)


2. #testAddingAndSwitchingFields

you look at the wrong test
we cannot help you when we have the wrong source given


 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:597)

 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
 org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
 org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
 org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)

 org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
 org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
 org.testng.TestRunner.privateRun(TestRunner.java:767)
 org.testng.TestRunner.run(TestRunner.java:617)
 org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
 org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
 org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
 org.testng.SuiteRunner.run(SuiteRunner.java:240)
 org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
 org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
 org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
 org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
 org.testng.TestNG.run(TestNG.java:1031)
 org.testng.TestNG.privateMain(TestNG.java:1338)
 org.testng.TestNG.main(TestNG.java:1307)

 Cheers,

 M'bert

 --
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+=
 I now declare this bizarre open!

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Test based on AbstractWicketTest fails with No RequestCycle is currently set

2013-09-06 Thread Martin Dietze
On Fri, September 06, 2013, Martin Grigorov wrote:

 2. #testAddingAndSwitchingFields
 
 you look at the wrong test
 we cannot help you when we have the wrong source given

Yes, sorry, I picked the wrong stacktrace, however they're all
identical anyway. The method 'testAddingAndSwitchingFields'
starts the same way as 'testRender':

|public void testAddingAndSwitchingFields( final int numberOfFields, final 
ListString switchButtonPaths, final ListString expectedFieldOrder ) {
|final FeedbackFormSpec formSpec = 
FeedbackFormSpecTestFactory.createEmpty();
|this.tester.startPage( new FeedbackFormSpecEditorTestPage( formSpec ) 
);
|// ...

I.e., the stacktrace below is exactly the same from the moment 
I instanciate the test page, and the super constructor is
called.

Here's the stacktrace again:

org.apache.wicket.WicketRuntimeException: No RequestCycle is currently set!
org.apache.wicket.Component.getRequest(Component.java:1803)
org.apache.wicket.markup.html.WebPage.dirty(WebPage.java:318)
org.apache.wicket.Page.dirty(Page.java:249)
org.apache.wicket.Page.componentStateChanging(Page.java:926)
org.apache.wicket.Component.addStateChange(Component.java:3527)
org.apache.wicket.Behaviors.add(Behaviors.java:55)
org.apache.wicket.Component.add(Component.java:4511)
com.mycompany.request.WicketContainerChecker.onInstantiation(WicketContainerChecker.java:48)
org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
org.apache.wicket.Component.init(Component.java:683)
org.apache.wicket.MarkupContainer.init(MarkupContainer.java:121)
org.apache.wicket.Page.init(Page.java:168)
org.apache.wicket.Page.init(Page.java:132)
org.apache.wicket.markup.html.WebPage.init(WebPage.java:76)
com.mycompany.ui.components.types.FeedbackFormSpecEditorTestPage.init(FeedbackFormSpecEditorTestPage.java:38)
com.mycompany.ui.components.types.FeedbackFormSpecEditorTest.testAddingAndSwitchingFields(FeedbackFormSpecEditorTest.java:80)

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
I am not in a hurry. I prefer to cross the town.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to unit test AttributeModifier

2013-05-09 Thread Dmitriy Neretin
Thanks to all! It works now!
Am 08.05.2013 14:39 schrieb Kees van Dieren i...@squins.com:

 Another option is to use the TagTester:

 TagTester tester = wicketTester.getTagByWicketId(containerId);

 tester.getAttribute(name); // returns: anyDynamicValue




 Best regards / Met vriendelijke groet,

 Kees van Dieren
 Squins IT Solutions BV
 Oranjestraat 30
 2983 HS Ridderkerk
 The Netherlands
 Mobile: +31 (0)6 30413841
 www.squins.com
 Chamber of commerce Rotterdam: 24435103


 2013/5/8 Martin Grigorov mgrigo...@apache.org

  Also check AttributeModifierTest in wicket-core/src/test/java/..
 
 
  On Tue, May 7, 2013 at 5:31 PM, Igor Vaynberg igor.vaynb...@gmail.com
  wrote:
 
   attribute modifiers are behaviors, so use
   component.getbehavior(AttributeModifier.class) to get it.
  
   -igor
  
   On Tue, May 7, 2013 at 8:24 AM, Dmitriy Neretin
   dmitriy.nere...@googlemail.com wrote:
Hello,
   
Is it possible to unit test an AttributeModifier?
   
I have a simple component:
   
WebMarkupContainer container = new WebMarkupContainer(containerId);
container.add(new AttributeModifier(name, anyDynamicValue));
   
In the unit test:
   
WebMarkupContainer container = (WebMarkupContainer)
tester.getComponentFromLastRenderedPage(containerId);
   
Is it possible to get the modifier above? I can see it in the object
   state
(while debugging) but I have no idea how to get it to test an
anyDynamicValue...
   
Any ideas?
   
Regards,
   
Dmitriy
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 
 
  --
  Martin Grigorov
  Wicket Training  Consulting
  http://jWeekend.com http://jweekend.com/
 



Re: How to unit test AttributeModifier

2013-05-08 Thread Martin Grigorov
Also check AttributeModifierTest in wicket-core/src/test/java/..


On Tue, May 7, 2013 at 5:31 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 attribute modifiers are behaviors, so use
 component.getbehavior(AttributeModifier.class) to get it.

 -igor

 On Tue, May 7, 2013 at 8:24 AM, Dmitriy Neretin
 dmitriy.nere...@googlemail.com wrote:
  Hello,
 
  Is it possible to unit test an AttributeModifier?
 
  I have a simple component:
 
  WebMarkupContainer container = new WebMarkupContainer(containerId);
  container.add(new AttributeModifier(name, anyDynamicValue));
 
  In the unit test:
 
  WebMarkupContainer container = (WebMarkupContainer)
  tester.getComponentFromLastRenderedPage(containerId);
 
  Is it possible to get the modifier above? I can see it in the object
 state
  (while debugging) but I have no idea how to get it to test an
  anyDynamicValue...
 
  Any ideas?
 
  Regards,
 
  Dmitriy

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Martin Grigorov
Wicket Training  Consulting
http://jWeekend.com http://jweekend.com/


Re: How to unit test AttributeModifier

2013-05-08 Thread Kees van Dieren
Another option is to use the TagTester:

TagTester tester = wicketTester.getTagByWicketId(containerId);

tester.getAttribute(name); // returns: anyDynamicValue




Best regards / Met vriendelijke groet,

Kees van Dieren
Squins IT Solutions BV
Oranjestraat 30
2983 HS Ridderkerk
The Netherlands
Mobile: +31 (0)6 30413841
www.squins.com
Chamber of commerce Rotterdam: 24435103


2013/5/8 Martin Grigorov mgrigo...@apache.org

 Also check AttributeModifierTest in wicket-core/src/test/java/..


 On Tue, May 7, 2013 at 5:31 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:

  attribute modifiers are behaviors, so use
  component.getbehavior(AttributeModifier.class) to get it.
 
  -igor
 
  On Tue, May 7, 2013 at 8:24 AM, Dmitriy Neretin
  dmitriy.nere...@googlemail.com wrote:
   Hello,
  
   Is it possible to unit test an AttributeModifier?
  
   I have a simple component:
  
   WebMarkupContainer container = new WebMarkupContainer(containerId);
   container.add(new AttributeModifier(name, anyDynamicValue));
  
   In the unit test:
  
   WebMarkupContainer container = (WebMarkupContainer)
   tester.getComponentFromLastRenderedPage(containerId);
  
   Is it possible to get the modifier above? I can see it in the object
  state
   (while debugging) but I have no idea how to get it to test an
   anyDynamicValue...
  
   Any ideas?
  
   Regards,
  
   Dmitriy
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



How to unit test AttributeModifier

2013-05-07 Thread Dmitriy Neretin
Hello,

Is it possible to unit test an AttributeModifier?

I have a simple component:

WebMarkupContainer container = new WebMarkupContainer(containerId);
container.add(new AttributeModifier(name, anyDynamicValue));

In the unit test:

WebMarkupContainer container = (WebMarkupContainer)
tester.getComponentFromLastRenderedPage(containerId);

Is it possible to get the modifier above? I can see it in the object state
(while debugging) but I have no idea how to get it to test an
anyDynamicValue...

Any ideas?

Regards,

Dmitriy


Re: How to unit test AttributeModifier

2013-05-07 Thread Igor Vaynberg
attribute modifiers are behaviors, so use
component.getbehavior(AttributeModifier.class) to get it.

-igor

On Tue, May 7, 2013 at 8:24 AM, Dmitriy Neretin
dmitriy.nere...@googlemail.com wrote:
 Hello,

 Is it possible to unit test an AttributeModifier?

 I have a simple component:

 WebMarkupContainer container = new WebMarkupContainer(containerId);
 container.add(new AttributeModifier(name, anyDynamicValue));

 In the unit test:

 WebMarkupContainer container = (WebMarkupContainer)
 tester.getComponentFromLastRenderedPage(containerId);

 Is it possible to get the modifier above? I can see it in the object state
 (while debugging) but I have no idea how to get it to test an
 anyDynamicValue...

 Any ideas?

 Regards,

 Dmitriy

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Best Way to Perform a Quick Test

2013-04-03 Thread Paul Bors
Here's a video on how to configure Eclipse to work with Wicket 1.5.x:
http://www.youtube.com/watch?v=3fdiCBb4rK8

Not sure if it's in English but then again you get the point from watching
the footage for 3 mins.

Once you have your project up and running, you can run it in debug mode and
step through your code line by line.

~ Thank you,
   Paul Bors

On Mon, Apr 1, 2013 at 11:24 AM, Dan Retzlaff dretzl...@gmail.com wrote:

 I think you misunderstand serialization. Only class member data is
 serialized, plus a small amount of metadata like the class name and a
 version. Normal methods, and any logging in those methods, have no effect
 on serialized output. If you tried printing and it didn't work, please
 share your code.

 On Mon, Apr 1, 2013 at 7:51 AM, madmax108 lifeofna...@gmail.com wrote:

  Hi, I'm just beginning with Wicket Development. I've been used to Java
  development where, when I want to perform a quick test, I simply add a
  sysout to see if a certain code segment is being reached eg.
  System.out.println(Segment 1 reached) or to find out what is being
  returned by a database call eg.
  System.out.println(makeDatabasecall().toString()) and so on. I know this
 is
  not the best way to debug code, but for minor projects, it makes sense to
  be
  quick testing.
 
  But as Wicket needs everything to be serialized, adding sysouts breaks
 the
  code.
 
  What is the best quick way to perform simple variable value checks (and
  print them out on a console/UI) using Wicket?
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Best-Way-to-Perform-a-Quick-Test-tp4657669.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Best Way to Perform a Quick Test

2013-04-01 Thread madmax108
Hi, I'm just beginning with Wicket Development. I've been used to Java
development where, when I want to perform a quick test, I simply add a
sysout to see if a certain code segment is being reached eg.
System.out.println(Segment 1 reached) or to find out what is being
returned by a database call eg.
System.out.println(makeDatabasecall().toString()) and so on. I know this is
not the best way to debug code, but for minor projects, it makes sense to be
quick testing.

But as Wicket needs everything to be serialized, adding sysouts breaks the
code.

What is the best quick way to perform simple variable value checks (and
print them out on a console/UI) using Wicket?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Best-Way-to-Perform-a-Quick-Test-tp4657669.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Best Way to Perform a Quick Test

2013-04-01 Thread Dan Retzlaff
I think you misunderstand serialization. Only class member data is
serialized, plus a small amount of metadata like the class name and a
version. Normal methods, and any logging in those methods, have no effect
on serialized output. If you tried printing and it didn't work, please
share your code.

On Mon, Apr 1, 2013 at 7:51 AM, madmax108 lifeofna...@gmail.com wrote:

 Hi, I'm just beginning with Wicket Development. I've been used to Java
 development where, when I want to perform a quick test, I simply add a
 sysout to see if a certain code segment is being reached eg.
 System.out.println(Segment 1 reached) or to find out what is being
 returned by a database call eg.
 System.out.println(makeDatabasecall().toString()) and so on. I know this is
 not the best way to debug code, but for minor projects, it makes sense to
 be
 quick testing.

 But as Wicket needs everything to be serialized, adding sysouts breaks the
 code.

 What is the best quick way to perform simple variable value checks (and
 print them out on a console/UI) using Wicket?



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Best-Way-to-Perform-a-Quick-Test-tp4657669.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Test Select2Choice with WicketTester

2013-02-14 Thread Ulf Gitschthaler
In most cases I want to simulate a user typing something in and selecting one 
of the offered choices. Afterwards I'd also like to submit the form and check 
if the model object of the Select2Choice field contains the right value, 
respectively I want to be able to submit the form if a Select2Choice field is a 
required field. 

Up to now it always failes because the model object is null. Just a simple 
example test case would be nice that shows how to test Select2Choice fields in 
a form. 

 

On Feb 13, 2013, at 9:41 PM, Ernesto Reinaldo Barreiro reier...@gmail.com 
wrote:

 What exactly do you want to test? E.g. simulate user typing on field?
 
 On Wed, Feb 13, 2013 at 8:25 PM, Stephen Walsh 
 step...@connectwithawalsh.com wrote:
 
 I may have the same question. How do you go about testing a select2 box
 with wicket tester?
 
 
 Additionally, is there any documentation on how to use wicket tester?
 —
 Stephen Walsh
 
 On Wed, Feb 13, 2013 at 6:08 AM, Sven Meier s...@meiers.net wrote:
 
 What's your problem with Select2Choice and WicketTester?
 Sven
 On 02/13/2013 10:59 AM, Ulf Gitschthaler wrote:
 Hi,
 
 We currently use Select2Choice (http://tinyurl.com/ab7hm8g) on almost
 every form on our website. Regretfully we didn't find a proper way to test
 it with WicketTester so far.
 
 Thus, I'd like to know if anybody figured out how to include
 Select2Choices in unit tests that use WicketTester. I didn't find anything
 useful on the web so far, even the select2 github repo does not contain any
 sample test.
 
 Thanks for your answers,
 Ulf
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -- 
 Regards - Ernesto Reinaldo Barreiro
 Antilia Soft
 http://antiliasoft.com/ http://antiliasoft.com/antilia


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Test Select2Choice with WicketTester

2013-02-14 Thread Ulf Gitschthaler
Thanks for your answer, I'll try this out today.
 
On Feb 14, 2013, at 11:53 AM, Ernesto Reinaldo Barreiro reier...@gmail.com 
wrote:

 Hi,
 
 On Thu, Feb 14, 2013 at 10:12 AM, Ulf Gitschthaler 
 ulf.gitschtha...@comsysto.com wrote:
 
 In most cases I want to simulate a user typing something in and selecting
 one of the offered choices. Afterwards I'd also like to submit the form and
 check if the model object of the Select2Choice field contains the right
 value, respectively I want to be able to submit the form if a Select2Choice
 field is a required field.
 
 
 
 Mind that  this component do is:
 
 1- It implements IResourceListener to be able to stream back JSON like:
 
 {results:[{id:2,text:Air Show},{id:180,text:American
 Football},{id:4,text:Anniversary
 },{id:6,text:Aquarium},{id:116,text:Babies},{id:8,text:Bar},{id:10,text:Baseball},{id:12,text:Basketball},{id:14,text:Beach
 Volleyball},{id:16,text:Beergarden},{id
 :18,text:Billard},{id:22,text:Botellón},{id:20,text:Bowling},{id:24,text:Bullfight},{id:36,text:Cafeteria},{id:26,text:Casino},{id:28,text:Child
 Museum},{id:176,text
 :Childrem},{id:30,text:Cinema},{id:32,text:Circus},{id:34,text:Climbing},{id:38,text:Comedy
 Club},{id:110,text:Concert},{id:40,text:Cricket},{id:42,text:DanceClass},{id:44,text:Dancing},{id:46,text:Daycare},{id:48,text:Deep
 Sea Fishing},{id
 :50,text:Dinopark},{id:52,text:Diving},{id:54,text:Fair},{id:206,text:Family},
 {id:208,text:Female},{id:56,text:Fireworks},{id:58,text:Fishing},{id:182,text:Forest
 },{id:60,text:Gay-Female},{id:62,text:Gay-Male},{id:64,text:Golfing},{id:66,text:Handball},{id:68,text:Hang
 Gliding},{id:70,text:Hiking},{id:108,text:Hiphop
 Concert},{id:72,text:Historical
 Museum},{id:74,text:Horse
 Riding},{id:76,text:Hunting},{id:78,text:Jazz
 Club},{id:80,text:Kayaking},{id:82,text:Kitesurfing},{id:84,text:Library},{id:184,text:Love},{id:86,text:Magic
 Show},{id:178,text:Male},{id:88,text:Mountainbiking
 },{id:90,text:Museum-Archeological},{id:92,text:Museum-Art},{id:94,text:Museum-Crafts
 },{id:96,text:Museum-Industry},{id:98,text:Museum-Naval},{id:100,text:Museum-Science
 },{id:102,text:Museum-War},{id:104,text:Music-choral},{id:106,text:Music-Classical
 },{id:114,text:Nanny},{id:118,text:Paintball},{id:120,text:Paragliding},{id:122,text
 :Parasailing},{id:124,text:Party},{id:126,text:Planetarium},{id:128,text:Playground},{id:130,text:Poker},{id:132,text:Public
 Art},{id:112,text:Rock Concert},{id:134,text:Ropes
 course},{id:136,text:Row Boat},{id:138,text:Rugby
 field},{id:140,text:Sailing},{id:142,text:Scout
 group},{id:144,text:Scuba
 Diving},{id:146,text:Snorkeling},{id:148,text:soccer},{id:150,text:Speed
 riding},{id:152,text:spelunking},{id:154,text:Squash},{id:156,text:Strip
 Club},{id:160,text:Surf
 Paddle},{id:158,text:Surfing},{id:162,text:Swimming},{id:166,text:Table
 Tennis},{id:164,text:Tea
 House},{id:168,text:Tennis},{id:170,text:Terrace},{id:172,text:Theater},{id:174,text:Theme
 Park},{id:186,text:Video
 Games},{id:188,text:Volleyball},{id:190,text:Walking
 Tour},{id:194,text:Water Park},{id:196,text:Water
 Skiing},{id:192,text:Watercraft},{id:198,text:Windsurfing},{id:200,text:Wine
 bar},{id:202,text:Wine Tasting},{id:204,text:Zoo}],more:null}
 
 For this it uses ChoiceProvider. So, you could test user typing directly
 using ChoiceProvider or for instance
 
 https://github.com/reiern70/wicket-select2/blob/master/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AbstractSelect2Choice.java#L235
 
 to test produced JSON. (This is not part of offcial select2 but it is a
 pending pull request). Maybe I can factor out this a bit more and add a
 method that receives int page and String term so that testing is even
 easier.
 
 2-On client side widget uses a hidden input to represent selections as
 
 input id=what-input class=round-3-nopad type=hidden name=categories
 value=2,4 style=display: none;
 
 Those selected values are initially  assigned via JSON when widget is
 constructed.  See method
 
 https://github.com/reiern70/wicket-select2/blob/master/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2MultiChoice.java#L114
 
 So one way... to simulate this might be as in
 
 TestMultiSelectPage testPage =tester.startPage(TestMultiSelectPage.class);
 tester.assertRenderedPage(TestMultiSelectPage.class);
 tester.getRequest().setParameter(countries, Country.CU.name()+,+
 Country.CA.name());
 tester.submitForm(testPage.getForm());
 Assert.assertTrue(testPage.getCountries().contains(Country.CU));
 Assert.assertTrue(testPage.getCountries().contains(Country.CA));
 Assert.assertTrue(!testPage.getCountries().contains(Country.US));
 
 So, you simulate client side working by passing a parameter with the
 selected choices.
 
 See
 
 https://github.com/reiern70/wicket-select2/blob/master/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/SelectTest.java
 
 
 
 -- 
 Regards - Ernesto Reinaldo Barreiro
 Antilia Soft
 http://antiliasoft.com/ http://antiliasoft.com

  1   2   3   4   5   >