1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.scripting;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.FunctionalTestCase;
16
17
18 public class GroovyRegistryLookupTestCase extends FunctionalTestCase
19 {
20 @Override
21 protected String getConfigResources()
22 {
23 return "groovy-registry-lookup-config.xml";
24 }
25
26 @Override
27 protected void doSetUp() throws Exception
28 {
29 super.doSetUp();
30
31 muleContext.getRegistry().registerObject("hello", new Hello());
32 }
33
34 public void testBindingCallout() throws Exception
35 {
36 MuleClient client = new MuleClient(muleContext);
37 MuleMessage response = client.send("vm://test", "", null);
38 assertNotNull(response);
39 assertEquals("hello", response.getPayloadAsString());
40 }
41
42 public static class Hello
43 {
44 public String sayHello()
45 {
46 return "hello";
47 }
48 }
49
50 }