Package com.hp.mwtests.ts.txoj.common.resources

Examples of com.hp.mwtests.ts.txoj.common.resources.AtomicObject


    public void run (String[] args)
    {
  try
  {
      AtomicObject obj = new AtomicObject();
      Uid objRef = obj.get_uid();
 
      AtomicAction A = new AtomicAction();
 
      A.begin();
 
      obj.set(1234);
 
      A.commit();
 
      AtomicObject recObj = new AtomicObject(objRef);
 
      AtomicAction B = new AtomicAction();

      B.begin();
 
      if (recObj.get() == 1234)
      {
    System.out.print("Passed.");

    assertSuccess();
      }
View Full Code Here


public class Hammer extends Test
{

public void run(String[] args)
    {
  HammerThreadedObject.object = new AtomicObject();
  HammerThreadedObject object1 = new HammerThreadedObject(2);
  HammerThreadedObject object2 = new HammerThreadedObject(-2);

  object1.start();
  object2.start();
View Full Code Here

  return System.currentTimeMillis() - t1;
    }

public static long persistentTest (long iters)
    {
  AtomicObject foo = new AtomicObject();
  AtomicAction A = new AtomicAction();
  long t1 = System.currentTimeMillis();

  A.begin();
 
  try
  {
      for (int c = 0; c < iters; c++)
      {
    foo.set(2);
      }
  }
  catch (TestException e)
  {
      System.out.println("AtomicObject exception raised.");
View Full Code Here

TOP

Related Classes of com.hp.mwtests.ts.txoj.common.resources.AtomicObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.