ParameterizedRunnerToParameterized update to account for test class inheritance

オープン
#91 コメント 5 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@MBoegers がすでに取り組んでいます。

2024年6月18日 から。

評価

この issue はまだ評価されていません。

説明

recipe

Discovered while applying JUnit4To5Migration on Antlr

For tests classes that inherit from a superclass and have a constructor which invokes the superclass constructor:

  • compare super constructor parameters with the MethodSource parameters
  • modify super constructor if necessary
  • add init method to class and superclass if necessary

before:

public class BaseRuntimeTest {
        public BaseRuntimeTest(RuntimeTestDescriptor descriptor, RuntimeTestSupport delegate) {
		this.descriptor = descriptor;
		this.delegate = delegate;
	}
}
public class TestPerformance extends BaseRuntimeTest {
	public TestPerformance(RuntimeTestDescriptor descriptor) {
		super(descriptor,new BaseGoTest());
	}
}

after:

public class BaseRuntimeTest {
        public BaseRuntimeTest(RuntimeTestSupport delegate) {
		this.delegate = delegate;
	}

	public void initBaseRuntimeTest(RuntimeTestDescriptor descriptor){
		this.descriptor = descriptor;
	}
}
public class TestPerformance extends BaseRuntimeTest {

	public TestPerformance() {
		super(new BaseGoTest());
	}

	public void initTestPerformance(RuntimeTestDescriptor descriptor) {
		initBaseRuntimeTest(descriptor);
	}
}

e.g. Antlr4-TestPerformance

主要言語
Java
スター
100
フォーク
109
平均マージ
3時間 52分
マージ済み PR(30日)
83

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openrewrite/rewrite-testing-frameworks のほかの issue

openrewrite/rewrite-testing-frameworks の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。