Examples of Conditions


Examples of org.restlet.data.Conditions

        final Response response = put("date", null, cond);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
    }

    public void testDateAndEntityTag2Get() throws Exception {
        final Conditions conditions = createConditions(AFTER,
                getDatastoreETag());
        final Response response = get("date", conditions);
        assertEquals(Status.REDIRECTION_NOT_MODIFIED, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

        final Response response = get("date", conditions);
        assertEquals(Status.REDIRECTION_NOT_MODIFIED, response.getStatus());
    }

    public void testDateAndEntityTag2Put() throws Exception {
        final Conditions conditions = createConditions(AFTER,
                getDatastoreETag());
        final Response response = put("date", null, conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

        final Response response = put("date", null, conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }

    public void testDateAndEntityTag3Get() throws Exception {
        final Conditions conditions = createConditions(BEFORE, new Tag(
                "shkhsdk"));
        final Response response = get("date", conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

        final Response response = get("date", conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }

    public void testDateAndEntityTag3Put() throws Exception {
        final Conditions conditions = createConditions(BEFORE, new Tag(
                "shkhsdk"));
        final Response response = put("date", null, conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

        final Response response = put("date", null, conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }

    public void testDateAndEntityTag4Get() throws Exception {
        final Conditions conditions = createConditions(AFTER,
                new Tag("shkhsdk"));
        final Response response = get("date", conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

        final Response response = get("date", conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }

    public void testDateAndEntityTag4Put() throws Exception {
        final Conditions conditions = createConditions(AFTER,
                new Tag("shkhsdk"));
        final Response response = put("date", null, conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

        final Response response = put("date", null, conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }

    public void testGetDateNotModified() throws Exception {
        final Conditions conditions = new Conditions();
        conditions.setModifiedSince(AFTER);
        final Response response = get("date", conditions);
        assertEquals(Status.REDIRECTION_NOT_MODIFIED, response.getStatus());
        assertFalse(response.isEntityAvailable()
                && response.getEntity().getSize() != 0);
        // from RFC 2616, Section 10.3.5
View Full Code Here

Examples of org.restlet.data.Conditions

        // differ from that sent in any previous response for the same
        // variant
    }

    public void testGetEntityTagMatch() throws Exception {
        Conditions conditions = new Conditions();
        conditions.setMatch(TestUtils.createList(getDatastoreETag()));
        Response response = get("date", conditions);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals(RequestService.getLastModificationDateFromDatastore(),
                response.getEntity().getModificationDate());
        assertEquals(getDatastoreETag(), response.getEntity().getTag());
        assertNotNull(response.getEntity().getText());
        assertTrue(response.getEntity().getSize() > 0);

        conditions = new Conditions();
        conditions.setMatch(TestUtils.createList(new Tag("affer")));
        response = get("date", conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

        response = get("date", conditions);
        assertEquals(PREC_FAILED, response.getStatus());
    }

    public void testGetEntityTagNoneMatch() throws Exception {
        Conditions conditions = new Conditions();
        conditions.setNoneMatch(TestUtils.createList(getDatastoreETag()));
        Response response = get("date", conditions);
        assertEquals(Status.REDIRECTION_NOT_MODIFIED, response.getStatus());

        conditions = new Conditions();
        conditions.setNoneMatch(TestUtils.createList(new Tag("affer")));
        response = get("date", conditions);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
    }
View Full Code Here

Examples of org.restlet.data.Conditions

    /**
     * @see RequestService#getLastModificationDateFromDatastore()
     * @throws Exception
     */
    public void testGetModifiedSince() throws Exception {
        Conditions conditions = new Conditions();
        conditions.setModifiedSince(BEFORE);
        Response response = get("date", conditions);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals(RequestService.getLastModificationDateFromDatastore(),
                response.getEntity().getModificationDate());
        assertEquals(getDatastoreETag(), response.getEntity().getTag());
        assertNotNull(response.getEntity().getText());
        assertTrue(response.getEntity().getSize() > 0);

        conditions = new Conditions();
        conditions.setModifiedSince(AFTER);
        response = get("date", conditions);
        assertEquals(Status.REDIRECTION_NOT_MODIFIED, response.getStatus());
        assertEquals(RequestService.getLastModificationDateFromDatastore(),
                response.getEntity().getModificationDate());
        assertEquals(getDatastoreETag(), response.getEntity().getTag());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.