use of com.hp.mwtests.ts.txoj.common.resources.HammerThreadedObject in project narayana by jbosstm.
the class LockConflictUnitTest method testAtomicObject.
@Test
public void testAtomicObject() throws Exception {
HammerThreadedObject.object = new AtomicObject();
HammerThreadedObject object1 = new HammerThreadedObject(2);
HammerThreadedObject object2 = new HammerThreadedObject(-2);
HammerThreadedObject.object.setRetry(2);
object1.start();
object2.start();
try {
object1.join();
object2.join();
} catch (InterruptedException e) {
}
}
use of com.hp.mwtests.ts.txoj.common.resources.HammerThreadedObject in project narayana by jbosstm.
the class Hammer method test.
@Test
public void test() {
HammerThreadedObject.object = new AtomicObject();
HammerThreadedObject object1 = new HammerThreadedObject(2);
HammerThreadedObject object2 = new HammerThreadedObject(-2);
object1.start();
object2.start();
try {
object1.join();
object2.join();
} catch (InterruptedException e) {
}
}
use of com.hp.mwtests.ts.txoj.common.resources.HammerThreadedObject in project narayana by jbosstm.
the class SharedHammer method main.
public static void main(String[] args) {
boolean creator = true;
Uid id = null;
for (int i = 0; i < args.length; i++) {
if ("-object".equals(args[i])) {
creator = false;
id = new Uid(args[i + 1]);
}
}
if (creator) {
HammerThreadedObject.object = new AtomicObject();
System.out.println("Object created with id: " + HammerThreadedObject.object);
} else
HammerThreadedObject.object = new AtomicObject(id);
HammerThreadedObject object1 = new HammerThreadedObject(1);
object1.start();
try {
object1.join();
} catch (InterruptedException e) {
}
}
Aggregations