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 super();
23 this.variant = variant;
24 this.configResources = configResources;
25 }
26
27 @Override
28 protected void doSetUp() throws Exception
29 {
30 super.doSetUp();
31
32 switch (variant)
33 {
34 case FLOW:
35 doSetUpForFlow();
36 break;
37
38 case SERVICE:
39 doSetUpForService();
40 break;
41 }
42 }
43
44 protected void doSetUpForFlow()
45 {
46
47 }
48
49 protected void doSetUpForService()
50 {
51
52 }
53
54 @Override
55 protected String getConfigResources()
56 {
57 return configResources;
58 }
59
60 @Override
61 protected String getTestHeader()
62 {
63 return "Testing: " + name.getMethodName() + " (" + variant + ")";
64 }
65
66 public static enum ConfigVariant
67 {
68 FLOW, SERVICE
69 }
70 }