[JBoss JIRA] (ARQ-1282) TestNG @DataProvider is fully invoked for each record
by Karel Cemus (JIRA)
Karel Cemus created ARQ-1282:
--------------------------------
Summary: TestNG @DataProvider is fully invoked for each record
Key: ARQ-1282
URL: https://issues.jboss.org/browse/ARQ-1282
Project: Arquillian
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: JBoss AS Containers
Affects Versions: 1.0.3.Final
Reporter: Karel Cemus
h2. Expected behavior
TestNG defines @DataProvider annotation to allow single method to perform multiple test cases. Provider method annotated with @DataProvider returns an array of arrays, each containing one test case. These parameters are given to the target method as input parameters. By the definition, the total count of performed test by single method is equal to number of test cases in related data provider.
h2. Actual behavior
Using TestNG under Arquillian framework makes this functionality buggy. Although the client (maven, IDE, etc.) thinks, that the total number of invoked test is correct, it is not. When we take a look into server's log, we can see that for each single test case it invoked full set of all test cases. It means, that in the end the amount of performed tests is equal to expected count squared. Such behaviour is not only slow but also in some cases it doesn't work and it makes tests to fail.
h2. Example
{code:java}
@DataProvider
public Object[][] sumProvider() {
return new Object[][]{
new Object[]{ 0, 0, 0 },
new Object[]{ 1, 1, 2 },
new Object[]{ 1, 5, 6 },
new Object[]{ 5, 1, 6 }
};
}
{code}
h3. Expected output in server log
{quote}
Execution of sum: 0 + 0 = 0
Execution of sum: 1 + 1 = 2
Execution of sum: 1 + 5 = 6
Execution of sum: 5 + 1 = 6
{quote}
h3. Actual output
{quote}
Execution of sum: 0 + 0 = 0
Execution of sum: 1 + 1 = 2
Execution of sum: 1 + 5 = 6
Execution of sum: 5 + 1 = 6
Execution of sum: 0 + 0 = 0
Execution of sum: 1 + 1 = 2
Execution of sum: 1 + 5 = 6
Execution of sum: 5 + 1 = 6
Execution of sum: 0 + 0 = 0
Execution of sum: 1 + 1 = 2
Execution of sum: 1 + 5 = 6
Execution of sum: 5 + 1 = 6
Execution of sum: 0 + 0 = 0
Execution of sum: 1 + 1 = 2
Execution of sum: 1 + 5 = 6
Execution of sum: 5 + 1 = 6
{quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQGRA-263) Deadlock in guardHttp with HTMLUnit
by Ron Šmeral (JIRA)
Ron Šmeral created ARQGRA-263:
---------------------------------
Summary: Deadlock in guardHttp with HTMLUnit
Key: ARQGRA-263
URL: https://issues.jboss.org/browse/ARQGRA-263
Project: Arquillian Graphene
Issue Type: Bug
Affects Versions: 2.0.0.Beta1
Environment: Graphene 2.0.0.Beta1-SNAPSHOT, selenium-htmlunit-driver 2.28.0
Reporter: Ron Šmeral
When running a Seam Booking ftest, the following deadlock appeared, during an invocation of {{guardHttp(browser.findElement(by)).click();}}
{noformat}
Found one Java-level deadlock:
=============================
"JS executor for com.gargoylesoftware.htmlunit.WebClient@111f5701":
waiting to lock monitor 0x00007f5374011c88 (object 0x00000000ff450138, a com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine),
which is held by "main"
"main":
waiting to lock monitor 0x00007f53e4fce1b0 (object 0x00000000f3238568, a com.gargoylesoftware.htmlunit.html.HtmlPage),
which is held by "JS executor for com.gargoylesoftware.htmlunit.WebClient@111f5701"
{noformat}
Full stacktrace:
{noformat}
Java stack information for the threads listed above:
===================================================
"JS executor for com.gargoylesoftware.htmlunit.WebClient@111f5701":
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:688)
- waiting to lock <0x00000000ff450138> (a com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$400(JavaScriptEngine.java:89)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:659)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:559)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:525)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:502)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:519)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:970)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:337)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:415)
at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:266)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:276)
at com.gargoylesoftware.htmlunit.html.DomNode.fireAddition(DomNode.java:914)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:894)
at com.gargoylesoftware.htmlunit.javascript.host.Node.appendChild(Node.java:232)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:137)
at net.sourceforge.htmlunit.corejs.javascript.FunctionObject.call(FunctionObject.java:452)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:815)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:415)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:274)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3132)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:587)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:651)
- locked <0x00000000f3238568> (a com.gargoylesoftware.htmlunit.html.HtmlPage)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:559)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:525)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:594)
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.setState(XMLHttpRequest.java:216)
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.doSend(XMLHttpRequest.java:661)
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.access$000(XMLHttpRequest.java:89)
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest$1.run(XMLHttpRequest.java:563)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:559)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:525)
at com.gargoylesoftware.htmlunit.javascript.background.JavascriptXMLHttpRequestJob.run(JavascriptXMLHttpRequestJob.java:36)
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:328)
at com.gargoylesoftware.htmlunit.javascript.background.DefaultJavaScriptExecutor.run(DefaultJavaScriptExecutor.java:161)
at java.lang.Thread.run(Thread.java:722)
"main":
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:648)
- waiting to lock <0x00000000f3238568> (a com.gargoylesoftware.htmlunit.html.HtmlPage)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:559)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:525)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:594)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:569)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:996)
at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:175)
at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:234)
at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:813)
at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:737)
at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:853)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:559)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:525)
at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:858)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1259)
at com.gargoylesoftware.htmlunit.html.HtmlPage.cleanUp(HtmlPage.java:278)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:429)
at com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2289)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:695)
- locked <0x00000000ff450138> (a com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.processPostponedActions(JavaScriptEngine.java:782)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1238)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1182)
at org.openqa.selenium.htmlunit.HtmlUnitMouse.click(HtmlUnitMouse.java:76)
at org.openqa.selenium.htmlunit.HtmlUnitWebElement.click(HtmlUnitWebElement.java:153)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invokeReal(GrapheneProxyHandler.java:209)
at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler$1.invoke(GrapheneProxyHandler.java:140)
at org.jboss.arquillian.graphene.guard.RequestGuardFactory$1.intercept(RequestGuardFactory.java:78)
at org.jboss.arquillian.graphene.proxy.InvocationContextImpl.invoke(InvocationContextImpl.java:73)
at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invoke(GrapheneProxyHandler.java:170)
at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.intercept(GrapheneProxyHandler.java:178)
at org.openqa.selenium.htmlunit.HtmlUnitWebElement$$EnhancerCGLIB$$da7bfba9.click(<generated>)
at org.jboss.seam.example.common.test.SeamGrapheneTest.clickAndWaitHttp(SeamGrapheneTest.java:177)
at org.jboss.seam.example.common.test.booking.graphene.RegistrationTest.register(RegistrationTest.java:117)
at org.jboss.seam.example.common.test.booking.graphene.RegistrationTest.testLongText(RegistrationTest.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)
at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)
at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQ-1027) Support CommandService Protocol SPI via Warp Protocol
by Aris Tzoumas (JIRA)
[ https://issues.jboss.org/browse/ARQ-1027?page=com.atlassian.jira.plugin.s... ]
Aris Tzoumas commented on ARQ-1027:
-----------------------------------
Here is the relevant commit inside my forked github project:
[https://github.com/atzoum/arquillian-extension-warp/commit/5f097cb78afe91...]
> Support CommandService Protocol SPI via Warp Protocol
> -----------------------------------------------------
>
> Key: ARQ-1027
> URL: https://issues.jboss.org/browse/ARQ-1027
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Extension - Warp
> Affects Versions: warp_1.0.0.Alpha1
> Reporter: Curtis McMillen
> Assignee: Lukáš Fryč
> Priority: Critical
> Fix For: warp_1.0.0.Beta1
>
> Attachments: stacktrace.txt
>
> Original Estimate: 1 day
> Remaining Estimate: 1 day
>
> It seems there is a problem with running Warp tests if arquillian-jacoco is on the classpath.
> When WarpFilter fires the AfterSuite event, the writeCoverageData observer in arquillian-jacoco is executing which ultimately leads to a NPE coming from servlet protocol. The full stacktrace is attached.
> You can reproduce by simply adding the following dependencies to the pom for warp in arquillian-showcase and then running the BasicJSFUnitTestCase.
> {code:xml}
> <dependency>
> <groupId>org.jboss.arquillian.extension</groupId>
> <artifactId>arquillian-jacoco</artifactId>
> <version>1.0.0.Alpha3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jacoco</groupId>
> <artifactId>org.jacoco.core</artifactId>
> <version>0.5.7.201204190339</version>
> <scope>test</scope>
> </dependency>
> {code}
> Removing these dependencies isn't really an option because I have other arquillian tests not using Warp that I want code coverage on. I tried using alternative annotated with @Specializes thinking I could basically disable the observer in arquillian-jacoco simply by including a different beans.xml in the deployment of my Warp tests. This however fails with "WELD-000047 Specializing bean must extend another bean" which I'm thinking is due to https://issues.jboss.org/browse/WELD-1113.
> Any ideas for getting this to work?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQ-1027) Support CommandService Protocol SPI via Warp Protocol
by Aris Tzoumas (JIRA)
[ https://issues.jboss.org/browse/ARQ-1027?page=com.atlassian.jira.plugin.s... ]
Aris Tzoumas commented on ARQ-1027:
-----------------------------------
I may have come up with a hackish solution...
It is as follows:
1) Setup a ServletProtocol event Bus when {{LocalExecutionEvent}} Event fires (Before the actual test execution). This bus gets destroyed when {{After}} Event fires.
2) Change {{WarpFilter}} to let requests for {{ServletTestRunner}} pass through (but first cache the call_id - {{ThreadLocal<String> currentCall}} static variable of {{ServletTestRunner}}). The requests which are routed to the ServletTestRunner are those made by the event bus I mentioned earlier.
3) Now, inside {{WarpFilter}}, before calling {{doFilterHttp}}, it resets ServletTestRunner's call_id to the cached value it got before.
This way, when Jacoco catches the {{AfterSuite}} event inside the remote container, it will successfully insert a new {{CoverageDataCommand}} inside ServletTestRunner's events Map (since the ThreadLocal variable has been initialized). This command will be read by the EventBus and the Command event will be fired inside the client for Jacoco's observer to work and log the coverage data. I tested it and it works :)
One problem I faced is that ServletTestRunner's {{currentCall}} variable has a default access modifier, so I had to create a utility Class inside warp-impl with package name "{{org.jboss.arquillian.protocol.servlet.runner}}" in order to be able to set that variable.
I cannot think of another solution that wouldn't involve changing the whole Warp's architecture (along with some ServletProtocol additions).
Please, let me know if you are interested in my solution, I could prepare a pull request for you (after I first polish it a bit) :)
> Support CommandService Protocol SPI via Warp Protocol
> -----------------------------------------------------
>
> Key: ARQ-1027
> URL: https://issues.jboss.org/browse/ARQ-1027
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Extension - Warp
> Affects Versions: warp_1.0.0.Alpha1
> Reporter: Curtis McMillen
> Assignee: Lukáš Fryč
> Priority: Critical
> Fix For: warp_1.0.0.Beta1
>
> Attachments: stacktrace.txt
>
> Original Estimate: 1 day
> Remaining Estimate: 1 day
>
> It seems there is a problem with running Warp tests if arquillian-jacoco is on the classpath.
> When WarpFilter fires the AfterSuite event, the writeCoverageData observer in arquillian-jacoco is executing which ultimately leads to a NPE coming from servlet protocol. The full stacktrace is attached.
> You can reproduce by simply adding the following dependencies to the pom for warp in arquillian-showcase and then running the BasicJSFUnitTestCase.
> {code:xml}
> <dependency>
> <groupId>org.jboss.arquillian.extension</groupId>
> <artifactId>arquillian-jacoco</artifactId>
> <version>1.0.0.Alpha3</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jacoco</groupId>
> <artifactId>org.jacoco.core</artifactId>
> <version>0.5.7.201204190339</version>
> <scope>test</scope>
> </dependency>
> {code}
> Removing these dependencies isn't really an option because I have other arquillian tests not using Warp that I want code coverage on. I tried using alternative annotated with @Specializes thinking I could basically disable the observer in arquillian-jacoco simply by including a different beans.xml in the deployment of my Warp tests. This however fails with "WELD-000047 Specializing bean must extend another bean" which I'm thinking is due to https://issues.jboss.org/browse/WELD-1113.
> Any ideas for getting this to work?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQ-197) Research support for @Deployment on multiple levels
by andrew zimmer (JIRA)
[ https://issues.jboss.org/browse/ARQ-197?page=com.atlassian.jira.plugin.sy... ]
andrew zimmer commented on ARQ-197:
-----------------------------------
@Geoffrey thanks for the pointer. I don't think I have the chops to get the hack applied to my current project...Alsak's commit remark that "other Arquillian extensions that rely on manipulating the deployment based on reading metadata from the TestClass will most likely not work" makes me think that there will be a raft of other issues that this causes in my current project.
I'm glad to hear that there's a path forward, so I'm keeping my fingers crossed that this improvement gets out to the mainline of arquillian soon. Thanks again for the info!
> Research support for @Deployment on multiple levels
> ---------------------------------------------------
>
> Key: ARQ-197
> URL: https://issues.jboss.org/browse/ARQ-197
> Project: Arquillian
> Issue Type: Feature Request
> Components: Base Implementation
> Reporter: Aslak Knutsen
> Priority: Critical
> Fix For: 1.1.0.CR1
>
>
> One deployment pr TestCase might not always be the ideal solution. Research how we can deploy multiple TestCases with one Deployment and test them all at once.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months