Package org.netbeans.server.componentsmatch

Examples of org.netbeans.server.componentsmatch.Component


    }

    @Test
    public void testSuspicousMethodWithMapping5() throws IOException{
        setUp("snapshot-277203.nps");
        doTest("org.netbeans.modules.versioning.system.cvss.CvsVisibilityQuery.isHiddenFolder", new Component("cvs", "code"));

    }
View Full Code Here


    }

    @Test
    public void testSuspicousMethodWithMapping6() throws IOException{
        setUp("snapshot-269341.nps");
        doTest("org.netbeans.modules.versioning.system.cvss.util.Utils.containsMetadata", new Component("cvs", "code"));
    }
View Full Code Here

        em = perUtils.createEntityManager();
        em.getTransaction().begin();
        MethodItem mi = sm.getSuspiciousMethodItem(em);
        assertEquals("correct method", correctMethod, mi.getMethodName());
        Component cmp = sm.getComponent(em);
        assertEquals("correct component", expectedComp, cmp);
        em.getTransaction().commit();
        em.close();
    }
View Full Code Here

        return nbuser;
    }

    private Component doComponentChecking(EntityManager em){
        // get component from comment
        Component comp = getComponentFromComment(preparedParams.getComment());
        // use unknown component for STACK OVERFLOW ISSUE 112156
        if ((comp == null) && (thrown.getMessage().contains("StackOverflowError"))) {// NOI18N
            comp = Component.UNKNOWN;
        }else if (comp == null) {
            comp = Matcher.getDefault().match(em, thrown);
View Full Code Here

            String comp = comment.substring(1, slashIndex);
            String subcomp = comment.substring(slashIndex + 1, endIndex);

            Components realComps = PersistenceUtils.getInstance().getComponents();
            if (realComps.getComponentsSet().contains(comp) && realComps.getSubcomponentsSet(comp).contains(subcomp)) {
                return new Component(comp, subcomp);
            }
        }
        return null;
    }
View Full Code Here

        }
        sn.setSuspiciousMethod(method);
        Report report = prepareReport(em, sn);

        // get component from comment
        Component comp = getComponentFromComment(preparedParams.getComment());
        if (comp == null){
            comp = checker.getComponentForSlowness();
        }
        if (comp == null || comp.equals(Component.UNKNOWN)) {
            comp = Component.UNKNOWN_SLOWNESS;
        }
        report.setComponent(comp);
        sn.setReportId(report);
        em.persist(sn);
View Full Code Here

        exc.setVmId(getVm(em, preparedParams.getVm()));
        exc.setOperatingsystemId(getOperatingsystem(em, preparedParams.getOs()));
        exc.setBuild(logFile.getBuildnumber());
        exc.setNbuserId(nbuser);
        Report report = prepareReport(em, exc);
        Component comp = doComponentChecking(em);
        report.setComponent(comp);
        exc.setReportId(report);
        exc.setReportdate(new Date());
        em.persist(exc);
        em.merge(report);
View Full Code Here

   
    @Test
    public void testGetComponentFromComment() throws Exception {
        String comment = "[javaee/JSP] \n this is my comment";
        Component comp = DbInsertion.getComponentFromComment(comment);
        assertEquals("javaee", comp.getComponent());
        assertEquals("JSP", comp.getSubComponent());

        comment = "unknown/nnnnnnnnnnnnn";
        comp = DbInsertion.getComponentFromComment(comment);
        assertNull("NO BRACKETS", comp);
View Full Code Here

        assertEquals("java.awt.EventDispatchThread.pumpEvents", ml.get(1).getMethodName());
        assertEquals("org.openide.nodes.ChildrenArray.nodesFor", ml.get(ml.size() - 1).getMethodName());
        EntityManager em = perUtils.createEntityManager();
        MethodItem mi = sm.getSuspiciousMethodItem(em);
        assertEquals("org.openide.nodes.ChildrenArray.nodesFor", mi.getMethodName());
        Component co = sm.getComponent(em);
        assertEquals("openide", co.getComponent());
        assertEquals("nodes", co.getSubComponent());
        em.close();
    }
View Full Code Here

        setUp("res/viewmodel_component.nps");
        perUtils.persist(new InnocentClass("org.netbeans.core.TimableEventQueue"));
        Matcher.getDefault().reload();
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Component comp = sm.getComponent(em);
        em.getTransaction().commit();
        em.close();
        assertEquals("java and loader classes are ignored", new Component("debuggercore", "code"), comp);

        em = perUtils.createEntityManager();
        em.getTransaction().begin();
        em.persist(new InnocentClass("org.openide.filesystems.FileUtil"));
        em.persist(new InnocentClass("URLMapper"));
        em.getTransaction().commit();
        em.close();
        Matcher.getDefault().reload();

        setUp("res/url_mapper.nps");
        em = perUtils.createEntityManager();
        em.getTransaction().begin();
        comp = sm.getComponent(em);
        em.getTransaction().commit();
        em.close();
        assertEquals("java and loader classes are ignored", new Component("editor", "code"), comp);

        setUp("res/heapdump.nps");
        em = perUtils.createEntityManager();
        em.getTransaction().begin();
        comp = sm.getComponent(em);
        em.getTransaction().commit();
        em.close();
        assertEquals("java and loader classes are ignored", new Component("openide", "actions"), comp);
    }
View Full Code Here

TOP

Related Classes of org.netbeans.server.componentsmatch.Component

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.