Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C6DCE5DA for ; Fri, 23 Nov 2012 06:16:06 +0000 (UTC) Received: (qmail 12872 invoked by uid 500); 23 Nov 2012 06:16:04 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 12678 invoked by uid 500); 23 Nov 2012 06:16:03 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 12627 invoked by uid 99); 23 Nov 2012 06:16:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2012 06:16:01 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2012 06:15:55 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TbmY2-0004Cl-Bv for users@maven.apache.org; Thu, 22 Nov 2012 22:15:34 -0800 Date: Thu, 22 Nov 2012 22:15:34 -0800 (PST) From: Stephane-3 To: users@maven.apache.org Message-ID: <1353651334362-5732576.post@n5.nabble.com> Subject: DAO injection in integration tests with a few database server specific methods MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have a Spring Hibernate project with a DAO coded against a MySql database. Most of the DAO methods would run on HSQLDB and on Oracle, except for some that contain database server specific syntax. I already use some Maven profiles to filter the database server data source specific properties. Now I wonder which way to go so as to have a few DAO methods specific to each database server. I would like to keep most of the DAO methods in a common location, and only have the database server specific DAO methods in anpther one. So for example, for the Oracle database server: Should the Oracle specific DAO methods sit in a different Java package ? Should there be a different resource xml file to have the beans for the integration tests injection of these specific DAO methods ? Here is my setup as of today: The abstract test class: @ContextConfiguration(locations = { "classpath:spring-hibernate.xml", "classpath:spring-hibernate-dao.xml", "classpath:spring-data-source.xml", "classpath:log4j.xml" }) public abstract class AbstractDaoTest extends AbstractTransactionalJUnit4SpringContextTests { } A Maven profile for the Oracle database server: oracle-test src/integration/java src/integration/filters/data-source.oracle.properties src/main/resources true src/integration/resources true The spring-hibernate-dao.xml file content: etc... -- View this message in context: http://maven.40175.n5.nabble.com/DAO-injection-in-integration-tests-with-a-few-database-server-specific-methods-tp5732576.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org