"Mark W. Shead" <mwsh...@gmail.com> wrote on 26/08/2009 15:58:05:
> I am using the Selenium testing so I'm subclassing from 
> AbstractIntegrationTestSuite in  tapestry-test.

Ahhh.... The key thing about the TapestryTest superclasses in Testify is 
that they orchestrate the annotation processing and test scope quite 
carefully. You can't use them in conjunction with the 
AbstractIntegrationTestSuite from tapestry-test (as you need to subclass 
both).

So, you'll need to write a custom superclass for your tests that extends 
AbstractIntegrationTestSuite and then make sure all your test classes 
extend it. Something like this:


public abstract class MyAbstractIntegrationTest extends 
AbstractIntegrationTestSuite {
    protected static final TapestryTester tester = new TapestryTester(
"com.myapp.tapestry5", "app", PageTester.DEFAULT_CONTEXT_PATH);
 
    @BeforeClass(alwaysRun=true)
    public final void processInjectAnnotation() {
        tester.injectInto(this);
    }

 
    @BeforeMethod(alwaysRun=true)
    public final void setUp() throws Exception {
          // Put any other general setup here such as: 
Mockito.initMocks(this)
        doSetUp();
        tester.collectForComponentsFrom(this);
    }


    /**
     * Override this instead of {...@link #setUp()}
     */
    protected void doSetUp() throws Exception {
        // Do nothing by default
    }


    @AfterMethod
    public final void tearDown() throws Exception {
        tester.endTest();
    }
}

Let me know how that goes and I can add it to Testify as another 
integration.

Paul


---

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional 
EU corporate and regulatory disclosures.

Reply via email to