1 9 package org.jboss.portal.test.cms.stress; 10 11 import org.jboss.portal.cms.NodeFactory; 12 import org.jboss.portal.common.transaction.Transactions; 13 14 import javax.transaction.TransactionManager ; 15 16 20 public class EndTxCommand extends Command 21 { 22 23 private boolean shouldCommit; 24 25 public EndTxCommand(boolean shouldCommit) 26 { 27 this.shouldCommit = Boolean.valueOf(shouldCommit).booleanValue(); 28 } 29 30 public void execute(Client.Result result, NodeFactory factory) throws Exception 31 { 32 TransactionManager tm = factory.getTransactionManager(); 33 boolean hasCommited = Transactions.end(tm); 34 result.assertTrue(hasCommited == shouldCommit, hasCommited ? "not rollbacked" : "not commited"); 35 } 36 37 protected String describe() 38 { 39 return shouldCommit ? "[commit]" : "[rollback]"; 40 } 41 42 } 43 | Popular Tags |