This worked. For the record I was also pointed to this url that briefly covers maven2/surefire/testng usage:

http://mohanrajk.wordpress.com/2007/07/21/maven-2-testng-and-surefire-plugin/

'TomTom' pointed this out to me in IRC (#tapestry irc.freenode.net) - ;-)

Thanks for the input

Joel Wiegman wrote:
FWIW, I haven't had any problems with TestNG, but I've been using a
suite.xml.  I would recommend trying that because it gives you some nice
flexibility (like parameterizing your tests, grouping your tests, etc.).
Documentation for using a suite XML in the POM can be found here:

http://maven.apache.org/plugins/maven-surefire-plugin/

In any case, this thread doesn't have much to do with Tapestry anymore,
so it probably belongs in the Maven user group...

-----Original Message-----
From: Chris Lewis [mailto:[EMAIL PROTECTED] Sent: Saturday, November 17, 2007 4:51 AM
To: Tapestry users
Subject: Re: T5: testing T5

Ok first things first. I made the following test:

package net.godcode.t5c;

import org.testng.annotations.Test;

public class TestForTest {
@Test
    public void aTest() {
} }


It does nothing and lives in src/test/java - this should be all I need
to run a test right? If I run just this from eclipse, it passes ok. If I
run mvn test, I still get the output:

Running net.godcode.t5c.TestForTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022
sec Running
net.godcode.t5c.integration.pagelevel.rendering.pages.TestSlideShow
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006
sec Running net.godcode.t5c.integration.pagelevel.SlideShowTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005
sec

Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

I don't know why its finding test classes but not tests. The classes are
probably being found by mvn b/c they live in the default hierarchy. They
are annotated w/ @Test, but its like they aren't being registered as
tests!?

Joel Wiegman wrote:
I've got the PageTester, and well as integration test (tapestry-test) functionality working with my web-app. Not too difficult but there were some hoops to jump through.

First of all, you may want to check out this thread:

http://www.nabble.com/Junit-4-or-TestNG-5-suite-support-tf4647280s177.
ht
ml

Maven's Surefire plug-in doesn't support suite functionality of either

Junit 4 or TestNG 5.  So if you want integration tests you may have to

use something similar to the Ant script that I posted.  I think Howard

worked around this by posting all of his tests in one monolithic class

(his AbstractIntegrationTestSuite class uses the @BeforeClass and @AfterClass annotations, not @BeforeSuite and @AfterSuite):

http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/sr
c/ test/java/org/apache/tapestry/integration/IntegrationTests.java?view=m
ar
kup

So I guess my advice would be to eliminate the Tapestry/PageTester from the equation altogether... Make sure Maven is able to find a basic simple test first.

Another thread of mine that may be useful:

http://www.nabble.com/Using-PageTester-with-tapestry-spring-tf4508561.
ht
ml

Hope that helps,

Joel

-----Original Message-----
From: Chris Lewis [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 3:32 PM
To: Tapestry users
Subject: Re: T5: testing T5

Ok I retract part of that. I see this output in mvn test now:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running
net.godcode.t5c.integration.pagelevel.rendering.pages.TestSlideShow
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 sec Running net.godcode.t5c.integration.pagelevel.SlideShowTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec

Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

It seems to run, but still says that 0 tests ran.... If I run from eclipse I get a different exception:

FAILED: testEffects
java.lang.NoClassDefFoundError: javax/servlet/ServletContext ..
..

I want to get a test suite together, and among other things, test for JS errors (via selenium). If anyone can point out my errors I;d be very grateful.

sincerely,
chris

Chris Lewis wrote:
I've started working on testing my components using the PageTester, partially based on the site docs and partially on the T5 source. I have a test method as follows, which mirrors how the FormTest in T5
works:

   @Test
   public void testEffects() {
       String appPackage =
"net.godcode.t5c.integration.pagelevel.rendering";
       String appName = "";
       tester = new PageTester(appPackage, appName);
       Document doc = tester.renderPage("TestSlideShow");
   }

The page template for TestSlideShow uses my component like so:

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
   <body>
       <div t:type="gc/slideshow" interval="3">
           <div>slide one</div>
           <div>second one</div>
           <div>third one</div>
       </div>
   </body>
</html>

I have two issues. First, when run by mvn test, no test gets run. Second, I am able to run it through eclipse using a TestNG run config,
but the test fails with an exception:
"org.apache.tapestry.ioc.internal.util.TapestryException: Unable to resolve 'gc/slideshow' to a component class name."

This test is part of the same project, but my fake app for testing
(net.godcode.t5c.integration.pagelevel.rendering) doesn't have an app

module to add the component lib to its component package list.
However, neither does the ones (....app2) used by T5! Can anyone point
out what I need to do?

Thanks tons!

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to