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