Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mockobjects.examples.mailinglist
Class TestMailingList  view TestMailingList download TestMailingList.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.mockobjects.util.TestCaseMo
              extended bycom.mockobjects.examples.mailinglist.TestMailingList
All Implemented Interfaces:
junit.framework.Test

public class TestMailingList
extends com.mockobjects.util.TestCaseMo


Field Summary
static java.lang.String[] COLUMN_NAMES
           
static java.lang.String EMAIL
           
private  MailingList list
           
private  com.mockobjects.sql.MockConnection mockConnection
           
private  MockListAction mockListAction
           
private  com.mockobjects.sql.MockPreparedStatement mockPreparedStatement
           
private  com.mockobjects.sql.MockStatement mockStatement
           
static java.lang.String NAME
           
static java.lang.String[] ONE_ROW
           
static java.lang.String[][] TWO_ROWS
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestMailingList(java.lang.String name)
           
 
Method Summary
private  com.mockobjects.sql.MockMultiRowResultSet makeMultiRowResultSet()
           
private  void setExpectationsForAddMember()
           
private  void setExpectationsForListMembers()
           
private  void setExpectationsForPreparedStatement(java.lang.String sqlStatement)
           
private  void setExpectationsForRemoveMember()
           
 void setUp()
          Sets up the fixture, for example, open a network connection.
 void testAddExistingMember()
           
 void testAddNewMember()
           
 void testListConnectionFailure()
           
 void testListmembersFailure()
           
 void testListNoMembers()
           
 void testListOneMember()
           
 void testListResultSetFailure()
           
 void testListStatementFailure()
           
 void testListTwoMembers()
           
 void testPrepareStatementFailsForAdd()
           
 void testRemoveMember()
           
 void testRemoveMissingMember()
           
private  void verifyJDBC()
           
 
Methods inherited from class com.mockobjects.util.TestCaseMo
assertFails, assertVerifyFails, start
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMN_NAMES

public static final java.lang.String[] COLUMN_NAMES

EMAIL

public static final java.lang.String EMAIL
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

ONE_ROW

public static final java.lang.String[] ONE_ROW

TWO_ROWS

public static final java.lang.String[][] TWO_ROWS

list

private MailingList list

mockListAction

private MockListAction mockListAction

mockConnection

private com.mockobjects.sql.MockConnection mockConnection

mockPreparedStatement

private com.mockobjects.sql.MockPreparedStatement mockPreparedStatement

mockStatement

private com.mockobjects.sql.MockStatement mockStatement
Constructor Detail

TestMailingList

public TestMailingList(java.lang.String name)
Method Detail

setUp

public void setUp()
Description copied from class: junit.framework.TestCase
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.


testAddNewMember

public void testAddNewMember()
                      throws MailingListException,
                             java.sql.SQLException

testAddExistingMember

public void testAddExistingMember()
                           throws java.sql.SQLException

testPrepareStatementFailsForAdd

public void testPrepareStatementFailsForAdd()
                                     throws MailingListException

testRemoveMember

public void testRemoveMember()
                      throws MailingListException,
                             java.sql.SQLException

testRemoveMissingMember

public void testRemoveMissingMember()
                             throws java.sql.SQLException

testListNoMembers

public void testListNoMembers()
                       throws MailingListException,
                              java.sql.SQLException

testListOneMember

public void testListOneMember()
                       throws MailingListException,
                              java.sql.SQLException

testListTwoMembers

public void testListTwoMembers()
                        throws MailingListException,
                               java.sql.SQLException

testListmembersFailure

public void testListmembersFailure()
                            throws java.sql.SQLException

testListResultSetFailure

public void testListResultSetFailure()
                              throws MailingListException

testListStatementFailure

public void testListStatementFailure()
                              throws MailingListException

testListConnectionFailure

public void testListConnectionFailure()
                               throws MailingListException

makeMultiRowResultSet

private com.mockobjects.sql.MockMultiRowResultSet makeMultiRowResultSet()

setExpectationsForListMembers

private void setExpectationsForListMembers()

setExpectationsForAddMember

private void setExpectationsForAddMember()

setExpectationsForRemoveMember

private void setExpectationsForRemoveMember()

setExpectationsForPreparedStatement

private void setExpectationsForPreparedStatement(java.lang.String sqlStatement)

verifyJDBC

private void verifyJDBC()