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 | 4 | public abstract class AbstractProxyPoolFactoryTestCase extends AbstractMuleTestCase |
23 | |
{ |
24 | |
public void testCreateProxyFromFactory() throws Exception |
25 | |
{ |
26 | 6 | Mock mockPool = new Mock(ObjectPool.class); |
27 | 2 | MuleDescriptor descriptor = getTestDescriptor("apple", Apple.class.getName()); |
28 | 2 | ObjectFactory factory = getProxyFactory(descriptor, (ObjectPool) mockPool.proxy()); |
29 | 2 | Object result = factory.create(); |
30 | 2 | assertNotNull(result); |
31 | 2 | MuleProxy proxy = (MuleProxy) result; |
32 | 2 | assertEquals("apple", proxy.getDescriptor().getName()); |
33 | 2 | mockPool.verify(); |
34 | 2 | } |
35 | |
|
36 | |
public abstract ObjectFactory getProxyFactory(MuleDescriptor descriptor, ObjectPool pool); |
37 | |
} |