com.mockrunner.mock.jdbc.MockSavepoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockrunner-jdk1.3-j2ee1.3 Show documentation
Show all versions of mockrunner-jdk1.3-j2ee1.3 Show documentation
Mockrunner is a lightweight framework for unit testing applications
in the J2EE environment. It supports servlets, filters, tag classes
and Struts actions. It includes a JDBC a JMS and a JCA test
framework and can be used to test EJB based applications.
The newest version!
package com.mockrunner.mock.jdbc;
import java.sql.SQLException;
import java.sql.Savepoint;
/**
* Mock implementation of Savepoint
.
*/
public class MockSavepoint implements Savepoint
{
private static int idCount = 0;
private String name;
private int id;
private int number;
private boolean released;
private boolean rolledback;
public MockSavepoint(int number)
{
this("", number);
}
public MockSavepoint(String name, int number)
{
this.name = name;
this.id = idCount++;
this.number = number;
released = false;
rolledback = false;
}
public int getSavepointId() throws SQLException
{
return id;
}
public String getSavepointName() throws SQLException
{
return name;
}
public int getNumber()
{
return number;
}
public boolean isReleased()
{
return released;
}
/**
* @deprecated use {@link #isRolledBack}
*/
public boolean isRollbacked()
{
return isRolledBack();
}
public boolean isRolledBack()
{
return rolledback;
}
public void setReleased(boolean released)
{
this.released = released;
}
/**
* @deprecated use {@link #setRolledBack}
*/
public void setRollbacked(boolean rollbacked)
{
setRolledBack(rollbacked);
}
public void setRolledBack(boolean rollbacked)
{
this.rolledback = rollbacked;
}
}