com.mockrunner.test.jdbc.BasicJDBCTestCaseAdapterTest 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.test.jdbc;
import java.sql.DriverManager;
import java.util.Enumeration;
import com.mockrunner.jdbc.BasicJDBCTestCaseAdapter;
import com.mockrunner.mock.jdbc.JDBCMockObjectFactory;
import com.mockrunner.mock.jdbc.MockDriver;
public class BasicJDBCTestCaseAdapterTest extends BasicJDBCTestCaseAdapter
{
private JDBCMockObjectFactory factory;
protected void setUp() throws Exception
{
factory = new JDBCMockObjectFactory();
setJDBCMockObjectFactory(factory);
super.setUp();
}
public void testJDBCFactorySet()
{
assertSame(factory, getJDBCMockObjectFactory());
assertSame(getJDBCMockObjectFactory(), getJDBCMockObjectFactory());
}
public void testDriverDeregistered() throws Exception
{
Enumeration drivers = DriverManager.getDrivers();
assertTrue(drivers.nextElement() instanceof MockDriver);
assertFalse(drivers.hasMoreElements());
super.tearDown();
drivers = DriverManager.getDrivers();
while(drivers.hasMoreElements())
{
assertFalse(drivers.nextElement() instanceof MockDriver);
}
}
}