I try it on the 2.1.0-M2-SNAPSHOT. 1,change Database settings :
<dbunit.dataTypeFactoryName>org.dbunit.ext.db2.Db2DataTypeFactory</dbunit.dataTypeFactoryName> <dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type> <hibernate.dialect>org.hibernate.dialect.DB2Dialect</hibernate.dialect> <jdbc.groupId>com.ibm</jdbc.groupId> <jdbc.artifactId>db2jcc</jdbc.artifactId> <jdbc.version>3.58.82</jdbc.version> <jdbc.driverClassName>com.ibm.db2.jcc.DB2Driver</jdbc.driverClassName> <jdbc.url>jdbc:db2://localhost:50000/test1</jdbc.url> <jdbc.username>db2admin</jdbc.username> <jdbc.password>sa</jdbc.password> 2,run mvn on core: C:\Users\Yen\works\myproject\core>mvn [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building AppFuse Modular Application - Core [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ Downloading: http://repo1.maven.org/maven2/com/ibm/db2jcc/3.58.82/db2jcc-3.58.82 .pom [INFO] Unable to find resource 'com.ibm:db2jcc:pom:3.58.82' in repository centra l (http://repo1.maven.org/maven2) [INFO] [aspectj:compile {execution: default}] [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 6 resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 5 resources [INFO] Preparing hibernate3:hbm2ddl [WARNING] Removing: hbm2ddl from forked lifecycle, to prevent recursive invocati on. [INFO] [aspectj:compile {execution: default}] [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 6 resources [INFO] [hibernate3:hbm2ddl {execution: default}] [INFO] Configuration XML file loaded: file:/C:/Users/Yen/works/myproject/core/sr c/main/resources/hibernate.cfg.xml [INFO] Configuration XML file loaded: file:/C:/Users/Yen/works/myproject/core/sr c/main/resources/hibernate.cfg.xml [INFO] Configuration Properties file loaded: C:\Users\Yen\works\myproject\core\t arget\test-classes\jdbc.properties drop table app_user; drop table role; drop table user_role; create table app_user (id bigint generated by default as identity, account_expir ed smallint not null, account_locked smallint not null, address varchar(150), ci ty varchar(50), country varchar(100), postal_code varchar(15), province varchar( 100), credentials_expired smallint not null, email varchar(255) not null unique, account_enabled smallint, first_name varchar(50) not null, last_name varchar(50 ) not null, password varchar(255) not null, password_hint varchar(255), phone_nu mber varchar(255), username varchar(50) not null unique, version integer, websit e varchar(255), primary key (id)); create table role (id bigint generated by default as identity, description varch ar(64), name varchar(20), primary key (id)); create table user_role (user_id bigint not null, role_id bigint not null, primar y key (user_id, role_id)); alter table user_role add constraint FK143BF46A4FD90D75 foreign key (role_id) re ferences role; alter table user_role add constraint FK143BF46AF503D155 foreign key (user_id) re ferences app_user; [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Nothing to compile - all classes are up to date [INFO] [dbunit:operation {execution: test-compile}] 553 [main] INFO org.dbunit.database.DatabaseDataSet - database name=DB2/NT database version=SQL09071 database major version=9 database minor version=7 jdbc driver name=IBM DB2 JDBC Universal Driver Architecture jdbc driver version=3.58.82 jdbc driver major version=3 jdbc driver minor version=58 576 [main] INFO org.dbunit.util.SQLHelper - class org.dbunit.database.DatabaseTa bleMetaData. Corrected table name: oldValue=user_role newValue=USER_ROLE 612 [main] INFO org.dbunit.util.SQLHelper - class org.dbunit.database.DatabaseTa bleMetaData. Corrected table name: oldValue=role newValue=ROLE 623 [main] INFO org.dbunit.util.SQLHelper - class org.dbunit.database.DatabaseTa bleMetaData. Corrected table name: oldValue=app_user newValue=APP_USER [INFO] [surefire:test {execution: default-test}] [INFO] Surefire report directory: C:\Users\Yen\works\myproject\core\target\suref ire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.mycompany.core.CoreTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.103 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [jar:jar {execution: default-jar}] [INFO] [install:install {execution: default-install}] [INFO] Installing C:\Users\Yen\works\myproject\core\target\core-1.0-SNAPSHOT.jar to C:\Users\Yen\.m2\repository\com\mycompany\core\1.0-SNAPSHOT\core-1.0-SNAPSHO T.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22 seconds [INFO] Finished at: Mon Feb 08 18:20:12 CST 2010 [INFO] Final Memory: 28M/51M [INFO] ------------------------------------------------------------------------ C:\Users\Yen\works\myproject\core> 3,run mvn on web: C:\Users\Yen\works\myproject\web>mvn [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building AppFuse Modular Application - Web (Struts 2) [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}] [INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}] [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 21 resources [INFO] Copying 37 resources [INFO] Copying 2 resources [INFO] Copying 71 resources [INFO] Copying 71 resources Downloading: http://repo1.maven.org/maven2/com/ibm/db2jcc/3.58.82/db2jcc-3.58.82 .pom [INFO] Unable to find resource 'com.ibm:db2jcc:pom:3.58.82' in repository centra l (http://repo1.maven.org/maven2) [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 17 source files to C:\Users\Yen\works\myproject\web\target\clas ses [INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 5 resources [INFO] Copying 11 resources [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Compiling 8 source files to C:\Users\Yen\works\myproject\web\target\test- classes [INFO] [dbunit:operation {execution: test-compile}] 570 [main] INFO org.dbunit.database.DatabaseDataSet - database name=DB2/NT database version=SQL09071 database major version=9 database minor version=7 jdbc driver name=IBM DB2 JDBC Universal Driver Architecture jdbc driver version=3.58.82 jdbc driver major version=3 jdbc driver minor version=58 589 [main] INFO org.dbunit.util.SQLHelper - class org.dbunit.database.DatabaseTa bleMetaData. Corrected table name: oldValue=user_role newValue=USER_ROLE 642 [main] INFO org.dbunit.util.SQLHelper - class org.dbunit.database.DatabaseTa bleMetaData. Corrected table name: oldValue=role newValue=ROLE 654 [main] INFO org.dbunit.util.SQLHelper - class org.dbunit.database.DatabaseTa bleMetaData. Corrected table name: oldValue=app_user newValue=APP_USER [INFO] [surefire:test {execution: default-test}] [INFO] Surefire report directory: C:\Users\Yen\works\myproject\web\target\surefi re-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.mycompany.webapp.listener.StartupListenerTest 2010-2-8 18:21:43 net.sf.ehcache.util.UpdateChecker doCheck 信息: New update(s) found: 1.7.2 [http://ehcache.org/news.html] DEBUG [main] StartupListener.contextInitialized(40) | Initializing context... DEBUG [main] StartupListener.contextInitialized(76) | authenticationManager bean not found, assuming test and ignoring... DEBUG [main] StartupListener.contextInitialized(84) | Remember Me Enabled? null DEBUG [main] StartupListener.contextInitialized(88) | Populating drop-downs... DEBUG [main] StartupListener.setupContext(105) | Drop-down initialization comple te [OK] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.104 sec Running com.mycompany.webapp.action.PasswordHintActionTest INFO [main] PasswordHintActionTest.loadContextLocations(190) | Loading context f or locations: classpath:/applicationContext-resources.xml,classpath:/application Context-dao.xml,classpath:/applicationContext-service.xml,classpath*:/applicatio nContext.xml,/WEB-INF/applicationContext*.xml 2010-2-8 18:21:45 net.sf.ehcache.CacheManager detectAndFixDiskStorePathConflict 警告: Creating a new instance of CacheManager using the diskStorePath "C:\Users\ Yen\AppData\Local\Temp\" which is already used by an existing CacheManager. The source of the configuration was classpath. The diskStore path for this CacheManager will be set to C:\Users\Yen\AppData\Loc al\Temp\\ehcache_auto_created_1265624505895. To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache .xml) for each CacheManager instance. 2010-2-8 18:21:46 net.sf.ehcache.util.UpdateChecker doCheck 信息: New update(s) found: 1.7.2 [http://ehcache.org/news.html] DEBUG [main] PasswordHintActionTest.startNewTransaction(354) | Began transaction (1): transaction manager [org.springframework.orm.hibernate3.HibernateTransacti onmana...@1f4c4a3]; rollback [true]. DEBUG [main] PasswordHintAction.execute(45) | Processing Password Hint... DEBUG [main] PasswordHintActionTest.endTransaction(324) | Rolled back transactio n after execution of test [testExecute]. Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.871 sec Running com.mycompany.webapp.filter.StaticFilterTest DEBUG [main] MockFilterChain.doFilter(37) | Forwarding to: /editProfile.html Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.075 sec Running com.mycompany.webapp.action.SignupActionTest DEBUG [main] SignupActionTest.startNewTransaction(354) | Began transaction (1): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionMana g...@1f4c4a3]; rollback [true]. DEBUG [main] SignupAction.sendUserMessage(164) | sending e-mail to user [self-re giste...@raibledesigns.com]... DEBUG [main] SignupActionTest.endTransaction(324) | Rolled back transaction afte r execution of test [testExecute]. DEBUG [main] SignupActionTest.startNewTransaction(354) | Began transaction (1): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionMana g...@1f4c4a3]; rollback [true]. DEBUG [main] SignupActionTest.endTransaction(324) | Rolled back transaction afte r execution of test [testDisplayForm]. Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.426 sec Running com.mycompany.webapp.filter.LocaleFilterTest DEBUG [main] LocaleFilter.init(157) | Initializing filter '' DEBUG [main] LocaleFilter.init(182) | Filter '' configured successfully DEBUG [main] MockFilterChain.doFilter(37) | Forwarding to: DEBUG [main] LocaleFilter.init(157) | Initializing filter '' DEBUG [main] LocaleFilter.init(182) | Filter '' configured successfully DEBUG [main] MockFilterChain.doFilter(37) | Forwarding to: DEBUG [main] LocaleFilter.init(157) | Initializing filter '' DEBUG [main] LocaleFilter.init(182) | Filter '' configured successfully DEBUG [main] MockFilterChain.doFilter(37) | Forwarding to: DEBUG [main] LocaleFilter.init(157) | Initializing filter '' DEBUG [main] LocaleFilter.init(182) | Filter '' configured successfully DEBUG [main] MockFilterChain.doFilter(37) | Forwarding to: DEBUG [main] LocaleFilter.init(157) | Initializing filter '' DEBUG [main] LocaleFilter.init(182) | Filter '' configured successfully DEBUG [main] MockFilterChain.doFilter(37) | Forwarding to: Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec Running com.mycompany.webapp.action.UserActionTest DEBUG [main] UserActionTest.startNewTransaction(354) | Began transaction (1): tr ansaction manager [org.springframework.orm.hibernate3.HibernateTransactionManage r...@1f4c4a3]; rollback [true]. DEBUG [main] UserActionTest.endTransaction(324) | Rolled back transaction after execution of test [testCancel]. DEBUG [main] UserActionTest.startNewTransaction(354) | Began transaction (1): tr ansaction manager [org.springframework.orm.hibernate3.HibernateTransactionManage r...@1f4c4a3]; rollback [true]. DEBUG [main] UserAction.edit(111) | checking for remember me login... DEBUG [main] UserActionTest.endTransaction(324) | Rolled back transaction after execution of test [testEdit]. DEBUG [main] UserActionTest.startNewTransaction(354) | Began transaction (1): tr ansaction manager [org.springframework.orm.hibernate3.HibernateTransactionManage r...@1f4c4a3]; rollback [true]. DEBUG [main] UserActionTest.endTransaction(324) | Rolled back transaction after execution of test [testSave]. DEBUG [main] UserActionTest.startNewTransaction(354) | Began transaction (1): tr ansaction manager [org.springframework.orm.hibernate3.HibernateTransactionManage r...@1f4c4a3]; rollback [true]. DEBUG [main] UserActionTest.testSaveConflictingUser(65) | original version #: 2 DEBUG [main] UserActionTest.endTransaction(324) | Rolled back transaction after execution of test [testSaveConflictingUser]. DEBUG [main] UserActionTest.startNewTransaction(354) | Began transaction (1): tr ansaction manager [org.springframework.orm.hibernate3.HibernateTransactionManage r...@1f4c4a3]; rollback [true]. DEBUG [main] UserActionTest.endTransaction(324) | Rolled back transaction after execution of test [testSearch]. DEBUG [main] UserActionTest.startNewTransaction(354) | Began transaction (1): tr ansaction manager [org.springframework.orm.hibernate3.HibernateTransactionManage r...@1f4c4a3]; rollback [true]. DEBUG [main] UserActionTest.endTransaction(324) | Rolled back transaction after execution of test [testRemove]. Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.576 sec <<< FA ILURE! Results : Failed tests: testSaveConflictingUser(com.mycompany.webapp.action.UserActionTest) Tests run: 17, Failures: 1, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] There are test failures. Please refer to C:\Users\Yen\works\myproject\web\target\surefire-reports for the individual test results. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 37 seconds [INFO] Finished at: Mon Feb 08 18:21:48 CST 2010 [INFO] Final Memory: 37M/63M [INFO] ------------------------------------------------------------------------ C:\Users\Yen\works\myproject\web> 4,look at surefire-reports ------------------------------------------------------------------------------- Test set: com.mycompany.webapp.action.UserActionTest ------------------------------------------------------------------------------- Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.573 sec <<< FAILURE! testSaveConflictingUser(com.mycompany.webapp.action.UserActionTest) Time elapsed: 0.083 sec <<< FAILURE! junit.framework.AssertionFailedError: expected:<2> but was:<3> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:277) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:71) at com.mycompany.webapp.action.UserActionTest.testSaveConflictingUser(UserActionTest.java:73) 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:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:79) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) 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:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) 5,if run mvn jetty:run on web, the application will wooks good(yes,it skip ActionTest) thanks. -- View this message in context: http://n4.nabble.com/ActionTest-FAILURE-on-Db2-tp1472754p1472754.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net