KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > tck > model > AbstractProxyPoolFactoryTestCase


1 /*
2  * $Id: AbstractProxyPoolFactoryTestCase.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.tck.model;
12
13 import com.mockobjects.dynamic.Mock;
14
15 import org.mule.impl.MuleDescriptor;
16 import org.mule.impl.model.MuleProxy;
17 import org.mule.tck.AbstractMuleTestCase;
18 import org.mule.tck.testmodels.fruit.Apple;
19 import org.mule.util.ObjectFactory;
20 import org.mule.util.ObjectPool;
21
22 /**
23  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
24  * @version $Revision: 3798 $
25  */

26 public abstract class AbstractProxyPoolFactoryTestCase extends AbstractMuleTestCase
27 {
28     public void testCreateProxyFromFactory() throws Exception JavaDoc
29     {
30         Mock mockPool = new Mock(ObjectPool.class);
31         MuleDescriptor descriptor = getTestDescriptor("apple", Apple.class.getName());
32         ObjectFactory factory = getProxyFactory(descriptor, (ObjectPool)mockPool.proxy());
33         Object JavaDoc result = factory.create();
34         assertNotNull(result);
35         MuleProxy proxy = (MuleProxy)result;
36         assertEquals("apple", proxy.getDescriptor().getName());
37         mockPool.verify();
38     }
39
40     public abstract ObjectFactory getProxyFactory(MuleDescriptor descriptor, ObjectPool pool);
41 }
42
Popular Tags