Top Description Fields Constructors Methods
org.testng.internal

public Class PackageUtils

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

Utility class that finds all the classes in a given package.

Created on Feb 24, 2006

Author
Cedric Beust

Field Summary

Modifier and TypeField and Description
private static final Collection<ClassLoader>
classLoaders

The additional class loaders to find classes in.

private static String[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static Function<ClassLoader, Stream<URL>>
asURLs(String packageDir)

public static String[]

Returns:

- The list of all the classes inside this package
findClassesInPackage
(String
- The package name
packageName
,
List<String>
- The inclusion list.
included
,
List<String>
- The exclusion list
excluded
)

private static String[]
private static boolean
matchTestClasspath(URL url, String lastFragment, boolean recursive)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoadersback to summary
private static final Collection<ClassLoader> classLoaders

The additional class loaders to find classes in.

testClassPathsback to summary
private static String[] testClassPaths

Constructor Detail

PackageUtilsback to summary
private PackageUtils()

Method Detail

asURLsback to summary
private static Function<ClassLoader, Stream<URL>> asURLs(String packageDir)
findClassesInPackageback to summary
public static String[] findClassesInPackage(String packageName, List<String> included, List<String> excluded) throws IOException
Parameters
packageName:String

- The package name

included:List<String>

- The inclusion list.

excluded:List<String>

- The exclusion list

Returns:String[]

- The list of all the classes inside this package

Exceptions
IOException:
- if there is an exception.
getTestClasspathback to summary
private static String[] getTestClasspath()
matchTestClasspathback to summary
private static boolean matchTestClasspath(URL url, String lastFragment, boolean recursive)