Package com.ibatis.sqlmap

Source Code of com.ibatis.sqlmap.ParameterMapTest

package com.ibatis.sqlmap;

import com.testdomain.Account;

import java.sql.SQLException;

public class ParameterMapTest extends BaseSqlMapTest {

  // SETUP & TEARDOWN

  protected void setUp() throws Exception {
    initSqlMap("com/ibatis/sqlmap/maps/SqlMapConfig.xml", null);
    initScript("com/scripts/account-init.sql");
  }

  protected void tearDown() throws Exception {
  }

  // PARAMETER MAP FEATURE TESTS

  public void testSpecifiedType() throws SQLException {
    Account account = newAccount6();

    sqlMap.update("insertAccountNullableEmail", account);

    account = (Account) sqlMap.queryForObject("getAccountNullableEmail", new Integer(6));

    assertAccount6(account);
  }

  public void testUnknownParameterClass() throws SQLException {
    Account account = newAccount6();

    sqlMap.update("insertAccountUknownParameterClass", account);

    account = (Account) sqlMap.queryForObject("getAccountNullableEmail", new Integer(6));

    assertAccount6(account);
  }

  public void testNullParameter() throws SQLException {

    Account account = (Account) sqlMap.queryForObject("getAccountNullParameter", null);


    assertNull(account);
  }

  public void testNullParameter2() throws SQLException {

    Account account = (Account) sqlMap.queryForObject("getAccountNullParameter");


    assertNull(account);
  }
}
TOP

Related Classes of com.ibatis.sqlmap.ParameterMapTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.