[jboss-svn-commits] JBL Code SVN: r29523 - in labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943: stm and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Oct 1 12:58:57 EDT 2009


Author: whitingjr
Date: 2009-10-01 12:58:56 -0400 (Thu, 01 Oct 2009)
New Revision: 29523

Modified:
   labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/entitymanager/TestSTMEntityManagerImpl.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/AbstractUnitT.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/TestUnitSTM.java
Log:
Added xml JAXB classes for marshalling data.

Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/entitymanager/TestSTMEntityManagerImpl.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/entitymanager/TestSTMEntityManagerImpl.java	2009-10-01 16:58:17 UTC (rev 29522)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/entitymanager/TestSTMEntityManagerImpl.java	2009-10-01 16:58:56 UTC (rev 29523)
@@ -1,8 +1,10 @@
 package uk.ac.ncl.sdia.a8905943.entitymanager;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.persistence.EntityExistsException;
 import javax.persistence.NoResultException;
@@ -31,10 +33,10 @@
 	 */
 	@Test
 	public void testCheckContainsMethodWorks() {
-		Map<String, List<Object>> modelStore = this.stm.getModel();
+		Map<String, Set<Object>> modelStore = this.stm.getModel();
 		Long carId = new Long(1);
 		LeccyCar car = new LeccyCar(carId);
-		List<Object> carList = new ArrayList<Object>();
+		Set<Object> carList = new HashSet<Object>();
 		carList.add(car);
 		String carFQCN = "uk.ac.ncl.sdia.a8905943.model.LeccyCar";
 		Assert.assertEquals(carFQCN, car.getClass().getName());
@@ -58,10 +60,10 @@
 	 */
 	@Test
 	public void testCheckSingleResultQueryWorks() {
-		Map<String, List<Object>> modelStore = this.stm.getModel();
+		Map<String, Set<Object>> modelStore = this.stm.getModel();
 		Long carId = new Long(1);
 		LeccyCar car = new LeccyCar(carId);
-		List<Object> carList = new ArrayList<Object>();
+		Set<Object> carList = new HashSet<Object>();
 		carList.add(car);
 		String carFQCN = "uk.ac.ncl.sdia.a8905943.model.LeccyCar";
 		Assert.assertEquals(carFQCN, car.getClass().getName());
@@ -92,10 +94,10 @@
 	@Test (expected=NonUniqueResultException.class)
 	public void testCheckSingleResultQueryThrowsNonUniqueException()
 	{
-		Map<String, List<Object>> modelStore = this.stm.getModel();
+		Map<String, Set<Object>> modelStore = this.stm.getModel();
 		Long carId = new Long(1);
 		LeccyCar car = new LeccyCar(carId);
-		List<Object> carList = new ArrayList<Object>();
+		Set<Object> carList = new HashSet<Object>();
 		carList.add(car);
 		carList.add(new LeccyCar(new Long(2)));
 		String carFQCN = "uk.ac.ncl.sdia.a8905943.model.LeccyCar";
@@ -110,10 +112,10 @@
 	@Test
 	public void testCheckFindEntity()
 	{
-		Map<String, List<Object>> modelStore = this.stm.getModel();
+		Map<String, Set<Object>> modelStore = this.stm.getModel();
 		Long carId = new Long(1);
 		LeccyCar car = new LeccyCar(carId);
-		List<Object> carList = new ArrayList<Object>();
+		Set<Object> carList = new HashSet<Object>();
 		carList.add(car);
 		carList.add(new LeccyCar(new Long(2)));
 		String carFQCN = "uk.ac.ncl.sdia.a8905943.model.LeccyCar";
@@ -141,10 +143,10 @@
 	@Test (expected=EntityExistsException.class)
 	public void testCheckPersistThrowsEntityExistsExceptino()
 	{
-		Map<String, List<Object>> modelStore = this.stm.getModel();
+		Map<String, Set<Object>> modelStore = this.stm.getModel();
 		Long carId = new Long(1);
 		LeccyCar car = new LeccyCar(carId);
-		List<Object> carList = new ArrayList<Object>();
+		Set<Object> carList = new HashSet<Object>();
 		carList.add(car);
 		String carFQCN = "uk.ac.ncl.sdia.a8905943.model.LeccyCar";
 		Assert.assertEquals(carFQCN, car.getClass().getName());
@@ -159,10 +161,10 @@
 	@Test
 	public void testCheckQueryDoesNotReturnRemovedEntity()
 	{
-	   Map<String, List<Object>> modelStore = this.stm.getModel();
+	   Map<String, Set<Object>> modelStore = this.stm.getModel();
       Long carId = new Long(1);
       LeccyCar car = new LeccyCar(carId);
-      List<Object> carList = new ArrayList<Object>();
+      Set<Object> carList = new HashSet<Object>();
       carList.add(car);
       carList.add(new LeccyCar(new Long(5)));
       modelStore.put(car.getClass().getName(), carList);
@@ -178,10 +180,10 @@
 	@Test
 	public void testCheckFindingDeletedEntityNoResult()
 	{
-	   Map<String, List<Object>> modelStore = this.stm.getModel();
+	   Map<String, Set<Object>> modelStore = this.stm.getModel();
       Long carId = new Long(1);
       LeccyCar car = new LeccyCar(carId);
-      List<Object> carList = new ArrayList<Object>();
+      Set<Object> carList = new HashSet<Object>();
       carList.add(car);
       carList.add(new LeccyCar(new Long(2)));
       String carFQCN = "uk.ac.ncl.sdia.a8905943.model.LeccyCar";
@@ -201,10 +203,10 @@
 	@Test
    public void testCheckFindingDeletedAfterAdding()
    {
-      Map<String, List<Object>> modelStore = this.stm.getModel();
+      Map<String, Set<Object>> modelStore = this.stm.getModel();
       Long carId = new Long(1);
       LeccyCar car = new LeccyCar(carId);
-      List<Object> carList = new ArrayList<Object>();
+      Set<Object> carList = new HashSet<Object>();
       carList.add(car);
       carList.add(new LeccyCar(new Long(2)));
       String carFQCN = "uk.ac.ncl.sdia.a8905943.model.LeccyCar";

Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/AbstractUnitT.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/AbstractUnitT.java	2009-10-01 16:58:17 UTC (rev 29522)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/AbstractUnitT.java	2009-10-01 16:58:56 UTC (rev 29523)
@@ -8,6 +8,7 @@
 
 import java.sql.Connection;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -25,15 +26,15 @@
 {
    protected STM stm = null;
    protected ConcurrentMap<Long, TransactedObjectReference> fieldStore = null;
-   protected ConcurrentMap<String, List<Object>> modelStore = null;
+   protected ConcurrentMap<String, Set<Object>> modelStore = null;
 
    
    @Before
    public void setUp()
    {
       this.fieldStore = new ConcurrentHashMap<Long, TransactedObjectReference>();
-      this.modelStore = new ConcurrentHashMap<String, List<Object>>();
-      this.stm  = new STM("retail", this.fieldStore, this.modelStore);
+      this.modelStore = new ConcurrentHashMap<String, Set<Object>>();
+      this.stm = new STM("retail", this.fieldStore, this.modelStore);
       STMFactory.getFactoryInstance().allocate(this.stm);
       stm.setCurrentTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
       stm.setTimeout(10000);

Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/TestUnitSTM.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/TestUnitSTM.java	2009-10-01 16:58:17 UTC (rev 29522)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/stm/TestUnitSTM.java	2009-10-01 16:58:56 UTC (rev 29523)
@@ -6,7 +6,7 @@
  */
 package uk.ac.ncl.sdia.a8905943.stm;
 
-import java.util.List;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -23,7 +23,7 @@
       throws IsolationLevelNotConfiguredException  
    { // expected to throw an exception when stm instructred to begin before configured
       ConcurrentMap<Long, TransactedObjectReference> fieldStore = new ConcurrentHashMap<Long, TransactedObjectReference>();
-      ConcurrentMap<String, List<Object>> modelStore = new ConcurrentHashMap<String, List<Object>>();
+      ConcurrentMap<String, Set<Object>> modelStore = new ConcurrentHashMap<String, Set<Object>>();
       
       STM stm = new STM("retail", fieldStore, modelStore);
       STMFactory.getFactoryInstance().allocate(stm);



More information about the jboss-svn-commits mailing list