Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to deploy if called in BeforeEach method in junit5 #543

Closed
gaol opened this issue Mar 15, 2024 · 4 comments
Closed

Failed to deploy if called in BeforeEach method in junit5 #543

gaol opened this issue Mar 15, 2024 · 4 comments
Assignees

Comments

@gaol
Copy link

gaol commented Mar 15, 2024

Issue Overview

JDK: 11
Maven: 3.8.6
arquillian: 1.8.0.Final
junit: junit5

If deployer.deploy() method is called in BeforeEach method, it failed with:

java.lang.IllegalArgumentException: No deployment scenario in context
	at org.jboss.arquillian.container.test.impl.client.deployment.ClientDeployer.deploy(ClientDeployer.java:62)
	at org.jboss.test.ws.jaxws.cxf.jbws3655.EarSchemaImportTestCase.setup(EarSchemaImportTestCase.java:53)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.jboss.arquillian.junit5.ArquillianExtension.interceptBeforeEachMethod(ArquillianExtension.java:99)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)

The demo code is like:

   @ArquillianResource
   private Deployer deployer;

   @BeforeEach
   public void setup() throws Exception {
      deployer.deploy(EAR_DEPLOYMENT);
   }

   @Deployment(testable = false, name=EAR_DEPLOYMENT,managed=false)
   public static JavaArchive createDeployment() {
      return ShrinkWrap.create(JavaArchive.class, EAR_DEPLOYMENT);
  }

   @Test
   @RunAsClient
   public void testSchemaImport() {
       // this never called because deploy(EAR_DEPLOYMENT) failed.
  }

but move the deploy() method call to each Test method, all work fine.

@petrberan
Copy link
Collaborator

Also can be found here: https://issues.redhat.com/browse/ARQ-2231

Was looking into it but I'll need more time to investigate

@petrberan
Copy link
Collaborator

This issue has been fixed by a hotfix from @rhusar in #583 so I'm assigning this issue to him either to close it or to track further progress

@petrberan petrberan assigned rhusar and unassigned petrberan Jul 12, 2024
@rhusar
Copy link
Collaborator

rhusar commented Jul 12, 2024

Thanks @petrberan, you are right, this should be resolved. Let's close and @gaol could you please report back (with 1.9.0.Final) if this was fixed for you completely? Thanks!

@rhusar rhusar closed this as completed Jul 12, 2024
@gaol
Copy link
Author

gaol commented Jul 17, 2024

Thanks @rhusar and @petrberan , yes, 1.9.0.Final works for me. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants