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

ResteasyClientProxy class should be deprecated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.17.Final
    • 3.0.14.Final
    • None
    • None

      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:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: