Package com.vaadin.flow.testutil
Class ClassFinder
- java.lang.Object
-
- com.vaadin.flow.testutil.ClassFinder
-
- Direct Known Subclasses:
ClassesSerializableTest
public abstract class ClassFinder extends Object
Superclass for testing classes which need to scan project's classpath.- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description ClassFinder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>findServerClasses(String classpathEntry, Collection<Pattern> excludes)Finds the server side classes/interfaces under a class path entry - either a directory or a JAR that matchesgetJarPattern().protected Stream<String>getBasePackages()protected PatterngetJarPattern()JARs that will be scanned for classes to test, in addition to classpath directories.protected static List<String>getRawClasspathEntries()Lists all class path entries by splitting the class path string.protected static booleanisFunctionalType(Type type)protected booleanisTestClass(Class<?> cls)protected booleanisTestClassPath(String classPath)
-
-
-
Method Detail
-
isTestClassPath
protected boolean isTestClassPath(String classPath)
-
isFunctionalType
protected static boolean isFunctionalType(Type type)
-
getRawClasspathEntries
protected static List<String> getRawClasspathEntries()
Lists all class path entries by splitting the class path string.Adapted from ClassPathExplorer.getRawClasspathEntries(), but without filtering.
- Returns:
- List of class path segment strings
-
getJarPattern
protected Pattern getJarPattern()
JARs that will be scanned for classes to test, in addition to classpath directories.- Returns:
- the compiled pattern
-
isTestClass
protected boolean isTestClass(Class<?> cls)
-
findServerClasses
protected List<String> findServerClasses(String classpathEntry, Collection<Pattern> excludes) throws IOException
Finds the server side classes/interfaces under a class path entry - either a directory or a JAR that matchesgetJarPattern().Only classes under
getBasePackages()are considered, and those matchingexcludesare filtered out.- Throws:
IOException
-
-