Interface SparkTestUtils


public interface SparkTestUtils
  • Method Details

    • createURI

      URI createURI(String name)
    • createCompiledClass

      File createCompiledClass(String className, File destDir, SparkTestUtils.JavaSourceFromString sourceFile, scala.collection.immutable.Seq<URL> classpathUrls)
      Creates a compiled class with the source file. Class file will be placed in destDir.
    • createCompiledClass

      File createCompiledClass(String className, File destDir, String toStringValue, String baseClass, scala.collection.immutable.Seq<URL> classpathUrls, scala.collection.immutable.Seq<String> implementsClasses, String extraCodeBody, scala.Option<String> packageName)
      Creates a compiled class with the given name. Class file will be placed in destDir.
    • createJarWithJavaSources

      URL createJarWithJavaSources(scala.collection.immutable.Map<String,String> sources, File jarFile, scala.collection.immutable.Seq<URL> classpathUrls)
      Compile Java source code and package the resulting class files into a JAR. Supports classes with package declarations - the JAR will contain the proper directory structure (e.g., org/apache/spark/Foo.class).

      Parameters:
      sources - map of fully-qualified class name to Java source code
      jarFile - the JAR file to create
      classpathUrls - additional classpath URLs needed for compilation
      Returns:
      URL of the created JAR file
    • createJarWithScalaSources

      URL createJarWithScalaSources(scala.collection.immutable.Seq<File> sourceFiles, File jarFile, scala.collection.immutable.Seq<URL> classpathUrls, scala.collection.immutable.Seq<String> excludeClassPrefixes)
      Compile Scala source files and package the resulting class files into a JAR.

      Parameters:
      sourceFiles - Scala source files to compile
      jarFile - the JAR file to create
      classpathUrls - additional classpath URLs needed for compilation
      excludeClassPrefixes - class name prefixes to exclude from the JAR (e.g., Seq("A") excludes A.class, A$.class)
      Returns:
      (undocumented)
    • expandManifestClasspath

      scala.collection.immutable.Seq<URL> expandManifestClasspath(URL url)
      If url points to a "pathing JAR" (a JAR whose manifest declares a Class-Path attribute), return the URLs referenced by that attribute (resolved relative to the JAR's parent directory) followed by the original URL. Otherwise return the original URL unchanged.
      Parameters:
      url - (undocumented)
      Returns:
      (undocumented)
    • listFilesRecursively

      scala.collection.immutable.Seq<File> listFilesRecursively(File dir)