[jboss-svn-commits] JBL Code SVN: r32479 - in labs/jbosstm/trunk: ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic and 4 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Apr 8 05:10:28 EDT 2010
Author: jhalliday
Date: 2010-04-08 05:10:26 -0400 (Thu, 08 Apr 2010)
New Revision: 32479
Added:
labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/EnvironmentBeanTest.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/EnvironmentBeanTest.java
labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/EnvironmentBeanTest.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/basic/
labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/basic/EnvironmentBeanTest.java
Modified:
labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java
Log:
Improve EnvironmentBean test coverage. JBTM-720
Added: labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/EnvironmentBeanTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/EnvironmentBeanTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/EnvironmentBeanTest.java 2010-04-08 09:10:26 UTC (rev 32479)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2010,
+ * @author JBoss, by Red Hat.
+ */
+package com.hp.mwtests.ts.txoj.basic;
+
+import com.arjuna.ats.txoj.common.TxojEnvironmentBean;
+import org.junit.Test;
+
+import java.util.HashMap;
+
+/**
+ * Unit tests for EnvironmentBean classes.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+public class EnvironmentBeanTest
+{
+ @Test
+ public void testTxojEnvironmentBean() throws Exception {
+ HashMap map;
+ com.arjuna.common.tests.simple.EnvironmentBeanTest.testBeanByReflection(new TxojEnvironmentBean());
+ }
+}
Added: labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/EnvironmentBeanTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/EnvironmentBeanTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/EnvironmentBeanTest.java 2010-04-08 09:10:26 UTC (rev 32479)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2010,
+ * @author JBoss, by Red Hat.
+ */
+package com.hp.mwtests.ts.jdbc.basic;
+
+import java.util.Hashtable;
+
+import com.arjuna.ats.jdbc.common.JDBCEnvironmentBean;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * Unit tests for EnvironmentBean classes.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+public class EnvironmentBeanTest
+{
+ @Test
+ public void testJDBCEnvironmentBean() throws Exception {
+ // reflection won't work on this one :-(
+
+ JDBCEnvironmentBean bean = new JDBCEnvironmentBean();
+
+ bean.setIsolationLevel(2);
+ assertEquals(2, bean.getIsolationLevel());
+
+ Hashtable hashtable = new Hashtable();
+ hashtable.put("testKey", "testValue");
+
+ bean.setJndiProperties(hashtable);
+ assertEquals(hashtable, bean.getJndiProperties());
+ assertNotSame(hashtable, bean.getJndiProperties());
+ }
+}
Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/EnvironmentBeanTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/EnvironmentBeanTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/EnvironmentBeanTest.java 2010-04-08 09:10:26 UTC (rev 32479)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2010,
+ * @author JBoss, by Red Hat.
+ */
+package com.hp.mwtests.ts.jts.utils;
+
+import com.arjuna.ats.jts.common.JTSEnvironmentBean;
+import org.junit.Test;
+
+/**
+ * Unit tests for EnvironmentBean classes.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+public class EnvironmentBeanTest
+{
+ @Test
+ public void testJTSEnvironmentBean() throws Exception {
+ com.arjuna.common.tests.simple.EnvironmentBeanTest.testBeanByReflection(new JTSEnvironmentBean());
+ }
+}
Added: labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/basic/EnvironmentBeanTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/basic/EnvironmentBeanTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/basic/EnvironmentBeanTest.java 2010-04-08 09:10:26 UTC (rev 32479)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2010,
+ * @author JBoss, by Red Hat.
+ */
+package com.hp.mwtests.orbportability.basic;
+
+import com.arjuna.orbportability.common.OrbPortabilityEnvironmentBean;
+import org.junit.Test;
+
+/**
+ * Unit tests for EnvironmentBean classes.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+public class EnvironmentBeanTest
+{
+ @Test
+ public void testOrbPortabilityEnvironmentBean() throws Exception {
+ com.arjuna.common.tests.simple.EnvironmentBeanTest.testBeanByReflection(new OrbPortabilityEnvironmentBean());
+ }
+}
Modified: labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java
===================================================================
--- labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java 2010-04-07 23:44:40 UTC (rev 32478)
+++ labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java 2010-04-08 09:10:26 UTC (rev 32479)
@@ -119,8 +119,13 @@
setter.invoke(bean, new Object[] {null});
outputValue = getter.invoke(bean, new Object[] {});
assertNotNull(outputValue);
- assertTrue(((Collection)outputValue).isEmpty());
+ if(outputValue instanceof Collection) {
+ assertTrue(((Collection)outputValue).isEmpty());
+ } else {
+ assertTrue(((Map)outputValue).isEmpty());
+ }
+
// TODO if collection type is an interface (but how to know?) test matched Instance|ClassNames field sync.
}
More information about the jboss-svn-commits
mailing list