From issues at jboss.org Wed Apr 4 08:52:00 2018 From: issues at jboss.org (Vlastislav Ramik (JIRA)) Date: Wed, 4 Apr 2018 08:52:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2181) Cannot specify the order of generating deployments In-Reply-To: References: Message-ID: Vlastislav Ramik created ARQ-2181: ------------------------------------- Summary: Cannot specify the order of generating deployments Key: ARQ-2181 URL: https://issues.jboss.org/browse/ARQ-2181 Project: Arquillian Issue Type: Bug Affects Versions: 1.4.0.Final Reporter: Vlastislav Ramik In case you have registered a custom implementation of DeploymentScenarioGenerator you cannot guarantee the order of execution here: https://github.com/arquillian/arquillian-core/commit/af9f07060f81db062db848b98cc776d4c7ba207a#diff-d3da9d1cfef4453a56074c1080a43a97R79 In my case the custom implementation is executed first (on empty list of deployments) and then is executed AutomaticDeploymentScenarioGenerator which creates a list of deployments based on @Deployment annotation in testClass I would need to opposite way. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Wed Apr 4 09:07:02 2018 From: issues at jboss.org (Vlastislav Ramik (JIRA)) Date: Wed, 4 Apr 2018 09:07:02 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2181) Cannot specify the order of generating deployments In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vlastislav Ramik updated ARQ-2181: ---------------------------------- Description: In case you have registered a custom implementation of DeploymentScenarioGenerator you cannot guarantee the order of execution here: https://github.com/arquillian/arquillian-core/commit/af9f07060f81db062db848b98cc776d4c7ba207a#diff-d3da9d1cfef4453a56074c1080a43a97R79 In my case the custom implementation is executed first (on empty list of deployments) and then is executed AutomaticDeploymentScenarioGenerator which creates a list of deployments based on @Deployment annotation in testClass I would need the opposite way. was: In case you have registered a custom implementation of DeploymentScenarioGenerator you cannot guarantee the order of execution here: https://github.com/arquillian/arquillian-core/commit/af9f07060f81db062db848b98cc776d4c7ba207a#diff-d3da9d1cfef4453a56074c1080a43a97R79 In my case the custom implementation is executed first (on empty list of deployments) and then is executed AutomaticDeploymentScenarioGenerator which creates a list of deployments based on @Deployment annotation in testClass I would need to opposite way. > Cannot specify the order of generating deployments > -------------------------------------------------- > > Key: ARQ-2181 > URL: https://issues.jboss.org/browse/ARQ-2181 > Project: Arquillian > Issue Type: Bug > Affects Versions: 1.4.0.Final > Reporter: Vlastislav Ramik > > In case you have registered a custom implementation of DeploymentScenarioGenerator you cannot guarantee the order of execution here: https://github.com/arquillian/arquillian-core/commit/af9f07060f81db062db848b98cc776d4c7ba207a#diff-d3da9d1cfef4453a56074c1080a43a97R79 > In my case the custom implementation is executed first (on empty list of deployments) and then is executed AutomaticDeploymentScenarioGenerator which creates a list of deployments based on @Deployment annotation in testClass > I would need the opposite way. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Tue Apr 10 09:58:07 2018 From: issues at jboss.org (Stephan Pirnbaum (JIRA)) Date: Tue, 10 Apr 2018 09:58:07 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQGRA-493) Javassist enhanced WebDriver does not work In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQGRA-493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558949#comment-13558949 ] Stephan Pirnbaum commented on ARQGRA-493: ----------------------------------------- This is still an issue with 2.3.2. Are there any plans on resolving this problem? > Javassist enhanced WebDriver does not work > ------------------------------------------ > > Key: ARQGRA-493 > URL: https://issues.jboss.org/browse/ARQGRA-493 > Project: Arquillian Graphene > Issue Type: Bug > Affects Versions: 2.1.0.Final > Reporter: Artur Signell > > When a WebDriver is wrapped inside a Javassist proxy, it seems that it will be rewrapped inside another proxy in org.jboss.arquillian.graphene.context.GrapheneContextImpl.LazyContext.getWebDriver(). > After this, when driver.get(...) is executed, the result is > java.lang.RuntimeException: not found _d32get:(Ljava/lang/String;)V in com.vaadin.testbench.TestBenchDriverProxy_$$_javassist_0$$EnhancerByGraphene$$a623df4c > at javassist.util.proxy.RuntimeSupport.error(RuntimeSupport.java:94) > at javassist.util.proxy.RuntimeSupport.findMethod(RuntimeSupport.java:70) > at javassist.util.proxy.RuntimeSupport.find2Methods(RuntimeSupport.java:54) > at com.vaadin.testbench.TestBenchDriverProxy_$$_javassist_0.get(TestBenchDriverProxy_$$_javassist_0.java) > at org.jboss.arquillian.graphene.location.LocationEnricher.handleLocationOf(LocationEnricher.java:136) > at org.jboss.arquillian.graphene.location.LocationEnricher.goTo(LocationEnricher.java:96) > at org.jboss.arquillian.graphene.location.LocationEnricher.resolve(LocationEnricher.java:81) > at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.enrichArguments(LocalTestExecuter.java:94) > at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:61) > 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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) > This does not happen if GrapheneProxyUtil.isProxy is updated to contain an additional check for javassist proxies: > if (interfaze.getName().equals("javassist.util.proxy.ProxyObject")) { > return true; > } > As I am not very familiar with this project, I have really no clue if this is a good or bad solution. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Wed Apr 11 11:54:04 2018 From: issues at jboss.org (Carlo Marchiori (JIRA)) Date: Wed, 11 Apr 2018 11:54:04 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-567) Supporting Test Suites (@ArquillianSuite) In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559715#comment-13559715 ] Carlo Marchiori commented on ARQ-567: ------------------------------------- I have found a workaround that consists in using - *Arquillian extension org.eu.ingwar.tools:arquillian-suite-extension* and it's attribute @ArquillianSuiteDeployment on the top Suite - *@RunWith(Suite.class)* on all *container test classes* that should not contain actual test method; this creates the correct test tree - *@RunWith(Arquillian.class)* on all *leaf test classes* that contain actual test methods; this instructs JUnit/Arquillian to invoke the test methods remotely > Supporting Test Suites (@ArquillianSuite) > ----------------------------------------- > > Key: ARQ-567 > URL: https://issues.jboss.org/browse/ARQ-567 > Project: Arquillian > Issue Type: Feature Request > Reporter: Mousavi Jahan Abadi S. M. > Assignee: Aslak Knutsen > Fix For: 1.2.0.Alpha1 > > > Currently, it is supported that JUnit test cases being run by Arquillian. This feature request is request for supporting test suites too to be run by Arquillian too. Idea is like: > @RunWith(ArquillianSuite.class) > @Suite.SuiteClasses( { TestCase1.class, TestCase2.class, .... } ) > public class AllTests{ > @Deployment > public static JavaArchive createTestArchive(){ > return ShrinkWrap.create(JavaArchive.class,"test.jar"); > } > } > The advantages of above approach for users of Arquillian framework are: > - Test cases don't needed to be modified to have: "@RunWith(Arquillian.class)" annotation. In other words, test cases will be pure JUnit code, and no Arquillian code (results in less coding for end users). > - It is not necessary to include the static "@Deployment" methods in all test cases any more, and only Test Suite need to define the archieving/deployment related setting/definitions. > The advantage of above approach for framework itself is: > - From performance point-of-view, it becomes possible for Arquillian to deploy all test cases in the Test Suite into J2EE container in one action (one deploy/undeploy for one test suite, instead of mulitple deploy/undeploy for each test case). -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Wed Apr 11 11:55:04 2018 From: issues at jboss.org (Carlo Marchiori (JIRA)) Date: Wed, 11 Apr 2018 11:55:04 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-567) Supporting Test Suites (@ArquillianSuite) In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559715#comment-13559715 ] Carlo Marchiori edited comment on ARQ-567 at 4/11/18 11:54 AM: --------------------------------------------------------------- I have found a workaround that consists in using - *Arquillian extension org.eu.ingwar.tools:arquillian-suite-extension* and its attribute @ArquillianSuiteDeployment on the top test class which also has the *@Deployment method* - *@RunWith(Suite.class)* on all *container test classes* that should not contain actual test method; this creates the correct test tree - *@RunWith(Arquillian.class)* on all *leaf test classes* that contain actual test methods; this instructs JUnit/Arquillian to invoke the test methods remotely was (Author: ygmarchi2): I have found a workaround that consists in using - *Arquillian extension org.eu.ingwar.tools:arquillian-suite-extension* and it's attribute @ArquillianSuiteDeployment on the top Suite - *@RunWith(Suite.class)* on all *container test classes* that should not contain actual test method; this creates the correct test tree - *@RunWith(Arquillian.class)* on all *leaf test classes* that contain actual test methods; this instructs JUnit/Arquillian to invoke the test methods remotely > Supporting Test Suites (@ArquillianSuite) > ----------------------------------------- > > Key: ARQ-567 > URL: https://issues.jboss.org/browse/ARQ-567 > Project: Arquillian > Issue Type: Feature Request > Reporter: Mousavi Jahan Abadi S. M. > Assignee: Aslak Knutsen > Fix For: 1.2.0.Alpha1 > > > Currently, it is supported that JUnit test cases being run by Arquillian. This feature request is request for supporting test suites too to be run by Arquillian too. Idea is like: > @RunWith(ArquillianSuite.class) > @Suite.SuiteClasses( { TestCase1.class, TestCase2.class, .... } ) > public class AllTests{ > @Deployment > public static JavaArchive createTestArchive(){ > return ShrinkWrap.create(JavaArchive.class,"test.jar"); > } > } > The advantages of above approach for users of Arquillian framework are: > - Test cases don't needed to be modified to have: "@RunWith(Arquillian.class)" annotation. In other words, test cases will be pure JUnit code, and no Arquillian code (results in less coding for end users). > - It is not necessary to include the static "@Deployment" methods in all test cases any more, and only Test Suite need to define the archieving/deployment related setting/definitions. > The advantage of above approach for framework itself is: > - From performance point-of-view, it becomes possible for Arquillian to deploy all test cases in the Test Suite into J2EE container in one action (one deploy/undeploy for one test suite, instead of mulitple deploy/undeploy for each test case). -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Wed Apr 11 12:08:03 2018 From: issues at jboss.org (David Matejcek (JIRA)) Date: Wed, 11 Apr 2018 12:08:03 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-567) Supporting Test Suites (@ArquillianSuite) In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559724#comment-13559724 ] David Matejcek commented on ARQ-567: ------------------------------------ Correct, I have found a bug in arquillian/payara connected with @Produces and classloaders (classcastexception of proxies), but I need some time to create a test for that. Meanwhile I added only the extension and @ArquillianSuiteDeployment annotation and to my surprise everything works - tests are even faster (no redeployments) and are runnable from Eclipse. I will try @RunWith(Suite.class) on another module, it seems promising :-) > Supporting Test Suites (@ArquillianSuite) > ----------------------------------------- > > Key: ARQ-567 > URL: https://issues.jboss.org/browse/ARQ-567 > Project: Arquillian > Issue Type: Feature Request > Reporter: Mousavi Jahan Abadi S. M. > Assignee: Aslak Knutsen > Fix For: 1.2.0.Alpha1 > > > Currently, it is supported that JUnit test cases being run by Arquillian. This feature request is request for supporting test suites too to be run by Arquillian too. Idea is like: > @RunWith(ArquillianSuite.class) > @Suite.SuiteClasses( { TestCase1.class, TestCase2.class, .... } ) > public class AllTests{ > @Deployment > public static JavaArchive createTestArchive(){ > return ShrinkWrap.create(JavaArchive.class,"test.jar"); > } > } > The advantages of above approach for users of Arquillian framework are: > - Test cases don't needed to be modified to have: "@RunWith(Arquillian.class)" annotation. In other words, test cases will be pure JUnit code, and no Arquillian code (results in less coding for end users). > - It is not necessary to include the static "@Deployment" methods in all test cases any more, and only Test Suite need to define the archieving/deployment related setting/definitions. > The advantage of above approach for framework itself is: > - From performance point-of-view, it becomes possible for Arquillian to deploy all test cases in the Test Suite into J2EE container in one action (one deploy/undeploy for one test suite, instead of mulitple deploy/undeploy for each test case). -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 13:00:00 2018 From: issues at jboss.org (=?UTF-8?Q?Matthias_B=C3=BCnger_=28JIRA=29?=) Date: Sun, 22 Apr 2018 13:00:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2182) @ApplyScriptBefore on test method is executed before methods annotated with @Before In-Reply-To: References: Message-ID: Matthias B?nger created ARQ-2182: ------------------------------------ Summary: @ApplyScriptBefore on test method is executed before methods annotated with @Before Key: ARQ-2182 URL: https://issues.jboss.org/browse/ARQ-2182 Project: Arquillian Issue Type: Feature Request Components: Extension - Persistence Affects Versions: persistence_1.0.0.Alpha7 Environment: JBoss Wildfly Oracle 11 Arquillian 1.4.0.FINAL Persistence_Extension 1.0.0.Alpha7 Reporter: Matthias B?nger Assignee: Bartosz Majsak I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {{@RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } }}} The prepare_test.sql {{delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; }} the "moreusers.sql" {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit;}} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 13:01:00 2018 From: issues at jboss.org (=?UTF-8?Q?Matthias_B=C3=BCnger_=28JIRA=29?=) Date: Sun, 22 Apr 2018 13:01:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2182) @ApplyScriptBefore on test method is executed before methods annotated with @Before In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias B?nger updated ARQ-2182: --------------------------------- Description: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=Bar.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } }} The prepare_test.sql {{delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; }} the "moreusers.sql" {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit;}} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. was: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {{@RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } }}} The prepare_test.sql {{delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; }} the "moreusers.sql" {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit;}} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. > @ApplyScriptBefore on test method is executed before methods annotated with @Before > ----------------------------------------------------------------------------------- > > Key: ARQ-2182 > URL: https://issues.jboss.org/browse/ARQ-2182 > Project: Arquillian > Issue Type: Feature Request > Components: Extension - Persistence > Affects Versions: persistence_1.0.0.Alpha7 > Environment: JBoss Wildfly > Oracle 11 > Arquillian 1.4.0.FINAL > Persistence_Extension 1.0.0.Alpha7 > Reporter: Matthias B?nger > Assignee: Bartosz Majsak > > I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. > In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). > See this class > {code:title=Bar.java|borderStyle=solid} > @RunWith(Arquillian.class) > public class DataSourceTest { > @Before > @ApplyScriptBefore({ "prepare_test.sql" }) > public void setUp() { > System.out.println("SetUp"); > } > @ApplyScriptBefore({ "moreusers.sql" }) > @Test > public void GetAllEmps() { > // The "prepare_test.sql" and the "moreusers.sql" should have been applied > } > > @Test > public void OtherTest() { > // Only the "prepare_test.sql" should have been applied > } > }} > The prepare_test.sql > {{delete from bish.EMP; > -- 14 Default-Employes > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > -- Standard noch 2 dazu, macht 16 > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > }} > the "moreusers.sql" > {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit;}} > I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. > When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". > If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts > {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} > then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. > So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 13:02:00 2018 From: issues at jboss.org (=?UTF-8?Q?Matthias_B=C3=BCnger_=28JIRA=29?=) Date: Sun, 22 Apr 2018 13:02:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2182) @ApplyScriptBefore on test method is executed before methods annotated with @Before In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias B?nger updated ARQ-2182: --------------------------------- Description: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=DataSourceTest.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } } {code} {code:title=prepare_test.sql|borderStyle=solid} delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} the "moreusers.sql" {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit;}} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. was: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=Bar.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } }} The prepare_test.sql {{delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; }} the "moreusers.sql" {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit;}} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. > @ApplyScriptBefore on test method is executed before methods annotated with @Before > ----------------------------------------------------------------------------------- > > Key: ARQ-2182 > URL: https://issues.jboss.org/browse/ARQ-2182 > Project: Arquillian > Issue Type: Feature Request > Components: Extension - Persistence > Affects Versions: persistence_1.0.0.Alpha7 > Environment: JBoss Wildfly > Oracle 11 > Arquillian 1.4.0.FINAL > Persistence_Extension 1.0.0.Alpha7 > Reporter: Matthias B?nger > Assignee: Bartosz Majsak > > I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. > In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). > See this class > {code:title=DataSourceTest.java|borderStyle=solid} > @RunWith(Arquillian.class) > public class DataSourceTest { > @Before > @ApplyScriptBefore({ "prepare_test.sql" }) > public void setUp() { > System.out.println("SetUp"); > } > @ApplyScriptBefore({ "moreusers.sql" }) > @Test > public void GetAllEmps() { > // The "prepare_test.sql" and the "moreusers.sql" should have been applied > } > > @Test > public void OtherTest() { > // Only the "prepare_test.sql" should have been applied > } > } > {code} > {code:title=prepare_test.sql|borderStyle=solid} > delete from bish.EMP; > -- 14 Default-Employes > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > -- Standard noch 2 dazu, macht 16 > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > {code} > the "moreusers.sql" > {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit;}} > I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. > When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". > If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts > {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} > then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. > So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 13:03:00 2018 From: issues at jboss.org (=?UTF-8?Q?Matthias_B=C3=BCnger_=28JIRA=29?=) Date: Sun, 22 Apr 2018 13:03:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2182) @ApplyScriptBefore on test method is executed before methods annotated with @Before In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias B?nger updated ARQ-2182: --------------------------------- Description: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=DataSourceTest.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } } {code} {code:title=prepare_test.sql|borderStyle=solid} delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} {code:title=moreusers.sql|borderStyle=solid} {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {code:borderStyle=solid} @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) {code} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. was: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=DataSourceTest.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } } {code} {code:title=prepare_test.sql|borderStyle=solid} delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} the "moreusers.sql" {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit;}} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {{@ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" })}} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. > @ApplyScriptBefore on test method is executed before methods annotated with @Before > ----------------------------------------------------------------------------------- > > Key: ARQ-2182 > URL: https://issues.jboss.org/browse/ARQ-2182 > Project: Arquillian > Issue Type: Feature Request > Components: Extension - Persistence > Affects Versions: persistence_1.0.0.Alpha7 > Environment: JBoss Wildfly > Oracle 11 > Arquillian 1.4.0.FINAL > Persistence_Extension 1.0.0.Alpha7 > Reporter: Matthias B?nger > Assignee: Bartosz Majsak > > I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. > In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). > See this class > {code:title=DataSourceTest.java|borderStyle=solid} > @RunWith(Arquillian.class) > public class DataSourceTest { > @Before > @ApplyScriptBefore({ "prepare_test.sql" }) > public void setUp() { > System.out.println("SetUp"); > } > @ApplyScriptBefore({ "moreusers.sql" }) > @Test > public void GetAllEmps() { > // The "prepare_test.sql" and the "moreusers.sql" should have been applied > } > > @Test > public void OtherTest() { > // Only the "prepare_test.sql" should have been applied > } > } > {code} > {code:title=prepare_test.sql|borderStyle=solid} > delete from bish.EMP; > -- 14 Default-Employes > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > -- Standard noch 2 dazu, macht 16 > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > {code} > {code:title=moreusers.sql|borderStyle=solid} > {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > {code} > I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. > When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". > If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts > {code:borderStyle=solid} > @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) > {code} > then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. > So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 13:04:00 2018 From: issues at jboss.org (=?UTF-8?Q?Matthias_B=C3=BCnger_=28JIRA=29?=) Date: Sun, 22 Apr 2018 13:04:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2182) @ApplyScriptBefore on test method is executed before methods annotated with @Before In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias B?nger updated ARQ-2182: --------------------------------- Description: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=DataSourceTest.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } } {code} {code:sql|title=prepare_test.sql|borderStyle=solid} delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} {code:title=moreusers.sql|borderStyle=solid} {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {code:borderStyle=solid} @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) {code} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. was: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=DataSourceTest.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } } {code} {code:title=prepare_test.sql|borderStyle=solid} delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} {code:title=moreusers.sql|borderStyle=solid} {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {code:borderStyle=solid} @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) {code} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. > @ApplyScriptBefore on test method is executed before methods annotated with @Before > ----------------------------------------------------------------------------------- > > Key: ARQ-2182 > URL: https://issues.jboss.org/browse/ARQ-2182 > Project: Arquillian > Issue Type: Feature Request > Components: Extension - Persistence > Affects Versions: persistence_1.0.0.Alpha7 > Environment: JBoss Wildfly > Oracle 11 > Arquillian 1.4.0.FINAL > Persistence_Extension 1.0.0.Alpha7 > Reporter: Matthias B?nger > Assignee: Bartosz Majsak > > I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. > In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). > See this class > {code:title=DataSourceTest.java|borderStyle=solid} > @RunWith(Arquillian.class) > public class DataSourceTest { > @Before > @ApplyScriptBefore({ "prepare_test.sql" }) > public void setUp() { > System.out.println("SetUp"); > } > @ApplyScriptBefore({ "moreusers.sql" }) > @Test > public void GetAllEmps() { > // The "prepare_test.sql" and the "moreusers.sql" should have been applied > } > > @Test > public void OtherTest() { > // Only the "prepare_test.sql" should have been applied > } > } > {code} > {code:sql|title=prepare_test.sql|borderStyle=solid} > delete from bish.EMP; > -- 14 Default-Employes > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > -- Standard noch 2 dazu, macht 16 > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > {code} > {code:title=moreusers.sql|borderStyle=solid} > {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > {code} > I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. > When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". > If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts > {code:borderStyle=solid} > @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) > {code} > then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. > So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 13:05:00 2018 From: issues at jboss.org (=?UTF-8?Q?Matthias_B=C3=BCnger_=28JIRA=29?=) Date: Sun, 22 Apr 2018 13:05:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2182) @ApplyScriptBefore on test method is executed before methods annotated with @Before In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias B?nger updated ARQ-2182: --------------------------------- Description: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=DataSourceTest.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } } {code} {code:sql|title=prepare_test.sql|borderStyle=solid} delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} {code:sql|title=moreusers.sql|borderStyle=solid} Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {code:borderStyle=solid} @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) {code} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. was: I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). See this class {code:title=DataSourceTest.java|borderStyle=solid} @RunWith(Arquillian.class) public class DataSourceTest { @Before @ApplyScriptBefore({ "prepare_test.sql" }) public void setUp() { System.out.println("SetUp"); } @ApplyScriptBefore({ "moreusers.sql" }) @Test public void GetAllEmps() { // The "prepare_test.sql" and the "moreusers.sql" should have been applied } @Test public void OtherTest() { // Only the "prepare_test.sql" should have been applied } } {code} {code:sql|title=prepare_test.sql|borderStyle=solid} delete from bish.EMP; -- 14 Default-Employes Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); -- Standard noch 2 dazu, macht 16 Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} {code:title=moreusers.sql|borderStyle=solid} {{Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); commit; {code} I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts {code:borderStyle=solid} @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) {code} then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. > @ApplyScriptBefore on test method is executed before methods annotated with @Before > ----------------------------------------------------------------------------------- > > Key: ARQ-2182 > URL: https://issues.jboss.org/browse/ARQ-2182 > Project: Arquillian > Issue Type: Feature Request > Components: Extension - Persistence > Affects Versions: persistence_1.0.0.Alpha7 > Environment: JBoss Wildfly > Oracle 11 > Arquillian 1.4.0.FINAL > Persistence_Extension 1.0.0.Alpha7 > Reporter: Matthias B?nger > Assignee: Bartosz Majsak > > I want to use an setUp-method annotated with {{@Before}} to apply a script with general preparations, executed before each method of my test class. In this script ("prepare_test.sql") I empty a table and insert some records. For this I used the {{@ApplyScriptBefore}}. > In one of my test cases I want to insert more records and apply another script ("moreusers", which only has some insert statements). > See this class > {code:title=DataSourceTest.java|borderStyle=solid} > @RunWith(Arquillian.class) > public class DataSourceTest { > @Before > @ApplyScriptBefore({ "prepare_test.sql" }) > public void setUp() { > System.out.println("SetUp"); > } > @ApplyScriptBefore({ "moreusers.sql" }) > @Test > public void GetAllEmps() { > // The "prepare_test.sql" and the "moreusers.sql" should have been applied > } > > @Test > public void OtherTest() { > // Only the "prepare_test.sql" should have been applied > } > } > {code} > {code:sql|title=prepare_test.sql|borderStyle=solid} > delete from bish.EMP; > -- 14 Default-Employes > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7839','KING','PRESIDENT',null,to_date('17.11.81','DD.MM.RR'),'5000',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7698','BLAKE','MANAGER','7839',to_date('01.05.81','DD.MM.RR'),'2850',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7782','CLARK','MANAGER','7839',to_date('09.06.81','DD.MM.RR'),'2450',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7566','JONES','MANAGER','7839',to_date('02.04.81','DD.MM.RR'),'2975',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7788','SCOTT','ANALYST','7566',to_date('09.12.82','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7902','FORD','ANALYST','7566',to_date('03.12.81','DD.MM.RR'),'3000',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7369','SMITH','CLERK','7902',to_date('17.12.80','DD.MM.RR'),'800',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7499','ALLEN','SALESMAN','7698',to_date('20.02.81','DD.MM.RR'),'1600','300','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7521','WARD','SALESMAN','7698',to_date('22.02.81','DD.MM.RR'),'1250','500','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7654','MARTIN','SALESMAN','7698',to_date('28.09.81','DD.MM.RR'),'1250','1400','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7844','TURNER','SALESMAN','7698',to_date('08.09.81','DD.MM.RR'),'1500','0','30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7876','ADAMS','CLERK','7788',to_date('12.01.83','DD.MM.RR'),'1100',null,'20'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7900','JAMES','CLERK','7698',to_date('03.12.81','DD.MM.RR'),'950',null,'30'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('7934','MILLER','CLERK','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > -- Standard noch 2 dazu, macht 16 > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9999','Test','Eins','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9998','Test','Zwei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > {code} > {code:sql|title=moreusers.sql|borderStyle=solid} > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9997','Test','Drei','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > Insert into bish.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('9996','Test','Vier','7782',to_date('23.01.82','DD.MM.RR'),'1300',null,'10'); > commit; > {code} > I think you get the situation. I won't focus the "{{OtherTest()}}" method no more in the description. > When I now execute the {{GetAllEmps()}} I get constraint problems (parent key not found for coloum mgr), because the script "{{moreusers.sql}}" is executed before the "{{prepare_tests.sql}}". > If I delete the {{setUpMethod}} and annotate the testmethod {{GetAllEmps()}} with both scripts > {code:borderStyle=solid} > @ApplyScriptBefore({ "prepare_test.sql", "moreusers.sql" }) > {code} > then the test passes, because the execution order ist correct and both scripts are applied. But I don't want to annotate every test method with the default script which should run before every test, but only annotate those methods which need further scripts/data. > So I would expect that the method annotated with {{@Before}} and its other annotations are executed before a "normal" test method and its annotations are executed. The docs say so, but the descriped scenario above shows that this is not reality. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 21:25:00 2018 From: issues at jboss.org (Hank Ibell (JIRA)) Date: Sun, 22 Apr 2018 21:25:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2183) Websphere container waits for entire timeout if application failed to deploy In-Reply-To: References: Message-ID: Hank Ibell created ARQ-2183: ------------------------------- Summary: Websphere container waits for entire timeout if application failed to deploy Key: ARQ-2183 URL: https://issues.jboss.org/browse/ARQ-2183 Project: Arquillian Issue Type: Enhancement Components: WebSphere Containers Affects Versions: 1.0.0.CR1 Environment: WLP, WebSphere Liberty Profile 8.5 Managed Container Reporter: Hank Ibell Assignee: Gerhard Poul h3. Issue Overview Currently, running the CDI TCK against Liberty takes about 3 hours and 20 minutes to complete. It looks like the container waits for the application MBean to reach the STARTED state and only gives up after the timeout elapses. The CDI TCK uses many broken applications to test that they do not deploy, so waiting the entire timeout for each test is not ideal. However, with the changes in this pull request, the CDI TCK now runs in approximately 50 minutes now. h3. Expected Behaviour Do not wait for timeout for application that failed to deploy. h3. Current Behaviour Container waits for a timeout to elapse before checking the logs to see if the application failed due to a deployment exception causing tests to take much longer to finish. h3. Steps To Reproduce 1. Deploy a CDI application that fails to start up due to a CDI deployment exception. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 21:26:00 2018 From: issues at jboss.org (Hank Ibell (JIRA)) Date: Sun, 22 Apr 2018 21:26:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2183) Websphere container waits for entire timeout if application failed to deploy In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hank Ibell updated ARQ-2183: ---------------------------- Status: Pull Request Sent (was: Open) Git Pull Request: https://github.com/OpenLiberty/liberty-arquillian/pull/4 > Websphere container waits for entire timeout if application failed to deploy > ---------------------------------------------------------------------------- > > Key: ARQ-2183 > URL: https://issues.jboss.org/browse/ARQ-2183 > Project: Arquillian > Issue Type: Enhancement > Components: WebSphere Containers > Affects Versions: 1.0.0.CR1 > Environment: WLP, WebSphere Liberty Profile 8.5 Managed Container > Reporter: Hank Ibell > Assignee: Gerhard Poul > > h3. Issue Overview > Currently, running the CDI TCK against Liberty takes about 3 hours and 20 minutes to complete. It looks like the container waits for the application MBean to reach the STARTED state and only gives up after the timeout elapses. > The CDI TCK uses many broken applications to test that they do not deploy, so waiting the entire timeout for each test is not ideal. However, with the changes in this pull request, the CDI TCK now runs in approximately 50 minutes now. > h3. Expected Behaviour > Do not wait for timeout for application that failed to deploy. > h3. Current Behaviour > Container waits for a timeout to elapse before checking the logs to see if the application failed due to a deployment exception causing tests to take much longer to finish. > h3. Steps To Reproduce > 1. Deploy a CDI application that fails to start up due to a CDI deployment exception. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 21:42:00 2018 From: issues at jboss.org (Hank Ibell (JIRA)) Date: Sun, 22 Apr 2018 21:42:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2184) Improve application deployment exception checking In-Reply-To: References: Message-ID: Hank Ibell created ARQ-2184: ------------------------------- Summary: Improve application deployment exception checking Key: ARQ-2184 URL: https://issues.jboss.org/browse/ARQ-2184 Project: Arquillian Issue Type: Bug Components: WebSphere Containers Affects Versions: 1.0.0.CR1 Environment: WLP, WebSphere Liberty Profile 8.5 Managed Container Reporter: Hank Ibell Assignee: Gerhard Poul h3. Issue Overview The container does not check if an application failed to start up due to subclasses of DeploymentException which the CDI specification allows: bq. An implementation is permitted to throw a subclass of DeploymentException for any deployment problem. Additionally, the container should throw an Arquillian DeploymentException if the application fails to startup for any reason. h3. Expected Behaviour 1.WAS container should throw a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException or any subclass of it. h3. Current Behaviour WAS container only throws a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 21:57:00 2018 From: issues at jboss.org (Hank Ibell (JIRA)) Date: Sun, 22 Apr 2018 21:57:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2184) Improve application deployment exception checking In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hank Ibell updated ARQ-2184: ---------------------------- Status: Pull Request Sent (was: Open) Git Pull Request: https://github.com/OpenLiberty/liberty-arquillian/pull/5 > Improve application deployment exception checking > ------------------------------------------------- > > Key: ARQ-2184 > URL: https://issues.jboss.org/browse/ARQ-2184 > Project: Arquillian > Issue Type: Bug > Components: WebSphere Containers > Affects Versions: 1.0.0.CR1 > Environment: WLP, WebSphere Liberty Profile 8.5 Managed Container > Reporter: Hank Ibell > Assignee: Gerhard Poul > > h3. Issue Overview > The container does not check if an application failed to start up due to subclasses of DeploymentException which the CDI specification allows: > bq. An implementation is permitted to throw a subclass of DeploymentException for any deployment problem. > Additionally, the container should throw an Arquillian DeploymentException if the application fails to startup for any reason. > h3. Expected Behaviour > 1.WAS container should throw a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException or any subclass of it. > h3. Current Behaviour > WAS container only throws a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Sun Apr 22 21:58:00 2018 From: issues at jboss.org (Hank Ibell (JIRA)) Date: Sun, 22 Apr 2018 21:58:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2184) Improve application deployment exception checking In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hank Ibell updated ARQ-2184: ---------------------------- Description: h3. Issue Overview The container does not check if an application failed to start up due to subclasses of DeploymentException which the CDI specification allows: bq. An implementation is permitted to throw a subclass of DeploymentException for any deployment problem. Additionally, the container should throw an Arquillian DeploymentException if the application fails to startup for any reason. h3. Expected Behaviour WAS container should throw a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException or any subclass of it. h3. Current Behaviour WAS container only throws a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException. was: h3. Issue Overview The container does not check if an application failed to start up due to subclasses of DeploymentException which the CDI specification allows: bq. An implementation is permitted to throw a subclass of DeploymentException for any deployment problem. Additionally, the container should throw an Arquillian DeploymentException if the application fails to startup for any reason. h3. Expected Behaviour 1.WAS container should throw a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException or any subclass of it. h3. Current Behaviour WAS container only throws a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException. > Improve application deployment exception checking > ------------------------------------------------- > > Key: ARQ-2184 > URL: https://issues.jboss.org/browse/ARQ-2184 > Project: Arquillian > Issue Type: Bug > Components: WebSphere Containers > Affects Versions: 1.0.0.CR1 > Environment: WLP, WebSphere Liberty Profile 8.5 Managed Container > Reporter: Hank Ibell > Assignee: Gerhard Poul > > h3. Issue Overview > The container does not check if an application failed to start up due to subclasses of DeploymentException which the CDI specification allows: > bq. An implementation is permitted to throw a subclass of DeploymentException for any deployment problem. > Additionally, the container should throw an Arquillian DeploymentException if the application fails to startup for any reason. > h3. Expected Behaviour > WAS container should throw a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException or any subclass of it. > h3. Current Behaviour > WAS container only throws a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Mon Apr 23 15:46:00 2018 From: issues at jboss.org (Hank Ibell (JIRA)) Date: Mon, 23 Apr 2018 15:46:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2184) Improve application deployment exception checking In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hank Ibell updated ARQ-2184: ---------------------------- Status: Resolved (was: Pull Request Sent) Resolution: Done > Improve application deployment exception checking > ------------------------------------------------- > > Key: ARQ-2184 > URL: https://issues.jboss.org/browse/ARQ-2184 > Project: Arquillian > Issue Type: Bug > Components: WebSphere Containers > Affects Versions: 1.0.0.CR1 > Environment: WLP, WebSphere Liberty Profile 8.5 Managed Container > Reporter: Hank Ibell > Assignee: Gerhard Poul > > h3. Issue Overview > The container does not check if an application failed to start up due to subclasses of DeploymentException which the CDI specification allows: > bq. An implementation is permitted to throw a subclass of DeploymentException for any deployment problem. > Additionally, the container should throw an Arquillian DeploymentException if the application fails to startup for any reason. > h3. Expected Behaviour > WAS container should throw a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException or any subclass of it. > h3. Current Behaviour > WAS container only throws a CDI DeploymentException if the application fails to startup due to a CDI DeploymentException. -- This message was sent by Atlassian JIRA (v7.5.0#75005) From issues at jboss.org Thu Apr 26 13:28:00 2018 From: issues at jboss.org (Gerhard Poul (JIRA)) Date: Thu, 26 Apr 2018 13:28:00 -0400 (EDT) Subject: [arquillian-issues] [JBoss JIRA] (ARQ-2183) Websphere container waits for entire timeout if application failed to deploy In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/ARQ-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gerhard Poul updated ARQ-2183: ------------------------------ Status: Resolved (was: Pull Request Sent) Resolution: Done > Websphere container waits for entire timeout if application failed to deploy > ---------------------------------------------------------------------------- > > Key: ARQ-2183 > URL: https://issues.jboss.org/browse/ARQ-2183 > Project: Arquillian > Issue Type: Enhancement > Components: WebSphere Containers > Affects Versions: 1.0.0.CR1 > Environment: WLP, WebSphere Liberty Profile 8.5 Managed Container > Reporter: Hank Ibell > Assignee: Gerhard Poul > > h3. Issue Overview > Currently, running the CDI TCK against Liberty takes about 3 hours and 20 minutes to complete. It looks like the container waits for the application MBean to reach the STARTED state and only gives up after the timeout elapses. > The CDI TCK uses many broken applications to test that they do not deploy, so waiting the entire timeout for each test is not ideal. However, with the changes in this pull request, the CDI TCK now runs in approximately 50 minutes now. > h3. Expected Behaviour > Do not wait for timeout for application that failed to deploy. > h3. Current Behaviour > Container waits for a timeout to elapse before checking the logs to see if the application failed due to a deployment exception causing tests to take much longer to finish. > h3. Steps To Reproduce > 1. Deploy a CDI application that fails to start up due to a CDI deployment exception. -- This message was sent by Atlassian JIRA (v7.5.0#75005)