Testing a panel in isolation (component id not found).

2014-03-17 Thread Jens Jahnke
Hi,

I'm trying to test a panel in isolation using `startComponentInPage(C)`.
The test goes as follows:

MyDataModel d = ...
Panel p = new MyCustomPanel(id, new LoadableDataModel(d));
tester.startComponentInPage(p);

Upon execution I get this output:

Unable to find component with id 'id' in [MyCustomPanel [Component id = id]]
Expected: 'id:name'.
Found with similar names: ''
MarkupStream: [markup = file:...]
wicket:panel xmlns:wicket=http://wicket.apache.org;
  div class=information
div class=name
  strongspan wicket:id=name/span/strong
/div
div class=meta
  img class=icon wicket:id=icon/
  span class=genre wicket:id=genre/span
/div
div class=description
  div wicket:id=description/div
/div
  /div
/wicket:panel, index = 2, current =  'span wicket:id=name' (line 0, 
column 0)]
...

Is there a way to get the id right or do I have to provide a custom 
page markup for testing?

Regards,

Jens

-- 
17. Lenzing 2014, 11:58
Homepage : http://www.wegtam.com

This is a country where people are free to practice their religion,
regardless of race, creed, color, obesity, or number of dangling keys...


pgp3tcNjGGLPI.pgp
Description: PGP signature


Re: Testing a panel in isolation (component id not found).

2014-03-17 Thread Jens Jahnke
Hi,

On Mon, 17 Mar 2014 13:05:57 +0200
Martin Grigorov mgrigo...@apache.org wrote:

MG This is the right way.
MG Can you show us the code that causes this error ?
MG #startComponentInPage() should not fail with such error ...

the exception is thrown at the line with tester.startComponentInPage, 
but here is the code of my custom panel:

public class MyCustomPanel extends Panel {
protected String name = ;
protected String icon = ;
protected String genre = ;
protected String description = ;

public MyCustomPanel(String id, IModelMyDataModel model) {
super(id, model);
prepareDefaultVariables(model.getObject());
}

protected void prepareDefaultVariables(MyDataModel data) {
name = data.getName();
icon = data.getIconName();
genre = data.getGenre();
description = data.getDescription();
}

protected void renderDefaultVariables() {
add(new Label(name, name));
PackageResourceReference iconRef = new 
PackageResourceReference(getClass(), icon);
add(new Image(icon, iconRef));
add(new Label(genre, genre));
add(new Label(description, description));
}
}

BTW: I'm using wicket 6.12 and are currently unable to upgrade to 6.14. :-|

Regards,

Jens

-- 
17. Lenzing 2014, 12:19
Homepage : http://www.wegtam.com

SAFETY
I can live without
Someone I love
But not without
Someone I need.


pgpkvJDO2pdn8.pgp
Description: PGP signature


Re: Testing a panel in isolation (component id not found).

2014-03-17 Thread Jens Jahnke
On Mon, 17 Mar 2014 13:38:29 +0200
Martin Grigorov mgrigo...@apache.org wrote:

MG I meant the test code that leads to the exception.

Okay, here it is:

private WicketTester tester;

@Before
public void setUp() throws Exception {
tester = new WicketTester(new MyApplication());
}

@Test
public void testRenderPanel() throws Exception {
MyDataModel d = new MyDataModel(name, icon.png, genre, description);
Panel info = new MyCustomPanel(id, new LoadableDataModel(d));
tester.startComponentInPage(info);
}

And thanks for the hints regarding the other code. I'll rework it accordingly.

Regards,

Jens

-- 
17. Lenzing 2014, 12:46
Homepage : http://www.wegtam.com

We are all in the gutter, but some of us are looking at the stars.
-- Oscar Wilde


pgpuwyr7OUxgv.pgp
Description: PGP signature


Re: Testing a panel in isolation (component id not found).

2014-03-17 Thread Jens Jahnke
On Mon, 17 Mar 2014 13:58:59 +0200
Martin Grigorov mgrigo...@apache.org wrote:

MG This method doesn't add the children components.
MG So trying to render this panel (via #startComponentInPag(panelInstance))
MG will fail because there are HTML elements with wicket:id in the markup
MG which have no Java counterparts.

*ouch* Stupid me. Thanks for pointing that out.

Regards,

Jens

-- 
17. Lenzing 2014, 13:03
Homepage : http://www.wegtam.com

Death is a spirit leaving a body, sort
of like a shell leaving the nut behind.
-- Erma Bombeck


pgpz_UQ6p7BjM.pgp
Description: PGP signature


Testing panels

2013-10-20 Thread Jens Jahnke
Hi,

I'm using wicket 6.11.0 and try to test some panels.
The test code looks like this:

public class NewRelicHeaderTest {
private WicketTester tester;

@Before
public void setUp() throws Exception {
tester = new WicketTester(new MyApplication());
}

@Test
public void testNewRelicHeaderPanel() {
tester.startComponentInPage(new NewRelicHeader(newRelicHeader));
}
}

But what I get is always an exception:

MarkupNotFoundException: Failed to find markup file associated. NewRelicHeader: 
[NewRelicHeader [Component id = newRelicHeader]]

Is there something I am missing?

Regards,

Jens

-- 
20. Gilbhart 2013, 09:43
Homepage : http://www.jan0sch.de

You will engage in a profitable business activity.


pgpgbRLoIJ7An.pgp
Description: PGP signature


Re: Testing panels

2013-10-20 Thread Jens Jahnke
On Sun, 20 Oct 2013 10:30:33 +0200
per.newgro per.new...@gmx.ch wrote:

PN Die you wrote already the markup file? It should be named
PN NewRel...Panel.HTML

Argh, thanks for the hint. My markup file was named wrong it read
NewRelicHeaderCode.html. :p

I changed it to NewRelicHeader.html but now I get a different error
message:

Unable to find component with id 'newrelic-header' in [NewRelicHeader 
[Component id = testObject]]
Expected: 'testObject:newrelic-header'.
Found with similar names: 'testObject:new-relic-header'

Regards,

Jens

-- 
20. Gilbhart 2013, 10:49
Homepage : http://www.jan0sch.de

I don't know why anyone would want a computer in their home.
-- Ken Olsen, president of DEC, 1974


pgpBLp4AfgIHa.pgp
Description: PGP signature


Re: Testing panels

2013-10-20 Thread Jens Jahnke
On Sun, 20 Oct 2013 10:51:25 +0200
Jens Jahnke jan0...@gmx.net wrote:

JJ Unable to find component with id 'newrelic-header' in
JJ [NewRelicHeader [Component id = testObject]] Expected:
JJ 'testObject:newrelic-header'. Found with similar names:
JJ 'testObject:new-relic-header'

I should stop coding after short nights... :-)
Just another typo (new-relic versus newrelic).

Thanks very much everything works fine now.

Regards,

Jens

-- 
20. Gilbhart 2013, 11:07
Homepage : http://www.jan0sch.de

You know, the difference between this company and
the Titanic is that the Titanic had paying customers.


pgpq_0ofDz33Y.pgp
Description: PGP signature


Re: Documentation for RequestLogger

2013-08-07 Thread Jens Jahnke
Hi,

On Tue, 6 Aug 2013 15:11:34 -0400
Paul Bors p...@bors.ws wrote:

PB Isn't Log4J shipped with the quick-start?
PB 
PB Create yourself a quick-start and analyze it:
PB http://wicket.apache.org/start/quickstart.html
PB 
PB PS: You can also check the initialization related topics as well as
PB your first stop for Wicket's doc via the Wicket Free Guide at:
PB http://wicket.apache.org/learn/books/freeguide.html

thanks for the information, the freeguide rocks.

But actually I found the solution in wicket in action. :)

Nonetheless it only logs to stdout but I guess thats a log4j question.

Regards,

Jens

-- 
07. Ernting 2013, 10:04
Homepage : http://www.jan0sch.de

In order to live free and happily, you must sacrifice boredom.
It is not always an easy sacrifice.


pgp9Up9H3UBot.pgp
Description: PGP signature


Re: Documentation for RequestLogger

2013-08-07 Thread Jens Jahnke
Hi,

On Wed, 7 Aug 2013 10:11:30 +0200
Martin Grigorov mgrigo...@apache.org wrote:

MG On Wed, Aug 7, 2013 at 10:07 AM, Jens Jahnke jan0...@gmx.net
MG wrote:
MG 
MG  Hi,
MG 
MG  On Tue, 6 Aug 2013 15:11:34 -0400
MG  Paul Bors p...@bors.ws wrote:
MG 
MG  PB Isn't Log4J shipped with the quick-start?
MG  PB
MG  PB Create yourself a quick-start and analyze it:
MG  PB http://wicket.apache.org/start/quickstart.html
MG  PB
MG  PB PS: You can also check the initialization related topics as
MG  PB well as your first stop for Wicket's doc via the Wicket Free
MG  PB Guide at: http://wicket.apache.org/learn/books/freeguide.html
MG 
MG  thanks for the information, the freeguide rocks.
MG 
MG  But actually I found the solution in wicket in action. :)
MG 
MG  Nonetheless it only logs to stdout but I guess thats a log4j
MG  question.
MG 
MG 
MG What do you mean that it logs to stdout ?
MG There is no usage of System.out/err in Wicket. The RequestLogger
MG uses SLF4J. Your question is really a log4j question (if you use
MG slf4j-log4j as backend).

sorry, I didn't express myself correctly. It logged to catalina.out
(tomcat).

I was able to solve the issue. Somehow I had slf4j-simple in my pom.xml
file. After changing that to slf4j-log4j12 everything works as expected.

Regards,

Jens

-- 
07. Ernting 2013, 11:14
Homepage : http://www.jan0sch.de

Never tell people how to do things.  Tell them WHAT to
do and they will surprise you with their ingenuity.
-- Gen. George S. Patton, Jr.


pgpy0pBGhE_TM.pgp
Description: PGP signature


Documentation for RequestLogger

2013-08-06 Thread Jens Jahnke
Hi,

I'd like to know if there is an official documentation for RequestLogger
anywhere?

I found several small bits on the net, but nothing that gives me a clue
how to actually do some logging.

I know that I have to initialise it somehow like this:

IRequestLoggerSettings requestLogger = 
Application.get().getRequestLoggerSettings();
requestLogger.setRequestLoggerEnabled(true);

But where do I have to put this initialisation? I've put it into my apps init() 
but it does nothing except creating an empty log file.

My log4j.properties:

log4j.category.org.apache.wicket.protocol.http.RequestLogger=INFO,RequestLogger
log4j.additivity.org.apache.wicket.protocol.http.RequestLogger=false
log4j.appender.RequestLogger=org.apache.log4j.RollingFileAppender
log4j.appender.RequestLogger.File=${catalina.home}/logs/wicket-requests.log
log4j.appender.RequestLogger.MaxFileSize=10MB
log4j.appender.RequestLogger.MaxBackupIndex=10
log4j.appender.RequestLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.RequestLogger.layout.ConversionPattern=%d{ISO8601} %-5p- 
%-26.26c{1} - %m\n


Regards,

Jens

-- 
06. Ernting 2013, 10:38
Homepage : http://www.jan0sch.de

Kirk to Enterprise...


pgpm33oCFzdz6.pgp
Description: PGP signature


Re: Wicket, Heroku and scaling

2013-01-11 Thread Jens Jahnke

On Fri, 11 Jan 2013 09:59:35 -0500
William Speirs wspe...@apache.org wrote:

WS @Jens Jahnke if you do create an ISessionStore for redis, please
WS post back if you're willing to share. I could see the use in that!
WS 
WS Thanks...

Of course I'll do that. But it will take some time because I can only
work on it in my spare time which is very limited in the next weeks.

Regards,

Jens

-- 
11. Hartung 2013, 16:12
Homepage : http://www.jan0sch.de

Whom the gods wish to destroy they first call promising.


pgp7RJiVwiUg5.pgp
Description: PGP signature


Wicket, Heroku and scaling

2013-01-09 Thread Jens Jahnke
Hi,

I've successfully deployed my first wicket app to heroku and would like
to know if there are any experiences regarding scaling.

Would the app benefit from rolling out more dynos?

It runs via embedded jetty using a starter class. My Procfile looks
like this:
web: java -cp target/classes:target/dependency/* StartJetty

Regards,

Jens

-- 
09. Hartung 2013, 18:02
Homepage : http://www.jan0sch.de

WYSIWYG:
What You See Is What You Get.


pgpibAZhqMsGx.pgp
Description: PGP signature


Re: Wicket, Heroku and scaling

2013-01-09 Thread Jens Jahnke
On Wed, 9 Jan 2013 18:14:51 +0100
Martijn Dashorst martijn.dasho...@gmail.com wrote:

MD  Would the app benefit from rolling out more dynos?
MD 
MD If your app is stateful and depends on the session:
MD it would suck, because heroku doesn't support sticky sessions.
MD Therefore requests will be sent to different dynos and several of
MD Wicket's features will not work.
MD 
MD if it isn't stateful and doesn't depend on container session state,
MD then you might be able to benefit from more dynos.

Thanks for the information. It is a stateful app. :-(

Could it be a workaround to store the session in a redis-store and is
this possible with wicket?

Regards,

Jens

-- 
09. Hartung 2013, 19:01
Homepage : http://www.jan0sch.de

Victory uber allies!


pgpCRF7oxm9Xf.pgp
Description: PGP signature


Re: Apache Wicket is a Flawed Framework

2011-11-18 Thread Jens Jahnke
Hi,

On Fri, 18 Nov 2011 11:04:39 +0100
kamiseq kami...@gmail.com wrote:

K but it is true that before I read wicket in action I was like a
K child in fog :/

I totally agree with that.

I'm just starting with wicket and without the book I think I would have
dumped it because there is not much free documentation. Although I find
most other web frameworks suffer in that region too. ;-)

Regards

-- 
18. Nebelung 2011, 11:36
Homepage : http://www.jan0sch.de

Right now I'm having amnesia and deja vu at the same time.
-- Steven Wright


pgpmQcvPd0RKP.pgp
Description: PGP signature