try {
DeploymentContext context = new DeploymentContext(outFile, URI.create("foo/bar"), ConfigurationModuleType.SERVICE, parentId, "domain", "server", null);
J2eeContext j2eeContext = new J2eeContextImpl("domain", "server", "null", "test", "configtest", "foo", NameFactory.J2EE_MODULE);
GbeanType[] gbeans = plan.getGbeanArray();
ServiceConfigBuilder.addGBeans(gbeans, cl, j2eeContext, context);
Set beanDatas = context.listGBeans(new ObjectName("*:*"));
assertEquals(1, beanDatas.size());
ObjectName beanName = (ObjectName) beanDatas.iterator().next();
GBeanData data = context.getGBeanInstance(beanName);
FooBarBean fooBarBean = (FooBarBean) data.getAttribute("fooBarBean");
assertNotNull(fooBarBean);