Skip to content

Commit 09fd618

Browse files
committed
Delete bogus tests
1 parent 4d1b9d2 commit 09fd618

File tree

3 files changed

+13
-77
lines changed

3 files changed

+13
-77
lines changed

src/main/kotlin/org/openrewrite/RecipeLoader.kt

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import org.openrewrite.config.CategoryDescriptor
88
import org.openrewrite.config.Environment
99
import org.openrewrite.config.RecipeDescriptor
1010
import java.net.URI
11+
import java.net.URL
1112
import java.net.URLClassLoader
1213
import java.nio.file.Path
1314
import java.nio.file.Paths
@@ -17,7 +18,7 @@ import kotlin.io.path.toPath
1718
/**
1819
* Data class to hold both descriptors and recipes loaded from an environment
1920
*/
20-
data class EnvironmentData(
21+
private data class EnvironmentData(
2122
val recipeDescriptors: Collection<RecipeDescriptor>,
2223
val categoryDescriptors: Collection<CategoryDescriptor>,
2324
val recipes: Collection<Recipe>
@@ -45,12 +46,17 @@ class RecipeLoader {
4546
recipeSources: String,
4647
recipeClasspath: String
4748
): RecipeLoadResult {
48-
// Create classloader from classpath
49-
val classloader = createClassLoader(recipeClasspath)
50-
5149
// Parse recipe origins
5250
val recipeOrigins: Map<URI, RecipeOrigin> = RecipeOrigin.parse(recipeSources)
53-
51+
52+
// Create classloader from classpath
53+
val classloader = recipeClasspath.split(";")
54+
.map(Paths::get)
55+
.map(Path::toUri)
56+
.map(URI::toURL)
57+
.toTypedArray<URL>()
58+
.let { URLClassLoader(it) }
59+
5460
// Add manifest information
5561
addInfosFromManifests(recipeOrigins, classloader)
5662

@@ -66,19 +72,7 @@ class RecipeLoader {
6672
recipeOrigins = recipeOrigins
6773
)
6874
}
69-
70-
/**
71-
* Create a URLClassLoader from the classpath string
72-
*/
73-
private fun createClassLoader(recipeClasspath: String): ClassLoader {
74-
return recipeClasspath.split(";")
75-
.map(Paths::get)
76-
.map(Path::toUri)
77-
.map(URI::toURL)
78-
.toTypedArray()
79-
.let { URLClassLoader(it) }
80-
}
81-
75+
8276
/**
8377
* Process recipe jars in parallel and collect both descriptors and recipes
8478
*/

src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import com.github.difflib.DiffUtils
99
import com.github.difflib.patch.Patch
1010
import org.openrewrite.config.CategoryDescriptor
1111
import org.openrewrite.config.DeclarativeRecipe
12-
import org.openrewrite.config.Environment
1312
import org.openrewrite.config.RecipeDescriptor
1413
import org.openrewrite.internal.StringUtils
1514
import picocli.CommandLine
@@ -29,7 +28,6 @@ import java.util.*
2928
import java.util.regex.Pattern
3029
import java.util.stream.Collectors.joining
3130

32-
import kotlin.io.path.toPath
3331
import kotlin.system.exitProcess
3432

3533

@@ -122,11 +120,9 @@ class RecipeMarkdownGenerator : Runnable {
122120
"org.openrewrite.table.RecipeRunStats"
123121
)
124122

125-
private val recipeLoader = RecipeLoader()
126-
127123
override fun run() {
128124
// Load recipe details into memory
129-
val loadResult = recipeLoader.loadRecipes(recipeSources, recipeClasspath)
125+
val loadResult = RecipeLoader().loadRecipes(recipeSources, recipeClasspath)
130126
val recipeOrigins = loadResult.recipeOrigins
131127

132128
val outputPath = Paths.get(destinationDirectoryName)

src/test/kotlin/org/openrewrite/RecipeLoaderTest.kt

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)