Package org.jboss.resteasy.spi.touri

Examples of org.jboss.resteasy.spi.touri.ObjectToURI


   }

   @Test
   public void testCustomResolver()
   {
      ObjectToURI instance = ObjectToURI.getInstance();
      CustomURIableObject custom = new CustomURIableObject();
      Assert.assertEquals("/my-url", instance.resolveURI(custom));

      instance.registerURIResolver(new URIResolver()
      {
         public boolean handles(Class<?> type)
         {
            return type == CustomURIableObject.class;
         }

         public String resolveURI(Object object)
         {
            return "/some-other-uri";
         }
      });

      Assert.assertEquals("/some-other-uri", instance.resolveURI(custom));
   }
View Full Code Here


   }

   @Test
   public void testDefaultResolvers()
   {
      ObjectToURI instance = ObjectToURI.getInstance();
      Assert.assertEquals("/foo/123", instance
              .resolveURI(new URITemplateObject(123)));
      Assert.assertEquals("/my-url", instance.resolveURI(new URIableObject()));
      Assert.assertEquals("/foo/123", instance.resolveURI(new MappedByObject(
              123)));
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.spi.touri.ObjectToURI

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.