Package com.testdomain

Examples of com.testdomain.Account


    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }

  public void testIterateNestedListProperty() throws SQLException {
    Account account = new Account();
    account.setAccountList(new ArrayList());
    account.getAccountList().add(new Account(1));
    account.getAccountList().add(new Account(2));
    account.getAccountList().add(new Account(3));

    List list = sqlMap.queryForList("iterateNestedListProperty", account);
    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }
View Full Code Here


    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }

  public void testIterateNestedListPropertyB() throws SQLException {
    Account account = new Account();
    account.setId(99);
    account.setAccountList(new ArrayList());
    account.getAccountList().add(new Account(1));
    account.getAccountList().add(new Account(2));
    account.getAccountList().add(new Account(3));

    List list = sqlMap.queryForList("iterateNestedListPropertyB", account);
    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }
View Full Code Here

  public void testIterateNestedMapListProperty() throws SQLException {
    Map account = new HashMap();
    List accountList = new ArrayList();
    account.put("accountList", accountList);
    accountList.add(new Account(1));
    accountList.add(new Account(2));
    accountList.add(new Account(3));

    List list = sqlMap.queryForList("iterateNestedMapListProperty", account);
    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }
View Full Code Here

    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }

  public void xtestArrayPropertyIterate2() throws SQLException {
    Account account = new Account();
    account.setIds(new int[]{1, 2, 3});
    List list = sqlMap.queryForList("dynamicQueryByExample2", account);
    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }
View Full Code Here

  }

  // TRANSACTION TESTS

  public void testStartCommitTransaction() throws SQLException {
    Account account = newAccount6();
    try {
      sqlMap.startTransaction();
      sqlMap.insert("insertAccountViaParameterMap", account);
      sqlMap.commitTransaction();
    } finally {
View Full Code Here

    assertAccount6(account);
  }


  public void testTransactionAlreadyStarted() throws SQLException {
    Account account = newAccount6();
    boolean exceptionThrownAsExpected = false;

    try {
      sqlMap.startTransaction();
      sqlMap.insert("insertAccountViaParameterMap", account);
View Full Code Here

    assertAccount6(account);
    assertTrue(exceptionThrownAsExpected);
  }

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

    sqlMap.insert("insertAccountViaParameterMap", account);

    boolean exceptionThrownAsExpected = false;
    try {
View Full Code Here

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

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


    boolean exceptionThrownAsExpected = false;
    try {
      sqlMap.insert("insertAccountViaParameterMap", null);
View Full Code Here

    assertAccount6(account);
  }

  public void testTransactionFailed2() throws SQLException {
    // testes method that does not require a parameter object
    Account account = newAccount6();


    boolean exceptionThrownAsExpected = false;
    try {
      sqlMap.insert("insertAccountViaParameterMap");
View Full Code Here

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

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

    try {
      sqlMap.startTransaction();
      sqlMap.update("insertAccountViaParameterMap", account);
      //sqlMap.commitTransaction();
View Full Code Here

TOP

Related Classes of com.testdomain.Account

Copyright © 2018 www.massapicom. 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.