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