Package org.openquark.cal.filter

Examples of org.openquark.cal.filter.RegExpBasedUnqualifiedNameFilter


    }
   
    /** Test that regular expression filtering is working */
    public void testReferenceFrequencyRegexpFiltering() {
        Map<Pair<QualifiedName, QualifiedName>, Integer> unfilteredMap = SourceMetricFinder.computeReferenceFrequencies(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false);
        Map<Pair<QualifiedName, QualifiedName>, Integer> filteredMap = SourceMetricFinder.computeReferenceFrequencies(moduleDefn, moduleTypeInfo, new RegExpBasedUnqualifiedNameFilter(".*Examples", true), false);

        int unfilteredFrequency = 0;
        int filteredFrequency = 0;
       
        // Extract reference frequency for leaf8
View Full Code Here


    }

    /** Test regexp-filtering in compositional-frequency computation */
    public void testCompositionalFrequencyRegexpFiltering() {
        Map<Pair<QualifiedName, QualifiedName>, Integer> unfilteredFrequencies = SourceMetricFinder.computeCompositionalFrequencies(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false);
        Map<Pair<QualifiedName, QualifiedName>, Integer> filteredFrequencies = SourceMetricFinder.computeCompositionalFrequencies(moduleDefn, moduleTypeInfo, new RegExpBasedUnqualifiedNameFilter("(.*test.*)|(.*Examples.*)", true), false);

        assertEquals(1, getCompositionalFrequency(filteredFrequencies, "callerC5", "mangleValue"));
        assertEquals(3, getCompositionalFrequency(unfilteredFrequencies, "callerC5", "mangleValue"));
    }
View Full Code Here

    }
   
    /** Test that function regular expression filtering is working */
    public void testLintWalkerRegexpFiltering() {
        List<LintWarning> unfilteredWarningsList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new AcceptAllQualifiedNamesFilter(), false, true, false, false, false, false);
        List<LintWarning> filteredWarningsList = SourceMetricFinder.computeLintWarnings(moduleDefn, moduleTypeInfo, new RegExpBasedUnqualifiedNameFilter("very.*", true), false, true, false, false, false, false);

        assertTrue(functionFlagged("veryLintyFunction", LintWarning.WarningType.UNPLINGED_PRIMITIVE_ARG, unfilteredWarningsList));
        assertFalse(functionFlagged("veryLintyFunction", LintWarning.WarningType.UNPLINGED_PRIMITIVE_ARG, filteredWarningsList));
    }
View Full Code Here

                  moduleFilter = new AcceptAllModulesFilter();
              }
             
              QualifiedNameFilter functionFilter;
              if (chooser.shouldExcludeFunctionsByRegexp()) {
                  functionFilter = new RegExpBasedUnqualifiedNameFilter(chooser.getExcludeFunctionsRegexp(), true);
              } else {
                  functionFilter = new AcceptAllQualifiedNamesFilter();
              }
             
              try {
View Full Code Here

                  moduleFilter = new AcceptAllModulesFilter();
              }
             
              QualifiedNameFilter functionFilter;
              if (chooser.shouldExcludeFunctionsByRegexp()) {
                  functionFilter = new RegExpBasedUnqualifiedNameFilter(chooser.getExcludeFunctionsRegexp(), true);
              } else {
                  functionFilter = new AcceptAllQualifiedNamesFilter();
              }
             
              try {
View Full Code Here

                    moduleFilter = new AcceptAllModulesFilter();
                }
               
                QualifiedNameFilter functionFilter;
                if (chooser.shouldExcludeFunctionsByRegexp()) {
                    functionFilter = new RegExpBasedUnqualifiedNameFilter(chooser.getExcludeFunctionsRegexp(), true);
                } else {
                    functionFilter = new AcceptAllQualifiedNamesFilter();
                }
               
                if(chooser.getOkSelected()) {
View Full Code Here

TOP

Related Classes of org.openquark.cal.filter.RegExpBasedUnqualifiedNameFilter

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.