Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(SpringJUnit4ClassRunner.class)
- @ContextConfiguration({ "classpath:applicationContext-service.xml", "classpath:applicationContext-persist.xml",
- "classpath:applicationContext-data-test.xml" })
- @Transactional
- public class InvoiceServiceImplTest {
- @Autowired
- private InvoicingServiceImpl service;
- @Before
- public void init() {
- createInvoiceData();
- }
- @Test
- public void testSendInvoice() throws InvoicingFault {
- InvoicingRequest req = createRequest();
- InvoicingResponse res = service.sendInvoice(req);
- TestCase.assertEquals(true, res.getInvoiceId() != null);
- }
- }
- if (BaseDAO.invoiceDAO().getOwner(applicationId) == null) {
- throw new ...
- }
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:jdbc="http://www.springframework.org/schema/jdbc"
- xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
- http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
- <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="configLocation" value="classpath:hibernate.cfg.xml" />
- <property name="mappingResources">
- <list>
- <value>mapping/InvoiceData.hbm.xml</value>
- <value>mapping/InvoiceOwner.hbm.xml</value>
- ...
- </list>
- </property>
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.show_sql">true</prop>
- <prop key="hibernate.format_sql">true</prop>
- <prop key="hibernate.connection.pool_size">30</prop>
- <prop key="hibernate.hbm2ddl.auto">create</prop>
- </props>
- </property>
- </bean>
- <jdbc:embedded-database id="dataSource" type="HSQL"></jdbc:embedded-database>
- </beans>
- 6324 DEBUG DefaultListableBeanFactory - Returning cached instance of singleton bean 'transactionManager'
- 6324 DEBUG HibernateTransactionManager - Found thread-bound Session [SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for Hibernate transaction
- 6324 DEBUG HibernateTransactionManager - Suspending current transaction, creating new transaction with name [fi.om.common.invoicing.service.InvoiceServiceImpl.sendInvoice]
- 6324 DEBUG HibernateTransactionManager - Opened new Session [SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for Hibernate transaction
- 6324 DEBUG HibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])]
- 6324 DEBUG SimpleDriverDataSource - Creating new JDBC Driver Connection to [jdbc:hsqldb:mem:dataSource]
- 6324 DEBUG TransactionImpl - begin
- 6324 DEBUG HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.hsqldb.jdbc.JDBCConnection@57ac2910]
- 8606 DEBUG SQL -
- select
- this_.ID as ID1_7_0_,
- this_.APPLICATION_ID as APPLICAT2_7_0_,
- this_.LAST_REQUEST as LAST_REQ3_7_0_,
- this_.APPLICATION_NAME as APPLICAT4_7_0_
- from
- INVOICE_OWNER this_
- where
- this_.APPLICATION_ID=?
- Hibernate:
- select
- this_.ID as ID1_7_0_,
- this_.APPLICATION_ID as APPLICAT2_7_0_,
- this_.LAST_REQUEST as LAST_REQ3_7_0_,
- this_.APPLICATION_NAME as APPLICAT4_7_0_
- from
- INVOICE_OWNER this_
- where
- this_.APPLICATION_ID=?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement