Discussion:
tomee testing
Matthew Broadhead
2018-06-22 07:03:20 UTC
Permalink
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?
Romain Manni-Bucau
2018-06-22 07:18:47 UTC
Permalink
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
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?
Matthew Broadhead
2018-06-22 07:42:02 UTC
Permalink
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.
Post by Romain Manni-Bucau
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
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?
Romain Manni-Bucau
2018-06-22 08:03:33 UTC
Permalink
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
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.
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
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?
Matthew Broadhead
2018-06-22 16:13:51 UTC
Permalink
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 ***@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?
Post by Romain Manni-Bucau
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).
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
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.
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
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?
Romain Manni-Bucau
2018-06-22 16:44:51 UTC
Permalink
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
Post by Matthew Broadhead
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
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?
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
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).
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
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
Post by Romain Manni-Bucau
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.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we have)
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
= "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?
Matthew Broadhead
2018-06-22 23:02:52 UTC
Permalink
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>

but i get these errors (which don't seem to stop execution)

fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
    at org.apache.sirona.asm.Frame.a(Unknown Source)
    at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown Source)

SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of java/net/URLClassLoader):
attempted  duplicate class definition for name:
"com/mysql/jdbc/ConnectionImpl"

but this one is a stopper

SEVERE - CDI Beans module deployment failed
org.apache.webbeans.exception.WebBeansDeploymentException:
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]

i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
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
Post by Matthew Broadhead
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
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?
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
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).
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
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
Post by Romain Manni-Bucau
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.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we have)
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
= "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?
Romain Manni-Bucau
2018-06-23 06:15:37 UTC
Permalink
Exclude mysql from sirona instrumentation. Its bytecode is not safe.

Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
but i get these errors (which don't seem to stop execution)
fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown Source)
SEVERE - Can't create DataSource
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Matthew Broadhead
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
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before any
other
Post by Romain Manni-Bucau
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).
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
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
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we have)
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the properties
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven build
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
load a test database.
i was going to start by just loading the database as normal as it
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
@ContainerProperties(@ContainerProperties.Property(name = "mydb",
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
= "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?
Matthew Broadhead
2018-06-23 08:05:34 UTC
Permalink
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation.  is sirona a requirement for
arquillian-tomee-remote?  i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
but i get these errors (which don't seem to stop execution)
fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown Source)
SEVERE - Can't create DataSource
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Matthew Broadhead
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
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before any
other
Post by Romain Manni-Bucau
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).
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
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
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we have)
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the properties
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven build
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
load a test database.
i was going to start by just loading the database as normal as it
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
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?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
@ContainerProperties(@ContainerProperties.Property(name = "mydb",
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
= "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?
Romain Manni-Bucau
2018-06-23 08:17:06 UTC
Permalink
It is not needed at all bit it appears in your stack. If it is a copy paste
just drop it ;)

Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
but i get these errors (which don't seem to stop execution)
fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Matthew Broadhead
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
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before any
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C (potentially using
arquillian, appcomposer or even other solutions).
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a real
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of applications or
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single
deployment
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot of
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
i am trying to use ApplicationComposer to create some tests. CDI
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
scanning the classes correctly but i am a little uncertain about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
load a test database.
i was going to start by just loading the database as normal as it
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
copy of production database. but how do i specify the username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
password or any other properties that are needed to connect to the
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
@ContainerProperties(@ContainerProperties.Property(name = "mydb",
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
= "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?
Matthew Broadhead
2018-06-23 10:54:49 UTC
Permalink
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html under
remote section.

now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
org.apache.webbeans.exception.WebBeansDeploymentException:
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
    at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
    at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)

i created the @Deployment using
@Inject
    private QuoteTypeDao quoteTypeDao;

    @Deployment(name = "archive")
    public static WebArchive war() {
        return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
                .addClasses(QuoteTypeDao.class);
    }

    @Test
    @OperateOnDeployment("archive")
    public void test1() {
        Quote quote = new Quote();
        Promotion promotion = null;
        List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
        System.out.println("Quote type list size: " +
quoteTypeList.size());
        for (QuoteType quoteType : quoteTypeList) {
            System.out.println(quoteType.getName());
            // quoteGeneratorDao.generateQuote(quote, promotion,
            // quoteType.getQuoteTypeCategories(), quoteQuestions,
            // quoteInit, true);
            assertEquals(0, 1);
        }
        assertEquals(0, 1);
    }

can i not inject a CDI bean into the test using arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a copy paste
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
but i get these errors (which don't seem to stop execution)
fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Matthew Broadhead
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
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before any
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C (potentially using
arquillian, appcomposer or even other solutions).
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a real
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of applications or
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single
deployment
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot of
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
i am trying to use ApplicationComposer to create some tests. CDI
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
scanning the classes correctly but i am a little uncertain about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
load a test database.
i was going to start by just loading the database as normal as it
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
copy of production database. but how do i specify the username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
password or any other properties that are needed to connect to the
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
@ContainerProperties(@ContainerProperties.Property(name = "mydb",
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
= "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?
Romain Manni-Bucau
2018-06-23 11:30:25 UTC
Permalink
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).

Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.

Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html under
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote, promotion,
// quoteType.getQuoteTypeCategories(), quoteQuestions,
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a copy
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is complaining
SEVERE - FATAL ERROR: Unknown error in Assembler. Please send the
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C (potentially
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
it sounds like Arquillian might be the best fit in my case. can
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
tests inject CDI beans from the webapps or does everything need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE instance)
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
parent pom? i need to run several webapps at once which are all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a real
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single
deployment
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot of
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some tests.
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little uncertain about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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?
Matthew Broadhead
2018-06-23 16:53:55 UTC
Permalink
do i need to copy the persistence.xml to src/test/resources/META-INF? 
or can i specify its location somewhere in config?

SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
    at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
    at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html under
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote, promotion,
// quoteType.getQuoteTypeCategories(), quoteQuestions,
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a copy
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is complaining
SEVERE - FATAL ERROR: Unknown error in Assembler. Please send the
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C (potentially
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
it sounds like Arquillian might be the best fit in my case. can
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
tests inject CDI beans from the webapps or does everything need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE instance)
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
parent pom? i need to run several webapps at once which are all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a real
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single
deployment
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot of
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some tests.
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little uncertain about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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?
Matthew Broadhead
2018-06-23 18:09:44 UTC
Permalink
ah ok.  i found
.addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"),
"persistence.xml")

in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java

but now i am back to
SEVERE - CDI Beans module deployment failed
org.apache.webbeans.exception.WebBeansDeploymentException:
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
    at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)

so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to src/test/resources/META-INF?
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
    at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
    at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html under
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
      at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
      at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
@Inject
      private QuoteTypeDao quoteTypeDao;
      public static WebArchive war() {
          return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
                  .addClasses(QuoteTypeDao.class);
      }
      public void test1() {
          Quote quote = new Quote();
          Promotion promotion = null;
          List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
          System.out.println("Quote type list size: " +
quoteTypeList.size());
          for (QuoteType quoteType : quoteTypeList) {
              System.out.println(quoteType.getName());
              // quoteGeneratorDao.generateQuote(quote, promotion,
              // quoteType.getQuoteTypeCategories(), quoteQuestions,
              // quoteInit, true);
              assertEquals(0, 1);
          }
          assertEquals(0, 1);
      }
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a copy
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation.  is sirona a requirement for
arquillian-tomee-remote?  i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
        at org.apache.sirona.asm.Frame.a(Unknown Source)
        at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C (potentially
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
it sounds like Arquillian might be the best fit in my case. can
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
tests inject CDI beans from the webapps or does everything need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE instance)
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
parent pom?  i need to run several webapps at once which are
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent.  i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a real
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single
deployment
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot of
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some tests.
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little uncertain about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database.  but how do i specify the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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?
Romain Manni-Bucau
2018-06-23 19:58:04 UTC
Permalink
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).

Maybe import our ziplock lib and use Mvn.Builder class if you are maven
based. It can help.

Le sam. 23 juin 2018 20:09, Matthew Broadhead
ah ok. i found
.addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"),
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to src/test/resources/META-INF?
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Matthew Broadhead
at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html under
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote, promotion,
// quoteType.getQuoteTypeCategories(), quoteQuestions,
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a copy
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C (potentially
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
it sounds like Arquillian might be the best fit in my case. can
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
tests inject CDI beans from the webapps or does everything need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE instance)
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
parent pom? i need to run several webapps at once which are all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a real
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single
deployment
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot of
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some tests.
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little uncertain
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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?
Matthew Broadhead
2018-06-24 09:36:57 UTC
Permalink
not much luck with arquillian.  i am trying ApplicationComposer again. 
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
        @ContainerProperties.Property(name = "sales.JdbcDriver", value
= "com.mysql.jdbc.Driver"),
        @ContainerProperties.Property(name = "sales.JdbcUrl", value =
"jdbc:mysql://localhost:3306/sales"),
        @ContainerProperties.Property(name = "sales.Username", value =
"admin"),
        @ContainerProperties.Property(name = "sales.Password", value =
"blahblah") })

but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
    at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
    at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)

how to bundle the mysql driver?  i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are maven
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
ah ok. i found
.addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"),
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to src/test/resources/META-INF?
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Matthew Broadhead
at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html under
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote, promotion,
// quoteType.getQuoteTypeCategories(), quoteQuestions,
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a copy
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html but i
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
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?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C (potentially
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
it sounds like Arquillian might be the best fit in my case. can
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
tests inject CDI beans from the webapps or does everything need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE instance)
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
parent pom? i need to run several webapps at once which are all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
of the parent. i think code is discouraged in parent project.
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a maven
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a real
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single
deployment
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot of
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some tests.
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little uncertain
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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?
Romain Manni-Bucau
2018-06-24 10:01:56 UTC
Permalink
Appcopposer loads classes in the classpath so add it as a test dependency.

Le dim. 24 juin 2018 11:37, Matthew Broadhead
not much luck with arquillian. i am trying ApplicationComposer again.
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
@ContainerProperties.Property(name = "sales.JdbcDriver", value
= "com.mysql.jdbc.Driver"),
@ContainerProperties.Property(name = "sales.JdbcUrl", value =
"jdbc:mysql://localhost:3306/sales"),
@ContainerProperties.Property(name = "sales.Username", value =
"admin"),
@ContainerProperties.Property(name = "sales.Password", value =
"blahblah") })
but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
how to bundle the mysql driver? i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are maven
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
ah ok. i found
.addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"),
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
Post by Romain Manni-Bucau
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to src/test/resources/META-INF?
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html
under
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote, promotion,
// quoteType.getQuoteTypeCategories(), quoteQuestions,
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a
copy
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html
but i
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not
safe.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at
org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not
embedded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
way
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is complaining
SEVERE - FATAL ERROR: Unknown error in Assembler. Please send
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
following stack trace and this message to
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
resolve class com.mysql.jdbc.Driver
is there any way to directly bring in the mysql driver from
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
central? or do i need to download manually and put it into
src/test/tomee/lib?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the
final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in
A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C
(potentially
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
Post by Matthew Broadhead
it sounds like Arquillian might be the best fit in my case.
can
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tests inject CDI beans from the webapps or does everything
need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE
instance)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
parent pom? i need to run several webapps at once which are
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
of the parent. i think code is discouraged in parent
project.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other
ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a
real
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app
(single
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
deployment
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot
of
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some
tests.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little uncertain
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as
normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to
connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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?
Matthew Broadhead
2018-06-24 10:15:14 UTC
Permalink
i tried adding test scope to pom.xml
<dependency>
            <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
            <scope>test</scope>
        </dependency>

also added mysql-connector-java-5.1.33.jar to the root of
src/test/resources but i still get
java.lang.IllegalArgumentException: mysql not found in classpath
    at
org.apache.openejb.testing.ApplicationComposers.findFiles(ApplicationComposers.java:1020)
    at
org.apache.openejb.testing.ApplicationComposers.addWebApp(ApplicationComposers.java:899)
    at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:651)
Post by Romain Manni-Bucau
Appcopposer loads classes in the classpath so add it as a test dependency.
Le dim. 24 juin 2018 11:37, Matthew Broadhead
not much luck with arquillian. i am trying ApplicationComposer again.
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
@ContainerProperties.Property(name = "sales.JdbcDriver", value
= "com.mysql.jdbc.Driver"),
@ContainerProperties.Property(name = "sales.JdbcUrl", value =
"jdbc:mysql://localhost:3306/sales"),
@ContainerProperties.Property(name = "sales.Username", value =
"admin"),
@ContainerProperties.Property(name = "sales.Password", value =
"blahblah") })
but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
how to bundle the mysql driver? i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are maven
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
ah ok. i found
.addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"),
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
Post by Romain Manni-Bucau
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to src/test/resources/META-INF?
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html
under
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote, promotion,
// quoteType.getQuoteTypeCategories(), quoteQuestions,
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a
copy
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html
but i
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not
safe.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported with
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at
org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not
embedded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
way
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is complaining
SEVERE - FATAL ERROR: Unknown error in Assembler. Please send
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
following stack trace and this message to
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
resolve class com.mysql.jdbc.Driver
is there any way to directly bring in the mysql driver from
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
central? or do i need to download manually and put it into
src/test/tomee/lib?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the
final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests in
A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C
(potentially
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
Post by Matthew Broadhead
it sounds like Arquillian might be the best fit in my case.
can
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tests inject CDI beans from the webapps or does everything
need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE
instance)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
parent pom? i need to run several webapps at once which are
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
of the parent. i think code is discouraged in parent
project.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other
ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a
real
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app
(single
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
deployment
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a lot
of
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some
tests.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little uncertain
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as
normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to
connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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?
Romain Manni-Bucau
2018-06-24 10:18:15 UTC
Permalink
you don't need @Jars for that

why you get an exception is cause appcomposers knows mysql has no EE
classes so it is excluded from the "find" logic. @Jars means "grab the jars
matching this prefix and scan them to include them in the deployed app".

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 dim. 24 juin 2018 à 12:15, Matthew Broadhead
Post by Matthew Broadhead
i tried adding test scope to pom.xml
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
<scope>test</scope>
</dependency>
also added mysql-connector-java-5.1.33.jar to the root of
src/test/resources but i still get
java.lang.IllegalArgumentException: mysql not found in classpath
at
org.apache.openejb.testing.ApplicationComposers.findFiles(ApplicationComposers.java:1020)
at
org.apache.openejb.testing.ApplicationComposers.addWebApp(ApplicationComposers.java:899)
at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:651)
Post by Romain Manni-Bucau
Appcopposer loads classes in the classpath so add it as a test
dependency.
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 11:37, Matthew Broadhead
not much luck with arquillian. i am trying ApplicationComposer again.
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
@ContainerProperties.Property(name = "sales.JdbcDriver", value
= "com.mysql.jdbc.Driver"),
@ContainerProperties.Property(name = "sales.JdbcUrl", value =
"jdbc:mysql://localhost:3306/sales"),
@ContainerProperties.Property(name = "sales.Username", value =
"admin"),
@ContainerProperties.Property(name = "sales.Password", value =
"blahblah") })
but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
Post by Romain Manni-Bucau
at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
Post by Romain Manni-Bucau
how to bundle the mysql driver? i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are maven
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
ah ok. i found
.addAsManifestResource(new
ClassLoaderAsset("META-INF/persistence.xml"),
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to src/test/resources/META-INF?
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive.
Here
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not
needed
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html
under
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote,
promotion,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
// quoteType.getQuoteTypeCategories(),
quoteQuestions,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a
copy
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html
but i
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor tests? if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not
safe.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported
with
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at
org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api
type
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not
embedded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container
config.
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
way
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading
org.apache.tomee:apache-tomee:7.0.3:zip:plus
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is complaining
SEVERE - FATAL ERROR: Unknown error in Assembler. Please send
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
following stack trace and this message to
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
resolve class com.mysql.jdbc.Driver
is there any way to directly bring in the mysql driver from
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
central? or do i need to download manually and put it into
src/test/tomee/lib?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the
final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed
before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests
in
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C
(potentially
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
Post by Matthew Broadhead
it sounds like Arquillian might be the best fit in my case.
can
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tests inject CDI beans from the webapps or does everything
need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE
instance)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
parent pom? i need to run several webapps at once which
are
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
of the parent. i think code is discouraged in parent
project.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other
ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of the
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a
real
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app
(single
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
deployment
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a
lot
Post by Romain Manni-Bucau
of
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some
tests.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little
uncertain
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as
normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to
connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@ContainerProperties(@ContainerProperties.Property(name =
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
ApplicationComposer?
Matthew Broadhead
2018-06-24 10:52:09 UTC
Permalink
This post might be inappropriate. Click to display it.
Romain Manni-Bucau
2018-06-24 11:02:23 UTC
Permalink
mapping error in your model it seems or bad persistence unit definition if
you dont use scanning.

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 dim. 24 juin 2018 à 12:52, Matthew Broadhead
Post by Matthew Broadhead
but now i get OpenJPA NPE on
List<QuoteType> quoteTypeList = query.getResultList();
<openjpa-2.4.2-r422266:1777108 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1029)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:928)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1032)
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
at
org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2382)
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
at
org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
at
org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2080)
at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:35)
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1257)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1013)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:869)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:800)
at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:541)
at
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274)
at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290)
at
uk.me.kissy.sales.dao.QuoteTypeDao.selectQuoteTypes(QuoteTypeDao.java:51)
at
uk.me.kissy.sales.dao.QuoteTypeDao$$OwbNormalScopeProxy0.selectQuoteTypes(uk/me/kissy/sales/dao/QuoteTypeDao.java)
at
uk.me.kissy.sales.test.QuoteGeneratorTest.test1(QuoteGeneratorTest.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:44)
at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:40)
at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1070)
at
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.NullPointerException
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:452)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:412)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:305)
at
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
at
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
at
org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1048)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1006)
... 45 more
Post by Romain Manni-Bucau
why you get an exception is cause appcomposers knows mysql has no EE
jars
Post by Romain Manni-Bucau
matching this prefix and scan them to include them in the deployed app".
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 à 12:15, Matthew Broadhead
Post by Matthew Broadhead
i tried adding test scope to pom.xml
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
<scope>test</scope>
</dependency>
also added mysql-connector-java-5.1.33.jar to the root of
src/test/resources but i still get
java.lang.IllegalArgumentException: mysql not found in classpath
at
org.apache.openejb.testing.ApplicationComposers.findFiles(ApplicationComposers.java:1020)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.addWebApp(ApplicationComposers.java:899)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:651)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Appcopposer loads classes in the classpath so add it as a test
dependency.
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 11:37, Matthew Broadhead
not much luck with arquillian. i am trying ApplicationComposer again.
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
@ContainerProperties.Property(name = "sales.JdbcDriver",
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
= "com.mysql.jdbc.Driver"),
@ContainerProperties.Property(name = "sales.JdbcUrl",
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"jdbc:mysql://localhost:3306/sales"),
@ContainerProperties.Property(name = "sales.Username",
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"admin"),
@ContainerProperties.Property(name = "sales.Password",
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"blahblah") })
but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
how to bundle the mysql driver? i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
ah ok. i found
.addAsManifestResource(new
ClassLoaderAsset("META-INF/persistence.xml"),
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to
src/test/resources/META-INF?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive.
Here
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not
needed
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html
under
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote,
promotion,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
// quoteType.getQuoteTypeCategories(),
quoteQuestions,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a
copy
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked http://incubator.apache.org/projects/sirona.html
but i
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
couldn't find any documentation. is sirona a requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor
tests?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not
safe.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported
with
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown Source)
at
org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api
type
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not
embedded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container
config.
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
this
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
way
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading
org.apache.tomee:apache-tomee:7.0.3:zip:plus
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is
complaining
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FATAL ERROR: Unknown error in Assembler. Please
send
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
following stack trace and this message to
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
resolve class com.mysql.jdbc.Driver
is there any way to directly bring in the mysql driver from
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
central? or do i need to download manually and put it into
src/test/tomee/lib?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write it in
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be executed
before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your tests
in
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C
(potentially
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
Post by Matthew Broadhead
it sounds like Arquillian might be the best fit in my
case.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
can
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tests inject CDI beans from the webapps or does
everything
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE
instance)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
parent pom? i need to run several webapps at once which
are
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
of the parent. i think code is discouraged in parent
project.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can set the property openejb.location (or the other
ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt require a
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete application*s* in a
real
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app
(single
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
deployment
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
from the classpath + single test setup) and will save a
lot
Post by Romain Manni-Bucau
of
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> |
Book
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create some
tests.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little
uncertain
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as
normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to
connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
@ContainerProperties(@ContainerProperties.Property(name =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
or
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
ApplicationComposer?
Matthew Broadhead
2018-06-24 11:46:16 UTC
Permalink
This post might be inappropriate. Click to display it.
Matthew Broadhead
2018-06-24 11:58:10 UTC
Permalink
i am loading the PU with a producer like
@ApplicationScoped
public class EntityManagerProducer {

    @PersistenceUnit(unitName = "sales")
    private EntityManagerFactory entityManagerFactory;

    @Produces
    @Default
    @RequestScoped
    public EntityManager create() {
        return this.entityManagerFactory.createEntityManager();
    }

    public void dispose(@Disposes @Default EntityManager entityManager) {
        if (entityManager.isOpen()) {
            entityManager.close();
        }
    }
}
Post by Matthew Broadhead
i changed
@Descriptors(@Descriptor(name = "persistence.xml", path =
META-INF/persistence.xml"))
to
@Descriptors(@Descriptor(name = "persistence.xml", path =
"src/main/resources/META-INF/persistence.xml"))
and now it is loading the persistence.xml
i still get the same error.  if i turn logging up to TRACE i get the
below.  is there any way to find the particular mapping might be
causing the problem?
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named factory
class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the
nested exception for details.: <openjpa-2.4.2-r422266:1777108 fatal
There was an error when invoking the static newInstance method on the
named factory class
"org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the nested
exception for details.
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1042)
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:718)
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:714)
    at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:724)
    at
org.apache.openejb.testing.ApplicationComposers.before(ApplicationComposers.java:386)
    at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1068)
    at
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named factory
class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the
nested exception for details.: <openjpa-2.4.2-r422266:1777108 fatal
There was an error when invoking the static newInstance method on the
named factory class
"org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the nested
exception for details.
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:873)
    ... 21 more
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named factory
class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the
nested exception for details.
    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:136)
    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:105)
    at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:157)
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:867)
    ... 21 more
Caused by: <openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named factory
class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the
nested exception for details.
    at
org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:73)
    at
org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:149)
    at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
    at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
    at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:109)
    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:134)
    ... 24 more
Caused by: java.lang.IllegalStateException: On a thread without an
initialized context nor a classloader mapping a deployed app
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:287)
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(ThreadSingletonServiceImpl.java:263)
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:298)
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:60)
    at
org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(WebBeansFinder.java:51)
    at
org.apache.webbeans.config.WebBeansContext.getInstance(WebBeansContext.java:185)
    at
org.apache.webbeans.config.WebBeansContext.currentInstance(WebBeansContext.java:203)
    at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$BmHandler.findBm(EntityManagerFactoryCallable.java:170)
    at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$BmHandler.invoke(EntityManagerFactoryCallable.java:158)
    at com.sun.proxy.$Proxy38.toString(Unknown Source)
    at java.lang.String.valueOf(String.java:2994)
    at java.lang.StringBuilder.append(StringBuilder.java:131)
    at java.util.AbstractMap.toString(AbstractMap.java:559)
    at java.text.MessageFormat.subformat(MessageFormat.java:1280)
    at java.text.MessageFormat.format(MessageFormat.java:865)
    at java.text.Format.format(Format.java:157)
    at java.text.MessageFormat.format(MessageFormat.java:841)
    at
org.apache.openjpa.lib.util.Localizer$Message.getMessage(Localizer.java:282)
    at
org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
    at
org.apache.openjpa.lib.log.AbstractLog.toString(AbstractLog.java:138)
    at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:72)
    at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:67)
    at
org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:764)
    at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at
org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:131)
    at
org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:65)
    ... 29 more
Post by Romain Manni-Bucau
mapping error in your model it seems or bad persistence unit
definition if
you dont use scanning.
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 dim. 24 juin 2018 à 12:52, Matthew Broadhead
Post by Matthew Broadhead
but now i get OpenJPA NPE on
List<QuoteType> quoteTypeList = query.getResultList();
<openjpa-2.4.2-r422266:1777108 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
      at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1029)
      at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:928)
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1032)
      at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
      at
org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2382)
      at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
      at
org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
      at
org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2080)
      at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:35)
      at
org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1257)
      at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1013)
      at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:869)
      at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:800)
      at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:541)
      at
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274)
      at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290)
      at
uk.me.kissy.sales.dao.QuoteTypeDao.selectQuoteTypes(QuoteTypeDao.java:51)
      at
uk.me.kissy.sales.dao.QuoteTypeDao$$OwbNormalScopeProxy0.selectQuoteTypes(uk/me/kissy/sales/dao/QuoteTypeDao.java)
      at
uk.me.kissy.sales.test.QuoteGeneratorTest.test1(QuoteGeneratorTest.java:96)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:44)
      at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:40)
      at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1070)
      at
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.NullPointerException
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:452)
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:412)
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:305)
      at
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
      at
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
      at
org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1048)
      at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1006)
      ... 45 more
Post by Romain Manni-Bucau
why you get an exception is cause appcomposers knows mysql has no EE
jars
Post by Romain Manni-Bucau
matching this prefix and scan them to include them in the deployed app".
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 à 12:15, Matthew Broadhead
Post by Matthew Broadhead
i tried adding test scope to pom.xml
<dependency>
               <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
               <scope>test</scope>
           </dependency>
also added mysql-connector-java-5.1.33.jar to the root of
src/test/resources but i still get
java.lang.IllegalArgumentException: mysql not found in classpath
       at
org.apache.openejb.testing.ApplicationComposers.findFiles(ApplicationComposers.java:1020)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
       at
org.apache.openejb.testing.ApplicationComposers.addWebApp(ApplicationComposers.java:899)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
       at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:651)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Appcopposer loads classes in the classpath so add it as a test
dependency.
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 11:37, Matthew Broadhead
not much luck with arquillian. i am trying ApplicationComposer
again.
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
"sales.JdbcDriver",
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
= "com.mysql.jdbc.Driver"),
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"jdbc:mysql://localhost:3306/sales"),
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"admin"),
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"blahblah") })
but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
        at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
        at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
how to bundle the mysql driver? i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
Post by Matthew Broadhead
ah ok.  i found
.addAsManifestResource(new
ClassLoaderAsset("META-INF/persistence.xml"),
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
         at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to
src/test/resources/META-INF?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
        at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
        at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive.
Here
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not
needed
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html
under
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
          at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
          at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
          private QuoteTypeDao quoteTypeDao;
          public static WebArchive war() {
              return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
          }
          public void test1() {
              Quote quote = new Quote();
              Promotion promotion = null;
              List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
              System.out.println("Quote type list size: " +
quoteTypeList.size());
              for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
                  // quoteGeneratorDao.generateQuote(quote,
promotion,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
                  // quoteType.getQuoteTypeCategories(),
quoteQuestions,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
                  // quoteInit, true);
                  assertEquals(0, 1);
              }
              assertEquals(0, 1);
          }
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a
copy
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked
http://incubator.apache.org/projects/sirona.html
but i
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
couldn't find any documentation.  is sirona a requirement for
arquillian-tomee-remote?  i.e. is it necessary to monitor
tests?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not
safe.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported
with
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
computeFrames option
            at org.apache.sirona.asm.Frame.a(Unknown
Source)
            at
org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api
type
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not
embedded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container
config.
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
this
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
way
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading
org.apache.tomee:apache-tomee:7.0.3:zip:plus
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is
complaining
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FATAL ERROR: Unknown error in Assembler. Please
send
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
following stack trace and this message to
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
resolve class com.mysql.jdbc.Driver
is there any way to directly bring in the mysql
driver from
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
central? or do i need to download manually and put it
into
src/test/tomee/lib?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write
it in
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be
executed
before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write your
tests
in
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C
(potentially
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> |
Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
Post by Matthew Broadhead
it sounds like Arquillian might be the best fit in my
case.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
can
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tests inject CDI beans from the webapps or does
everything
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE
instance)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
parent pom?  i need to run several webapps at once
which
are
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
of the parent.  i think code is discouraged in parent
project.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can set the property openejb.location (or the
other
ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The advantage of
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt
require a
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete
application*s* in a
real
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app
(single
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
deployment
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
from the classpath + single test setup) and will
save a
lot
Post by Romain Manni-Bucau
of
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> |
Book
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create
some
tests.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little
uncertain
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the database as
normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i specify
the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to
connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
@ContainerProperties(@ContainerProperties.Property(name =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
or
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
ApplicationComposer?
Matthew Broadhead
2018-06-24 12:27:40 UTC
Permalink
if i comment out fetch then it works! hooray!
        Root<QuoteType> quoteType = cq.from(QuoteType.class);
//        quoteType.fetch("quoteTypeCategories", JoinType.LEFT);

is there any way to make fetch work or do you think i have a mapping
error somewhere?  i have never had any problems so far
Post by Matthew Broadhead
i am loading the PU with a producer like
@ApplicationScoped
public class EntityManagerProducer {
    private EntityManagerFactory entityManagerFactory;
    public EntityManager create() {
        return this.entityManagerFactory.createEntityManager();
    }
        if (entityManager.isOpen()) {
            entityManager.close();
        }
    }
}
Post by Matthew Broadhead
i changed
@Descriptors(@Descriptor(name = "persistence.xml", path =
META-INF/persistence.xml"))
to
@Descriptors(@Descriptor(name = "persistence.xml", path =
"src/main/resources/META-INF/persistence.xml"))
and now it is loading the persistence.xml
i still get the same error.  if i turn logging up to TRACE i get the
below.  is there any way to find the particular mapping might be
causing the problem?
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.: <openjpa-2.4.2-r422266:1777108
fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1042)
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:718)
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:714)
    at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:724)
    at
org.apache.openejb.testing.ApplicationComposers.before(ApplicationComposers.java:386)
    at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1068)
    at
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.: <openjpa-2.4.2-r422266:1777108
fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:873)
    ... 21 more
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:136)
    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:105)
    at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:157)
    at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:867)
    ... 21 more
Caused by: <openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
    at
org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:73)
    at
org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:149)
    at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
    at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
    at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:109)
    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:134)
    ... 24 more
Caused by: java.lang.IllegalStateException: On a thread without an
initialized context nor a classloader mapping a deployed app
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:287)
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(ThreadSingletonServiceImpl.java:263)
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:298)
    at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:60)
    at
org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(WebBeansFinder.java:51)
    at
org.apache.webbeans.config.WebBeansContext.getInstance(WebBeansContext.java:185)
    at
org.apache.webbeans.config.WebBeansContext.currentInstance(WebBeansContext.java:203)
    at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$BmHandler.findBm(EntityManagerFactoryCallable.java:170)
    at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$BmHandler.invoke(EntityManagerFactoryCallable.java:158)
    at com.sun.proxy.$Proxy38.toString(Unknown Source)
    at java.lang.String.valueOf(String.java:2994)
    at java.lang.StringBuilder.append(StringBuilder.java:131)
    at java.util.AbstractMap.toString(AbstractMap.java:559)
    at java.text.MessageFormat.subformat(MessageFormat.java:1280)
    at java.text.MessageFormat.format(MessageFormat.java:865)
    at java.text.Format.format(Format.java:157)
    at java.text.MessageFormat.format(MessageFormat.java:841)
    at
org.apache.openjpa.lib.util.Localizer$Message.getMessage(Localizer.java:282)
    at
org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
    at
org.apache.openjpa.lib.log.AbstractLog.toString(AbstractLog.java:138)
    at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:72)
    at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:67)
    at
org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:764)
    at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at
org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:131)
    at
org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:65)
    ... 29 more
Post by Romain Manni-Bucau
mapping error in your model it seems or bad persistence unit
definition if
you dont use scanning.
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 dim. 24 juin 2018 à 12:52, Matthew Broadhead
Post by Matthew Broadhead
but now i get OpenJPA NPE on
List<QuoteType> quoteTypeList = query.getResultList();
<openjpa-2.4.2-r422266:1777108 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
      at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1029)
      at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:928)
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1032)
      at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
      at
org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2382)
      at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
      at
org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
      at
org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2080)
      at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:35)
      at
org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1257)
      at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1013)
      at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:869)
      at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:800)
      at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:541)
      at
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274)
      at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290)
      at
uk.me.kissy.sales.dao.QuoteTypeDao.selectQuoteTypes(QuoteTypeDao.java:51)
      at
uk.me.kissy.sales.dao.QuoteTypeDao$$OwbNormalScopeProxy0.selectQuoteTypes(uk/me/kissy/sales/dao/QuoteTypeDao.java)
      at
uk.me.kissy.sales.test.QuoteGeneratorTest.test1(QuoteGeneratorTest.java:96)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:44)
      at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:40)
      at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1070)
      at
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.NullPointerException
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:452)
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:412)
      at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:305)
      at
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
      at
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
      at
org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1048)
      at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1006)
      ... 45 more
Post by Romain Manni-Bucau
why you get an exception is cause appcomposers knows mysql has no EE
jars
Post by Romain Manni-Bucau
matching this prefix and scan them to include them in the deployed app".
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 à 12:15, Matthew Broadhead
Post by Matthew Broadhead
i tried adding test scope to pom.xml
<dependency>
               <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
               <scope>test</scope>
           </dependency>
also added mysql-connector-java-5.1.33.jar to the root of
src/test/resources but i still get
java.lang.IllegalArgumentException: mysql not found in classpath
       at
org.apache.openejb.testing.ApplicationComposers.findFiles(ApplicationComposers.java:1020)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
       at
org.apache.openejb.testing.ApplicationComposers.addWebApp(ApplicationComposers.java:899)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
       at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:651)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Appcopposer loads classes in the classpath so add it as a test
dependency.
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 11:37, Matthew Broadhead
not much luck with arquillian. i am trying ApplicationComposer
again.
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
"sales.JdbcDriver",
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
= "com.mysql.jdbc.Driver"),
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"jdbc:mysql://localhost:3306/sales"),
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"admin"),
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"blahblah") })
but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
        at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
        at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
how to bundle the mysql driver? i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
Post by Matthew Broadhead
ah ok.  i found
.addAsManifestResource(new
ClassLoaderAsset("META-INF/persistence.xml"),
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
         at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to
src/test/resources/META-INF?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
SEVERE - FAIL ... sales:    Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
        at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
        at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive.
Here
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not
needed
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html
under
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
          at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
          at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
          private QuoteTypeDao quoteTypeDao;
          public static WebArchive war() {
              return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addClasses(QuoteTypeDao.class);
          }
          public void test1() {
              Quote quote = new Quote();
              Promotion promotion = null;
              List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
              System.out.println("Quote type list size: " +
quoteTypeList.size());
              for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
                  // quoteGeneratorDao.generateQuote(quote,
promotion,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
                  // quoteType.getQuoteTypeCategories(),
quoteQuestions,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
                  // quoteInit, true);
                  assertEquals(0, 1);
              }
              assertEquals(0, 1);
          }
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a
copy
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked
http://incubator.apache.org/projects/sirona.html
but i
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
couldn't find any documentation.  is sirona a
requirement for
arquillian-tomee-remote?  i.e. is it necessary to monitor
tests?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode
is not
safe.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not supported
with
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
computeFrames option
            at org.apache.sirona.asm.Frame.a(Unknown
Source)
            at
org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api
type
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not
embedded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container
config.
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
this
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
way
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading
org.apache.tomee:apache-tomee:7.0.3:zip:plus
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is
complaining
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FATAL ERROR: Unknown error in Assembler.
Please
send
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
following stack trace and this message to
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
resolve class com.mysql.jdbc.Driver
is there any way to directly bring in the mysql
driver from
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
central? or do i need to download manually and put
it into
src/test/tomee/lib?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write
it in
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be
executed
before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write
your tests
in
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C
(potentially
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
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> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau>
| Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
Post by Matthew Broadhead
it sounds like Arquillian might be the best fit in my
case.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
can
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tests inject CDI beans from the webapps or does
everything
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
done through http? looking at
https://tomee.apache.org/refcard/refcard.html "Simple
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE
instance)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
parent pom?  i need to run several webapps at once
which
are
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
of the parent.  i think code is discouraged in parent
project.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can set the property openejb.location (or the
other
ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The
advantage of
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt
require a
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete
application*s* in a
real
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real
app
(single
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
deployment
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
from the classpath + single test setup) and will
save a
lot
Post by Romain Manni-Bucau
of
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |
Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> |
Book
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create
some
tests.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little
uncertain
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the
database as
normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i
specify the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to
connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
@ContainerProperties(@ContainerProperties.Property(name =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
or
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
ApplicationComposer?
Romain Manni-Bucau
2018-06-24 13:06:28 UTC
Permalink
Maybe try adding openejb-javaagent on the test jvm in your test
configuration (and surefire args if it works).


Le dim. 24 juin 2018 14:27, Matthew Broadhead
Post by Matthew Broadhead
if i comment out fetch then it works! hooray!
Root<QuoteType> quoteType = cq.from(QuoteType.class);
// quoteType.fetch("quoteTypeCategories", JoinType.LEFT);
is there any way to make fetch work or do you think i have a mapping
error somewhere? i have never had any problems so far
Post by Matthew Broadhead
i am loading the PU with a producer like
@ApplicationScoped
public class EntityManagerProducer {
@PersistenceUnit(unitName = "sales")
private EntityManagerFactory entityManagerFactory;
@Produces
@Default
@RequestScoped
public EntityManager create() {
return this.entityManagerFactory.createEntityManager();
}
if (entityManager.isOpen()) {
entityManager.close();
}
}
}
Post by Matthew Broadhead
i changed
@Descriptors(@Descriptor(name = "persistence.xml", path =
META-INF/persistence.xml"))
to
@Descriptors(@Descriptor(name = "persistence.xml", path =
"src/main/resources/META-INF/persistence.xml"))
and now it is loading the persistence.xml
i still get the same error. if i turn logging up to TRACE i get the
below. is there any way to find the particular mapping might be
causing the problem?
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.: <openjpa-2.4.2-r422266:1777108
fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1042)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:718)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:714)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:724)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.before(ApplicationComposers.java:386)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1068)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
Post by Matthew Broadhead
Post by Matthew Broadhead
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
Post by Matthew Broadhead
Post by Matthew Broadhead
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Post by Matthew Broadhead
Post by Matthew Broadhead
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.: <openjpa-2.4.2-r422266:1777108
fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:873)
Post by Matthew Broadhead
Post by Matthew Broadhead
... 21 more
<openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:136)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:105)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:157)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:867)
Post by Matthew Broadhead
Post by Matthew Broadhead
... 21 more
Caused by: <openjpa-2.4.2-r422266:1777108 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an
error when invoking the static newInstance method on the named
factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See
the nested exception for details.
at
org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:73)
at
org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:149)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:109)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:134)
Post by Matthew Broadhead
Post by Matthew Broadhead
... 24 more
Caused by: java.lang.IllegalStateException: On a thread without an
initialized context nor a classloader mapping a deployed app
at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:287)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(ThreadSingletonServiceImpl.java:263)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:298)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:60)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(WebBeansFinder.java:51)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.webbeans.config.WebBeansContext.getInstance(WebBeansContext.java:185)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.webbeans.config.WebBeansContext.currentInstance(WebBeansContext.java:203)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$BmHandler.findBm(EntityManagerFactoryCallable.java:170)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable$BmHandler.invoke(EntityManagerFactoryCallable.java:158)
Post by Matthew Broadhead
Post by Matthew Broadhead
at com.sun.proxy.$Proxy38.toString(Unknown Source)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at java.util.AbstractMap.toString(AbstractMap.java:559)
at java.text.MessageFormat.subformat(MessageFormat.java:1280)
at java.text.MessageFormat.format(MessageFormat.java:865)
at java.text.Format.format(Format.java:157)
at java.text.MessageFormat.format(MessageFormat.java:841)
at
org.apache.openjpa.lib.util.Localizer$Message.getMessage(Localizer.java:282)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openjpa.lib.log.AbstractLog.toString(AbstractLog.java:138)
at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:72)
at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:67)
at
org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:764)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:60)
Post by Matthew Broadhead
Post by Matthew Broadhead
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Post by Matthew Broadhead
Post by Matthew Broadhead
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Post by Matthew Broadhead
Post by Matthew Broadhead
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:131)
at
org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:65)
... 29 more
Post by Romain Manni-Bucau
mapping error in your model it seems or bad persistence unit definition if
you dont use scanning.
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>
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 à 12:52, Matthew Broadhead
Post by Matthew Broadhead
but now i get OpenJPA NPE on
List<QuoteType> quoteTypeList = query.getResultList();
<openjpa-2.4.2-r422266:1777108 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1029)
at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:928)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1032)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2382)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2080)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:35)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1257)
at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1013)
at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:869)
at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:800)
at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:541)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274)
at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
uk.me.kissy.sales.dao.QuoteTypeDao.selectQuoteTypes(QuoteTypeDao.java:51)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
uk.me.kissy.sales.dao.QuoteTypeDao$$OwbNormalScopeProxy0.selectQuoteTypes(uk/me/kissy/sales/dao/QuoteTypeDao.java)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
uk.me.kissy.sales.test.QuoteGeneratorTest.test1(QuoteGeneratorTest.java:96)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:44)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:40)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1070)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Caused by: java.lang.NullPointerException
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:452)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:412)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:305)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1048)
at
org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1006)
... 45 more
Post by Romain Manni-Bucau
why you get an exception is cause appcomposers knows mysql has no EE
jars
Post by Romain Manni-Bucau
matching this prefix and scan them to include them in the deployed app".
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 à 12:15, Matthew Broadhead
Post by Matthew Broadhead
i tried adding test scope to pom.xml
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
<scope>test</scope>
</dependency>
also added mysql-connector-java-5.1.33.jar to the root of
src/test/resources but i still get
java.lang.IllegalArgumentException: mysql not found in classpath
at
org.apache.openejb.testing.ApplicationComposers.findFiles(ApplicationComposers.java:1020)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.addWebApp(ApplicationComposers.java:899)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:651)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Appcopposer loads classes in the classpath so add it as a test
dependency.
Post by Romain Manni-Bucau
Le dim. 24 juin 2018 11:37, Matthew Broadhead
not much luck with arquillian. i am trying ApplicationComposer
again.
now i understand the properties format
@ContainerProperties({ @ContainerProperties.Property(name = "sales",
value = "new://Resource?type=DataSource"),
@ContainerProperties.Property(name =
"sales.JdbcDriver",
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
= "com.mysql.jdbc.Driver"),
@ContainerProperties.Property(name = "sales.JdbcUrl",
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"jdbc:mysql://localhost:3306/sales"),
@ContainerProperties.Property(name = "sales.Username",
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"admin"),
@ContainerProperties.Property(name = "sales.Password",
value =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
"blahblah") })
but now i get
org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver
at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
how to bundle the mysql driver? i tried
@Jars("mysql")
Post by Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).
Maybe import our ziplock lib and use Mvn.Builder class if you are
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
based. It can help.
Le sam. 23 juin 2018 20:09, Matthew Broadhead
ah ok. i found
.addAsManifestResource(new
ClassLoaderAsset("META-INF/persistence.xml"),
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
"persistence.xml")
in
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
but now i am back to
SEVERE - CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
for injection into Field Injection Point, field name : quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
so i must have missed a required class somewhere
Post by Matthew Broadhead
do i need to copy the persistence.xml to
src/test/resources/META-INF?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
or can i specify its location somewhere in config?
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid EjbModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FAIL ... sales: Missing required persistence.xml for
@PersistenceUnit ref "entityManagerFactory" to unit "sales"
SEVERE - Invalid WebModule(name=sales,
path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
INFO - Set the 'openejb.validation.output.level' system property to
VERBOSE for increased validation details.
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
org.apache.openejb.config.ValidationFailedException: Module failed
validation. AppModule(name=sales)
at
org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can but you need to add all the object graph in the archive.
Here
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
you
miss an injection it seems (in your dao?).
Side note: operatesondeployment and naming your archive is not
needed
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
here.
It is useful when you deploy N > 1 archives.
Le sam. 23 juin 2018 12:54, Matthew Broadhead
Post by Matthew Broadhead
i got the sample configuration from
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
under
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
remote section.
now my problem is that i can't inject the CDI bean
SEVERE - CDI Beans module deployment failed
Api type
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the
qualifiers
quoteTypeDao,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Name:null, API
Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
@Inject
private QuoteTypeDao quoteTypeDao;
@Deployment(name = "archive")
public static WebArchive war() {
return ShrinkWrap.create(WebArchive.class,
"test.war").addAsWebInfResource(EmptyAsset.INSTANCE,
"beans.xml")
.addClasses(QuoteTypeDao.class);
}
@Test
@OperateOnDeployment("archive")
public void test1() {
Quote quote = new Quote();
Promotion promotion = null;
List<QuoteType> quoteTypeList =
quoteTypeDao.selectQuoteTypes(promotion, true);
System.out.println("Quote type list size: " +
quoteTypeList.size());
for (QuoteType quoteType : quoteTypeList) {
System.out.println(quoteType.getName());
// quoteGeneratorDao.generateQuote(quote,
promotion,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
// quoteType.getQuoteTypeCategories(),
quoteQuestions,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
// quoteInit, true);
assertEquals(0, 1);
}
assertEquals(0, 1);
}
can i not inject a CDI bean into the test using
arquillian-tomee-remote?
Post by Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If
it is a
copy
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
paste
Post by Romain Manni-Bucau
just drop it ;)
Le sam. 23 juin 2018 10:05, Matthew Broadhead
Post by Matthew Broadhead
hi, i checked
http://incubator.apache.org/projects/sirona.html
but i
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
couldn't find any documentation. is sirona a
requirement for
arquillian-tomee-remote? i.e. is it necessary to monitor
tests?
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
if so,
then how do i exclude the mysql lib from the configuration?
<!-- we monitor the test with sirona -->
<property name="javaagent">
mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
</property>
Post by Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode
is not
safe.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le sam. 23 juin 2018 01:03, Matthew Broadhead
Post by Matthew Broadhead
thanks i added it using
<property
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33</property>
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but i get these errors (which don't seem to stop
execution)
fail to transform
class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
JSR/RET are not supported with computeFrames
optionjava.lang.RuntimeException: JSR/RET are not
supported
with
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
computeFrames option
at org.apache.sirona.asm.Frame.a(Unknown
Source)
at
org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Source)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of
"com/mysql/jdbc/ConnectionImpl"
but this one is a stopper
SEVERE - CDI Beans module deployment failed
Api
type
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with
the
qualifiers
quoteTypeDao,
Bean Owner : [QuoteGeneratorArquillian,
WebBeansType:ENTERPRISE,
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Name:null, API
Types:[java.lang.Object,uk.me
.kissy.sales.test.QuoteGeneratorArquillian],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
i tried enabling remote support as i am trying remote not
embedded
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *
Post by Romain Manni-Bucau
You can add it in libs property of arquillian container
config.
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Just
prefix
Post by Romain Manni-Bucau
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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
this
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
way
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 18:13, Matthew Broadhead
Post by Matthew Broadhead
INFO: Downloading
org.apache.tomee:apache-tomee:7.0.3:zip:plus
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
please
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
wait...
i have an arquillian test running up ok but it is
complaining
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
SEVERE - FATAL ERROR: Unknown error in Assembler.
Please
send
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
following stack trace and this message to
Unable to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
resolve class com.mysql.jdbc.Driver
is there any way to directly bring in the mysql
driver from
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
central? or do i need to download manually and put
it into
src/test/tomee/lib?
Post by Romain Manni-Bucau
You can theorically but I'd recommand you to write
it in
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
final
module
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
instead of trying to use the parent which will be
executed
before
any
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
other
Post by Romain Manni-Bucau
modules.
If A depends on B which depends on C then write
your tests
in
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
A for
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
complete app tests and write unit tests in B and C
(potentially
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
using
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
arquillian, appcomposer or even other solutions).
http://tomee.apache.org/developer/testing/arquillian/index.html
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
http://tomee.apache.org/developer/testing/index.html
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |
Blog
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau>
| Book
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
Post by Matthew Broadhead
it sounds like Arquillian might be the best fit in my
case.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
can
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
tests inject CDI beans from the webapps or does
everything
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
need to
be
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
done through http? looking at
https://tomee.apache.org/refcard/refcard.html
"Simple
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Arquilian
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Test"
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
looks as if beans can be injected...
is it possible to create the tests (or at least TomEE
instance)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
in a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
parent pom? i need to run several webapps at once
which
are
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
all
modules
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
of the parent. i think code is discouraged in parent
project.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
You can set the property openejb.location (or the
other
ones we
have)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
point to an openejb.xml if you want. The
advantage of
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
properties
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
that it is filtered during the test and doesnt
require a
maven
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
build
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
but
Post by Romain Manni-Bucau
Post by Matthew Broadhead
it
Post by Romain Manni-Bucau
is up to you and depends the project setup.
Arquillian is great to test complete
application*s* in a
real
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
server,
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
ApplicationComposer is good to test small parts of
applications
or
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real
app
(single
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
deployment
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
from the classpath + single test setup) and will
save a
lot
Post by Romain Manni-Bucau
of
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
time.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |
Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <
https://github.com/rmannibucau> |
Post by Romain Manni-Bucau
LinkedIn <https://www.linkedin.com/in/rmannibucau>
|
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Book
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
<
https://www.packtpub.com/application-development/java-ee-8-high-performance
Post by Matthew Broadhead
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
Post by Matthew Broadhead
i am trying to use ApplicationComposer to create
some
tests.
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
CDI
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
scanning the classes correctly but i am a little
uncertain
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
about
how
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
to
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
load a test database.
i was going to start by just loading the
database as
normal as
it
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
is a
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
copy of production database. but how do i
specify the
username
and
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
password or any other properties that are needed to
connect to
the
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
db?
@ContainerProperties(@ContainerProperties.Property(name =
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
"mydb",
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
value
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
= "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
Post by Romain Manni-Bucau
Post by Matthew Broadhead
or
Post by Romain Manni-Bucau
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
Post by Romain Manni-Bucau
Post by Matthew Broadhead
ApplicationComposer?
Andy Gumbrecht
2018-06-22 11:35:15 UTC
Permalink
I use a resources.xml with property replacement syntax value:-default

The default values should be the local db, and these can be overridden by
env, -D and properties for prod.

Andy.

On Fri, 22 Jun 2018, 09:03 Matthew Broadhead,
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?
Loading...