Package org.netbeans.modules.exceptions.entity

Examples of org.netbeans.modules.exceptions.entity.Comment


       
       
        List<Comment> commentList = PersistenceUtils.getAll(em, Comment.class);
        assertEquals("THERE SHOULD BE TWO COMMENTS", 2, commentList.size());
        //first record
        Comment comment = commentList.get(0);
        assertEquals(comments[0],comment.getComment());
       
        comment = commentList.get(1);
        //second record
        assertEquals(comments[1],comment.getComment());
       
        exceptionList = PersistenceUtils.getAll(em, org.netbeans.modules.exceptions.entity.Exceptions.class);
        exception = exceptionList.get(0);
        assertEquals("THERE MUST BE ONE ISSUE", 2, exceptionList.size());
        //check the first one
View Full Code Here


        exc.setSummary(summarys[0]);
        report.setComponent("comp1");
        report.setSubcomponent("subcomp1");
        exc.setReportId(report);
       
        Comment comment = new Comment();
        comment.setComment("comment 1");
       
        persUtil.persist(report);
        persUtil.persist(exc);
       
        exc = new Exceptions();
        report = new Report();
        report.setId(2);
        exc.setId(2);
        exc.setSummary(summarys[1]);
        report.setComponent("comp1");
        report.setSubcomponent("subcomp1");
        exc.setReportId(report);
        comment = new Comment();
        comment.generateId();
        comment.setComment("comment 2");
       
        persUtil.persist(report);
        persUtil.persist(exc);
       
        exc = new Exceptions();
        report = new Report();
        report.setId(3);
        exc.setId(new Integer(3));
        exc.setSummary(summarys[2]);
        report.setComponent("comp2");
        report.setSubcomponent("subcomp2");
        exc.setReportId(report);
        comment = new Comment();
        comment.setComment("comment 3");
        comment.generateId();
        persUtil.persist(report);
        persUtil.persist(exc);
       
       
        List<Exceptions> excList = persUtil.getAll(Exceptions.class);
View Full Code Here

            submit.getReportId().setSubcomponent(subcomponent);
            submit.getReportId().setComponentManChanged(true);
            merge = true;
        }

        Comment commentEntity = null;
        if ((comment != null) && (comment.length() > 0)) {
            commentEntity = new Comment();
            commentEntity.generateId();
            commentEntity.setComment(comment);
            Principal p = request.getUserPrincipal();
            if (p != null) {
                List<? extends Object> params = Collections.<String>singletonList(p.getName());
                Map paramMap = Collections.singletonMap("name", params);
                Collection<Nbuser> col = PersistenceUtils.getInstance().find(Nbuser.class, paramMap);
                if (!col.isEmpty()) {
                    Nbuser nbuser = col.iterator().next();
                    commentEntity.setNbuserId(nbuser);
                }
                commentEntity.setSubmitId(submit);
                submit.getCommentCollection().add(commentEntity);
            }
            merge = true;
        }
View Full Code Here

        sbm.setSummary("summary");
        sbm.setVmId(vm);
        sbm.setOperatingsystemId(os);
        em.persist(sbm);

        Comment comment = new Comment();
        comment.generateId();
        comment.setComment("Test Comment");
        comment.setNbuserId(user);
        comment.setSubmitId(sbm);
        em.persist(comment);

        return sbm;
    }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.exceptions.entity.Comment

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.