diff --git a/src/test/kotlin/org/openrewrite/maven/MavenRecipeTest.kt b/src/test/kotlin/org/openrewrite/maven/MavenRecipeTest.kt deleted file mode 100644 index 4bc49af752..0000000000 --- a/src/test/kotlin/org/openrewrite/maven/MavenRecipeTest.kt +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2021 the original author or authors. - *
- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *
- * https://www.apache.org/licenses/LICENSE-2.0 - *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.openrewrite.maven
-
-import org.assertj.core.api.Assertions
-import org.intellij.lang.annotations.Language
-import org.junit.jupiter.api.fail
-import org.openrewrite.*
-import org.openrewrite.java.JavaParser
-import org.openrewrite.maven.tree.Maven
-import org.openrewrite.scheduling.ForkJoinScheduler
-import java.util.*
-import java.util.concurrent.Callable
-import java.util.concurrent.CompletableFuture
-import java.util.concurrent.ForkJoinPool
-
-/**
- * Test harness for maven-base recipes. The assertChanged/assertUnchanged expect before/after to be maven pom files and
- * both methods provide the ability to add additional java and pom files to test for the presence of parent poms and
- * dependent types in the Java source.
- */
-interface MavenRecipeTest {
- val recipe: Recipe?
- get() = null
-
- val treePrinter: TreePrinter<*>?
- get() = null
-
- val javaParser: JavaParser
- get() = JavaParser.fromJavaVersion()
- .logCompilationWarningsAndErrors(true)
- .build()
-
- val mavenParser : MavenParser
- get() = MavenParser.builder().build()
-
- fun assertChanged(
- javaPaser : JavaParser = this.javaParser,
- mavenParsre : MavenParser = this.mavenParser,
- @Language("XML") before: String,
- @Language("XML") after: String,
- additionalJavaFiles : Array scheduleVisit(
- recipe: Recipe,
- before: MutableList,
- ctx: ExecutionContext,
- recipeThatDeletedSourceFile: MutableMap {
- ctx.putMessage("cyclesThatResultedInChanges", cyclesThatResultedInChanges)
- val afterList = delegate.scheduleVisit(recipe, before, ctx, recipeThatDeletedSourceFile)
- if (afterList !== before) {
- cyclesThatResultedInChanges = cyclesThatResultedInChanges.inc()
- if (cyclesThatResultedInChanges > expectedCyclesThatMakeChanges &&
- before.isNotEmpty() && afterList.isNotEmpty()
- ) {
- Assertions.assertThat(afterList[0]!!.printTrimmed())
- .`as`(
- "Expected recipe to complete in $expectedCyclesThatMakeChanges cycle${if (expectedCyclesThatMakeChanges == 1) "" else "s"}, " +
- "but took at least one more cycle. Between the last two executed cycles there were changes."
- )
- .isEqualTo(before[0]!!.printTrimmed())
- }
- }
- return afterList
- }
-
- fun verify() {
- if (cyclesThatResultedInChanges != expectedCyclesThatMakeChanges) {
- fail("Expected recipe to complete in $expectedCyclesThatMakeChanges cycle${if (expectedCyclesThatMakeChanges > 1) "s" else ""}, but took $cyclesThatResultedInChanges cycle${if (cyclesThatResultedInChanges > 1) "s" else ""}.")
- }
- }
- }
-
-}
\ No newline at end of file