Announcement Announcement Module
Collapse
No announcement yet.
perform test fails when using hibernate/postgresql jpa. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • perform test fails when using hibernate/postgresql jpa.

    I modified the pizzashop.roo script in the 1.2.0.SNAPSHOT-BUILD from:
    Code:
    jpa setup --provider ECLIPSELINK --database H2_IN_MEMORY
    to
    Code:
    jpa setup --provider HIBERNATE --database POSTGRES --databaseName pizza --hostName localhost --userName admin --password foooooooo --transactionManager
    The database does exist in psql.

    Do I need to pass additional params to the surefire plugin to use a db that requires auth?

    Is it HIBERNATE vs ECLIPSELINK or H2_IN_MEMORY vs POSTGRES that's causing the issue?

    Or, is there any mechanism to swap jpa config for unit tests?

    Here's the output:

    0 %> mvn -e test
    [INFO] Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building pizzashop 0.1.0.BUILD-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- aspectj-maven-plugin:1.2:compile (default) @ pizzashop ---
    [INFO]
    [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ pizzashop ---
    [debug] execute contextualize
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 5 resources
    [INFO]
    [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ pizzashop ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- aspectj-maven-plugin:1.2:test-compile (default) @ pizzashop ---
    [INFO]
    [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ pizzashop ---
    [debug] execute contextualize
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 0 resource
    [INFO]
    [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ pizzashop ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-surefire-plugin:2.8:test (default-test) @ pizzashop ---
    [INFO] Surefire report directory: /Users/bedge/nim/src/trunk/source/pizzajackpsql/target/surefire-reports
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 8.300s
    [INFO] Finished at: Thu Sep 01 16:25:56 PDT 2011
    [INFO] Final Memory: 5M/81M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8:test (default-test) on project pizzashop: There are test failures.
    [ERROR]
    [ERROR] Please refer to /Users/bedge/nim/src/trunk/source/pizzajackpsql/target/surefire-reports for the individual test results.
    [ERROR] -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8:test (default-test) on project pizzashop: There are test failures.

    Please refer to /Users/bedge/nim/src/trunk/source/pizzajackpsql/target/surefire-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModul eBuilder.buildProject(LifecycleModuleBuilder.java: 84)
    at org.apache.maven.lifecycle.internal.LifecycleModul eBuilder.buildProject(LifecycleModuleBuilder.java: 59)
    at org.apache.maven.lifecycle.internal.LifecycleStart er.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStart er.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.jav a:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java :196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:1 41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher. launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher. launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher. mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher. main(Launcher.java:352)
    Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

    Please refer to /Users/bedge/nim/src/trunk/source/pizzajackpsql/target/surefire-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.re portExecution(SurefireHelper.java:74)
    at org.apache.maven.plugin.surefire.SurefirePlugin.wr iteSummary(SurefirePlugin.java:644)
    at org.apache.maven.plugin.surefire.SurefirePlugin.ex ecuteAfterPreconditionsChecked(SurefirePlugin.java :640)
    at org.apache.maven.plugin.surefire.AbstractSurefireM ojo.execute(AbstractSurefireMojo.java:103)
    at org.apache.maven.plugin.DefaultBuildPluginManager. executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.e xecute(MojoExecutor.java:209)
    ... 19 more
    [ERROR]
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/d...ilureException

    -Bruce

  • #2
    As another datapoint, this JPA setting works:
    jpa setup --provider ECLIPSELINK --database POSTGRES --databaseName pizza --hostName localhost --userName admin --password foooooooooo --transactionManager

    so it is HIBERNATE instead of ECLIPSELINK that's causing the problem.

    -Bruce

    Comment

    Working...
    X