Skip to content

Commit

Permalink
fixes #975
Browse files Browse the repository at this point in the history
  • Loading branch information
fabapp2 committed Oct 19, 2023
1 parent f8cac7c commit 1af2236
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public List<SourceFile> processMainSources(
mainProjectProvenance.add(sourceSet("main", dependencies, typeCache));

// FIXME: 945 Why target and not all main?
List<Path> parsedJavaPaths = mainJavaSources.stream().map(ResourceUtil::getPath).toList();
List<Path> parsedJavaPaths = javaSourcesInTarget.stream().map(ResourceUtil::getPath).toList();
Stream<SourceFile> parsedJava = cus.map(addProvenance(baseDir, mainProjectProvenance, parsedJavaPaths));
log.debug("[%s] Scanned %d java source files in main scope.".formatted(currentProject, mainJavaSources.size()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
* @author Fabian Krüger
*/
@SpringBootTest(classes = {SbmSupportRewriteConfiguration.class, SbmTestConfiguration.class})
@Issue("https://github.com/spring-projects-experimental/spring-boot-migrator/issues/975")
public class CompareParserRecipeRunTest {

@Autowired
Expand All @@ -58,9 +57,8 @@ public class CompareParserRecipeRunTest {
private ExecutionContext executionContext;

@Test
@DisplayName("runningRecipe")
@ExpectedToFail("FIXME: #975")
void runningRecipe() {
@DisplayName("Running a recipe with RewriteMavenParser should yield the same result as with RewriteProjectParser")
void runningARecipeWithRewriteMavenParserYieldsTheSameResultAsWithRewriteProjectParser() {
Path baseDir = TestProjectHelper.getMavenProject("parser-recipe-run");
RewriteProjectParsingResult sutParsingResult = sut.parse(baseDir);
RewriteProjectParsingResult compParsingResult = comparingParser.parse(baseDir);
Expand Down Expand Up @@ -105,7 +103,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
// Run Parser independent from Maven
counter.setRelease(0);
RecipeRun sutRecipeRun = recipe.run(new InMemoryLargeSourceSet(sutParsingResult.sourceFiles()), executionContext);
assertThat(counter.get()).isEqualTo(3); // differs, should be 2
assertThat(counter.get()).isEqualTo(2); // differs, should be 2
assertThat(sutRecipeRun.getChangeset().getAllResults()).hasSize(1); // is 0
}

Expand Down

0 comments on commit 1af2236

Please sign in to comment.