Package org.netbeans.modules.exceptions.entity

Examples of org.netbeans.modules.exceptions.entity.Submit$SubmitImpl


        iss.setResolution("FIXED");
        iss.setIssueStatus("RESOLVED");

        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Submit sb = em.find(Submit.class, excData.getSubmitId());
        sb.getReportId().setIssueId(1000);
        em.merge(sb);
        em.getTransaction().commit();
        em.close();

        addNext(4, false, 0);
View Full Code Here


        super.tearDown();
    }

    @Test
    public void testReportIssue() throws IOException {
        Submit sbm = reportSubmit(1);
        Issue issue = bzr.getIssue(issueid);
        assertEquals(new Integer(1), issue.getReporterSubmitId());
        assertEquals("summary", issue.getShortDesc());
        assertNotNull(issue.getKeywords());
        assertTrue(issue.getStatusWhiteboard().contains("EXCEPTIONS_REPORT"));
View Full Code Here

        bzr.createAttachment(sbm, null);
    }

    @Test
    public void testReportWithCCAndMessage() throws IOException{
        Submit sbm = prepareData(em, 1);
        closeEM();

        bzr.reportSubmit(sbm, null, "Extra message to add", SOME_EXISTING_USERS[2] + "@testnetbeans.org");

        createEM();
        sbm = em.find(Submit.class, 1);
        issueid = sbm.getReportId().getIssueId();
        assertNotNull(issueid);
        assertTrue(issueid != 0);
    }
View Full Code Here

        assertTrue(issueid != 0);
    }

    @Test
    public void testCreateWithCCs() throws IOException {
        Submit sbm = prepareData(em, 1);
        em.merge(sbm);

        Submit sbm2 = prepareData(em, 2);
        sbm2.setReportId(sbm.getReportId());
        em.merge(sbm2);

        Submit sbm3 = prepareData(em, 3);
        sbm3.setReportId(sbm.getReportId());
        em.merge(sbm3);
        closeEM();

        bzr.reportSubmit(sbm, null, null, sbm.getNbuserId().getName());
View Full Code Here

    }

    @Test
    public void testFilterOpen() throws IOException {
        List<Integer> allSubmits = new ArrayList<Integer>();
        Submit first = em.find(Submit.class, 1);
        if (first == null) {
            first = reportSubmit(1);
        }
        allSubmits.add(first.getReportId().getIssueId());
        Submit next = reportSubmit(2);
        allSubmits.add(next.getReportId().getIssueId());
        next = reportSubmit(3);
        allSubmits.add(next.getReportId().getIssueId());
        next = reportSubmit(4);
        allSubmits.add(next.getReportId().getIssueId());

        Collection<Integer> filtered = bzr.filterOpen(allSubmits);
        assertEquals(4, filtered.size());

        BugzillaReporterImpl bri = new BugzillaReporterImpl();
View Full Code Here

        assertNotNull(issue.getDuplicateOf());
        assertEquals(11533, issue.getDuplicateOf().intValue());
    }

    private Submit reportSubmit(int id) throws IOException {
        Submit sbm = prepareData(em, id);
        closeEM();

        bzr.reportSubmit(sbm, null);

        createEM();
        sbm = em.find(Submit.class, id);
        issueid = sbm.getReportId().getIssueId();
        assertNotNull(issueid);
        assertTrue(issueid != 0);
        return sbm;
    }
View Full Code Here

        Report r = new Report(i);
        r.setComponent("ide");
        r.setSubcomponent("Code");
        em.persist(r);
        Submit sbm;
        if (isSlowness) {
            Method m = new Method(i);
            m.setName("test" + i);
            em.persist(m);

            Slowness slowness = new Slowness(i);
            slowness.setActionTime(Long.valueOf(i));
            slowness.setSuspiciousMethod(m);
            sbm = slowness;
        } else {
            Stacktrace stack = new Stacktrace(i);
            stack.setMessage("Something is wrong");
            em.persist(stack);
            Exceptions exc = new Exceptions(i);
            exc.setStacktrace(stack);
            sbm = exc;
        }
        sbm.setReportId(r);
        sbm.setNbuserId(user);
        sbm.setLogfileId(lf);
        sbm.setSummary("summary");
        sbm.setVmId(vm);
        sbm.setOperatingsystemId(os);
        em.persist(sbm);

        Comment comment = new Comment();
        comment.generateId();
        comment.setComment("Test Comment");
View Full Code Here

        final int id = submit.getId();
        org.netbeans.web.Utils.processPersistable(new Persistable.Transaction() {

            public TransactionResult runQuery(EntityManager em) {
                try {
                    Submit thisSubmit = em.find(submit.getClass(), id);
                    if (thisSubmit == null) {
                        throw new IllegalStateException("Submit id " + id + " was not found");
                    }
                    Report report = thisSubmit.getReportId();
                    if (report.isInIssuezilla()){
                        // stop insertion
                        return TransactionResult.ROLLBACK;
                    }
                    int bugId = delegate.reportSubmit(thisSubmit.getSubmit(em), password, extraComment, extraCC);
                    report.setIssueId(bugId, BugzillaReporter.class);
                    report = em.merge(report);
                    return TransactionResult.COMMIT;
                } catch (Exception e) {
                    String message = "Bug was not created for report #" + id;
View Full Code Here

            id = new Integer(idParam);
        } catch (NumberFormatException e) {
            request.setAttribute("error", "Issue id is not set correctly - you have probably used wrong link");
            return mapping.findForward(ERROR);
        }
        Submit submit = Submit.getById(em, id);
        if (submit == null) {
            LOG.log(Level.WARNING, "Cannot find exceptions instance with id {0}", id);
            response.setHeader("Refresh", "30"); // refresh the page in 30s
            return mapping.findForward(PLEASE_WAIT);
        }

        // make updates
        boolean merge = false;
        if ((newissuezillaid != null) && (submit != null)) {
            submit.getReportId().setIssueId(newissuezillaid, getClass());
            submit.getReportId().setIssueManChanged(true);
            merge = true;
        }

        if ((newduplicateof != null) && (submit != null)) {
            Submit duplExc = null;
            if (newduplicateof != null) {
                duplExc = Submit.getById(em, newduplicateof);
            }
            submit.setReportId(duplExc.getReportId());
            submit.getReportId().setDuplicateManChanged(true);
            merge = true;
        }

        if ((subcomponent != null) && (subcomponent.length() > 0) && (component != null) && (component.length() > 0)) {
View Full Code Here

            Integer duplicateId = Integer.parseInt(iss.trim());
            ids.add(duplicateId);
        }
        if (setComponent){
            Collections.sort(ids);
            Submit sbm = Submit.getById(em, ids.get(ids.size() -1 ));
            report.setComponent(sbm.getReportId().getComponent());
            report.setSubcomponent(sbm.getReportId().getSubcomponent());
        }
        for (Integer id : ids) {
            Submit sbm = Submit.getById(em, id);
            sbm.setReportId(report);
            sbm.getReportId().setDuplicateManChanged(true);
            redirected.add(em.merge(sbm));
        }
        return redirected;
    }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.exceptions.entity.Submit$SubmitImpl

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.