Search in sources :

Example 1 with ResourcesAnnotationHandler

use of org.eclipse.jetty.annotations.ResourcesAnnotationHandler in project jetty.project by eclipse.

the class TestResourceAnnotations method testResourcesAnnotation.

@Test
public void testResourcesAnnotation() throws Exception {
    new org.eclipse.jetty.plus.jndi.EnvEntry(server, "resA", objA, false);
    new org.eclipse.jetty.plus.jndi.EnvEntry(server, "resB", objB, false);
    AnnotationIntrospector introspector = new AnnotationIntrospector();
    ResourcesAnnotationHandler handler = new ResourcesAnnotationHandler(wac);
    introspector.registerHandler(handler);
    introspector.introspect(ResourceA.class);
    introspector.introspect(ResourceB.class);
    assertEquals(objA, env.lookup("peach"));
    assertEquals(objB, env.lookup("pear"));
}
Also used : ResourcesAnnotationHandler(org.eclipse.jetty.annotations.ResourcesAnnotationHandler) AnnotationIntrospector(org.eclipse.jetty.annotations.AnnotationIntrospector) Test(org.junit.Test)

Aggregations

AnnotationIntrospector (org.eclipse.jetty.annotations.AnnotationIntrospector)1 ResourcesAnnotationHandler (org.eclipse.jetty.annotations.ResourcesAnnotationHandler)1 Test (org.junit.Test)1