public class DestroyTest extends Test
{
public void run(String[] args)
{
AtomicObject atomicObject = new AtomicObject();
Uid u = atomicObject.get_uid();
AtomicAction a = new AtomicAction();
a.begin();
try
{
atomicObject.set(10);
}
catch (TestException e)
{
logInformation("set : failed");
logInformation("Unexpected exception - "+e);
e.printStackTrace(System.err);
assertFailure();
}
logInformation("set : ok");
if (!atomicObject.destroy())
{
logInformation("destroy : failed");
a.abort();
assertFailure();
}
a.commit();
atomicObject = new AtomicObject(u);
boolean passed = false;
try
{
int val = atomicObject.get();
if (val != -1)
{
logInformation("got : "+val);