From jboss-remoting-commits at lists.jboss.org Fri Jan 8 17:46:07 2010 Content-Type: multipart/mixed; boundary="===============5201541550494580731==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r5652 - remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker. Date: Fri, 08 Jan 2010 17:46:07 -0500 Message-ID: <201001082246.o08Mk7hR007584@svn01.web.mwc.hst.phx2.redhat.com> --===============5201541550494580731== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2010-01-08 17:46:06 -0500 (Fri, 08 Jan 2010) New Revision: 5652 Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/ClientI= nvokerDelayedDestructionTestCase.java Log: JBREM-1176: Updated testStaticTimer() to account for the destruction and re= creation of the Timer. Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/= ClientInvokerDelayedDestructionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/Client= InvokerDelayedDestructionTestCase.java 2010-01-08 22:14:34 UTC (rev 5651) +++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/invoker/Client= InvokerDelayedDestructionTestCase.java 2010-01-08 22:46:06 UTC (rev 5652) @@ -51,6 +51,7 @@ = /** * Unit tests from JBREM-877. + * Adjusted for JBREM-1176. * = * @author Ron Sigal * @version $Revision: 1.1 $ @@ -271,10 +272,11 @@ setupServer(); = = - // Get static Timer. + // Verify Timer hasn't been created. Field field =3D Client.class.getDeclaredField("invokerDestructionTim= er"); field.setAccessible(true); Timer invokerDestructionTimer =3D (Timer) field.get(null); + assertNull(invokerDestructionTimer); = // Create client. InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); @@ -292,6 +294,10 @@ clients[i].disconnect(); } = + // Verify Timer has been created. + invokerDestructionTimer =3D (Timer) field.get(null); + assertNotNull(invokerDestructionTimer); + = // Verify all Clients are using the same Timer. for (int i =3D 0; i < 50; i++) { @@ -300,7 +306,37 @@ = Thread.sleep(10000); assertEquals(0, InvokerRegistry.getClientInvokers().length); + = + // Verify Timer has been destroyed. + invokerDestructionTimer =3D (Timer) field.get(null); + assertNull(invokerDestructionTimer); + = + // Recreate Clients to verify that a new Timer is created. + for (int i =3D 0; i < 50; i++) + { + clients[i] =3D new Client(clientLocator, clientConfig); + clients[i].connect(); + assertEquals("abc", clients[i].invoke("abc")); + clients[i].disconnect(); + } + = + // Verify Timer has been created. + invokerDestructionTimer =3D (Timer) field.get(null); + assertNotNull(invokerDestructionTimer); + = + // Verify all Clients are using the same Timer. + for (int i =3D 0; i < 50; i++) + { + assertEquals("Should be the same Timer", invokerDestructionTimer,= field.get(clients[i])); + } = + Thread.sleep(10000); + assertEquals(0, InvokerRegistry.getClientInvokers().length); + = + // Verify Timer has been destroyed. + invokerDestructionTimer =3D (Timer) field.get(null); + assertNull(invokerDestructionTimer); + = shutdownServer(); log.info(getName() + " PASSES"); } --===============5201541550494580731==--