Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39856 > unrolled thread

maven integration test

Started by"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
First post2022-11-23 06:41 -0800
Last post2022-11-28 09:59 -0800
Articles 11 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  maven integration test "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-23 06:41 -0800
    Re: maven integration test "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-23 06:47 -0800
      Re: maven integration test "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-23 07:44 -0800
        Re: maven integration test "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2022-11-23 07:58 -0800
          Re: maven integration test "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-23 08:47 -0800
            Re: maven integration test "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2022-11-23 08:57 -0800
              Re: maven integration test "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-23 09:01 -0800
                Re: maven integration test "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2022-11-23 09:11 -0800
                  Re: maven integration test "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-23 12:30 -0800
                    Re: maven integration test "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2022-11-23 21:22 -0800
                      Re: maven integration test "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-28 09:59 -0800

#39856 — maven integration test

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-11-23 06:41 -0800
Subjectmaven integration test
Message-ID<0dd077c9-5754-44f5-9c1c-8537fd08789an@googlegroups.com>
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.

[toc] | [next] | [standalone]


#39857

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-11-23 06:47 -0800
Message-ID<d177928e-49c1-4f86-a591-901ebe0c3d51n@googlegroups.com>
In reply to#39856
> 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.

[toc] | [prev] | [next] | [standalone]


#39858

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-11-23 07:44 -0800
Message-ID<eabefb2b-5660-4b39-942c-634d8feb2c40n@googlegroups.com>
In reply to#39857
> > 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.

[toc] | [prev] | [next] | [standalone]


#39859

From"Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com>
Date2022-11-23 07:58 -0800
Message-ID<tllfub$tss$1@gioia.aioe.org>
In reply to#39858

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

[toc] | [prev] | [next] | [standalone]


#39860

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-11-23 08:47 -0800
Message-ID<d0deda74-fb8c-43bf-8c29-2bc479a2c243n@googlegroups.com>
In reply to#39859
> 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".

[toc] | [prev] | [next] | [standalone]


#39861

From"Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com>
Date2022-11-23 08:57 -0800
Message-ID<tlljde$i03$1@gioia.aioe.org>
In reply to#39860

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?

[toc] | [prev] | [next] | [standalone]


#39862

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-11-23 09:01 -0800
Message-ID<330c1128-d6ea-4b3e-a151-c2d7a9acc5b6n@googlegroups.com>
In reply to#39861
> 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.

[toc] | [prev] | [next] | [standalone]


#39863

From"Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com>
Date2022-11-23 09:11 -0800
Message-ID<tllk7k$vu0$1@gioia.aioe.org>
In reply to#39862

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?

[toc] | [prev] | [next] | [standalone]


#39864

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-11-23 12:30 -0800
Message-ID<cc2de9e2-a106-4bf0-8f07-2738ff309d4dn@googlegroups.com>
In reply to#39863
> 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?

[toc] | [prev] | [next] | [standalone]


#39865

From"Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com>
Date2022-11-23 21:22 -0800
Message-ID<tlmv2i$le8$1@gioia.aioe.org>
In reply to#39864

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.

[toc] | [prev] | [next] | [standalone]


#39866

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2022-11-28 09:59 -0800
Message-ID<fcd66757-f70b-4183-9127-f09c6882dfe4n@googlegroups.com>
In reply to#39865
> 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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web