Package org.jboss.resteasy.core

Examples of org.jboss.resteasy.core.ResourceMethodInvoker


      MediaType bar = MediaType.valueOf("application/bar");

      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(foo);
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
      }
      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(bar);
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
      }
      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(MediaType.valueOf("*/*"));
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
      }
      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(MediaType.valueOf("application/*"));
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
      }
   }
View Full Code Here


      registry.addPerRequestResource(ConsumeResource.class);

      ArrayList<MediaType> accepts = new ArrayList<MediaType>();

      {
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", MediaType.valueOf("text/plain"), accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(ConsumeResource.class.getMethod("doGetWildCard"), method.getMethod());
      }
      {
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", MediaType.valueOf("application/foo"), accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(ConsumeResource.class.getMethod("doGetFoo"), method.getMethod());
      }
      {
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", MediaType.valueOf("application/bar"), accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(ConsumeResource.class.getMethod("doGetBar"), method.getMethod());
      }
      {
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", MediaType.valueOf("application/baz"), accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(ConsumeResource.class.getMethod("doGetBaz"), method.getMethod());
      }
   }
View Full Code Here

      ArrayList<MediaType> accepts = new ArrayList<MediaType>();
      accepts.add(MediaType.WILDCARD_TYPE);
      accepts.add(MediaType.TEXT_HTML_TYPE);

      {
         ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(ComplexResource.class.getMethod("method2"), method.getMethod());
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.core.ResourceMethodInvoker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.