@Test public void testFindGlobs() throws IOException, LogAbortException { Map<String, ClassReader> zipClasses = new TreeMap<String, ClassReader>(); Map<String, InputStream> filesFound = new TreeMap<String, InputStream>(); mAa.parseZip(mOsJarPath, zipClasses, filesFound); TreeMap<String, ClassReader> found = new TreeMap<String, ClassReader>(); found.clear(); mAa.findGlobs("mock_android.view", zipClasses, found); assertArrayEquals(new String[] { }, found.keySet().toArray()); mAa.findGlobs("mock_android.*.*Group$*Layout*", zipClasses, found); assertArrayEquals(new String[] { "mock_android.view.ViewGroup$LayoutParams", "mock_android.view.ViewGroup$MarginLayoutParams" }, found.keySet().toArray()); mAa.findGlobs("mock_android.**Group*", zipClasses, found); assertArrayEquals(new String[] { "mock_android.view.ViewGroup", "mock_android.view.ViewGroup$LayoutParams", "mock_android.view.ViewGroup$MarginLayoutParams" }, found.keySet().toArray()); found.clear(); mAa.findGlobs("mock_android.view.View", zipClasses, found); assertArrayEquals(new String[] { "mock_android.view.View" }, found.keySet().toArray()); found.clear(); mAa.findGlobs("mock_android.view.*", zipClasses, found); assertArrayEquals(new String[] { "mock_android.view.View", "mock_android.view.ViewGroup", "mock_android.view.ViewGroup$LayoutParams", "mock_android.view.ViewGroup$MarginLayoutParams" }, found.keySet().toArray()); for (String key : found.keySet()) { ClassReader value = found.get(key); assertNotNull("No value for " + key, value); assertEquals(key, AsmAnalyzer.classReaderToClassName(value)); } }
void findGlobs(String globPattern, Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutFound) throws LogAbortException { Pattern regexp = getPatternFromGlob(globPattern); for (Entry<String, ClassReader> entry : zipClasses.entrySet()) { String class_name = entry.getKey(); if (regexp.matcher(class_name).matches() && !mExcludedClasses.contains(getOuterClassName(class_name))) { findClass(class_name, zipClasses, inOutFound); } } }
AsmAnalyzer { void findGlobs(String globPattern, Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutFound) throws LogAbortException { Pattern regexp = getPatternFromGlob(globPattern); for (Entry<String, ClassReader> entry : zipClasses.entrySet()) { String class_name = entry.getKey(); if (regexp.matcher(class_name).matches() && !mExcludedClasses.contains(getOuterClassName(class_name))) { findClass(class_name, zipClasses, inOutFound); } } } }
AsmAnalyzer { void findGlobs(String globPattern, Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutFound) throws LogAbortException { Pattern regexp = getPatternFromGlob(globPattern); for (Entry<String, ClassReader> entry : zipClasses.entrySet()) { String class_name = entry.getKey(); if (regexp.matcher(class_name).matches() && !mExcludedClasses.contains(getOuterClassName(class_name))) { findClass(class_name, zipClasses, inOutFound); } } } AsmAnalyzer(Log log, List<String> osJarPath, AsmGenerator gen,
            String[] deriveFrom, String[] includeGlobs, Set<String> excludeClasses,
            String[] includeFileGlobs); }
AsmAnalyzer { void findGlobs(String globPattern, Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutFound) throws LogAbortException { Pattern regexp = getPatternFromGlob(globPattern); for (Entry<String, ClassReader> entry : zipClasses.entrySet()) { String class_name = entry.getKey(); if (regexp.matcher(class_name).matches() && !mExcludedClasses.contains(getOuterClassName(class_name))) { findClass(class_name, zipClasses, inOutFound); } } } AsmAnalyzer(Log log, List<String> osJarPath, AsmGenerator gen,
            String[] deriveFrom, String[] includeGlobs, Set<String> excludeClasses,
            String[] includeFileGlobs); void analyze(); }
AsmAnalyzer { void findGlobs(String globPattern, Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutFound) throws LogAbortException { Pattern regexp = getPatternFromGlob(globPattern); for (Entry<String, ClassReader> entry : zipClasses.entrySet()) { String class_name = entry.getKey(); if (regexp.matcher(class_name).matches() && !mExcludedClasses.contains(getOuterClassName(class_name))) { findClass(class_name, zipClasses, inOutFound); } } } AsmAnalyzer(Log log, List<String> osJarPath, AsmGenerator gen,
            String[] deriveFrom, String[] includeGlobs, Set<String> excludeClasses,
            String[] includeFileGlobs); void analyze();  }