1
2
3
4
5
6
7
8
9
10 package org.mule.test.transformers;
11
12 import org.mule.tck.FunctionalTestCase;
13 import org.mule.tck.testmodels.fruit.FruitBasket;
14 import org.mule.tck.testmodels.fruit.FruitBowl;
15 import org.mule.tck.testmodels.fruit.Apple;
16 import org.mule.tck.testmodels.fruit.Banana;
17 import org.mule.module.client.MuleClient;
18 import org.mule.util.concurrent.Latch;
19
20 import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
21
22 public class AutoTransformerTestCase extends FunctionalTestCase
23 {
24 private static Latch latch;
25 protected String getConfigResources()
26 {
27 return "org/mule/test/integration/transformer/auto-transformer-test.xml";
28 }
29
30 public void testInboundAutoTransform() throws Exception
31 {
32 latch = new Latch();
33 MuleClient client = new MuleClient(muleContext);
34 client.dispatch("vm://in", new FruitBowl(new Apple(), new Banana()), null);
35
36 assertTrue(latch.await(3000, TimeUnit.MILLISECONDS));
37 }
38
39 public static class FruitBasketComponent
40 {
41 public void process(FruitBasket fb)
42 {
43 assertTrue(fb.hasApple());
44 assertTrue(fb.hasBanana());
45 latch.countDown();
46 }
47 }
48 }