Hi,
I just came across the following error:
junit.framework.AssertionFailedError: expected:<WebTestPage> but
was:<DummyHomePage>
To narrow it down I created a simple Testclass with the according html.
I also added a test case. Here we go:
WebTestPage.java:
-------------
[...]
public class WebTestPage extends WebPage {
public WebTestPage() {
Model icon;
icon = new Model("gfx/offline.gif");
add(new Image("statusImage", icon));
}
}
-------------
WebTestPage.html:
-------------
<html>
<head></head>
<body>
<img wicket:id="statusImage" border="0" />
</body>
</html>
-------------
WebTestPageTest.java:
-------------
[...]
public class WebTestPageTest {
private WicketTester tester = new WicketTester();
@Test
public void simpleTest() throws Exception {
WebTestPage page = new WebTestPage();
tester.startPage(page);
tester.assertRenderedPage(WebTestPage.class);
}
}
-------------
The real error in this is: gfx/offline.gif does not exist. If i change
it to a file that exists everything goes fine.
If I test it in my Tomcat I get a prober 404:
Unable to find package resource [path = default/gfx/offline.gif, style =
null, locale = en]
I tried to dig into the code to find the reason why the errormessage I
get with jUnit is so meaningless but didn't get far. Maybe someone of
you has more knowledge on this part?
Thanks in advance!
Sven
PS: I'm using the following jars:
12. Jun 15:21 wicket-1.3.0-incubating-SNAPSHOT.jar
12. Jun 15:21 wicket-extensions-1.3.0-incubating-SNAPSHOT.jar
12. Jun 15:21 wicket-spring-1.3.0-incubating-SNAPSHOT.jar
12. Jun 15:21 wicket-spring-annot-1.3.0-incubating-SNAPSHOT.jar
As you can see they are fresh as can be (central european time). Maven
fetches them from http://www.wicketstuff.org/maven/repository/
PPS: Here is the full stack trace:
junit.framework.AssertionFailedError: expected:<WebTestPage> but
was:<DummyHomePage>
at
org.apache.wicket.util.tester.WicketTester.assertResult(WicketTester.java:499)
at
org.apache.wicket.util.tester.WicketTester.assertRenderedPage(WicketTester.java:373)
at default.WebTestPageTest.simpleTest(WebTestPageTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
at
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user