[jboss-svn-commits] JBL Code SVN: r27870 - in labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM: .settings and 7 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Jul 11 05:23:44 EDT 2009
Author: whitingjr
Date: 2009-07-11 05:23:44 -0400 (Sat, 11 Jul 2009)
New Revision: 27870
Added:
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/Owner.java
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/stm/
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/stm/cell/
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/stm/cell/DataCell.java
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/JUTestAllTests.java
Modified:
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.classpath
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.settings/org.eclipse.jdt.core.prefs
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/pom.xml
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/TransactionImpl.java
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/model/TransactionStatus.java
labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/handle/JUnitTestFieldUtils.java
Log:
Updated test cases.
Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.classpath
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.classpath 2009-07-11 09:22:18 UTC (rev 27869)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.classpath 2009-07-11 09:23:44 UTC (rev 27870)
@@ -6,5 +6,6 @@
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.generic.runtimeTarget/JBoss v5.0"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.settings/org.eclipse.jdt.core.prefs 2009-07-11 09:22:18 UTC (rev 27869)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/.settings/org.eclipse.jdt.core.prefs 2009-07-11 09:23:44 UTC (rev 27870)
@@ -1,5 +1,12 @@
-#Wed May 20 11:56:22 BST 2009
+#Thu Jul 09 14:43:03 BST 2009
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/pom.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/pom.xml 2009-07-11 09:22:18 UTC (rev 27869)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/pom.xml 2009-07-11 09:23:44 UTC (rev 27870)
@@ -12,12 +12,6 @@
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.bcel</groupId>
<artifactId>bcel</artifactId>
<version>5.2</version>
Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/Owner.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/Owner.java (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/Owner.java 2009-07-11 09:23:44 UTC (rev 27870)
@@ -0,0 +1,20 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package uk.ac.ncl.sdia.a8905943.impl;
+
+/**
+ * The owner object represents the relationship between a data cell
+ * and a transaction that wants to modify the cells value.
+ *
+ * @author <a href="whitingjr at hotmail.com">Jeremy Whiting</a>
+ * @version $Revision: 1.1 $
+ */
+public class Owner {
+
+
+
+}
Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/TransactionImpl.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/TransactionImpl.java 2009-07-11 09:22:18 UTC (rev 27869)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/impl/TransactionImpl.java 2009-07-11 09:23:44 UTC (rev 27870)
@@ -9,10 +9,12 @@
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import javax.transaction.RollbackException;
+import javax.transaction.Status;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
import org.apache.log4j.Logger;
@@ -29,7 +31,7 @@
public class TransactionImpl implements STMTransaction{
// status available for inspection
- private volatile TransactionStatus status = TransactionStatus.NOTSTARTED;
+ private volatile int status = Status.STATUS_NO_TRANSACTION;
/**
* the statusModifer should be used for updating the status field. Any part of the system that is responsible
* for transitioning a transaction through it's states should use this field.
@@ -54,7 +56,6 @@
private final TransactionReadSet readSet = new TransactionReadSet();
private static final Logger logger = Logger.getLogger(TransactionImpl.class);
-
@Override
public void commit() {
@@ -80,8 +81,7 @@
@Override
public int getStatus() throws SystemException {
- // TODO Auto-generated method stub
- return 0;
+ return status;
}
@Override
@@ -124,13 +124,11 @@
{
logger.info("Starting transaction with id ["++"].");
}
-
- if ()
- {
-
- }
-
}
+ public TransactionImpl(Xid id) {
+ // FIXME TransactionImpl constructor
+ }
+
}
Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/model/TransactionStatus.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/model/TransactionStatus.java 2009-07-11 09:22:18 UTC (rev 27869)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/model/TransactionStatus.java 2009-07-11 09:23:44 UTC (rev 27870)
@@ -21,7 +21,7 @@
// aditional states for STM design to work
, VALIDATING
- /* initial state transition model
+ /* state transition model
NOTSTARTED -> RUNNING
RUNNING -> VALIDATING or ABORTING
VALIDATING -> PREPARED
Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/stm/cell/DataCell.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/stm/cell/DataCell.java (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/stm/cell/DataCell.java 2009-07-11 09:23:44 UTC (rev 27870)
@@ -0,0 +1,19 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package uk.ac.ncl.sdia.a8905943.stm.cell;
+
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+
+import uk.ac.ncl.sdia.a8905943.impl.Owner;
+
+public class DataCell<T> {
+
+ private volatile T reference;
+ private final AtomicReferenceFieldUpdater<DataCell,T> updater = AtomicReferenceFieldUpdater.newUpdater(DataCell.class, , reference);
+ private volatile Owner owner;
+
+}
Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/JUTestAllTests.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/JUTestAllTests.java (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/JUTestAllTests.java 2009-07-11 09:23:44 UTC (rev 27870)
@@ -0,0 +1,22 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package uk.ac.ncl.sdia.a8905943;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import uk.ac.ncl.sdia.a8905943.handle.JUnitTestFieldUtils;
+
+ at RunWith(Suite.class)
+ at SuiteClasses({
+ JUnitTestFieldUtils.class
+})
+public class JUTestAllTests {
+
+
+}
Modified: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/handle/JUnitTestFieldUtils.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/handle/JUnitTestFieldUtils.java 2009-07-11 09:22:18 UTC (rev 27869)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/test/java/uk/ac/ncl/sdia/a8905943/handle/JUnitTestFieldUtils.java 2009-07-11 09:23:44 UTC (rev 27870)
@@ -18,8 +18,7 @@
public class JUnitTestFieldUtils
{
-
- @Test public void checkIdFieldFound()
+ @Test public void testcheckIdFieldFound()
throws FieldNotFoundException
{
try
@@ -37,6 +36,7 @@
Assert.fail("Not expecting to have an exception thrown when finding the id field.");
}
}
+
@Test (expected=FieldNotFoundException.class)
public void checkExpectedExceptionThrown()
throws FieldNotFoundException
@@ -62,8 +62,7 @@
/**
*
- * A typical car entity that has expected id annotated field. Not worried about
- * bean accessor methods for the purpose of testing.
+ * A typical car entity that has expected id annotated field.
*
* @author <a href="whitingjr at hotmail.com">Jeremy Whiting</a>
* @version $Revision: 1.1 $
More information about the jboss-svn-commits
mailing list