Examples of DefectBean


Examples of org.apache.wink.example.history.legacy.DefectBean

                                 @Context LinkBuilders linkProcessor,
                                 @Context UriInfo uriInfo) {

        // if content was not sent => there is no meaning for the defect, throw
        // exception.
        DefectBean defect = asset.getDefect();
        if (defect == null) {
            throw new WebApplicationException(
                                              new RuntimeException(
                                                                   "The content of the defect is missing"),
                                              Response.Status.BAD_REQUEST);
        }

        DataStore store = DataStore.getInstance();
        if (defect.getId() != null) {
            // undelete operation
            if (!store.isDefectDeleted(defect.getId())) {
                // the defect was already undeleted!
                // it's a conflict!
                return Response.status(Status.CONFLICT).build();
            }
            // this is undelete operation, there is no need to populate new id
        } else {
            // this is a new defect so generate an id
            defect.setId(store.getDefectUniqueId());
        }

        // validate that the user didn't send deleted=true by mistake
        defect.setDeleted(false);

        // add defect legacy bean to the memory store
        store.putDefect(defect.getId(), defect);

        URI location = uriInfo.getAbsolutePathBuilder().segment(defect.getId()).build();
        return Response.created(location).entity(asset).build();
    }
View Full Code Here

Examples of org.apache.wink.example.history.legacy.DefectBean

                                 @MatrixParam(REVISION) @DefaultValue("-1") int defectRevision) {

        // create data object (populated with store data)
        DataStore store = DataStore.getInstance();
        String defectId = segment.getPath();
        DefectBean defect = store.getDefect(defectId);
        if (defectRevision != -1) {
            // get specific revision
            // even if the defect was deleted, it is returned
            defect = store.getDefect(defectId, defectRevision);
        }
View Full Code Here

Examples of org.apache.wink.example.history.legacy.DefectBean

        // obtain data object from the memory store
        // if the defect was deleted, it cannot be updated anymore.
        DataStore store = DataStore.getInstance();
        String defectId = segement.getPath();
        DefectBean defect = store.getDefect(defectId);
        if (defect == null) {
            throw new WebApplicationException(new RuntimeException("Defect " + defectId
                + " not found"), Response.Status.NOT_FOUND);
        }

        // validate that user didn't send deleted flag, since it will mark
        // defect as deleted.
        // to delete a defect, DELETE http method should be used
        defect = asset.getDefect();
        defect.setDeleted(false);

        // set Id in the asset for cases that element <id> is missing
        // in the request body
        defect.setId(defectId);

        // update defect legacy bean to the memory store
        store.putDefect(defectId, defect);

        return asset;
View Full Code Here

Examples of org.apache.wink.example.history.legacy.DefectBean

        // obtain data object from memory store
        // if the object was already deleted, null will be returned
        DataStore store = DataStore.getInstance();
        String defectId = segement.getPath();
        DefectBean defect = store.getDefect(defectId);
        if (defect == null) {
            throw new WebApplicationException(new RuntimeException("Defect " + defectId
                + " not found"), Response.Status.NOT_FOUND);
        }
View Full Code Here

Examples of org.apache.wink.example.locking.legacy.DefectBean

     * @return initialized instance
     */
    private static DataStore createSingletonInstance() {
        DataStore store = new DataStore();

        DefectBean defectBean1 =
            new DefectBean(
                           "1",
                           "Cannot perform payment",
                           "In Payment Services page, error message appears when trying to perform payment with valid credit card.",
                           new Date(50505050), "tester1", "1-critical", "New", "developer1");
        DefectBean defectBean2 =
            new DefectBean("2", "Cancel button is missing",
                           "In Payment Services Confirmation page, the Cancel button is missing.",
                           new Date(50505051), "tester2", "4-minor", "New", "developer2");
        DefectBean defectBean3 =
            new DefectBean(
                           "3",
                           "Login failure",
                           "When trying to login with the user 'Admin', I'm getting an error 'The user is locked'.",
                           new Date(50505052), "tester3", "1-critical", "Assigned", "developer3");

        DefectBean defectBean4 =
            new DefectBean(
                           "4",
                           "Missing expiration field",
                           "In Payment Services page, the expiration field of credit card is missing.",
                           new Date(50505052), "tester2", "2-high", "Assigned", "developer3");

        DefectBean defectBean5 =
            new DefectBean(
                           "5",
                           "Missing asterisk for mandatory fields",
                           "In Payment Services page, there is no indication for mandatory fields.",
                           new Date(50505052), "tester2", "4-minor", "Assigned", "developer3");

        DefectBean defectBean6 =
            new DefectBean(
                           "6",
                           "User is not locked",
                           "When trying to login with the same user three times with wrong password, the user doesn't get locked.",
                           new Date(50505052), "tester3", "2-high", "Fixed", "developer2");

        DefectBean defectBean7 =
            new DefectBean("7", "Logout button", "The pages are missing the button 'logout'.",
                           new Date(50505052), "tester1", "2-high", "New", "developer1");

        DefectBean defectBean8 =
            new DefectBean("8", "Error messages", "Error messages are not displayed in red color",
                           new Date(50505052), "tester1", "4-minor", "Fixed", "developer1");

        DefectBean defectBean9 =
            new DefectBean(
                           "9",
                           "Submit button is disabled in Edit Profile page",
                           "When trying to submit changes in Edit Profile page, the Submit button is disabled.",
                           new Date(50505052), "tester3", "2-high", "New", "developer1");

        DefectBean defectBean10 =
            new DefectBean("10", "Id field is disabled in Edit Profile page",
                           "Cannot change the Id in Edit Profile page, it is disabled.",
                           new Date(50505052), "tester1", "2-high", "New", "developer1");

        DefectBean defectBean11 =
            new DefectBean("11", "Cannot login to the system",
                           "Cannot login to the system with the user 'David'.", new Date(50505052),
                           "tester3", "1-critical", "Rejected", "developer1");

        DefectBean defectBean12 =
            new DefectBean("12", "Checkbox is disabled",
                           "Checkbox is disabled in Edit Profile page", new Date(50505052),
                           "tester3", "2-high", "Rejected", "developer1");

        DefectBean defectBean13 =
            new DefectBean("13", "Missing message text",
                           "Missing message text in Edit Profile page", new Date(50505052),
                           "tester3", "4-minor", "Rejected", "developer1");

        DefectBean defectBean14 =
            new DefectBean(
                           "14",
                           "Wrong translation for the word 'user'",
                           "When moving to French language the translation of 'user' word is incorrect",
                           new Date(50505052), "tester3", "2-high", "Rejected", "developer1");

        store.putDefect(defectBean1.getId(), defectBean1);
        store.putDefect(defectBean2.getId(), defectBean2);
        store.putDefect(defectBean3.getId(), defectBean3);
        store.putDefect(defectBean4.getId(), defectBean4);
        store.putDefect(defectBean5.getId(), defectBean5);
        store.putDefect(defectBean6.getId(), defectBean6);
        store.putDefect(defectBean7.getId(), defectBean7);
        store.putDefect(defectBean8.getId(), defectBean8);
        store.putDefect(defectBean9.getId(), defectBean9);
        store.putDefect(defectBean10.getId(), defectBean10);
        store.putDefect(defectBean11.getId(), defectBean11);
        store.putDefect(defectBean12.getId(), defectBean12);
        store.putDefect(defectBean13.getId(), defectBean13);
        store.putDefect(defectBean14.getId(), defectBean14);

        return store;
    }
View Full Code Here

Examples of org.apache.wink.example.locking.legacy.DefectBean

     * @param key requested defect key (defect id).
     * @return previous defect bean associated with specified key, or
     *         <tt>null<tt> if there was no mapping for key.
     */
    public DefectBean removeDefect(String key) {
        DefectBean old = this.defects.remove(key);
        this.lastModified = System.currentTimeMillis();
        return old;
    }
View Full Code Here

Examples of org.apache.wink.example.locking.legacy.DefectBean

     * @return initialized instance
     */
    private static DataStore createSingletonInstance() {
        DataStore store = new DataStore();

        DefectBean defectBean1 =
            new DefectBean(
                           "1",
                           "Cannot perform payment",
                           "In Payment Services page, error message appears when trying to perform payment with valid credit card.",
                           new Date(50505050), "tester1", "1-critical", "New", "developer1");
        DefectBean defectBean2 =
            new DefectBean("2", "Cancel button is missing",
                           "In Payment Services Confirmation page, the Cancel button is missing.",
                           new Date(50505051), "tester2", "4-minor", "New", "developer2");
        DefectBean defectBean3 =
            new DefectBean(
                           "3",
                           "Login failure",
                           "When trying to login with the user 'Admin', I'm getting an error 'The user is locked'.",
                           new Date(50505052), "tester3", "1-critical", "Assigned", "developer3");

        DefectBean defectBean4 =
            new DefectBean(
                           "4",
                           "Missing expiration field",
                           "In Payment Services page, the expiration field of credit card is missing.",
                           new Date(50505052), "tester2", "2-high", "Assigned", "developer3");

        DefectBean defectBean5 =
            new DefectBean(
                           "5",
                           "Missing asterisk for mandatory fields",
                           "In Payment Services page, there is no indication for mandatory fields.",
                           new Date(50505052), "tester2", "4-minor", "Assigned", "developer3");

        DefectBean defectBean6 =
            new DefectBean(
                           "6",
                           "User is not locked",
                           "When trying to login with the same user three times with wrong password, the user doesn't get locked.",
                           new Date(50505052), "tester3", "2-high", "Fixed", "developer2");

        DefectBean defectBean7 =
            new DefectBean("7", "Logout button", "The pages are missing the button 'logout'.",
                           new Date(50505052), "tester1", "2-high", "New", "developer1");

        DefectBean defectBean8 =
            new DefectBean("8", "Error messages", "Error messages are not displayed in red color",
                           new Date(50505052), "tester1", "4-minor", "Fixed", "developer1");

        DefectBean defectBean9 =
            new DefectBean(
                           "9",
                           "Submit button is disabled in Edit Profile page",
                           "When trying to submit changes in Edit Profile page, the Submit button is disabled.",
                           new Date(50505052), "tester3", "2-high", "New", "developer1");

        DefectBean defectBean10 =
            new DefectBean("10", "Id field is disabled in Edit Profile page",
                           "Cannot change the Id in Edit Profile page, it is disabled.",
                           new Date(50505052), "tester1", "2-high", "New", "developer1");

        DefectBean defectBean11 =
            new DefectBean("11", "Cannot login to the system",
                           "Cannot login to the system with the user 'David'.", new Date(50505052),
                           "tester3", "1-critical", "Rejected", "developer1");

        DefectBean defectBean12 =
            new DefectBean("12", "Checkbox is disabled",
                           "Checkbox is disabled in Edit Profile page", new Date(50505052),
                           "tester3", "2-high", "Rejected", "developer1");

        DefectBean defectBean13 =
            new DefectBean("13", "Missing message text",
                           "Missing message text in Edit Profile page", new Date(50505052),
                           "tester3", "4-minor", "Rejected", "developer1");

        DefectBean defectBean14 =
            new DefectBean(
                           "14",
                           "Wrong translation for the word 'user'",
                           "When moving to French language the translation of 'user' word is incorrect",
                           new Date(50505052), "tester3", "2-high", "Rejected", "developer1");

        store.putDefect(defectBean1.getId(), defectBean1);
        store.putDefect(defectBean2.getId(), defectBean2);
        store.putDefect(defectBean3.getId(), defectBean3);
        store.putDefect(defectBean4.getId(), defectBean4);
        store.putDefect(defectBean5.getId(), defectBean5);
        store.putDefect(defectBean6.getId(), defectBean6);
        store.putDefect(defectBean7.getId(), defectBean7);
        store.putDefect(defectBean8.getId(), defectBean8);
        store.putDefect(defectBean9.getId(), defectBean9);
        store.putDefect(defectBean10.getId(), defectBean10);
        store.putDefect(defectBean11.getId(), defectBean11);
        store.putDefect(defectBean12.getId(), defectBean12);
        store.putDefect(defectBean13.getId(), defectBean13);
        store.putDefect(defectBean14.getId(), defectBean14);

        return store;
    }
View Full Code Here

Examples of org.apache.wink.example.locking.legacy.DefectBean

     * @param key requested defect key (defect id).
     * @return previous defect bean associated with specified key, or
     *         <tt>null<tt> if there was no mapping for key.
     */
    public DefectBean removeDefect(String key) {
        DefectBean old = this.defects.remove(key);
        this.lastModified = System.currentTimeMillis();
        return old;
    }
View Full Code Here

Examples of org.apache.wink.example.locking.legacy.DefectBean

    @Path(DEFECT_URL)
    @Produces(MediaType.APPLICATION_XML)
    public Response getDefect(@Context Request request, @PathParam(DEFECT) String defectId) {

        // get defect from the store
        DefectBean bean = store.getDefect(defectId);
        if (bean == null) {
            // defect was not found
            return Response.status(Status.NOT_FOUND).build();
        }

        // create defect's etag
        EntityTag defectBeanEtag = new EntityTag(String.valueOf(bean.hashCode()));

        // evaluate the precondition
        ResponseBuilder precondition = request.evaluatePreconditions(defectBeanEtag);
        if (precondition != null) {
            // defect was not modified, return 304
View Full Code Here

Examples of org.apache.wink.example.locking.legacy.DefectBean

            // IF-MATCH header wasn't sent, cannot validate the precondition
            throw new WebApplicationException(Status.BAD_REQUEST);
        }

        // obtain data object from the memory store
        DefectBean bean = store.getDefect(defectId);
        if (bean == null) {
            // not found, return 404
            throw new WebApplicationException(Status.NOT_FOUND);
        }

        // create defect's etag
        EntityTag defectBeanEtag = new EntityTag(String.valueOf(bean.hashCode()));

        ResponseBuilder preconditions = request.evaluatePreconditions(defectBeanEtag);
        if (preconditions != null) {
            return preconditions.build();
        }
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.