From: Adrian B. <ej...@us...> - 2003-05-07 11:59:51
|
User: ejort Date: 03/05/07 04:59:49 Modified: src/main/org/jboss/test/jmx/test DeployConnectionManagerUnitTestCase.java Log: Hack this test so it works Revision Changes Path 1.10 +20 -7 jbosstest/src/main/org/jboss/test/jmx/test/DeployConnectionManagerUnitTestCase.java Index: DeployConnectionManagerUnitTestCase.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployConnectionManagerUnitTestCase.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DeployConnectionManagerUnitTestCase.java 3 Mar 2003 06:45:50 -0000 1.9 +++ DeployConnectionManagerUnitTestCase.java 7 May 2003 11:59:49 -0000 1.10 @@ -35,7 +35,7 @@ /** * @see <related> * @author <a href="mailto:d_j...@us...">David Jencks</a> - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ public class DeployConnectionManagerUnitTestCase extends JBossTestCase @@ -114,7 +114,8 @@ //Get the xmbean descriptor from the di for the ra. Document ddDoc = (Document)getServer().getAttribute(new ObjectName("jboss.deployment:name=JBoss LocalTransaction JDBC Wrapper,service=DeploymentInfo"), "Document"); - Element dd = ddDoc.getRootElement(); + Element dd = ddDoc.getRootElement().element("outbound-adapters").element("connectionfactory-interface").element("mbean"); + log.debug(dd); assertTrue("server did not return an objectInstance", getServer().createMBean("org.jboss.mx.modelmbean.XMBean", mcfName, @@ -149,7 +150,6 @@ { AttributeList al = new AttributeList(); al.add(new Attribute("JndiName", "ConnectionManagerTestDS")); - al.add(new Attribute("ManagedConnectionFactoryName", mcfName)); al.add(new Attribute("TrackConnectionByTx", Boolean.TRUE)); al.add(new Attribute("LocalTransactions", Boolean.TRUE)); al.add(new Attribute("ManagedConnectionPool", mcpName)); @@ -158,7 +158,7 @@ al.add(new Attribute("JaasSecurityManagerService", new ObjectName("jboss.security:service=JaasSecurityManager"))); al.add(new Attribute("TransactionManagerService", new ObjectName("jboss.tm:service=TransactionManagerService"))); //try to set the attributes on the bean - assertTrue("setAttributes returned null", getServer().setAttributes(cmName, al) != null); + checkSetAttributes(cmName, al); }//anon block so I don't rename var @@ -171,18 +171,19 @@ al.add(new Attribute("UserName", "sa")); al.add(new Attribute("Password", "")); - assertTrue("setAttributes returned null", getServer().setAttributes(mcfName, al) != null); + checkSetAttributes(mcfName, al); }//anon block so I don't rename var { AttributeList al = new AttributeList(); al.add(new Attribute("MinSize", new Integer(0))); al.add(new Attribute("MaxSize", new Integer(50))); - al.add(new Attribute("BlockingTimeoutMillis", new Long(5000))); + // al.add(new Attribute("BlockingTimeoutMillis", new Long(5000))); al.add(new Attribute("IdleTimeoutMinutes", new Integer(15))); al.add(new Attribute("Criteria", "ByContainer")); + al.add(new Attribute("ManagedConnectionFactoryName", mcfName)); //try to set the attributes on the bean - assertTrue("setAttributes returned null", getServer().setAttributes(mcpName, al) != null); + checkSetAttributes(mcpName, al); }//anon block so I don't rename var @@ -283,4 +284,16 @@ } + protected void checkSetAttributes(ObjectName name, AttributeList list) + throws Exception + { + AttributeList result = getServer().setAttributes(name, list); + if (result.size() != list.size()) + { + AttributeList temp = new AttributeList(list); + temp.removeAll(result); + throw new Exception("For ObjectName " + name + + " the following attributes were not set " + temp); + } + } } |