* @version $Rev: 541105 $ $Date: 2007-05-24 06:27:56 +0800 (Thu, 24 May 2007) $
*/
public class GenericConnectionManagerGBeanSerializationTest extends TestCase {
public void testSerialization() throws Exception {
Kernel kernel = new BasicKernel("test");
kernel.boot();
AbstractName abstractName = new AbstractName(URI.create("foo/bar/1/car?name=ConnectionManager"));
GBeanData data = new GBeanData(abstractName, GenericConnectionManagerGBean.GBEAN_INFO);
data.setAttribute("transactionSupport", NoTransactions.INSTANCE);
data.setAttribute("pooling", new SinglePool(10, 0, 5000, 5, false, false, true));
kernel.loadGBean(data, this.getClass().getClassLoader());
kernel.startGBean(abstractName);
Object cm = kernel.getGBean(abstractName);
assertTrue(cm instanceof GenericConnectionManagerGBean);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(cm);
out.flush();