tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: tomee testing
Date Fri, 22 Jun 2018 16:44:51 GMT
You can add it in libs property of arquillian container config. Just prefix
the coords with mvn:.

Ex: mvn:mysql:mysql-connector-jav:version

It is a multiline property so you can add N libs to tomee lib this way

Le ven. 22 juin 2018 18:13, Matthew Broadhead
<matthew.broadhead@nbmlaw.co.uk.invalid> a écrit :

> INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please
> wait...
>
> i have an arquillian test running up ok but it is complaining
> SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the
> following stack trace and this message to users@tomee.apache.org :
>   org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> resolve class com.mysql.jdbc.Driver
>
> is there any way to directly bring in the mysql driver from maven
> central?  or do i need to download manually and put it into
> src/test/tomee/lib?
>
>
> On 22/06/18 10:03, Romain Manni-Bucau wrote:
> > You can theorically but I'd recommand you to write it in the final module
> > instead of trying to use the parent which will be executed before any
> other
> > modules.
> >
> > If A depends on B which depends on C then write your tests in A for the
> > complete app tests and write unit tests in B and C (potentially using
> > arquillian, appcomposer or even other solutions).
> >
> > For reference:
> > http://tomee.apache.org/developer/testing/arquillian/index.html and
> > http://tomee.apache.org/developer/testing/index.html
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> >
> > Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
> > <matthew.broadhead@nbmlaw.co.uk.invalid> a écrit :
> >
> >> it sounds like Arquillian might be the best fit in my case.  can the
> >> tests inject CDI beans from the webapps or does everything need to be
> >> done through http?  looking at
> >> https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test"
> it
> >> looks as if beans can be injected...
> >>
> >> is it possible to create the tests (or at least TomEE instance) in a
> >> parent pom?  i need to run several webapps at once which are all modules
> >> of the parent.  i think code is discouraged in parent project.
> >>
> >>
> >> On 22/06/18 09:18, Romain Manni-Bucau wrote:
> >>> You can set the property openejb.location (or the other ones we have)
> to
> >>> point to an openejb.xml if you want. The advantage of the properties is
> >>> that it is filtered during the test and doesnt require a maven build
> but
> >> it
> >>> is up to you and depends the project setup.
> >>>
> >>> Arquillian is great to test complete application*s* in a real server,
> >>> ApplicationComposer is good to test small parts of applications or
> >>> frameworks, TomEE,
> >>> TomEEEmbeddedSingleRunner is great to test a real app (single
> deployment
> >>> from the classpath + single test setup) and will save a lot of time.
> >>>
> >>> Romain Manni-Bucau
> >>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> >>> <https://rmannibucau.metawerx.net/> | Old Blog
> >>> <http://rmannibucau.wordpress.com> | Github <
> >> https://github.com/rmannibucau> |
> >>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> >>> <
> >>
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >>>
> >>>
> >>> Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
> >>> <matthew.broadhead@nbmlaw.co.uk.invalid> a écrit :
> >>>
> >>>> i am trying to use ApplicationComposer to create some tests.  CDI is
> >>>> scanning the classes correctly but i am a little uncertain about how
> to
> >>>> load a test database.
> >>>>
> >>>> i was going to start by just loading the database as normal as it is
a
> >>>> copy of production database.  but how do i specify the username and
> >>>> password or any other properties that are needed to connect to the db?
> >>>>
> >>>> @ContainerProperties(@ContainerProperties.Property(name = "mydb",
> value
> >>>> = "jdbc:mysql://localhost:3306/mydb"))
> >>>>
> >>>> is there a way to specify the resource in an xml file?
> >>>>
> >>>> another question...is it better to start with Arquillian or
> >>>> ApplicationComposer?
> >>>>
> >>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message