I have a failing test here. It should be pretty self explanatory:
package org.deuce.test.basic;
import junit.framework.TestCase;
import org.deuce.Atomic;
/**
* Enum types have several synthetic methods generated for them. This
test is meant to ensure
* that calls to these methods do not include a context from within a
transaction as enumerations are
* already immutable/thread safe and not instrumented.
*
* @author Adam Lewis
*
*/
public class SyntheticEnumMethodTest extends TestCase{
public static enum A { ZERO, ONE, TWO };
public void testOrdinal() throws Exception {
atomicOrdinalAccess();
}
@Atomic
private void atomicOrdinalAccess(){
A a = A.ZERO;
assertEquals(0, a.ordinal());
}
public void testValueOf() throws Exception {
atomicValueOfAccess();
}
@Atomic
private void atomicValueOfAccess(){
A a = A.valueOf("ZERO");
assertEquals(a, A.ZERO);
}
}