jboss-arquillian

ArquillianProxyException instead of ConstrainViolationException in JUnit @Test(expected)

百般思念 提交于 2019-12-13 13:13:37
问题 When using Arquillian to test my (JPA) entities as part of an integration test, everything seems seems to work, except testing for ConstraintViolation s. For example it should not be possible to persist an entity instance which had null values in fields annotated with Bean Validation's @NotNull. Instead of a ConstrainViolationException I get ArquillianProxyException : Unexpected exception, expected<javax.validation.ConstraintViolationException> but was<org.jboss.arquillian.test.spi

Arquillian: Attempted to register the same Observer, ServerSetupObserver multiple times

旧街凉风 提交于 2019-12-13 02:16:06
问题 I am trying to configure arquillian with wildfly but am the following Getting error in the process of running test: java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:165)....... Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ........... Caused by: java.lang

arquillian-glassfish-embedded-3.1 1.0.0.CR3 configuring JDBC datasource

孤街浪徒 提交于 2019-12-13 01:07:02
问题 I was trying to use arquillian-glassfish-embedded-3.1 container to test and EJB3 application. I was trying to figure out how to set up a simple JDBC datasource that could be injected as a resource to a Stateless ejb. Here is what I have : @Stateless public class HelloEJBBean implements HelloEJB { @Resource(name="myDataSource") private DataSource datasource; public String sayHelloEJB(String name) { return "Hello " + name; } } also have arquillian.xml with the following content: <?xml version=

Maven folder layout: Should I place tests in the EAR or its sub-modules?

泪湿孤枕 提交于 2019-12-12 10:28:30
问题 We have an EAR project with several sub-modules (multiple EJBs, Web Projects, Application Clients, etc). The natural scope for unitary tests are their respective sub-modules (since they are supposed to be testing isolated units). In a short amount of time we have introduced non obvious testing dependencies. Projects were mocking functionality from other projects, etc. Soon our architecture evolved to several stand-alone jar files with mocks (web project 1 mocks, ejb 2 mocks, etc); we wire

Cannot run Arquillian test case on Glassfish

落爺英雄遲暮 提交于 2019-12-12 09:54:26
问题 I am stuck very badly in a very simple implementation of an Arquillian test case. I followed Can I add jars to maven 2 build classpath without installing them? to add my project jars to maven repository. I am using Glassfish server as my application server. Then I need to write arquillian test cases. For that I used the following code @Inject private ControllerLoginModule controllerloginmodule; @Deployment public static WebArchive createDeployment() { File[] lib = Maven.resolver() .resolve(

JPA 2.1 testing: persisting the pre-loaded data

ⅰ亾dé卋堺 提交于 2019-12-12 04:43:46
问题 I'm testing my JPA classes using Arquillian against "remote" containers (Glassfish 4 and WildFly 10, to be specific). I want to: Generate the database schema from the JPA entities' definitions (as opposed to SQL scripts). Pre-load some data to imitate "the data that was already there". For a most trivial example, to test if I can remove an entity without creating it in the same test first. Be able to perform queries, inserts, updates, deletes, etc. There are javax.persistence.* properties

Parameter value element […] did not match expected type [org.hibernate.type.EnumType]

依然范特西╮ 提交于 2019-12-12 03:53:55
问题 I'm living in a nightmare, and it is a dependency nightmare ;) I'm testing an EJB application that uses Hibernate 3. I deploy it either: On WebSphere 8 (EJB JAR built into an EAR), which is my desired target environment. It works just fine there. As per standards in our organization, (Hibernate) dependencies are taken care of through a separate process. It appears that I'm getting the following Hibernate dependencies there: org.hibernate:hibernate-validator:3.1.0.ga org.hibernate:hibernate

Parent last for Hibernate Arquillian test on JBOSS

房东的猫 提交于 2019-12-11 20:51:00
问题 I'm having an Arquillian test. The subject is an EJB that uses Hibernate 3, which I add to the shrinkwrapped archives along with all other Maven dependencies. It deploys the EJB as a JAR wrapped in an EAR, to an embedded JBOSS 7 which has Hibernate 4 on board. It clashes with the following exception: java.lang.AbstractMethodError: org/hibernate/usertype/UserType.nullSafeSet( Ljava/sql/PreparedStatement;Ljava/lang/Object; ILorg/hibernate/engine/spi/SessionImplementor;)V I strongly believe that

arquillian persistence extension doesn't work

雨燕双飞 提交于 2019-12-11 17:58:24
问题 I'm trying to get my webservice tested. This webservice uses ejb with jpa to retrieve its data. So i want to use the arquillian extension to get this done. This is my arquillian test class: @RunWith(Arquillian.class) public class PersonWebServiceIT { private PersonWebService service; @Deployment(testable = false) public static Archive<?> createDeployment() { return ShrinkWrap .create(ZipImporter.class, "test.ear") .importFrom(new File("simple-webservice-ear-1.0.0-SNAPSHOT.ear")) .as

How to add classes from another to the Arquillian deployment archive?

一笑奈何 提交于 2019-12-11 15:19:46
问题 I'm getting started with Arquillian and followed the tutorial. It covers how to inject EJBs into a test case. Since Arquillian is targeting Java Web and EE projects, I'm very suprised that the separation of entity classes and EJB interfaces wasn't covered in the tutorial since at least EE projects where everything is dumped in one project are rare. Since there's no coverage in the tutorial and no understandable error message by any of the EE containers, I managed to extract a test case by