Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10576

Server reload missing in tearDown method of EjbElytronDomainSetup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.1.0.ER1
    • 7.1.0.DR17, 7.1.0.DR18, 7.1.0.DR19
    • Test Suite
    • None

      Clean up method in EjbElytronDomainSetup server setup class currently calls management operations on server that require a reload, but the method implicitly states not to reload the server, leaving the server in improperly cleaned up state after test case run, causing multiple tests that use incorrectly cleaned up services to fail with error:

      EjbElytronDomainSetup.java
      @Override
          public void tearDown(final ManagementClient managementClient, final String containerId) {
              System.out.println("tearing down...");
      
              List<ModelNode> updates = new LinkedList<>();
              updates.add(createRemoveIgnoring(undertowDomainAddress));
              updates.add(createRemoveIgnoring(httpAuthenticationAddress));
              updates.add(Util.getWriteAttributeOperation(ejbRemoteAddress, "connector-ref", "http-remoting-connector"));
              updates.add(createRemoveIgnoring(ejbDomainAddress));
              updates.add(createRemoveIgnoring(remotingConnectorAddress));
              updates.add(createRemoveIgnoring(saslAuthenticationAddress));
              updates.add(createRemoveIgnoring(domainAddress));
              updates.add(createRemoveIgnoring(realmAddress));
      
              try {
                  applyUpdates(managementClient.getControllerClient(), updates, true);
              } catch (Exception e) {
                  throw new RuntimeException(e);
              }
          }
      
          private static ModelNode createRemoveIgnoring(PathAddress address) {
              ModelNode remove = Util.createRemoveOperation(address);
              // Don't rollback when the AS detects the war needs the module
              remove.get(OPERATION_HEADERS, ROLLBACK_ON_RUNTIME_FAILURE).set(false);
              remove.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(false);
              return remove;
          }
      
          protected static void applyUpdates(final ModelControllerClient client, final List<ModelNode> updates, boolean allowFailure) {
              for (ModelNode update : updates) {
                  try {
                      applyUpdate(client, update, allowFailure);
                  } catch (Exception e) {
                      throw new RuntimeException(e);
                  }
              }
          }
      mvn clean test -Dtest=org.jboss.as.test.integration.ejb.security.*. -Delytron -Dwildfly.tmp.enable.elytron.profile.tests
      Running org.jboss.as.test.integration.ejb.security.EJBInWarDefaultSecurityDomainTestCase
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.274 sec - in org.jboss.as.test.integration.ejb.security.EJBInWarDefaultSecurityDomainTestCase
      Running org.jboss.as.test.integration.ejb.security.EJBSecurityTestCase
      Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.374 sec - in org.jboss.as.test.integration.ejb.security.EJBSecurityTestCase
      Running org.jboss.as.test.integration.ejb.security.InherritanceAnnSFSBTestCase
      Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.396 sec <<< FAILURE! - in org.jboss.as.test.integration.ejb.security.InherritanceAnnSFSBTestCase
      testSingleMethodAnnotationsUser1(org.jboss.as.test.integration.ejb.security.InherritanceAnnSFSBTestCase)  Time elapsed: 0.166 sec  <<< ERROR!
      javax.naming.CommunicationException: EJBCLIENT000062: Failed to look up "/inherritanceAnnOnlySFSB//InherritanceAnnOnlyCheckSFSB!org.jboss.as.test.integration.ejb.security.authorization.SimpleAuthorizationRemote?stateful" [Root exception is java.lang.IllegalStateException: EJBCLIENT000024: Not able to find EJB matching "StatelessEJBLocator for "/inherritanceAnnOnlySFSB/InherritanceAnnOnlyCheckSFSB", view is interface org.jboss.as.test.integration.ejb.security.authorization.SimpleAuthorizationRemote, affinity is None"]
      	at org.jboss.ejb.client.EJBRootContext.lookupNative(EJBRootContext.java:144)
      	at org.wildfly.naming.client.AbstractContext.lookup(AbstractContext.java:88)
      	at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:149)
      	at javax.naming.InitialContext.lookup(InitialContext.java:417)
      	at org.jboss.as.test.integration.ejb.security.AnnSBTest.getBean(AnnSBTest.java:94)
      	at org.jboss.as.test.integration.ejb.security.AnnSBTest.lambda$testSingleMethodAnnotationsUser1Template$1(AnnSBTest.java:165)
      	at org.wildfly.common.context.Contextual.runCallable(Contextual.java:127)
      	at org.jboss.as.test.integration.ejb.security.AnnSBTest.testSingleMethodAnnotationsUser1Template(AnnSBTest.java:163)
      	at org.jboss.as.test.integration.ejb.security.InherritanceAnnSFSBTestCase.testSingleMethodAnnotationsUser1(InherritanceAnnSFSBTestCase.java:71)
      	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.jboss.arquillian.junit.Arquillian$8$1.invoke(Arquillian.java:374)
      	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: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)
      	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:145)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      	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.GeneratedMethodAccessor14.invoke(Unknown Source)
      	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)
      	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.GeneratedMethodAccessor13.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:130)
      	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
      	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
      	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
      	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:136)
      	at org.jboss.arquillian.junit.Arquillian$8.evaluate(Arquillian.java:367)
      	at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:245)
      	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:426)
      	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
      	at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:259)
      	at org.jboss.arquillian.junit.Arquillian$7$1.invoke(Arquillian.java:319)
      	at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.execute(ClientBeforeAfterLifecycleEventExecuter.java:99)
      	at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.on(ClientBeforeAfterLifecycleEventExecuter.java:72)
      	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      	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)
      	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.createBeforeContext(ContainerEventController.java:124)
      	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:130)
      	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
      	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
      	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      	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)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.fireCustomLifecycle(EventTestRunnerAdaptor.java:159)
      	at org.jboss.arquillian.junit.Arquillian$7.evaluate(Arquillian.java:312)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:204)
      	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:426)
      	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
      	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)
      	at org.junit.runners.Suite.runChild(Suite.java:128)
      	at org.junit.runners.Suite.runChild(Suite.java:27)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:108)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:78)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:54)
      	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:144)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      Caused by: java.lang.IllegalStateException: EJBCLIENT000024: Not able to find EJB matching "StatelessEJBLocator for "/inherritanceAnnOnlySFSB/InherritanceAnnOnlyCheckSFSB", view is interface org.jboss.as.test.integration.ejb.security.authorization.SimpleAuthorizationRemote, affinity is None"
      	at org.jboss.ejb.client.EJBClientContext.discoverAffinityNone(EJBClientContext.java:719)
      	at org.jboss.ejb.client.EJBClientContext.performLocatedAction(EJBClientContext.java:701)
      	at org.jboss.ejb.client.EJBClientContext.createSession(EJBClientContext.java:681)
      	at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:288)
      	at org.jboss.ejb.client.EJBRootContext.lookupNative(EJBRootContext.java:142)
      	... 135 more
      	Suppressed: org.xnio.http.UpgradeFailedException: Invalid response code 200
      		at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:471)
      		at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:400)
      		at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      		at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
      		at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
      		at org.xnio.nio.WorkerThread.run(WorkerThread.java:567)
      		at ...asynchronous invocation...(Unknown Source)
      		at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:537)
      		at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:503)
      		at org.jboss.remoting3.ConnectionInfo$None.getConnection(ConnectionInfo.java:84)
      		at org.jboss.remoting3.ConnectionInfo.getConnection(ConnectionInfo.java:57)
      		at org.jboss.remoting3.EndpointImpl.doGetConnection(EndpointImpl.java:458)
      		at org.jboss.remoting3.EndpointImpl.getConnectedIdentity(EndpointImpl.java:403)
      		at org.jboss.remoting3.UncloseableEndpoint.getConnectedIdentity(UncloseableEndpoint.java:55)
      		at org.jboss.remoting3.Endpoint.getConnectedIdentity(Endpoint.java:126)
      		at org.jboss.remoting3.Endpoint.getConnectedIdentity(Endpoint.java:139)
      		at org.jboss.remoting3.Endpoint.getConnection(Endpoint.java:216)
      		at org.jboss.ejb.protocol.remote.RemotingEJBDiscoveryProvider.lambda$discover$0(RemotingEJBDiscoveryProvider.java:103)
      		at java.security.AccessController.doPrivileged(Native Method)
      		at org.jboss.ejb.protocol.remote.RemotingEJBDiscoveryProvider.discover(RemotingEJBDiscoveryProvider.java:103)
      		at org.wildfly.discovery.impl.AggregateDiscoveryProvider.discover(AggregateDiscoveryProvider.java:58)
      		at org.wildfly.discovery.ConfiguredProvider.discover(ConfiguredProvider.java:45)
      		at org.wildfly.discovery.Discovery.discover(Discovery.java:94)
      		at org.jboss.ejb.client.EJBClientContext.discover(EJBClientContext.java:442)
      		at org.jboss.ejb.client.EJBClientContext.discoverAffinityNone(EJBClientContext.java:714)
      		... 139 more
      
      

      If no test with EjbElytronDomainSetup is ran before these failing tests, they will be successful.

              mjurc@redhat.com Michal Jurc
              mjurc@redhat.com Michal Jurc
              Michal Jurc Michal Jurc
              Michal Jurc Michal Jurc
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: