jboss-arquillian

Maven is automatically skipping tests

限于喜欢 提交于 2019-12-03 05:43:15
How come that Maven is skipping all of my tests by default?I have a pom.xml with few profiles and I am not able to run my tests through neither of them. One of my profiles looks like <profile> <id>jsf-test</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-remote</artifactId> <version>${jboss.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.jsf.tests</groupId> <artifactId>jsf-app</artifactId> <version>${jsf-app.version}</version> <type>war</type> </dependency> </dependencies> <build> <plugins> <plugin>

Explicite Local EJB not injected with Arquillian

核能气质少年 提交于 2019-12-03 01:27:09
I use Arquillian to test an stateless session bean that has an explicit local and remote interface. But in the test Arquillian does not "inject" anything in a field that has the type of the local interface, but it works for the remote interface. @Stateless public class TestServiceImpl implements TestServiceLocal, TestServiceRemote { public String greet() { return "hallo"; } } The remote interface: @Remote public interface TestServiceRemote { public String greet(); } The locale interface: @Local public interface TestServiceLocal { public String greet(); } And this is the test: @RunWith

How to access PrimeFaces components through Graphene in the most portable way?

女生的网名这么多〃 提交于 2019-12-02 11:53:53
I'm writing Arquillian+Graphene functional tests for a Java EE web client with Primefaces 6.1 components and would like to write them in the most portable way from the beginning. I noticed that there's no possibility to perform operations like WebElement.click on any PrimeFaces component which is clickable (e.g. not on p:selectBooleanCheckbox since the WebElement is a div containing another div containing an input ), so that I have to figure out how a clickable component is structured for every component and access it via XPath figure the above out for every component after I change the

JPA EntityManager.detach() still load lazy relations

女生的网名这么多〃 提交于 2019-12-02 04:20:11
问题 I got a problem that goes against my understanding of how it supposed to work. I have a Arquillian-test that tests a repository-method with a JPA query. The test persists an object, and then persists an another object with the first persisted object in a field. Then it calls the repository-method. Next the test detaches (and clear the entitymanager, checks that the object is not contained in the em etc etc). Last the test checks if the related object is there or not (it shouldn't since the

Arquillian integration test code coverage issue with Jacoco

浪尽此生 提交于 2019-12-02 04:16:25
I am doing integration testing using arquillian and tomee remote plugin. it is working good. But my code coverage is not working. I am using Jacoco plugin for code coverage. Getting Exception in my Java class java.lang.instrument.IllegalClassFormatException: Error while instrumenting com/demo/EmpService How to do code coverage in remote container using Jacoco ? Note: I have passed javaagent ( argLine ) to server catalina opts in integration phase. I am injecting my bean in test class and trying to cover test cases. Test case is passed. But no code coverage and getting exception EmpService:

Testing jpa entity classes - error Transaction is required

人盡茶涼 提交于 2019-12-01 12:10:06
Based on an archetype i created a java ee app. There is an included arquillian test that runs fine. it just calls a method on a @Stateless bean that persists an pre-made entity. now i added some entity with some relations and i wrote a test for them. But on peristing any entity i get Transaction is required to perform this operation (either use a transaction or extended persistence context) I think i need to mark the testmethod with @Transactional but it seems not to be in class path. Manually invoking the transaction on injected EntityManager yields another error. So how to correctly setup

Build Path Issue with Maven Dependencies (jconsole-jdk.jar) [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-11-30 18:17:38
This question already has an answer here: Missing artifact “sun.jdk:jconsole:jar:jdk” 7 answers I switched to Wildfly 8.1 and can not resolve this build (path) problem, which somehow is eventually influenced by arquillian test framework. pom.xml : <properties> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <version.org.jboss.arquillian>1.1.5.Final</version.org.jboss.arquillian> <version.org.wildfly>8.1.0.Final</version.org.wildfly> <version.junit>4.11</version.junit> </properties> <profiles> <profile> <id

How to add test classes to an imported ear file and run server side with arquillian?

自作多情 提交于 2019-11-30 15:35:10
I want to create integration tests using arquillian. As deployment i want to use the ear that is also used to deploy in production. So this is my deployment: @Deployment(testable = true) public static Archive<?> createDeployment() { return ShrinkWrap .create(ZipImporter.class, "test.ear") .importFrom(new File("simple-webservice-ear-1.0.0-SNAPSHOT.ear")) .as(EnterpriseArchive.class); } When i run my test class I get a java.lang.ClassNotFoundException because the test class is not found. I know I can set testable=false on the deployment but then the persistence extension doesn't work: see

Injecting EntityManager with a producer in tomcat

﹥>﹥吖頭↗ 提交于 2019-11-30 14:47:24
I am running a project using Hibernate and Weld CDI on tomcat 7. I have write a ServletContextListener to create the EntityManagerFactory and EntityManager during application startup. public class PersistenceListener implements ServletContextListener { private static EntityManagerFactory entityManagerFactory; public void contextInitialized(ServletContextEvent sce){ ServletContext context = sce.getServletContext(); entityManagerFactory = Persistence.createEntityManagerFactory("hibernate-test"); } public void contextDestroyed(ServletContextEvent sce) { entityManagerFactory.close(); } public

Embedded Glassfish, security and Arquillian questions

落爺英雄遲暮 提交于 2019-11-30 12:14:48
问题 I want to test my EJBs on an embedded Glassfish using Arquillian. The important thing is that I have to have security up because my bean logic does some programmatic security checking ( sessionContext.isCallerInRole(role) ). Is it possible to simulate a login with Arquillian on an Embedded Glassfish? How do I setup the Embedded Glassfish to use user and role property files? [EDIT] I found a post who's directions I decided to follow (http://community.jboss.org/message/580290) but I still got