Ejemplo n.º 1
0
  @Test
  public void testGettersAndSetters() throws Exception {
    CustomerDAO dao = new CustomerDAO();
    ITransactionManager txMgr = EasyMock.createStrictMock(ITransactionManager.class);
    IConfiguration configuration = EasyMock.createStrictMock(IConfiguration.class);

    dao.setTransactionManager(txMgr);
    dao.setConfiguration(configuration);

    assertEquals("Wrong transaction manager.", txMgr, dao.getTransactionManager());
    assertEquals("Wrong customer service.", configuration, dao.getConfiguration());
  }
Ejemplo n.º 2
0
 @Test
 public void testConstructor() throws Exception {
   CustomerDAO dao = new CustomerDAO();
   assertNull("txManager should be null.", dao.getTransactionManager());
 }