blob: 605c5ad3a80236bcd9ef695d3041f73accefe63a [file] [log] [blame]
class PropertyTest extends GroovyTestCase {
// TODO should barf as TestCase has a private setter?
// @Property String name = "abc"
@Property String cheese = "edam"
/** TODO can't do constructors :)
PropertyTest() {
}
*/
void testProperty() {
def foo = this.cheese
assert foo == "edam"
assert cheese == "edam"
assert this.getCheese() == "edam"
assert this.cheese == "edam"
def bar = this
assert bar.getCheese() == "edam"
assert bar.cheese == "edam"
cheese = "cheddar"
assert this.getCheese() == "cheddar"
assert this.cheese == "cheddar"
}
}