Appfuse 3.5 + HSQLDB errors when executing the tests

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Appfuse 3.5 + HSQLDB errors when executing the tests

predicador37
Hi all:

I get a lot of errors no matter what I do with HSQLDB profile. I'm trying the following:

1. Get a basic appfuse struts2 project:

mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring-archetype -DarchetypeVersion=3.5.0 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=https://oss.sonatype.org/content/repositories/appfuse

BUILD SUCCESS with this.

2. Test HSQLDB:

(from the project directory) mvn test -Phsqldb

And then, a lot of errors:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.246 sec <<< FAILUR     E! - in com.mycompany.webapp.listener.StartupListenerTest
 212 testContextInitialized(com.mycompany.webapp.listener.StartupListenerTest)  Time elaps     ed: 9.991 sec  <<< ERROR!
 213 org.springframework.transaction.CannotCreateTransactionException: Could not open Hibe     rnate Session for transaction; nested exception is org.hibernate.exception.GenericJDB     CException: Could not open connection
...
Caused by: java.sql.SQLSyntaxErrorException: unexpected end of statement
 305     at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) ~[hsqldb-2.3.2.jar:2.3.2     ]

I think those are the most significative error messages.

I've read an old post from Matt and added a custom HSQLDB profile to my pom.xml based on the parent one, but modifying the validation query as follows:

<profile>
        <id>hsqldb</id>
        <activation>
                <activeByDefault>true</activeByDefault>
        </activation>

        <properties>
                <dbunit.dataTypeFactoryName>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory
                </dbunit.dataTypeFactoryName>
                <hibernate.dialect>org.hibernate.dialect.HSQLDialect
                </hibernate.dialect>
                <jdbc.groupId>org.hsqldb</jdbc.groupId>
                <jdbc.artifactId>hsqldb</jdbc.artifactId>
                <jdbc.version>${hsqldb.version}</jdbc.version>
                <jdbc.driverClassName>org.hsqldb.jdbcDriver</jdbc.driverClassName>
                <jdbc.url>
<![CDATA[jdbc:hsqldb:/tmp/${db.name};shutdown=true]]>
</jdbc.url>
                <jdbc.username>sa</jdbc.username>
                <jdbc.password />
                <jdbc.validationQuery>
<![CDATA[SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS]]>
</jdbc.validationQuery>
        </properties>
</profile>

With this I manage to get the tests frozen at:

 DEBUG [main] UserDaoHibernate.saveUser(53) | user's id: null
221 Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.927 sec - in com.mycompany.webapp.controller.S    ignupControllerTest
222 Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 17.246 sec - in com.mycompany.webapp.controller.P    asswordHintControllerTest
223 WARN [main] UserFormController.showForm(191) | User 'user' is trying to edit user with id 'null'

Whenever the tests are executed, I get errors in the maven goals.

Anyone has tested this archetype with this database profile? Any ideas?


Loading...