From jboss-remoting-commits at lists.jboss.org Tue Aug 31 11:50:47 2010
Content-Type: multipart/mixed; boundary="===============0704920001811684689=="
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: r6080 -
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test.
Date: Tue, 31 Aug 2010 11:50:46 -0400
Message-ID: <201008311550.o7VFokXS000496@svn01.web.mwc.hst.phx2.redhat.com>
--===============0704920001811684689==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: ron.sigal(a)jboss.com
Date: 2010-08-31 11:50:46 -0400 (Tue, 31 Aug 2010)
New Revision: 6080
Added:
remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/Co=
pyOnWriteHashMapTestCase.java
Log:
JBREM-1244: New unit test.
Added: remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/tes=
t/CopyOnWriteHashMapTestCase.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
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/C=
opyOnWriteHashMapTestCase.java (rev 0)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/C=
opyOnWriteHashMapTestCase.java 2010-08-31 15:50:46 UTC (rev 6080)
@@ -0,0 +1,246 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.jboss.remoting3.CopyOnWriteHashMapWrapper;
+import org.jboss.xnio.log.Logger;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author Ron Sigal
+ * @version $Revision: 1.1 $
+ *
+ * Copyright Aug 28, 2010
+ */
+(a)Test(suiteName =3D "CopyOnWriteHashMap")
+public class CopyOnWriteHashMapTestCase extends RemotingTestBase {
+
+ private static final Logger log =3D Logger.getLogger(CopyOnWriteHashMap=
TestCase.class);
+
+ @BeforeMethod
+ public void setUp() {
+ }
+
+ @AfterMethod
+ public void tearDown() throws IOException {
+ }
+ =
+ @Test
+ public void testIdentityFalse() throws Exception {
+ enter();
+ =
+ try {
+ doTest(false);
+ log.info(getName() + " PASSES");
+ } finally {
+ exit();
+ }
+ }
+
+ @Test
+ public void testIdentityTrue() throws Exception {
+ enter();
+ =
+ try {
+ doTest(true);
+ log.info(getName() + " PASSES");
+ } finally {
+ exit();
+ }
+ }
+ =
+ protected void doTest(boolean identity) {
+ CopyOnWriteHashMapWrapper