我有使用德比的单元测试(在maven中)。德比卡住了吗?
在测试运行结束时,会有一段非常长的暂停,并在暂停之前包含这些日志消息。
INFO: Closing Hibernate SessionFactory Nov 16, 2009 8:30:31 PM org.hibernate.impl.SessionFactoryImpl close INFO: closing Nov 16, 2009 8:30:31 PM org.hibernate.tool.hbm2ddl.SchemaExport execute INFO: Running hbm2ddl schema export Nov 16, 2009 8:30:31 PM org.hibernate.tool.hbm2ddl.SchemaExport execute INFO: exporting generated schema to database
Hibernate的配置:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hbm2ddl.auto">create-drop</property>
<property name="show_sql">false</property>
</session-factory>
</hibernate-configuration>
从引用:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<!-- data source elsewhere -->
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>com/basistech/configdb/dao/Gazetteer.hbm.xml</value>
<value>com/basistech/configdb/dao/FileGazetteer.hbm.xml</value>
<value>com/basistech/configdb/dao/Regexpset.hbm.xml</value>
<value>com/basistech/configdb/dao/Redactjoiner.hbm.xml</value>
<value>com/basistech/configdb/dao/Misc.hbm.xml</value>
</list>
</property>
<property name="configLocation" value="classpath:com/basistech/configdb/dao/hibernate.xml"/>
终于Maven的:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>codegen</id>
<goals>
<goal>hbm2java</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<components>
<component>
<name>hbm2java</name>
</component>
</components>
<componentProperties>
<configurationfile>src/main/hibernate/codegen-hibernate.xml</configurationfile>
</componentProperties>
</configuration>
</execution>
</executions>
</plugin>
这里没有足够的细节给出答案。请提供您的hibernate和/或hibernate3-maven插件配置。这将有所帮助。 – 2009-11-17 10:26:41
看起来像一切正常对我来说 – 2009-11-17 13:27:12
除了1分钟的暂停。为什么要在最后一段时间序列化模式? – bmargulies 2009-11-17 13:41:25