Re: [Wicket-user] wickettester failures

2007-06-06 Thread Ryan Sonnek
THANK YOU!

I was pulling my hair out, and since this was my first time with the
WicketTester, i was totally thinking it was my use of the wicket
classes.

Now i'm back to kicking ass!

On 6/6/07, James McLaughlin <[EMAIL PROTECTED]> wrote:
> Hi Ryan,
>
> This explains it:
> http://www.jroller.com/page/gridhaus?entry=maven2_testing_madness
>
> File it under "Ways in which maven hates me..." :)
>
> If you put this stanza in your pom, your test will work:
>
> 
> ...
>   
> org.apache.maven.plugins
> maven-surefire-plugin
> 
>   
> **/*Panel*
>   
> 
>   
>
> best,
> jim
>
> On 6/6/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote:
> > On 6/5/07, James McLaughlin <[EMAIL PROTECTED]> wrote:
> > > Hi Ryan,
> > > I don't think you can test it like that unless you have a default
> > > constructor, and even then I don't think it will work (I'm a bit
> > > spotty on this). What I have always done is this:
> > >
> > > tester.startPanel(new TestPanelSource () {
> > >  Panel getTestPanel(final String panelId) {
> > >return new TestPanel(panelId);
> > >  }
> > > });
> > >
> > > Hope that fixes it for you.
> >
> > No luck.  Using the TestPanelSource still has the same issues.  I've
> > also tried using tester.startPage() instead of using panels, and I
> > still get the same exception:
> >
> > org.apache.maven.surefire.booter.SurefireExecutionException: There is
> > no application attached to current thread main
> >
> > -
> > 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
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
> -
> 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
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wickettester failures

2007-06-06 Thread James McLaughlin
Hi Ryan,

This explains it:
http://www.jroller.com/page/gridhaus?entry=maven2_testing_madness

File it under "Ways in which maven hates me..." :)

If you put this stanza in your pom, your test will work:


...
  
org.apache.maven.plugins
maven-surefire-plugin

  
**/*Panel*
  

  

best,
jim

On 6/6/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote:
> On 6/5/07, James McLaughlin <[EMAIL PROTECTED]> wrote:
> > Hi Ryan,
> > I don't think you can test it like that unless you have a default
> > constructor, and even then I don't think it will work (I'm a bit
> > spotty on this). What I have always done is this:
> >
> > tester.startPanel(new TestPanelSource () {
> >  Panel getTestPanel(final String panelId) {
> >return new TestPanel(panelId);
> >  }
> > });
> >
> > Hope that fixes it for you.
>
> No luck.  Using the TestPanelSource still has the same issues.  I've
> also tried using tester.startPage() instead of using panels, and I
> still get the same exception:
>
> org.apache.maven.surefire.booter.SurefireExecutionException: There is
> no application attached to current thread main
>
> -
> 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
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wickettester failures

2007-06-06 Thread Ryan Sonnek
On 6/5/07, James McLaughlin <[EMAIL PROTECTED]> wrote:
> Hi Ryan,
> I don't think you can test it like that unless you have a default
> constructor, and even then I don't think it will work (I'm a bit
> spotty on this). What I have always done is this:
>
> tester.startPanel(new TestPanelSource () {
>  Panel getTestPanel(final String panelId) {
>return new TestPanel(panelId);
>  }
> });
>
> Hope that fixes it for you.

No luck.  Using the TestPanelSource still has the same issues.  I've
also tried using tester.startPage() instead of using panels, and I
still get the same exception:

org.apache.maven.surefire.booter.SurefireExecutionException: There is
no application attached to current thread main

-
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wickettester failures

2007-06-06 Thread Ryan Sonnek
here is the output from maven (copied from bamboo logs):

[INFO] Surefire report directory: /data/​home/​wicket/​var/​data/
bamboo/​xml-data/​build-dir/​ WICKETSCRIPTACULOUS-TRUNK/​target/
surefire-reports
org.apache.maven.surefire.booter.SurefireExecutionException: Unable to
instantiate POJO 'class
org.wicketstuff.scriptaculous.inplaceeditor.TestPanel'; nested
exception is java.lang.InstantiationException:
org.wicketstuff.scriptaculous.inplaceeditor.TestPanel; nested
exception is org.apache.maven.surefire.testset.TestSetFailedException:
Unable to instantiate POJO 'class
org.wicketstuff.scriptaculous.inplaceeditor.TestPanel'; nested
exception is java.lang.InstantiationException:
org.wicketstuff.scriptaculous.inplaceeditor.TestPanel
org.apache.maven.surefire.testset.TestSetFailedException: Unable to
instantiate POJO 'class
org.wicketstuff.scriptaculous.inplaceeditor.TestPanel'; nested
exception is java.lang.InstantiationException:
org.wicketstuff.scriptaculous.inplaceeditor.TestPanel
java.lang.InstantiationException:
org.wicketstuff.scriptaculous.inplaceeditor.TestPanel
at java.lang.Class.newInstance0(Class.java:335)
at java.lang.Class.newInstance(Class.java:303)
at 
org.apache.maven.surefire.testset.PojoTestSet.(PojoTestSet.java:52)
at 
org.apache.maven.surefire.junit.JUnitDirectoryTestSuite.createTestSet(JUnitDirectoryTestSuite.java:61)
at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:93)
at 
org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:147)
at org.apache.maven.surefire.Surefire.run(Surefire.java:108)
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:585)
at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)

On 6/5/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> What is the failure stack trace when you execute it in maven?
>
> Eelco
>
> On 6/5/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote:
> > I could use a little help here.  I'm trying to write a unit test for
> > my component in wicketstuff-scriptaculous.  The test runs in eclipse
> > just fine, but running "mvn test" causes a build failure.
> >
> > What is the correct way to test this?
> >
> > public class AjaxEditInPlaceLabelTest extends TestCase {
> > public void testModelIsNotEscaped() {
> > WicketTester tester = new WicketTester();
> > tester.startPanel(TestPanel.class);
> >
> > tester.assertContains("me & you");
> > }
> > }
> >
> > public class TestPanel extends Panel {
> > public TestPanel(String id) {
> > super(id);
> > add(new AjaxEditInPlaceLabel("label", new Model("me & 
> > you")));
> > }
> > }
> >
> >
> > http://www.wicketstuff.org/bamboo/build/viewBuildLog.action?buildKey=WICKETSCRIPTACULOUS-TRUNK&buildNumber=49
> >
> > -
> > 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
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
> -
> 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
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wickettester failures

2007-06-05 Thread Eelco Hillenius
What is the failure stack trace when you execute it in maven?

Eelco

On 6/5/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote:
> I could use a little help here.  I'm trying to write a unit test for
> my component in wicketstuff-scriptaculous.  The test runs in eclipse
> just fine, but running "mvn test" causes a build failure.
>
> What is the correct way to test this?
>
> public class AjaxEditInPlaceLabelTest extends TestCase {
> public void testModelIsNotEscaped() {
> WicketTester tester = new WicketTester();
> tester.startPanel(TestPanel.class);
>
> tester.assertContains("me & you");
> }
> }
>
> public class TestPanel extends Panel {
> public TestPanel(String id) {
> super(id);
> add(new AjaxEditInPlaceLabel("label", new Model("me & you")));
> }
> }
>
>
> http://www.wicketstuff.org/bamboo/build/viewBuildLog.action?buildKey=WICKETSCRIPTACULOUS-TRUNK&buildNumber=49
>
> -
> 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
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wickettester failures

2007-06-05 Thread James McLaughlin
Hi Ryan,
I don't think you can test it like that unless you have a default
constructor, and even then I don't think it will work (I'm a bit
spotty on this). What I have always done is this:

tester.startPanel(new TestPanelSource () {
 Panel getTestPanel(final String panelId) {
   return new TestPanel(panelId);
 }
});

Hope that fixes it for you.

best,
jim

On 6/5/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote:
> I could use a little help here.  I'm trying to write a unit test for
> my component in wicketstuff-scriptaculous.  The test runs in eclipse
> just fine, but running "mvn test" causes a build failure.
>
> What is the correct way to test this?
>
> public class AjaxEditInPlaceLabelTest extends TestCase {
> public void testModelIsNotEscaped() {
> WicketTester tester = new WicketTester();
> tester.startPanel(TestPanel.class);
>
> tester.assertContains("me & you");
> }
> }
>
> public class TestPanel extends Panel {
> public TestPanel(String id) {
> super(id);
> add(new AjaxEditInPlaceLabel("label", new Model("me & you")));
> }
> }
>
>
> http://www.wicketstuff.org/bamboo/build/viewBuildLog.action?buildKey=WICKETSCRIPTACULOUS-TRUNK&buildNumber=49
>
> -
> 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
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] wickettester failures

2007-06-05 Thread Ryan Sonnek
I could use a little help here.  I'm trying to write a unit test for
my component in wicketstuff-scriptaculous.  The test runs in eclipse
just fine, but running "mvn test" causes a build failure.

What is the correct way to test this?

public class AjaxEditInPlaceLabelTest extends TestCase {
public void testModelIsNotEscaped() {
WicketTester tester = new WicketTester();
tester.startPanel(TestPanel.class);

tester.assertContains("me & you");
}
}

public class TestPanel extends Panel {
public TestPanel(String id) {
super(id);  
add(new AjaxEditInPlaceLabel("label", new Model("me & you")));
}
}


http://www.wicketstuff.org/bamboo/build/viewBuildLog.action?buildKey=WICKETSCRIPTACULOUS-TRUNK&buildNumber=49

-
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user