new FileOfClasses( new ByteArrayInputStream(DEFAULT_EXCLUSIONS.getBytes(StandardCharsets.UTF_8)))); if (jarIS != null) scope.addInputStreamForJarToScope(ClassLoaderReference.Application, jarIS); else AnalysisScopeReader.addClassPathToScope(inPath, scope, ClassLoaderReference.Application); AnalysisOptions options = new AnalysisOptions(scope, null);
@Test public void testJarInputStream() throws IOException, ClassHierarchyException { AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), AnalysisScopeTest.class.getClassLoader()); // assumes com.ibm.wala.core.tests is the current working directory Path bcelJarPath = Paths.get( System.getProperty("user.dir"), "..", "com.ibm.wala.core.testdata", "bcel-5.2.jar" ); scope.addInputStreamForJarToScope(ClassLoaderReference.Application, new FileInputStream (bcelJarPath.toString())); ClassHierarchy cha = ClassHierarchyFactory.make(scope); Assert.assertNotNull("couldn't find expected class", cha.lookupClass( TypeReference.findOrCreate(ClassLoaderReference.Application, "Lorg/apache/bcel/verifier/Verifier"))); } }