Package com.sun.jersey.api.model

Examples of com.sun.jersey.api.model.AbstractResource


    }

    @Test
    public void testGetSRMReturningVoid() throws Exception {
        System.out.println("---\nAn issue should be reported if a get sub-resource method returns void:");
        AbstractResource ar = IntrospectionModeller.createResource(TestGetSRMReturningVoid.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
        assertTrue(!validator.getIssueList().get(0).isFatal());
View Full Code Here


    }

    @Test
    public void testGetSRMConsumingEntity() throws Exception {
        System.out.println("---\nAn issue should be reported if a get method consumes an entity:");
        AbstractResource ar = IntrospectionModeller.createResource(TestGetSRMConsumingEntity.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
        assertTrue(!validator.getIssueList().get(0).isFatal());
View Full Code Here

    }

    @Test
    public void testGetSRMConsumingFormParam() throws Exception {
        System.out.println("---\nAn issue should be reported if a get method consumes a form param:");
        AbstractResource ar = IntrospectionModeller.createResource(TestGetSRMConsumingFormParam.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
        assertTrue(validator.getIssueList().get(0).isFatal());
View Full Code Here

    }

    @Test
    public void testMultipleHttpMethodDesignatorsRM() throws Exception {
        System.out.println("---\nAn issue should be reported if more than one HTTP method designator exist on a resource method:");
        AbstractResource ar = IntrospectionModeller.createResource(TestMultipleHttpMethodDesignatorsRM.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(validator.fatalIssuesFound());
    }
View Full Code Here

    }

    @Test
    public void testMultipleHttpMethodDesignatorsSRM() throws Exception {
        System.out.println("---\nAn issue should be reported if more than one HTTP method designator exist on a sub-resource method:");
        AbstractResource ar = IntrospectionModeller.createResource(TestMultipleHttpMethodDesignatorsSRM.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(validator.fatalIssuesFound());
    }
View Full Code Here

    }

    @Test
    public void testEntityParamOnSRL() throws Exception {
        System.out.println("---\nAn issue should be reported if an entity parameter exists on a sub-resource locator:");
        AbstractResource ar = IntrospectionModeller.createResource(TestEntityParamOnSRL.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(validator.fatalIssuesFound());
    }
View Full Code Here

    }

    @Test
    public void testNonConflictingHttpMethodDelete() throws Exception {
        System.out.println("---\nNo issue should be reported if produced mime types differ");
        AbstractResource ar = IntrospectionModeller.createResource(TestNonConflictingHttpMethodDelete.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(validator.getIssueList().isEmpty());
    }
View Full Code Here

    }

    @Test
    public void testAmbiguousParams() throws Exception {
        System.out.println("---\nA warning should be reported if ambiguous source of a parameter is seen");
        AbstractResource ar = IntrospectionModeller.createResource(TestAmbiguousParams.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.fatalIssuesFound());
        assertEquals(6, validator.getIssueList().size());
View Full Code Here

    }

    @Test
    public void testEmptyPathSegment() throws Exception {
        System.out.println("---\nA warning should be reported if @Path with \"/\" or empty string value is seen");
        AbstractResource ar = IntrospectionModeller.createResource(TestEmptyPathSegment.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.fatalIssuesFound());
        assertEquals(1, validator.getIssueList().size());
View Full Code Here

    }

    @Test
    public void testTypeVariableResource() throws Exception {
        System.out.println("---\n");
        AbstractResource ar = IntrospectionModeller.createResource(TypeVariableResource.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.fatalIssuesFound());
        assertEquals(7, validator.getIssueList().size());
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.model.AbstractResource

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.