SourceFileScope extends AbstractJavaScope { public String getPackageName() { return packageImage; } SourceFileScope(final ClassLoader classLoader);  SourceFileScope(final ClassLoader classLoader, final String packageImage); void configureImports(final List<ASTImportDeclaration> imports); Set<String> getExplicitImports(); boolean hasAuxclasspath(); Class<?> resolveType(String name); String getPackageName(); @Override void addDeclaration(NameDeclaration declaration); Map<ClassNameDeclaration, List<NameOccurrence>> getClassDeclarations(); @Override String toString(); ClassNameDeclaration findClassNameDeclaration(String name); Map<String, Node> getQualifiedTypeNames();  }
@Test public void testPackageIsEmptyString() { ASTCompilationUnit acu = parseCode(TEST1); assertEquals(acu.getScope().getEnclosingScope(SourceFileScope.class).getPackageName(), ""); }
@Test public void testPackageNameFound() { ASTCompilationUnit acu = parseCode(TEST2); assertEquals(acu.getScope().getEnclosingScope(SourceFileScope.class).getPackageName(), "foo.bar"); }