removed default profile and replaced with "jpa"

This commit is contained in:
Mic 2013-12-16 20:58:15 +09:00
parent ea81fe07d8
commit 5cfd482edc
3 changed files with 7 additions and 7 deletions

View file

@ -27,12 +27,12 @@
<!-- ================== 3 Profiles to choose from =================== <!-- ================== 3 Profiles to choose from ===================
- default (uses JPA)
- jdbc (uses Spring" JdbcTemplate) - jdbc (uses Spring" JdbcTemplate)
- jpa
- spring-data-jpa - spring-data-jpa
=============================================================================--> =============================================================================-->
<beans profile="default,spring-data-jpa"> <beans profile="jpa,spring-data-jpa">
<!-- JPA EntityManagerFactory --> <!-- JPA EntityManagerFactory -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="dataSource"> p:dataSource-ref="dataSource">
@ -80,7 +80,7 @@
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jdbc"/> <context:component-scan base-package="org.springframework.samples.petclinic.repository.jdbc"/>
</beans> </beans>
<beans profile="default"> <beans profile="jpa">
<!-- <!--
Loads JPA beans Loads JPA beans
Will automatically be transactional due to @Transactional. Will automatically be transactional due to @Transactional.

View file

@ -10,11 +10,10 @@ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
<context-param> <context-param>
<param-name>spring.profiles.active</param-name> <param-name>spring.profiles.active</param-name>
<param-value>default</param-value> <param-value>jpa</param-value>
</context-param> </context-param>
<!-- Default profile is "jpa" (see business-config.xml for more details). <!-- When using Spring JDBC, use the following: -->
When using Spring JDBC, uncomment the following: -->
<!-- <context-param> <!-- <context-param>
<param-name>spring.profiles.active</param-name> <param-name>spring.profiles.active</param-name>
<param-value>jdbc</param-value> <param-value>jdbc</param-value>

View file

@ -2,6 +2,7 @@
package org.springframework.samples.petclinic.service; package org.springframework.samples.petclinic.service;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ -16,7 +17,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration(locations = {"classpath:spring/business-config.xml"}) @ContextConfiguration(locations = {"classpath:spring/business-config.xml"})
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
// No active profile specificied because JPA uses the "default" profile @ActiveProfiles("jpa")
public class ClinicServiceJpaTests extends AbstractClinicServiceTests { public class ClinicServiceJpaTests extends AbstractClinicServiceTests {
} }