@Test
public void wadlIsGeneratedWithUnknownCustomParameterAnnotation() throws JAXBException, PrivilegedActionException
{

    /* Set up a ClassDocType that has something for a custom-annotated parameter */
    ClassDocType cdt = new ClassDocType();
    cdt.setClassName(TestResource.class.getName());

    MethodDocType mdt = new MethodDocType();
    mdt.setMethodName("method");
    cdt.getMethodDocs().add(mdt);

    ParamDocType pdt = new ParamDocType("x", "comment about x");
    mdt.getParamDocs().add(pdt);

    AnnotationDocType adt = new AnnotationDocType();
    adt.setAnnotationTypeName(CustomParam.class.getName());
    adt.getAttributeDocs().add(new NamedValueType("value", "x"));

    pdt.getAnnotationDocs().add(adt);

    ResourceDocType rdt = new ResourceDocType();
    rdt.getDocs().add(cdt);


    /* Generate WADL for that class */
    WadlGenerator wg = new WadlGeneratorResourceDocSupport(new WadlGeneratorImpl(), rdt);

    WadlBuilder wb = new WadlBuilder(wg);
    AbstractResource resource = IntrospectionModeller.createResource(TestResource.class);
    ApplicationDescription app = wb.generate(null,null,null, Collections.singleton(resource));


    /* Confirm that it can be marshalled without error */
    StringWriter sw = new StringWriter();

    JAXBContext context =
            AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>(){

                @Override
                public JAXBContext run() throws JAXBException {
                    return JAXBContext.newInstance(Application.class);
                }
            });

    Marshaller m = context.createMarshaller();
    m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

    m.marshal(app.getApplication(), sw);
}