Re: Component .java file unit testing and @Property

2010-06-17 Thread Christian Edward Gruber
I encountered this and use TestUtil (TestUtils?) to extract and set properties without creating accessors/mutators. Makes the test read a little less "O-O" but it's perfectly serviceable. My only issue was that TestUtils is part of the tapestry convenience test case hierarchy which depend

Re: Component .java file unit testing and @Property

2010-06-17 Thread Peter Niederwieser
Another option: Write your tests in Groovy, which lets you access private fields. (Of course you'll get other benefits from using Groovy. In short, it's a much better language for testing, especially when combined with Spock.) Cheers, Peter Christian Edward Gruber-3 wrote: > > Hey, > > S

Re: Component .java file unit testing and @Property

2010-06-08 Thread Christian Edward Gruber
Ok, so I ran into an issue where, because of how the TestUtil class fits in the hierarchy of TestBase, etc, it requires a dependency on org.testng.Assert. I filed a bug in JIRA and added a patch to extract PropertyUtil, but maintaining the TestUtil signatures for backwards compatibility, bu

Re: Component .java file unit testing and @Property

2010-06-08 Thread Christian Edward Gruber
Woot! Thanks. I thought I'd read about these, but couldn't find them. We'll check them out. Saves some effort on my part. Let's get those into the page on unit testing. I only saw PageTester. :) Christian. On Jun 8, 2010, at 5:03 PM, Igor Drobiazko wrote: Please have a look at TestUtil

Re: Component .java file unit testing and @Property

2010-06-08 Thread Igor Drobiazko
Please have a look at TestUtils [1]. Methods create(), set() and get() are what you are looking for. For T5.1 see [2]. [1] http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/ioc/test/TestUtils.html [2] http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ioc/tes

Component .java file unit testing and @Property

2010-06-08 Thread Christian Edward Gruber
Hey, So @Property is beautiful, but sometimes when I'm testing the thin controller logic that remains I want access to an @Property from within the test in order to verify that something was done/changed. I've looked at PageTester, but I don't want to dig into the rendered document,