01: /* DdBehaviour.java
02: *
03: * DDSteps - Data Driven JUnit Test Steps
04: * Copyright (C) 2005 Jayway AB
05: * www.ddsteps.org
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License version 2.1 as published by the Free Software Foundation.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, visit
18: * http://www.opensource.org/licenses/lgpl-license.php
19: */
20:
21: package org.ddsteps.junit.behaviour;
22:
23: import junit.framework.TestResult;
24:
25: /**
26: * @author adamskogman
27: * @version $Id: DdBehaviour.java,v 1.1 2006/01/29 21:25:39 adamskogman Exp $
28: */
29: public interface DdBehaviour {
30:
31: /**
32: * Let your countTestCases() delegate to this method.
33: *
34: * @return The number of testcases.
35: * @see junit.framework.TestCase#countTestCases()
36: */
37: int countTestCases();
38:
39: /**
40: * Let your run(TestResult) delegate to this method.
41: *
42: * @param result
43: * @param ddTestCase For handling callbacks.
44: * @return If true, then call make super call super.run(TestResult)
45: */
46: boolean run(TestResult result, DdBehaviourCallbackHandler ddTestCase);
47:
48: /**
49: * Let your setUp() delegate to this method.
50: * <p>
51: * May call any callback on the ddTestCase, except (@link DdBehaviourCallbackHandler#setUp()) which may cause a recursive
52: * loop.
53: *
54: * @param ddTestCase Callback handler.
55: * @throws Exception
56: */
57: void setUp(DdBehaviourCallbackHandler ddTestCase) throws Exception;
58:
59: /**
60: * Let your tearDown() delegate to this method.
61: * <p>
62: * May call any callback on the ddTestCase, except (@link DdBehaviourCallbackHandler#tearDown()()) which may cause a
63: * recursive loop.
64: *
65: * @param ddTestCase Callback handler.
66: * @throws Exception
67: */
68: void tearDown(DdBehaviourCallbackHandler ddTestCase)
69: throws Exception;
70:
71: }
|