JUnitテストで次のコードを実行して、gitリポジトリのフェッチをテストしています。JGitに必要な基本機能のそれぞれについてテストを作成しているので、アプリケーションにそれらを実装できます。問題は、以下のgit.fetch()呼び出しで次のエラーが発生し続けることです。
Loading of translation bundle failed for [org.eclipse.jgit.JGitText, en_US]
org.eclipse.jgit.errors.TranslationBundleLoadingException: Loading of translation bundle failed for [org.eclipse.jgit.JGitText, en_US]
コードサンプルは以下のとおりです。リポジトリパスとすべてが正しいように見えることを確認しました。フェッチ呼び出しにブレークポイントを設定してから、MSysGitで同じコマンドを実行すると、機能します。
try {
String remoteName = "origin";
URIish uri = new URIish(repository.getRepositoryDirectory());
saveRemote(repository2.getRepository(), uri, remoteName);
Git git = repository.getGit();
FetchResult r = git.fetch().setRemote(remoteName).call();
assertNotNull("Did not get any result from fetch.", r);
} catch (JGitInternalException ex) {
fail("Failed to do fetch. " + ex.getMessage());
} catch (InvalidRemoteException ex) {
fail("Failed to do fetch. " + ex.getMessage());
} catch (URISyntaxException ex) {
fail("Failed to do fetch. " + ex.getMessage());
}
ありがとう!