• Re: maven integration test

    From e.d.programmer@gmail.com@21:1/5 to All on Wed Nov 23 06:47:45 2022
    We are using a .properties file for the jdbc connect string.
    I am loading the .properties file with the <file> tag using read-project-properties in the properties-maven-plugin.
    duh. failsafe needs the properties file values. Of course I mess with this for 3 days then ask why it doesn't work and right away take a closer look and see I never put the properties-maven-plugin in the plugins section, just in the pluginManagement
    section.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From e.d.programmer@gmail.com@21:1/5 to All on Wed Nov 23 06:41:26 2022
    Why does integration test fail?
    If I add <goal>integration-test</goal> in the build, plugins section under the maven-failsafe-plugin, failsafe executes the *IT.java test programs and throws "failed to connect" (to local JDBC database) on running mvn install.
    Without that goal line, install succeeds.
    If I right click the tests in eclipse and select run as junit test, they succeed.
    We are using a .properties file for the jdbc connect string.
    I am loading the .properties file with the <file> tag using read-project-properties in the properties-maven-plugin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey H. Coffield@21:1/5 to e.d.pro...@gmail.com on Wed Nov 23 07:58:02 2022
    On 11/23/22 07:44, e.d.pro...@gmail.com wrote:
    We are using a .properties file for the jdbc connect string.
    I am loading the .properties file with the <file> tag using read-project-properties in the properties-maven-plugin.
    duh. failsafe needs the properties file values. Of course I mess with this for 3 days then ask why it doesn't work and right away take a closer look and see I never put the properties-maven-plugin in the plugins section, just in the pluginManagement
    section.

    Now what am I missing?
    I deleted the integration-test goal, then ran these commands, all success. mvn validate
    mvn compile
    mvn test
    mvn package
    mvn verify
    mvn install
    Then I put the integration-test goal back in and ran mvn clean install and it fails database connection again.

    What is the output from maven with -e and -X?

    Jeff Coffield

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From e.d.programmer@gmail.com@21:1/5 to All on Wed Nov 23 07:44:23 2022
    We are using a .properties file for the jdbc connect string.
    I am loading the .properties file with the <file> tag using read-project-properties in the properties-maven-plugin.
    duh. failsafe needs the properties file values. Of course I mess with this for 3 days then ask why it doesn't work and right away take a closer look and see I never put the properties-maven-plugin in the plugins section, just in the pluginManagement
    section.

    Now what am I missing?
    I deleted the integration-test goal, then ran these commands, all success.
    mvn validate
    mvn compile
    mvn test
    mvn package
    mvn verify
    mvn install
    Then I put the integration-test goal back in and ran mvn clean install and it fails database connection again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey H. Coffield@21:1/5 to e.d.pro...@gmail.com on Wed Nov 23 08:57:18 2022
    On 11/23/22 08:47, e.d.pro...@gmail.com wrote:
    What is the output from maven with -e and -X?

    Jeff Coffield

    Unit tests are fast. I hate these integration tests.
    I took out the integration-test goal and ran another full mvn clean install and it succeeded.
    I put it back in and ran mvn -e -X install. It's just now finishing, with "network adapter could not establish the connection".

    Have you checked the server side logs and possibly turned on debugging
    there to see what, if any, shows there?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey H. Coffield@21:1/5 to e.d.pro...@gmail.com on Wed Nov 23 09:11:16 2022
    On 11/23/22 09:01, e.d.pro...@gmail.com wrote:
    Have you checked the server side logs and possibly turned on debugging
    there to see what, if any, shows there?
    Server side? It's a jdbc connection, to an oracle database on the same machine.
    Tests run fine if I right click them to run as junit in eclipse.

    But is there a difference between when it connects and it doesn't in the
    server logs?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From e.d.programmer@gmail.com@21:1/5 to All on Wed Nov 23 08:47:15 2022
    What is the output from maven with -e and -X?

    Jeff Coffield

    Unit tests are fast. I hate these integration tests.
    I took out the integration-test goal and ran another full mvn clean install and it succeeded.
    I put it back in and ran mvn -e -X install. It's just now finishing, with "network adapter could not establish the connection".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From e.d.programmer@gmail.com@21:1/5 to All on Wed Nov 23 09:01:33 2022
    Have you checked the server side logs and possibly turned on debugging
    there to see what, if any, shows there?
    Server side? It's a jdbc connection, to an oracle database on the same machine. Tests run fine if I right click them to run as junit in eclipse.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From e.d.programmer@gmail.com@21:1/5 to All on Wed Nov 23 12:30:23 2022
    But is there a difference between when it connects and it doesn't in the server logs?
    Again, there is no server? I'm running a maven build on localhost with integration tests failing to connect to an oracle service running on localhost. What log are we looking for?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey H. Coffield@21:1/5 to e.d.pro...@gmail.com on Wed Nov 23 21:22:25 2022
    On 11/23/22 12:30, e.d.pro...@gmail.com wrote:
    But is there a difference between when it connects and it doesn't in the
    server logs?
    Again, there is no server? I'm running a maven build on localhost with integration tests failing to connect to an oracle service running on localhost. What log are we looking for?


    The Oracle service should have a log file that you can set a debug level
    on to see what is being passed to it. That will tell you if any
    connection is made when the tests fail and what is being passed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From e.d.programmer@gmail.com@21:1/5 to All on Mon Nov 28 09:59:42 2022
    The Oracle service should have a log file that you can set a debug level
    on to see what is being passed to it. That will tell you if any
    connection is made when the tests fail and what is being passed.
    solved it. The connection machine name, port is in .properties files.
    The test wasn't finding the right .properties file which was in a package folder under src/test/java. I moved that path under src/test/resources.
    There are multiple properties files. The tests don't work with the default app file, this file needs to override it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)