01: package abbot.script;
02:
03: import junit.extensions.abbot.*;
04:
05: public class SampleTest extends ResolverFixture {
06:
07: public void testSaveProperty() throws Throwable {
08: String PROP_NAME = "my.int";
09: abbot.script.Resolver r = getResolver();
10: Sample call = new Sample(r, "Test property from Sample",
11: CPTestClass.class.getName(), "intReturningMethod",
12: new String[0], null);
13: call.setPropertyName(PROP_NAME);
14: call.run();
15: assertEquals("Property should be set to the return value",
16: new Integer(CPTestClass.intReturningMethod()), r
17: .getProperty(PROP_NAME));
18: }
19:
20: public SampleTest(String name) {
21: super (name);
22: }
23:
24: public static void main(String[] args) {
25: TestHelper.runTests(args, SampleTest.class);
26: }
27: }
28:
29: class CPTestClass {
30: public static int intReturningMethod() {
31: return 0;
32: }
33: }
|