9 Replies Latest reply on Feb 21, 2008 6:27 PM by Patrick Stahmer

    Integration testing with TestNG plugin and hsqldb

    Patrick Stahmer Newbie

      Hello!
      I switched my test environment from mysql to hsqldb and now I get the following error. It seams that the schema is not exported correctly, but why? The schema export works with mysql.



      ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] schema export unsuccessful
      org.hibernate.JDBCException: Error during import script execution
           at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
           at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
           at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
           at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
           at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
           at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:918)
           at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:656)
           at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
           at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:259)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
           at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
           at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
           at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
           at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
           at org.jboss.system.ServiceController.doChange(ServiceController.java:659)
           at org.jboss.system.ServiceController.start(ServiceController.java:431)
           at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:149)
           at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:107)
           at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
           at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
           at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
           at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
           at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
           at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
           at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
           at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
           at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
           at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
           at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
           at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
           at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
           at org.testng.TestRunner.runWorkers(TestRunner.java:678)
           at org.testng.TestRunner.privateRun(TestRunner.java:624)
           at org.testng.TestRunner.run(TestRunner.java:495)
           at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
           at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
           at org.testng.SuiteRunner.run(SuiteRunner.java:190)
           at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
           at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
           at org.testng.TestNG.run(TestNG.java:699)
           at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:122)
      Caused by: java.sql.SQLException: Table not found in statement [insert into User]
           at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
           at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
           at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source)
           at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:83)
           at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)
           ... 82 more
      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.units:jar=classes.jar,unitName=TAPS state=Create
      javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing table: address
           at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:663)
           at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
           at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:259)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
           at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
           at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
           at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
           at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
           at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:96)
           at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:90)
           at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:151)
           at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:604)
           at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:400)
           at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:53)
           at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:37)
           at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
           at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
           at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
           at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
           at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
           at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
           at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
           at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
           at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
           at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
           at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
           at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
           at org.testng.TestRunner.runWorkers(TestRunner.java:678)
           at org.testng.TestRunner.privateRun(TestRunner.java:624)
           at org.testng.TestRunner.run(TestRunner.java:495)
           at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
           at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
           at org.testng.SuiteRunner.run(SuiteRunner.java:190)
           at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
           at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
           at org.testng.TestNG.run(TestNG.java:699)
           at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:122)
      Caused by: org.hibernate.HibernateException: Missing table: address
           at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1080)
           at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
           at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:317)
           at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
           at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:918)
           at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:656)
           ... 76 more
      FAILED CONFIGURATION: @BeforeClass init
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      
      jboss.j2ee:jar=classes,name=AuthenticatorAction,service=EJB3
       -> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=classes.jar,unitName=TAPS **}
      
      jboss.j2ee:jar=classes,name=ChangePasswordAction,service=EJB3
       -> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=classes.jar,unitName=TAPS **}
      
      jboss.j2ee:jar=classes,name=ImportExportDAO,service=EJB3
       -> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=classes.jar,unitName=TAPS **}
      
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      <UNKNOWN> -> ** UNRESOLVED Demands 'persistence.units:jar=classes.jar,unitName=TAPS **
      
      persistence.units:jar=classes.jar,unitName=TAPS -> org.hibernate.HibernateException: Missing table: address
      
      
           at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
           at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128)
           at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
           at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
           at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
           at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
           at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
           at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
      ... Removed 22 stack frames
      SKIPPED CONFIGURATION: @BeforeMethod begin
      SKIPPED CONFIGURATION: @AfterMethod end
      SKIPPED CONFIGURATION: @BeforeMethod begin
      SKIPPED CONFIGURATION: @AfterMethod end
      SKIPPED CONFIGURATION: @AfterClass cleanup
      SKIPPED: testLoginComponent
      SKIPPED: testLogin



      My persistence.xml:


      <?xml version="1.0" encoding="UTF-8"?>
      <!-- Persistence deployment descriptor for dev profile -->
      <persistence xmlns="http://java.sun.com/xml/ns/persistence" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
                   version="1.0">
                   
         <persistence-unit name="TAPS">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:/TAPSDatasource</jta-data-source>
            <properties>
                  <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
               <property name="hibernate.hbm2ddl.auto" value="create"/>
               <property name="hibernate.show_sql" value="false"/>
               <property name="hibernate.use_sql_comments" value="true"/>
               <property name="hibernate.format_sql" value="false"/>
               <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
               
               <!-- Required binding for Seam-managed persistence context in Embeddable JBoss -->
               <property name="jboss.entity.manager.factory.jndi.name" value="java:/entityManagerFactories/TAPS"/>
                
            </properties>
         </persistence-unit>
          
      </persistence>



      My Project-ds.xml:



      <?xml version="1.0" encoding="UTF-8"?>
          
      <datasources>
         
         <local-tx-datasource>
            <jndi-name>TAPSDatasource</jndi-name>
            <connection-url>jdbc:hsqldb:.</connection-url>
            <driver-class>org.hsqldb.jdbcDriver</driver-class>
            <user-name>sa</user-name>
            <password></password>
         </local-tx-datasource>
          
      </datasources>



        • 1. Re: Integration testing with TestNG plugin and hsqldb
          Pete Muir Master

          Let's see the bit of the log where hibernate creates the tables.

          • 2. Re: Integration testing with TestNG plugin and hsqldb
            Patrick Stahmer Newbie

            Thanks in advance.


            I have two additional questions:
            1. To get the tests run I have to disable all timer-based methods. Is that a problem of JBoss Embedded? How can I avoid it?
            2. If I have an instance of JBoss AS running on my local maschine  I got a conflict with Jboss Embedded. Which config properties must be changed?


            Thats the log:


            INFO  [org.hibernate.cfg.annotations.Version] Hibernate Annotations 3.3.1.Beta1
            INFO  [org.hibernate.cfg.Environment] Hibernate 3.2.4.sp1
            INFO  [org.hibernate.cfg.Environment] hibernate.properties not found
            INFO  [org.hibernate.cfg.Environment] Bytecode provider name : javassist
            INFO  [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling
            INFO  [org.hibernate.ejb.Version] Hibernate EntityManager 3.3.2.Beta1
            INFO  [org.hibernate.ejb.Ejb3Configuration] Processing PersistenceUnitInfo [
                 name: TAPS
                 ...]
            WARN  [org.hibernate.ejb.Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
            INFO  [org.hibernate.connection.ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
            INFO  [org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider] Using provided datasource
            INFO  [org.hibernate.cfg.SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0
            INFO  [org.hibernate.cfg.SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0
            INFO  [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
            INFO  [org.hibernate.transaction.TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
            INFO  [org.hibernate.transaction.TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
            INFO  [org.hibernate.transaction.TransactionManagerLookupFactory] instantiated TransactionManagerLookup
            INFO  [org.hibernate.cfg.SettingsFactory] Automatic flush during beforeCompletion(): disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Automatic session close at end of transaction: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] JDBC batch size: 15
            INFO  [org.hibernate.cfg.SettingsFactory] JDBC batch updates for versioned data: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Scrollable result sets: enabled
            INFO  [org.hibernate.cfg.SettingsFactory] JDBC3 getGeneratedKeys(): disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Connection release mode: auto
            INFO  [org.hibernate.cfg.SettingsFactory] Default batch fetch size: 1
            INFO  [org.hibernate.cfg.SettingsFactory] Generate SQL with comments: enabled
            INFO  [org.hibernate.cfg.SettingsFactory] Order SQL updates by primary key: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Order SQL inserts for batching: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
            INFO  [org.hibernate.hql.ast.ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
            INFO  [org.hibernate.cfg.SettingsFactory] Query language substitutions: {}
            INFO  [org.hibernate.cfg.SettingsFactory] JPA-QL strict compliance: enabled
            INFO  [org.hibernate.cfg.SettingsFactory] Second-level cache: enabled
            INFO  [org.hibernate.cfg.SettingsFactory] Query cache: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
            INFO  [org.hibernate.cfg.SettingsFactory] Optimize cache for minimal puts: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Cache region prefix: TAPS
            INFO  [org.hibernate.cfg.SettingsFactory] Structured second-level cache entries: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Statistics: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Deleted entity synthetic identifier rollback: disabled
            INFO  [org.hibernate.cfg.SettingsFactory] Default entity-mode: pojo
            INFO  [org.hibernate.cfg.SettingsFactory] Named query checking : enabled
            INFO  [org.hibernate.search.Version] Hibernate Search 3.0.0.GA
            INFO  [org.hibernate.impl.SessionFactoryImpl] building session factory
            INFO  [org.hibernate.impl.SessionFactoryObjectFactory] Factory name: persistence.units:unitName=TAPS
            INFO  [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
            INFO  [org.hibernate.impl.SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.units:unitName=TAPS
            WARN  [org.hibernate.impl.SessionFactoryObjectFactory] InitialContext did not implement EventContext
            INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] Running hbm2ddl schema export
            INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] exporting generated schema to database
            INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] Executing import script: /import.sql
            ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] schema export unsuccessful
            org.hibernate.JDBCException: Error during import script execution
                 at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
                 at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
                 at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
                 at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
                 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
                 at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:918)
                 at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:656)
                 at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
                 at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:259)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)...


            • 3. Re: Integration testing with TestNG plugin and hsqldb
              Pete Muir Master

              So do you actually have the User table in the database? Or listed as an entity?

              • 4. Re: Integration testing with TestNG plugin and hsqldb
                Pete Muir Master

                Bjoern S wrote on Feb 20, 2008 03:24 PM:


                Thanks in advance.

                I have two additional questions:
                1. To get the tests run I have to disable all timer-based methods. Is that a problem of JBoss Embedded? How can I avoid it?



                Embedded doesn't support EJB3 timers. You can still use JDK timers or Quartz timers. Check the embedded JIRA and vote/create an issue.

                • 5. Re: Integration testing with TestNG plugin and hsqldb
                  Patrick Stahmer Newbie

                  In my test environment all tables are (or should be) created by hibernate from entity definitions:


                  <property name="hibernate.hbm2ddl.auto" value="create"/> 



                  The test data is imported during import script execution (import.sql). But for some reason the export of the database schema does not work with HSQL, but it works fine with MYSQL.

                  • 6. Re: Integration testing with TestNG plugin and hsqldb
                    Pete Muir Master

                    Yes, because the User table is missing - I'm trying to get you to find out why ;-)

                    • 7. Re: Integration testing with TestNG plugin and hsqldb
                      Patrick Stahmer Newbie

                      Is it really missing? Because after the exception the entity User ist bind on table user:


                      ...           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:122)
                      Caused by: java.sql.SQLException: Table not found in statement [insert into User]
                           at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
                           at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
                           at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source)
                           at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:83)
                           at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)
                           ... 82 more
                      INFO  [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                      INFO  [org.hibernate.ejb.Ejb3Configuration] Processing PersistenceUnitInfo [
                           name: TAPS
                           ...]
                      WARN  [org.hibernate.ejb.Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.LoadingSchedule
                      INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.company.TAPS.model.LoadingSchedule on table loadingschedule
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.CargoImport
                      INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.company.TAPS.model.CargoImport on table ladungenimport
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.Cargo
                      INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.company.TAPS.model.Cargo on table cargo
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.TimeSlot
                      INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.company.TAPS.model.TimeSlot on table timeslot
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.DaySchedule
                      INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.company.TAPS.model.DaySchedule on table dayschedule
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.WaybillReceiver
                      INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.company.TAPS.model.WaybillReceiver on table waybillreceiver
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.User
                      INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.company.TAPS.model.User on table user
                      INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.company.TAPS.model.SlotBooking
                      ...


                      • 8. Re: Integration testing with TestNG plugin and hsqldb
                        Daniel Hinojosa Master

                        I believe 'user' a reserved work in HSQLDB.


                        For me personally I always name my tables with the initial characters of project.  So if I am working on 'Total World Domination' project I name my tables

                        twd_user

                        .  It's not too unsightly, and it keeps me from having to redo my app for different dbs.



                        • 9. Re: Integration testing with TestNG plugin and hsqldb
                          Patrick Stahmer Newbie

                          No, that doesn't help. But thanks.


                          WARN  [org.hibernate.impl.SessionFactoryObjectFactory] InitialContext did not implement EventContext
                          INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] Running hbm2ddl schema export
                          INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] exporting generated schema to database
                          INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] Executing import script: /import.sql
                          ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] schema export unsuccessful
                          org.hibernate.JDBCException: Error during import script execution
                               at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
                               at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
                               at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
                               at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
                               at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
                               at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:918)
                               at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:656)
                               at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
                               at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:259)
                               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                               at java.lang.reflect.Method.invoke(Method.java:585)
                               at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
                               at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
                               at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                               at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
                               at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
                               at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
                               at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
                               at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
                               at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
                               at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
                               at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                               at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                               at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                               at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                               at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                               at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                               at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                               at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                               at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                               at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                               at org.jboss.system.ServiceController.doChange(ServiceController.java:659)
                               at org.jboss.system.ServiceController.start(ServiceController.java:431)
                               at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:149)
                               at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:107)
                               at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
                               at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
                               at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                               at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
                               at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
                               at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874)
                               at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
                               at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
                               at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                               at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                               at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                               at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                               at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                               at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                               at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                               at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
                               at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
                               at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
                               at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
                               at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
                               at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
                               at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
                               at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
                               at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
                               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                               at java.lang.reflect.Method.invoke(Method.java:585)
                               at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
                               at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
                               at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
                               at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
                               at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
                               at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
                               at org.testng.TestRunner.runWorkers(TestRunner.java:678)
                               at org.testng.TestRunner.privateRun(TestRunner.java:624)
                               at org.testng.TestRunner.run(TestRunner.java:495)
                               at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
                               at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
                               at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
                               at org.testng.SuiteRunner.run(SuiteRunner.java:190)
                               at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
                               at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
                               at org.testng.TestNG.run(TestNG.java:699)
                               at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
                               at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:122)
                          Caused by: java.sql.SQLException: Table not found in statement [insert into tapsuser]
                               at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
                               at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
                               at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source)
                               at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:83)
                               at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)
                               ... 82 more
                          INFO  [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                          INFO  [org.hibernate.ejb.Ejb3Configuration] Processing PersistenceUnitInfo [
                               name: TAPS
                               ...]
                          WARN  [org.hibernate.ejb.Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.LoadingSchedule
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.LoadingSchedule on table loadingschedule
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.CargoImport
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.CargoImport on table ladungenimport
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.Cargo
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.Cargo on table cargo
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.TimeSlot
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.TimeSlot on table timeslot
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.DaySchedule
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.DaySchedule on table dayschedule
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.WaybillReceiver
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.WaybillReceiver on table waybillreceiver
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.User
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.User on table tapsuser
                          INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.saarstahl.TAPS.model.SlotBooking
                          INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.saarstahl.TAPS.model.SlotBooking on table slotbooking