1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.tck; |
8 | |
|
9 | |
import org.mule.tck.junit4.FunctionalTestCase; |
10 | |
|
11 | |
import org.junit.runner.RunWith; |
12 | |
import org.junit.runners.Parameterized; |
13 | |
|
14 | |
@RunWith(Parameterized.class) |
15 | |
public abstract class AbstractServiceAndFlowTestCase extends FunctionalTestCase |
16 | |
{ |
17 | |
protected ConfigVariant variant; |
18 | |
protected String configResources; |
19 | |
|
20 | |
public AbstractServiceAndFlowTestCase(ConfigVariant variant, String configResources) |
21 | |
{ |
22 | 0 | super(); |
23 | 0 | this.variant = variant; |
24 | 0 | this.configResources = configResources; |
25 | 0 | } |
26 | |
|
27 | |
@Override |
28 | |
protected void doSetUp() throws Exception |
29 | |
{ |
30 | 0 | super.doSetUp(); |
31 | |
|
32 | 0 | switch (variant) |
33 | |
{ |
34 | |
case FLOW: |
35 | 0 | doSetUpForFlow(); |
36 | 0 | break; |
37 | |
|
38 | |
case SERVICE: |
39 | 0 | doSetUpForService(); |
40 | |
break; |
41 | |
} |
42 | 0 | } |
43 | |
|
44 | |
protected void doSetUpForFlow() |
45 | |
{ |
46 | |
|
47 | 0 | } |
48 | |
|
49 | |
protected void doSetUpForService() |
50 | |
{ |
51 | |
|
52 | 0 | } |
53 | |
|
54 | |
@Override |
55 | |
protected String getConfigResources() |
56 | |
{ |
57 | 0 | return configResources; |
58 | |
} |
59 | |
|
60 | |
@Override |
61 | |
protected String getTestHeader() |
62 | |
{ |
63 | 0 | return "Testing: " + name.getMethodName() + " (" + variant + ")"; |
64 | |
} |
65 | |
|
66 | 0 | public static enum ConfigVariant |
67 | |
{ |
68 | 0 | FLOW, SERVICE |
69 | |
} |
70 | |
} |