View Javadoc
1   /*
2    * DatabaseConnectionTest.java   Mar 26, 2002
3    *
4    * The DbUnit Database Testing Framework
5    * Copyright (C)2002-2004, DbUnit.org
6    *
7    * This library is free software; you can redistribute it and/or
8    * modify it under the terms of the GNU Lesser General Public
9    * License as published by the Free Software Foundation; either
10   * version 2.1 of the License, or (at your option) any later version.
11   *
12   * This library is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this library; if not, write to the Free Software
19   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20   *
21   */
22  package org.dbunit.database;
23  
24  import org.dbunit.DatabaseProfile;
25  import org.dbunit.IDatabaseTester;
26  import org.dbunit.JdbcDatabaseTester;
27  
28  /**
29   * @author Andres Almiray (aalmiray@users.sourceforge.net)
30   * @author Last changed by: $Author$
31   * @version $Revision$ $Date$
32   * @since 2.2.0
33   */
34  public class JdbcDatabaseTesterConnectionIT
35          extends AbstractDatabaseTesterConnectionIT
36  {
37      private JdbcDatabaseTester databaseTester;
38  
39      @Override
40      protected IDatabaseTester getDatabaseTester() throws Exception
41      {
42          if (databaseTester == null)
43          {
44              final DatabaseProfile profile = getEnvironment().getProfile();
45              databaseTester = new JdbcDatabaseTester(profile.getDriverClass(),
46                      profile.getConnectionUrl(), profile.getUser(),
47                      profile.getPassword(), profile.getSchema());
48          }
49          return databaseTester;
50      }
51  }