Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1280

ClientErrorBadMediaTypeTest shouldn't ignore configuration errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 3.0.15.Final
    • 3.0.13.Final
    • jaxrs
    • None

      ClientErrorBadMediaTypeTest from RESTEasy shouldn't ignore configuration errors

      Maven project: jaxrs/resteasy-jaxrs
      Class: org.jboss.resteasy.test.finegrain.resource.ClientErrorBadMediaTypeTest

      This class contains this code:

            try
            {
               delegateField = MediaType.class.getDeclaredField("delegate");
               ......
               System.out.println("Set MediaType.delegate field to " + delegate);
            }
            catch (Exception e)
            {
               skipTest = true;
               return;
            }
      

      NoSuchFieldException error occurs in this try block, so test is skipped. But configuration in this test should be correct and test should not be skipped.

      Stacktrace in upstream test if try block is commented:

      java.lang.NoSuchFieldException: delegate
      	at java.lang.Class.getDeclaredField(Class.java:2070)
      	at org.jboss.resteasy.test.finegrain.resource.ClientErrorBadMediaTypeTest.before(ClientErrorBadMediaTypeTest.java:94)
      

      Execution of this test with EAP is skipped too beacuse of java.lang.NoSuchFieldException on line delegateField = MediaType.class.getDeclaredField("delegate");:

      10:54:39,990 ERROR [stderr] (default task-2) java.lang.NoSuchFieldException: delegate
      10:54:39,990 ERROR [stderr] (default task-2) 	at java.lang.Class.getDeclaredField(Class.java:2057)
      10:54:39,991 ERROR [stderr] (default task-2) 	at org.jboss.resteasy.test.client.exception.ClientErrorBadMediaTypeTest.before(ClientErrorBadMediaTypeTest.java:57)
      10:54:39,991 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      10:54:39,991 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      10:54:39,991 ERROR [stderr] (default task-2) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      10:54:39,991 ERROR [stderr] (default task-2) 	at java.lang.reflect.Method.invoke(Method.java:483)
      10:54:39,991 ERROR [stderr] (default task-2) 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      10:54:39,992 ERROR [stderr] (default task-2) 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      10:54:39,992 ERROR [stderr] (default task-2) 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      10:54:39,992 ERROR [stderr] (default task-2) 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      10:54:39,992 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian$StatementLifecycleExecutor.invoke(Arquillian.java:351)
      10:54:39,993 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.container.test.impl.execution.BeforeLifecycleEventExecuter.on(BeforeLifecycleEventExecuter.java:35)
      10:54:39,993 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      10:54:39,993 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      10:54:39,993 ERROR [stderr] (default task-2) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      10:54:39,993 ERROR [stderr] (default task-2) 	at java.lang.reflect.Method.invoke(Method.java:483)
      10:54:39,994 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      10:54:39,994 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
      10:54:39,994 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
      10:54:39,994 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
      10:54:39,994 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      10:54:39,995 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      10:54:39,995 ERROR [stderr] (default task-2) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      10:54:39,995 ERROR [stderr] (default task-2) 	at java.lang.reflect.Method.invoke(Method.java:483)
      10:54:39,995 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      10:54:39,995 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      10:54:39,996 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
      10:54:39,996 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      10:54:39,996 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      10:54:39,996 ERROR [stderr] (default task-2) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      10:54:39,996 ERROR [stderr] (default task-2) 	at java.lang.reflect.Method.invoke(Method.java:483)
      10:54:39,997 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      10:54:39,997 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      10:54:39,997 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
      10:54:39,997 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      10:54:39,997 ERROR [stderr] (default task-2) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      10:54:39,997 ERROR [stderr] (default task-2) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      10:54:39,997 ERROR [stderr] (default task-2) 	at java.lang.reflect.Method.invoke(Method.java:483)
      10:54:39,998 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      10:54:39,998 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      10:54:39,998 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
      10:54:39,998 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
      10:54:39,998 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)
      10:54:39,998 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)
      10:54:39,998 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
      10:54:39,999 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
      10:54:39,999 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)
      10:54:39,999 ERROR [stderr] (default task-2) 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      10:54:39,999 ERROR [stderr] (default task-2) 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      10:54:39,999 ERROR [stderr] (default task-2) 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      10:54:40,000 ERROR [stderr] (default task-2) 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      10:54:40,000 ERROR [stderr] (default task-2) 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      10:54:40,000 ERROR [stderr] (default task-2) 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      10:54:40,000 ERROR [stderr] (default task-2) 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      10:54:40,000 ERROR [stderr] (default task-2) 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      10:54:40,001 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
      10:54:40,001 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
      10:54:40,001 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
      10:54:40,001 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
      10:54:40,001 ERROR [stderr] (default task-2) 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      10:54:40,002 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
      10:54:40,002 ERROR [stderr] (default task-2) 	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      10:54:40,002 ERROR [stderr] (default task-2) 	at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
      10:54:40,002 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)
      10:54:40,002 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)
      10:54:40,003 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)
      10:54:40,003 ERROR [stderr] (default task-2) 	at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)
      10:54:40,003 ERROR [stderr] (default task-2) 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
      10:54:40,003 ERROR [stderr] (default task-2) 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      10:54:40,003 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      10:54:40,003 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      10:54:40,004 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      10:54:40,004 ERROR [stderr] (default task-2) 	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      10:54:40,004 ERROR [stderr] (default task-2) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      10:54:40,004 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      10:54:40,004 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      10:54:40,004 ERROR [stderr] (default task-2) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      10:54:40,004 ERROR [stderr] (default task-2) 	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      10:54:40,005 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      10:54:40,005 ERROR [stderr] (default task-2) 	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      10:54:40,005 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      10:54:40,005 ERROR [stderr] (default task-2) 	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
      10:54:40,005 ERROR [stderr] (default task-2) 	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      10:54:40,005 ERROR [stderr] (default task-2) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      10:54:40,006 ERROR [stderr] (default task-2) 	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      10:54:40,006 ERROR [stderr] (default task-2) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      10:54:40,006 ERROR [stderr] (default task-2) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      10:54:40,006 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
      10:54:40,006 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
      10:54:40,006 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      10:54:40,007 ERROR [stderr] (default task-2) 	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
      10:54:40,007 ERROR [stderr] (default task-2) 	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
      10:54:40,007 ERROR [stderr] (default task-2) 	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
      10:54:40,007 ERROR [stderr] (default task-2) 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      10:54:40,008 ERROR [stderr] (default task-2) 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      10:54:40,008 ERROR [stderr] (default task-2) 	at java.lang.Thread.run(Thread.java:745)
      

              mstefank Martin Stefanko
              mkopecky@redhat.com Marek Kopecky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: