Update builds to support strictMode testing

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

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java

調査の方向性

Start by locating the Gradle and Maven build files and their existing test tasks, then determine how strictMode is configured and how the tests should be run twice. The issue does not name files or provide a verified implementation; completion requires a confirmed approach that works in both builds and passes the full test suite.

索引モデルが issue の本文から書いたものです。

説明

In progress

After executing the unit tests, set default strictMode to true, then re-run all of the tests.
Fix in both gradle and maven builds. It might be possible (?) to integrate this action into the existing test task, but if not:

In Gradle:
Modify the existing test task (copilot, I have not verified this):

apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'junit:junit:4.12'
}

task modifyCode {
    doLast {
        // Add your code modification logic here
        def file = file('src/main/java/com/example/YourClass.java')
        def text = file.text
        text = text.replaceAll('oldCode', 'newCode')
        file.text = text
        println 'Code modified.'
    }
}

task rerunTests(dependsOn: ['modifyCode', 'test']) {
    doLast {
        println 'Re-running tests...'
    }
}

test {
    finalizedBy 'rerunTests'
}

If a new task is needed (claude.ai, not verified):

    dependsOn test
    doLast {
        // Make your code change here
        File sourceFile = file('src/main/java/YourFile.java')
        String content = sourceFile.text
        content = content.replace('oldCode', 'newCode')
        sourceFile.text = content
        
        // Run tests again
        tasks.test.execute()
    }
}

Copilot also suggests a one-test-run fix for maven, but it requires a new ModifyCode class. Not shown here.

In Maven, new task (claude.ai, not verified):

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>3.1.0</version>
    <executions>
        <execution>
            <id>test-with-code-change</id>
            <phase>verify</phase>
            <goals>
                <goal>java</goal>
            </goals>
            <configuration>
                <mainClass>org.apache.maven.shared.utils.io.FileUtils</mainClass>
                <arguments>
                    <argument>src/main/java/YourFile.java</argument>
                    <argument>oldCode</argument>
                    <argument>newCode</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>
主要言語
Java
スター
4.7k
フォーク
2.6k
平均マージ
11日 18分
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

stleary/JSON-java のほかの issue

stleary/JSON-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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