@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); // TODO - J2 wadlMethod.setId(m.getHttpMethod() + m.getPath()); return wadlMethod; }
@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.extendedElement); } return wadlMethod; }
@Test public void testWadl() throws Exception { final Response response = target("/application.wadl").request().get(); assertThat(response.getStatus(), is(200)); assertThat(response.hasEntity(), is(true)); final Method method = (Method) response .readEntity(com.sun.research.ws.wadl.Application.class) // wadl .getResources() .get(0) .getResource() .get(0) // resource .getMethodOrResource() .get(0); // method final Param param = method.getRequest().getParam().get(0); // param // not interested in returned value, only whether we can compile. assertThat(param.isRequired(), notNullValue()); assertThat(param.isRepeating(), notNullValue()); }