Package org.netbeans.modules.exceptions.entity

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


                result = query.getResultList();
            } else {
                List<Report> reports = query.getResultList();
                result = new ArrayList<Exceptions>(reports.size());
                for (Report report : reports) {
                    Exceptions exc =  report.getExceptionsCollection(em).iterator().next();
                    result.add(exc);
                }
            }
        } finally {
            em.close();
View Full Code Here


        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Report r1 = new Report(1);
        Report r2 = new Report(2);
        Report r3 = new Report(3);
        Exceptions exc1 = new Exceptions(1);
        Exceptions exc2 = new Exceptions(2);
        Exceptions exc3 = new Exceptions(3);
        exc1.setReportId(r1);
        exc2.setReportId(r2);
        exc3.setReportId(r3);
        r1.setIssueId(ISSUE_ID);
        r2.setIssueId(ISSUE_ID);
        r3.setIssueId(ISSUE_ID);
        em.persist(r1);
        em.persist(r2);
View Full Code Here

        }
        assertEquals("EXCEPTION STATUS", new Integer(10), Report.Status.getInteger(set));
       
       
        System.out.println("testInsertExceptions");
        Exceptions exc = new Exceptions();
        Report report = new Report();
        report.setId(1);
        exc.setId(1);
        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);
View Full Code Here

    }
   
    public void testFindExceptionCandidates(){
        String mainSummary = "SUMMARY";
        String secondSummary = "SECOND SUMMARY";
        Exceptions except = new Exceptions();
        Report report = new Report(5);
        except.setReportId(report);
        report.setIssueId(0);
        except.setId(5);
        except.setSummary(mainSummary);
        persUtil.persist(report);
        persUtil.persist(except);
        for (int i = 0; i < 9; i++){
            Exceptions exc2 = new Exceptions();
            exc2.setId(i+6);
            exc2.setSummary(secondSummary);
            exc2.setReportId(report);
            persUtil.persist(exc2);
        }
        List<Report> result = persUtil.findExceptionCandidates(9);
        assertEquals("NUMBER OF CANDIDATES", 1, result.size());
//        assertEquals("CANDIDATE ISSUE", mainSummary, result.get(0).getSummary());
        result = persUtil.findExceptionCandidates(10);
        assertEquals("NUMBER OF CANDIDATES", 0, result.size());
       
        Exceptions exc2 = new Exceptions();
        exc2.setId(20);
        exc2.setSummary(secondSummary);
        exc2.setReportId(report);
        persUtil.persist(exc2);
        result = persUtil.findExceptionCandidates(10);
        assertEquals("NUMBER OF CANDIDATES", 1, result.size());
       
    }
View Full Code Here

    public void testExceptionsIsOpen(){
        MockServices.setServices(LogReporter.class);
        EntityManager em = persUtil.createEntityManager();
        em.getTransaction().begin();

        Exceptions exc = new Exceptions(100);
        Report report = new Report(100);
        exc.setReportId(report);
        assertTrue(PersistenceUtils.exceptionIsOpen(exc));

        report.setIssueId(0);
        assertTrue(PersistenceUtils.exceptionIsOpen(exc));
View Full Code Here

    public void testStacktraceFormat() throws Exception {
        File log = LogsManagerTest.extractResourceAs(StacktraceFormatTest.class, data, "formatterTest", "NB2040811605");
        addLog(log, "NB2040811605");
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Exceptions exc = em.find(Exceptions.class, 1);
        assertNotNull(exc);
        Stacktrace stack = exc.getStacktrace();
        String result = new String(Utils.format(stack));
        em.getTransaction().commit();
        em.close();

        assertTrue(result.contains("NullPointerException"));
View Full Code Here

        addNext(117817, true, 1);//ID 4
        processReopenHandler();

        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Exceptions exc1 = em.find(Exceptions.class, 1);
        Exceptions exc2 = em.find(Exceptions.class, 2);
        Exceptions exc3 = em.find(Exceptions.class, 3);
        Exceptions exc4 = em.find(Exceptions.class, 4);
        List<Submit> col1 = exc1.getReportId().getSubmitCollection();
        assertTrue(col1.contains(exc3));
        assertFalse(col1.contains(exc4));
        assertEquals(2, col1.size());
View Full Code Here

       
        addNext(5, true, 5);//ID 6
        //
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Exceptions exc6 = em.find(Exceptions.class, 6);
        Report r2 = new Report(Utils.getNextId(Report.class));
        em.persist(r2);
        exc6.setReportId(r2);
        em.merge(exc6);
        em.getTransaction().commit();
        em.close();

        addNext(2, true, 5);//ID 7
        processReopenHandler();

        em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Exceptions exc7 = em.find(Exceptions.class, 7);
        assertEquals("Open duplicate exists", r2, exc7.getReportId());
        em.getTransaction().commit();
        em.close();

    }
View Full Code Here

    }

    private void processReopenHandler() {
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Exceptions exc = em.find(Exceptions.class, excData.getSubmitId());
        em.getTransaction().commit();

        em.getTransaction().begin();
        exc = (Exceptions) ReopenHandler.createHandler(exc).process(em);
        em.getTransaction().commit();
View Full Code Here

    }

    private void verifyIssueChecking(){
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Exceptions exc = em.find(Exceptions.class, excData.getSubmitId());
        Throwable thr = exc.getMockThrowable();
        assertNotNull(Utils.checkOpenIssues(em, thr));


        assertNotNull(Utils.checkIssue(em, thr));
        assertNull(Utils.checkOpenIssues(em, thr));
View Full Code Here

TOP

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

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.