1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.spring;
12
13 import org.mule.api.endpoint.ImmutableEndpoint;
14 import org.mule.api.service.Service;
15 import org.mule.tck.FunctionalTestCase;
16
17 public class InheritedPropertiesMule2458TestCase extends FunctionalTestCase
18 {
19
20 protected String getConfigResources()
21 {
22 return "org/mule/test/spring/inherited-properties-mule-2458-test.xml";
23 }
24
25 public void testProperties()
26 {
27 Service service = muleContext.getRegistry().lookupService("service");
28 assertNotNull(service);
29 ImmutableEndpoint endpoint = (ImmutableEndpoint) service.getInboundRouter().getEndpoints().get(0);
30 assertNotNull(endpoint);
31
32 assertProperty(endpoint, "global-only", "global");
33 assertProperty(endpoint, "local-only", "local");
34 assertProperty(endpoint, "url-only", "url");
35
36 assertProperty(endpoint, "global-and-local", "local");
37 assertProperty(endpoint, "global-and-url", "global");
38 assertProperty(endpoint, "local-and-url", "local");
39
40 assertProperty(endpoint, "all", "local");
41 }
42
43 protected void assertProperty(ImmutableEndpoint endpoint, String name, String value)
44 {
45 Object property = endpoint.getProperty(name);
46 assertNotNull("Property " + name + " is missing", property);
47 String actual = property.toString();
48 assertEquals("Unexpected value for " + name + ": " + actual + ", not " + value, value, actual);
49 }
50
51 }