Hi

Both are in the classpath for different ejbmodule so that s ok.

Maybe have a look to altdd to use test.persistence.xml in src/main/resources
Le 3 nov. 2013 00:00, "Matthias Wessendorf" <mat...@apache.org> a écrit :

> Hi,
>
>
> when running unit tests - where I have a
> src/test/resources/META-INF/persistence.xml file - I am wondering why the
> one in src/main is also included.
>
> Wouldn't the one in test be the 'right' one ?
>
> See also [1]
>
> -Matthias
>
>
> [1]
>
> https://github.com/matzew/tomee/blob/trunk/examples/jpa-hibernate/src/test/resources/META-INF/persistence.xml
>
>
> From the LOG (note the 'PersistenceUnit(name=movie-unit-TEST' and the
> 'PersistenceUnit(name=movie-unit'):
>
>
>
>
> INFO - Configuring PersistenceUnit(name=movie-unit-TEST,
> provider=org.hibernate.ejb.HibernatePersistence)
> INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type
> 'DataSource for 'movie-unit-TEST'.
> INFO - Configuring Service(id=movieDatabaseNonJta, type=Resource,
> provider-id=movieDatabase)
> INFO - Creating Resource(id=movieDatabaseNonJta)
> INFO - Adjusting PersistenceUnit movie-unit-TEST <non-jta-data-source> to
> Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
> INFO - Configuring PersistenceUnit(name=movie-unit,
> provider=org.hibernate.ejb.HibernatePersistence)
> INFO - Adjusting PersistenceUnit movie-unit <non-jta-data-source> to
> Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
> INFO - Enterprise application
> "/Users/matzew/TEMP/TomEEFix/examples/jpa-hibernate" loaded.
> INFO - Assembling app: /Users/matzew/TEMP/TomEEFix/examples/jpa-hibernate
> INFO - HV000001: Hibernate Validator 4.3.0.Final
> INFO - HV000002: Ignoring XML configuration.
> INFO - HV000002: Ignoring XML configuration.
> INFO - HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
> INFO - HHH000412: Hibernate Core {4.1.8.Final}
> INFO - HHH000206: hibernate.properties not found
> INFO - HHH000021: Bytecode provider name : javassist
> INFO - HHH000204: Processing PersistenceUnitInfo [
> name: movie-unit-TEST
> ...]
> INFO - HHH000130: Instantiating explicit connection provider:
> org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
> INFO - HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
> INFO - HHH000268: Transaction strategy:
> org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
> INFO - HHH000397: Using ASTQueryTranslatorFactory
> INFO - HHH000227: Running hbm2ddl schema export
> INFO - HHH000230: Schema export complete
> INFO - PersistenceUnit(name=movie-unit-TEST,
> provider=org.hibernate.ejb.HibernatePersistence) - provider time 2143ms
> INFO - HHH000204: Processing PersistenceUnitInfo [
> name: movie-unit
> ...]
> INFO - HHH000130: Instantiating explicit connection provider:
> org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
> INFO - HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
> INFO - HHH000268: Transaction strategy:
> org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
> INFO - HHH000397: Using ASTQueryTranslatorFactory
> INFO - HHH000227: Running hbm2ddl schema export
> INFO - HHH000230: Schema export complete
> INFO - PersistenceUnit(name=movie-unit,
> provider=org.hibernate.ejb.HibernatePersistence) - provider time 673ms
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>

Reply via email to