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

ResteasyClientProxy class should be deprecated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.1.CR1, 7.0.1.GA
    • 7.0.0.ER4
    • REST
    • None
    • EAP 7.0.1

      org.jboss.resteasy.client.core.marshallers.ResteasyClientProxy class should be deprecated. Proxy object could be cast to ResteasyClientProxy only if old deprecated client is used.

      This test use old deprecated client. Test pass:

          @Test
          public void testOldClient() throws Exception {
              InterfaceA a = ProxyFactory.create(InterfaceA.class, generateURL("/foobar"));
              assertEquals("FOO", a.getFoo());
              InterfaceB b = ((ResteasyClientProxy) a).as(InterfaceB.class);
              assertEquals("BAR", b.getBar());
          }
      

      This test use new client. Test fails with java.lang.ClassCastException: com.sun.proxy.$Proxy49 cannot be cast to org.jboss.resteasy.client.core.marshallers.ResteasyClientProxy:

          @Test
          public void testNewClient() throws Exception {
              InterfaceA a = client.target(generateURL("/foobar")).proxy(InterfaceA.class);
              assertEquals("FOO", a.getFoo());
              InterfaceB b = ((ResteasyClientProxy) a).as(InterfaceB.class);
              assertEquals("BAR", b.getBar());
          }
      

      So ResteasyClientProxy could be used only with old client and should be deprecated.

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

              Created:
              Updated:
              Resolved: