All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mockrunner.jdbc.StatementResultSetHandler Maven / Gradle / Ivy

Go to download

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.jdbc;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.mockrunner.mock.jdbc.MockStatement;

/**
 * Concrete handler for {@link AbstractResultSetHandler}.
 */
public class StatementResultSetHandler extends AbstractResultSetHandler
{
    private List statements;

    public StatementResultSetHandler()
    {
        statements = new ArrayList();
    }  
    
    /**
     * The Connection adds new statements with
     * this method.
     * @param statement the {@link MockStatement}
     */
    public void addStatement(MockStatement statement)
    {
        statement.setResultSetHandler(this);
        statements.add(statement);
    }
    
    /**
     * Returns a List of all statements.
     * @return the List of {@link MockStatement} objects
     */
    public List getStatements()
    {
        return Collections.unmodifiableList(statements);
    }

    /**
     * Clears the List of statements.
     */
    public void clearStatements()
    {
        statements.clear();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy