1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.tck.model; |
12 | |
|
13 | |
import org.mule.impl.MuleDescriptor; |
14 | |
import org.mule.impl.model.MuleProxy; |
15 | |
import org.mule.tck.AbstractMuleTestCase; |
16 | |
import org.mule.tck.testmodels.fruit.Apple; |
17 | |
import org.mule.util.ObjectFactory; |
18 | |
import org.mule.util.ObjectPool; |
19 | |
|
20 | |
import com.mockobjects.dynamic.Mock; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | 0 | public abstract class AbstractProxyPoolFactoryTestCase extends AbstractMuleTestCase |
27 | |
{ |
28 | |
public void testCreateProxyFromFactory() throws Exception |
29 | |
{ |
30 | 0 | Mock mockPool = new Mock(ObjectPool.class); |
31 | 0 | MuleDescriptor descriptor = getTestDescriptor("apple", Apple.class.getName()); |
32 | 0 | ObjectFactory factory = getProxyFactory(descriptor, (ObjectPool) mockPool.proxy()); |
33 | 0 | Object result = factory.create(); |
34 | 0 | assertNotNull(result); |
35 | 0 | MuleProxy proxy = (MuleProxy) result; |
36 | 0 | assertEquals("apple", proxy.getDescriptor().getName()); |
37 | 0 | mockPool.verify(); |
38 | 0 | } |
39 | |
|
40 | |
public abstract ObjectFactory getProxyFactory(MuleDescriptor descriptor, ObjectPool pool); |
41 | |
} |