1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.vm;
12
13 import org.mule.DefaultMuleMessage;
14 import org.mule.api.MuleException;
15 import org.mule.api.MuleMessage;
16 import org.mule.api.transport.MessageAdapter;
17 import org.mule.api.transport.MessageTypeNotSupportedException;
18 import org.mule.transport.AbstractMessageAdapterTestCase;
19 import org.mule.transport.DefaultMessageAdapter;
20
21
22
23
24 public class VMMessageAdapterTestCase extends AbstractMessageAdapterTestCase
25 {
26
27
28
29
30
31
32 public MessageAdapter createAdapter(Object payload) throws MessageTypeNotSupportedException
33 {
34 if (payload instanceof MuleMessage)
35 {
36 return new DefaultMessageAdapter(payload);
37 }
38 else
39 {
40 throw new MessageTypeNotSupportedException(payload, DefaultMessageAdapter.class);
41 }
42 }
43
44
45
46
47
48
49 public Object getValidMessage() throws MuleException
50 {
51 return new DefaultMuleMessage("Valid Message");
52 }
53
54
55
56
57
58
59 public Object getInvalidMessage()
60 {
61 return "Invalid message";
62 }
63
64 }