站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

TransactionAssert - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.common.junit
Class TransactionAssert

java.lang.Object
  extended byAssert
      extended byorg.jboss.portal.common.junit.TransactionAssert

public class TransactionAssert
extends Assert

Version:
$Revision: 5246 $
Author:
Julien Viet
See Also:
Serialized Form

Nested Class Summary
static class TransactionAssert.Terminator
           
 
Field Summary
static TransactionAssert.Terminator MARKED_AS_ROLLBACK
          .
static TransactionAssert.Terminator MUST_COMMIT
          .
static TransactionAssert.Terminator MUST_ROLLBACK
          .
static TransactionAssert.Terminator NONE
          .
private static java.lang.String[] STATUS_NAMES
           
 
Constructor Summary
TransactionAssert()
           
 
Method Summary
static void assertStatusEquals(int expectedStatus)
          Assert the status of the current transaction.
static void beginTransaction()
          Begin a transaction or fail.
static void commitTransaction()
          Commit the transaction or fail.
static java.lang.String decodeStatus(int status)
          Decode the status name.
static int endTransaction()
          If no transaction do nothing.
static int endTransaction(TransactionAssert.Terminator expectedTerminator)
          If no transaction do nothing.
static javax.transaction.UserTransaction getUserTransaction()
           
static void rollbackTransaction()
          Rollback the transaction or fail.
static void rollbackTransaction(boolean marked)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_NAMES

private static final java.lang.String[] STATUS_NAMES

NONE

public static final TransactionAssert.Terminator NONE
.


MARKED_AS_ROLLBACK

public static final TransactionAssert.Terminator MARKED_AS_ROLLBACK
.


MUST_COMMIT

public static final TransactionAssert.Terminator MUST_COMMIT
.


MUST_ROLLBACK

public static final TransactionAssert.Terminator MUST_ROLLBACK
.

Constructor Detail

TransactionAssert

public TransactionAssert()
Method Detail

decodeStatus

public static java.lang.String decodeStatus(int status)
Decode the status name.

Parameters:
status - the status value
Returns:
the translated status name or null if it is not valid

assertStatusEquals

public static void assertStatusEquals(int expectedStatus)
Assert the status of the current transaction.

Parameters:
expectedStatus - the expected status

commitTransaction

public static void commitTransaction()
Commit the transaction or fail.


rollbackTransaction

public static void rollbackTransaction()
Rollback the transaction or fail.


rollbackTransaction

public static void rollbackTransaction(boolean marked)

beginTransaction

public static void beginTransaction()
Begin a transaction or fail.


endTransaction

public static int endTransaction()
If no transaction do nothing. End the transaction if it is active or marked for rollback otherwise fail.


endTransaction

public static int endTransaction(TransactionAssert.Terminator expectedTerminator)
If no transaction do nothing. End the transaction if it is active or marked for rollback otherwise fail.


getUserTransaction

public static javax.transaction.UserTransaction getUserTransaction()