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 Details

    • ClassFinder

      public ClassFinder()
  • Method Details

    • 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
    • getBasePackages

      protected Stream<String> getBasePackages()
    • 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 matches getJarPattern().

      Only classes under getBasePackages() are considered, and those matching excludes are filtered out.

      Throws:
      IOException