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

Open
gaol opened this issue Mar 15, 2024 · 1 comment · May be fixed by #544
Open

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

gaol opened this issue Mar 15, 2024 · 1 comment · May be fixed by #544
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

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.

2 participants