Integration tests using Spring and DBunit

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Integration tests using Spring and DBunit

Saeid
This post was updated on .
Hi everybody!
I'm a newbie in the appfuse and recently have created some test classes (using Spring integration with DBUnit maven plugin) , but it does not recognize it's parent class "BaseActionTestCase" though imported "org.appfuse.webapp.action.BaseActionTestCase" as following:

import org.appfuse.webapp.action.BaseActionTestCase;
...
import org.springframework.mock.web.MockHttpServletRequest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class CategoryActionTest extends BaseActionTestCase {
...
}

I'm using appfuse 3.0.0 and it looks like it's being in appfuse 3.5.0 package.

1) Any JAR library i've not imported it in POM?

2) Basically, how can i migrate from an old appfuse version to the new?

thanks in advace!

Reply | Threaded
Open this post in threaded view
|

Re: BaseActionTestCase in Appfuse 3.0.0

mraible
Administrator
You should have a BaseActionTestCase in your project. Can you look in src/main/java (or src/test/java) and see if it's there? If so, maybe we need to update the tutorial?

For migrating from AppFuse 3.0 to 3.5, there's a section in the release notes:


It looks like you're using Struts, so you might be able to look at what it took us to upgrade the Struts demo application. 


Cheers,

Matt


On Tue, Mar 3, 2015 at 1:18 AM, Saeid <[hidden email]> wrote:
Hi everybody!
I'm a newbie in the appfuse and recently have created some test classes
(using Spring integration with DBUnit maven plugin) , but it does not
recognize it's parent class "BaseActionTestCase" though imported
"org.appfuse.webapp.action.BaseActionTestCase" as following:

import org.appfuse.webapp.action.BaseActionTestCase;
...
import org.springframework.mock.web.MockHttpServletRequest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class CategoryActionTest extends BaseActionTestCase {
...
}

I'm using appfuse 3.0.0 and it looks like it's being in appfuse 3.5.0
package.

1) Any JAR library i've not imported it in POM?

2) Basically, how can i migrate from an old appfuse version to the new?

thanks in advace!





--
View this message in context: http://appfuse.547863.n4.nabble.com/BaseActionTestCase-in-Appfuse-3-0-0-tp4657734.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: BaseActionTestCase in Appfuse 3.0.0

Saeid
dear matt!
There's no definition for class BaseActionTestCase in the project. It seems the plugin (appfuse:gen) lacks something both in version 3.0.0 or 3.5.0 !

thanks!
Reply | Threaded
Open this post in threaded view
|

Re: BaseActionTestCase in Appfuse 3.0.0

mraible
Administrator
If I create a new struts basic project with 3.5.0, there is a BaseActionTestCase.java in the src/test/java directory.

$ mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts-archetype -DarchetypeVersion=3.5.0 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=https://oss.sonatype.org/content/repositories/appfuse
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: appfuse-basic-struts-archetype:3.5.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.mycompany
[INFO] Parameter: artifactId, Value: myproject
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.mycompany
[INFO] Parameter: packageInPathFormat, Value: com/mycompany
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.mycompany
[INFO] Parameter: groupId, Value: com.mycompany
[INFO] Parameter: artifactId, Value: myproject
[INFO] project created from Archetype in dir: /Users/mraible/myproject
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.919 s
[INFO] Finished at: 2015-03-03T11:09:09-07:00
[INFO] Final Memory: 10M/310M
[INFO] ------------------------------------------------------------------------
⌁ [mraible:~] 4s $ cd myproject/
⌁ [mraible:~/myproject] $ ls src/test/
java/      resources/
⌁ [mraible:~/myproject] $ ls src/test/java/com/mycompany/webapp/
action/   filter/   listener/
⌁ [mraible:~/myproject] $ ls src/test/java/com/mycompany/webapp/action/
BaseActionTestCase.java      PasswordHintActionTest.java  SignupActionTest.java        UserActionTest.java
⌁ [mraible:~/myproject] $ ls src/test/java/com/mycompany/webapp/action/BaseActionTestCase.java
src/test/java/com/mycompany/webapp/action/BaseActionTestCase.java

You could copy the one from our source control if that helps.

https://github.com/appfuse/appfuse/blob/master/web/struts/src/test/java/org/appfuse/webapp/action/BaseActionTestCase.java

Cheers,

Matt

> On Mar 3, 2015, at 10:00 AM, Saeid <[hidden email]> wrote:
>
> dear matt!
> There's no definition for class BaseActionTestCase in the project. It seems
> the plugin (appfuse:gen) lacks something both in version 3.0.0 or 3.5.0 !
>
> thanks!
>
>
>
> --
> View this message in context: http://appfuse.547863.n4.nabble.com/Integration-tests-using-Spring-and-DBunit-tp4657734p4657737.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: BaseActionTestCase in Appfuse 3.0.0

Saeid
ok matt! I'll create a project just as you say through:

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


Then as soon as i issue mvn test or mvn integration-test i'll be stoped with the following error :


[INFO] --- hibernate4-maven-plugin:1.0.5:export (default) @ mmohit ---
[INFO] Scanning directory D:\Java\mmohit\target\classes for annotated classes...
[INFO] Scanning dependencies for scope none
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.341 s
[INFO] Finished at: 2015-03-04T10:19:51+03:30
[INFO] Final Memory: 18M/45M
[INFO] ------------------------------------------------------------------------

Failed to execute goal de.juplo:hibernate4-maven-plugin:1.0.5:export (default) on project mmohit:
No annotated classes found in directory D:\Java\mmohit\target\classes



it seems it could not resolve required "transitive dependencies"!


what do you think matt?
Reply | Threaded
Open this post in threaded view
|

Re: BaseActionTestCase in Appfuse 3.0.0

mraible
Administrator
Unfortunately, I am unable to reproduce this problem. What version of Java and Maven are you using? What Operating System? Here's what happens when I try it on OS X Yosemite with Java 8 and Maven 3.2.5.

$ mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts-archetype -DarchetypeVersion=3.5.0 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=https://oss.sonatype.org/content/repositories/appfuse
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: appfuse-basic-struts-archetype:3.5.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.mycompany
[INFO] Parameter: artifactId, Value: myproject
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.mycompany
[INFO] Parameter: packageInPathFormat, Value: com/mycompany
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.mycompany
[INFO] Parameter: groupId, Value: com.mycompany
[INFO] Parameter: artifactId, Value: myproject
[INFO] project created from Archetype in dir: /Users/mraible/myproject
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.739 s
[INFO] Finished at: 2015-03-04T07:44:19-07:00
[INFO] Final Memory: 11M/304M
[INFO] ------------------------------------------------------------------------
[mraible:~] 3s $ cd myproject/
[mraible:~/myproject] $ mvn test
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AppFuse Struts 2 Application 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ myproject ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 64 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myproject ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /Users/mraible/myproject/target/classes
[INFO]
[INFO] --- native2ascii-maven-plugin:1.0-beta-1:native2ascii (native2ascii-utf8) @ myproject ---
[INFO] Includes: [ApplicationResources_el*.properties, ApplicationResources_zh*.properties, ApplicationResources_ko*.properties, displaytag_el*.properties, displaytag_zh*.properties, errors_el*, errors_ko*, errors_tr*, errors_zh*]
[INFO] Excludes: []
[INFO] Processing /Users/mraible/myproject/target/classes/ApplicationResources_el.properties
[INFO] Processing /Users/mraible/myproject/target/classes/ApplicationResources_ko.properties
[INFO] Processing /Users/mraible/myproject/target/classes/ApplicationResources_zh.properties
[INFO] Processing /Users/mraible/myproject/target/classes/ApplicationResources_zh_CN.properties
[INFO] Processing /Users/mraible/myproject/target/classes/ApplicationResources_zh_TW.properties
[INFO] Processing /Users/mraible/myproject/target/classes/displaytag_el.properties
[INFO] Processing /Users/mraible/myproject/target/classes/displaytag_zh.properties
[INFO] Processing /Users/mraible/myproject/target/classes/displaytag_zh_CN.properties
[INFO] Processing /Users/mraible/myproject/target/classes/displaytag_zh_TW.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_el.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_ko.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_tr.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_zh.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_zh_CN.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_zh_TW.properties
[INFO]
[INFO] --- native2ascii-maven-plugin:1.0-beta-1:native2ascii (native2ascii-8859_1) @ myproject ---
[INFO] Includes: [errors_de.properties, errors_fr.properties, errors_nl.properties, errors_pt*.properties]
[INFO] Excludes: []
[INFO] Processing /Users/mraible/myproject/target/classes/errors_de.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_fr.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_nl.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_pt.properties
[INFO] Processing /Users/mraible/myproject/target/classes/errors_pt_BR.properties
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] Copying 12 resources
[INFO]
[INFO] --- build-helper-maven-plugin:1.9.1:reserve-network-port (reserve-ports) @ myproject ---
[INFO] Reserved port 63228 for cargo.port
[INFO] Reserved port 63229 for cargo.ajp.port
[INFO] Reserved port 63230 for cargo.debug.port
[INFO]
[INFO] --- hibernate4-maven-plugin:1.0.5:export (default) @ myproject ---
[INFO] Scanning directory /Users/mraible/myproject/target/classes for annotated classes...
[INFO] Scanning dependencies for scope compile
[INFO] Scanning dependency org.appfuse:appfuse-struts:pom:3.5.0 for annotated classes...
[INFO] Scanning dependency org.appfuse:appfuse-service:jar:3.5.0 for annotated classes...
[INFO] Scanning dependency org.appfuse:appfuse-hibernate:jar:3.5.0 for annotated classes...
[INFO] Scanning dependency org.appfuse:appfuse-data-common:jar:3.5.0 for annotated classes...
[INFO] Scanning dependency commons-dbcp:commons-dbcp:jar:1.4 for annotated classes...
[INFO] Scanning dependency org.directwebremoting:dwr:jar:2.0.10 for annotated classes...
[INFO] Scanning dependency net.sf.ehcache:ehcache-web:jar:2.0.4 for annotated classes...
[INFO] Scanning dependency net.sf.ehcache:ehcache-core:jar:2.6.9 for annotated classes...
[INFO] Scanning dependency javax.servlet:jstl:jar:1.2 for annotated classes...
[INFO] Scanning dependency org.apache.velocity:velocity-tools:jar:2.0 for annotated classes...
[INFO] Scanning dependency org.springframework.security:spring-security-taglibs:jar:3.2.5.RELEASE for annotated classes...
[INFO] Scanning dependency org.springframework:spring-webmvc:jar:4.1.3.RELEASE for annotated classes...
[INFO] Scanning dependency org.tuckey:urlrewritefilter:jar:4.0.3 for annotated classes...
[INFO] Scanning dependency ro.isdc.wro4j:wro4j-core:jar:1.7.5 for annotated classes...
[INFO] Scanning dependency org.webjars:jquery-cookie:jar:1.3.1 for annotated classes...
[INFO] Scanning dependency org.webjars:bootstrap:jar:3.3.1 for annotated classes...
[INFO] Scanning dependency org.webjars:bootstrap-datepicker:jar:1.3.1 for annotated classes...
[INFO] Scanning dependency org.webjars:bootswatch-spacelab:jar:3.3.1+2 for annotated classes...
[INFO] Scanning dependency commons-lang:commons-lang:jar:2.6 for annotated classes...
[INFO] Scanning dependency org.springframework.security:spring-security-core:jar:3.2.5.RELEASE for annotated classes...
[INFO] Scanning dependency org.springframework.security:spring-security-config:jar:3.2.5.RELEASE for annotated classes...
[INFO] Scanning dependency org.springframework.security:spring-security-ldap:jar:3.2.5.RELEASE for annotated classes...
[INFO] Scanning dependency org.aspectj:aspectjweaver:jar:1.8.4 for annotated classes...
[INFO] Scanning dependency org.aspectj:aspectjrt:jar:1.8.4 for annotated classes...
[INFO] Scanning dependency junit:junit:jar:4.12 for annotated classes...
[INFO] Scanning dependency org.slf4j:slf4j-api:jar:1.7.7 for annotated classes...
[INFO] Scanning dependency org.apache.logging.log4j:log4j-jcl:jar:2.1 for annotated classes...
[INFO] Scanning dependency org.apache.logging.log4j:log4j-slf4j-impl:jar:2.1 for annotated classes...
[INFO] Scanning dependency org.apache.logging.log4j:log4j-core:jar:2.1 for annotated classes...
[INFO] Scanning dependency org.jboss.logging:jboss-logging:jar:3.2.0.Beta1 for annotated classes...
[INFO] Scanning dependency mysql:mysql-connector-java:jar:5.1.27 for annotated classes...
[INFO] Scanning dependency org.springframework:spring-test:jar:4.1.3.RELEASE for annotated classes...
[INFO] Reading properties from file /Users/mraible/myproject/target/classes/jdbc.properties...
[INFO] Gathered hibernate-configuration (turn on debugging for details):
[INFO]   hibernate.connection.driver_class = com.mysql.jdbc.Driver
[INFO]   jdbc.password =
[INFO]   hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
[INFO]   jdbc.url = jdbc:mysql://localhost/myproject?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
[INFO]   hibernate.connection.username = root
[INFO]   hibernate.connection.url = jdbc:mysql://localhost/myproject?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
[INFO]   jdbc.driverClassName = com.mysql.jdbc.Driver
[INFO]   jdbc.username = root
[INFO]   hibernate.connection.password =
[INFO]   jdbc.validationQuery = SELECT 1 + 1
[INFO] HV000001: Hibernate Validator 5.1.3.Final
[INFO] HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
[INFO] HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
[INFO] HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
[INFO] HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
[INFO] HHH000227: Running hbm2ddl schema export

    alter table user_role
        drop
        foreign key FK_it77eq964jhfqtu54081ebtio;
[ERROR] HHH000389: Unsuccessful: alter table user_role drop foreign key FK_it77eq964jhfqtu54081ebtio
[ERROR] Table 'myproject.user_role' doesn't exist

    alter table user_role
        drop
        foreign key FK_apcc8lxk2xnug8377fatvbn04;
[ERROR] HHH000389: Unsuccessful: alter table user_role drop foreign key FK_apcc8lxk2xnug8377fatvbn04
[ERROR] Table 'myproject.user_role' doesn't exist

    drop table if exists app_user;

    drop table if exists role;

    drop table if exists user_role;

    create table app_user (
        id bigint not null auto_increment,
        account_expired bit not null,
        account_locked bit not null,
        address varchar(150),
        city varchar(50),
        country varchar(100),
        postal_code varchar(15),
        province varchar(100),
        credentials_expired bit not null,
        email varchar(255) not null,
        account_enabled bit,
        first_name varchar(50) not null,
        last_name varchar(50) not null,
        password varchar(255) not null,
        password_hint varchar(255),
        phone_number varchar(255),
        username varchar(50) not null,
        version integer,
        website varchar(255),
        primary key (id)
    ) ENGINE=InnoDB;

    create table role (
        id bigint not null auto_increment,
        description varchar(64),
        name varchar(20),
        primary key (id)
    ) ENGINE=InnoDB;

    create table user_role (
        user_id bigint not null,
        role_id bigint not null,
        primary key (user_id, role_id)
    ) ENGINE=InnoDB;

    alter table app_user
        add constraint UK_1j9d9a06i600gd43uu3km82jw  unique (email);

    alter table app_user
        add constraint UK_3k4cplvh82srueuttfkwnylq0  unique (username);

    alter table user_role
        add constraint FK_it77eq964jhfqtu54081ebtio
        foreign key (role_id)
        references role (id);

    alter table user_role
        add constraint FK_apcc8lxk2xnug8377fatvbn04
        foreign key (user_id)
        references app_user (id);
[INFO] HHH000230: Schema export complete
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myproject ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /Users/mraible/myproject/target/test-classes
[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test-compile) @ myproject ---
[INFO]
        database name=MySQL
        database version=5.6.16
        database major version=5
        database minor version=6
        jdbc driver name=MySQL Connector Java
        jdbc driver version=mysql-connector-java-5.1.27 ( Revision: [hidden email]-20131021093118-gtm1bh1vb450xipt )
        jdbc driver major version=5
        jdbc driver minor version=1

[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ myproject ---
[INFO] Surefire report directory: /Users/mraible/myproject/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.mycompany.webapp.action.UserActionTest
Running com.mycompany.webapp.filter.LocaleFilterTest
Running com.mycompany.webapp.action.PasswordHintActionTest
Running com.mycompany.webapp.listener.StartupListenerTest
Running com.mycompany.webapp.action.SignupActionTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.117 sec - in com.mycompany.webapp.filter.LocaleFilterTest
DEBUG [main] LookupDaoHibernate.getRoles(39) | Retrieving all role names...
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.005 sec - in com.mycompany.webapp.listener.StartupListenerTest
DEBUG [main] UserDaoHibernate.saveUser(53) | user's id: -1
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [UK_1j9d9a06i600gd43uu3km82jw]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)
        at org.springframework.orm.hibernate4.HibernateExceptionTranslator.convertHibernateAccessException(HibernateExceptionTranslator.java:57)
        at org.springframework.orm.hibernate4.HibernateExceptionTranslator.translateExceptionIfPossible(HibernateExceptionTranslator.java:44)
        at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
        at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy69.saveUser(Unknown Source)
        at org.appfuse.service.impl.UserManagerImpl.saveUser(UserManagerImpl.java:147)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:267)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:52)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:267)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy73.saveUser(Unknown Source)
        at com.mycompany.webapp.action.UserAction.save(UserAction.java:185)
        at com.mycompany.webapp.action.UserActionTest.testSaveConflictingUser(UserActionTest.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:73)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
        at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:73)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:72)
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3285)
        at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3183)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3525)
        at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:159)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:349)
        at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1222)
        at org.appfuse.dao.hibernate.UserDaoHibernate.saveUser(UserDaoHibernate.java:57)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
        ... 60 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '[hidden email]' for key 'UK_1j9d9a06i600gd43uu3km82jw'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2825)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2459)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2376)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2360)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
        ... 78 more
WARN [main] UserManagerImpl.saveUser(150) | could not execute statement; SQL [n/a]; constraint [UK_1j9d9a06i600gd43uu3km82jw]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
WARN [main] PasswordHintAction.execute(74) | user 'UNKNOWN123' not found...
DEBUG [main] UserDaoHibernate.saveUser(53) | user's id: null
WARN [main] PasswordHintAction.execute(37) | Username not specified, notifying user that it's a required field.
DEBUG [main] UserDaoHibernate.saveUser(53) | user's id: -2
WARN [main] PasswordHintAction.execute(74) | user 'manager' not found...
DEBUG [main] UserDaoHibernate.saveUser(53) | user's id: -2
WARN [main] PasswordHintAction.execute(74) | user 'manager' not found...
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.692 sec - in com.mycompany.webapp.action.PasswordHintActionTest
DEBUG [main] UserDaoHibernate.saveUser(53) | user's id: -1
DEBUG [main] UserManagerImpl.removeUser(169) | removing user: -2
DEBUG [main] UserDaoHibernate.saveUser(53) | user's id: null
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [UK_1j9d9a06i600gd43uu3km82jw]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)
        at org.springframework.orm.hibernate4.HibernateExceptionTranslator.convertHibernateAccessException(HibernateExceptionTranslator.java:57)
        at org.springframework.orm.hibernate4.HibernateExceptionTranslator.translateExceptionIfPossible(HibernateExceptionTranslator.java:44)
        at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
        at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy69.saveUser(Unknown Source)
        at org.appfuse.service.impl.UserManagerImpl.saveUser(UserManagerImpl.java:147)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.086 sec - in com.mycompany.webapp.action.UserActionTest
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:267)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:52)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:267)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy73.saveUser(Unknown Source)
        at com.mycompany.webapp.action.SignupAction.save(SignupAction.java:76)
        at com.mycompany.webapp.action.SignupActionTest.testSave(SignupActionTest.java:72)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:73)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
        at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:73)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:72)
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211)
        at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:96)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:58)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558)
        at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98)
        at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:490)
        at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:195)
        at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:179)
        at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:214)
        at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324)
        at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288)
        at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194)
        at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125)
        at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:209)
        at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:194)
        at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:114)
        at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
        at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:684)
        at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:676)
        at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:671)
        at org.appfuse.dao.hibernate.UserDaoHibernate.saveUser(UserDaoHibernate.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
        ... 60 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '[hidden email]' for key 'UK_1j9d9a06i600gd43uu3km82jw'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2825)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2459)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2376)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2360)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
        ... 89 more
WARN [main] UserManagerImpl.saveUser(150) | could not execute statement; SQL [n/a]; constraint [UK_1j9d9a06i600gd43uu3km82jw]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
WARN [main] SignupAction.save(83) | User 'self-registered' already exists!
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.986 sec - in com.mycompany.webapp.action.SignupActionTest

Results :

Tests run: 22, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test) @ myproject ---
[INFO]
        database name=MySQL
        database version=5.6.16
        database major version=5
        database minor version=6
        jdbc driver name=MySQL Connector Java
        jdbc driver version=mysql-connector-java-5.1.27 ( Revision: [hidden email]-20131021093118-gtm1bh1vb450xipt )
        jdbc driver major version=5
        jdbc driver minor version=1

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.260 s
[INFO] Finished at: 2015-03-04T07:44:37-07:00
[INFO] Final Memory: 40M/195M
[INFO] ------------------------------------------------------------------------

> On Mar 4, 2015, at 12:31 AM, Saeid <[hidden email]> wrote:
>
> ok matt! I'll create a project just as you say through:
>
> $ mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes
> -DarchetypeArtifactId=appfuse-basic-struts-archetype
> -DarchetypeVersion=3.5.0 -DgroupId=com.mycompany -DartifactId=myproject
> -DarchetypeRepository=https://oss.sonatype.org/content/repositories/appfuse
>
>
> Then as soon as i issue *mvn test* or *mvn integration-test* i'll be stoped
> with the following error :
>
> *
> [INFO] --- hibernate4-maven-plugin:1.0.5:export (default) @ mmohit ---
> [INFO] Scanning directory D:\Java\mmohit\target\classes for annotated
> classes...
> [INFO] Scanning dependencies for scope none
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 18.341 s
> [INFO] Finished at: 2015-03-04T10:19:51+03:30
> [INFO] Final Memory: 18M/45M
> [INFO]
> ------------------------------------------------------------------------
>
> Failed to execute goal de.juplo:hibernate4-maven-plugin:1.0.5:export
> (default) on project mmohit:
> No annotated classes found in directory D:\Java\mmohit\target\classes*
>
>
> it seems it could not resolve required "transitive dependencies"!
>
>
> what do you think matt?
>
>
>
>
> --
> View this message in context: http://appfuse.547863.n4.nabble.com/Integration-tests-using-Spring-and-DBunit-tp4657734p4657740.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: BaseActionTestCase in Appfuse 3.0.0

Saeid
jdk =1.7
maven = 3.2.3
os= win7 version 6.1
Reply | Threaded
Open this post in threaded view
|

Re: BaseActionTestCase in Appfuse 3.0.0

mraible
Administrator
I tried it with Java 8 on Maven 3.2.1 on Windows 7 Ultimate SP1. I had similar successful results.

[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test) @ myproject ---
[INFO]
        database name=MySQL
        database version=5.1.51-community
        database major version=5
        database minor version=1
        jdbc driver name=MySQL Connector Java
        jdbc driver version=mysql-connector-java-5.1.27 ( Revision: alexander.so
[hidden email]-20131021093118-gtm1bh1vb450xipt )
        jdbc driver major version=5
        jdbc driver minor version=1

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.154 s
[INFO] Finished at: 2015-03-04T08:33:57-07:00
[INFO] Final Memory: 35M/180M
[INFO] ------------------------------------------------------------------------
C:\Users\Administrator\Source\myproject>

> On Mar 4, 2015, at 7:49 AM, Saeid <[hidden email]> wrote:
>
> jdk =1.7
> maven = 3.2.3
> os= win7 version 6.1
>
>
>
>
> --
> View this message in context: http://appfuse.547863.n4.nabble.com/Integration-tests-using-Spring-and-DBunit-tp4657734p4657742.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.