

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS Device Farm での Appium Java JUnit テストのトラブルシューティング
<a name="troubleshooting-appium-java-junit"></a>

以下のトピックでは、Appium Java JUnit テストのアップロード中に発生するエラーメッセージを挙げ、各エラーを解決するための推奨回避策を伝えます。

**注記**  
以下の手順は Linux x86\$164 および Mac を対象にしています。

## APPIUM\$1JAVA\$1JUNIT\$1TEST\$1PACKAGE\$1UNZIP\$1FAILED
<a name="APPIUM_JAVA_JUNIT_TEST_PACKAGE_UNZIP_FAILED"></a>

次のメッセージが表示された場合は、下の手順に従って問題を解決してください。

**警告**  
テスト ZIP ファイルを開けませんでした。ファイルが有効であることを確認して、もう一度お試しください。

エラーなしでテストパッケージを解凍できることを確かめてください。次の例では、パッケージ名は「**zip-with-dependencies.zip**」です。

1. テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:

   ```
   $ unzip zip-with-dependencies.zip
   ```

1. 正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:

   ```
   $ tree .
   ```

   有効な Appium Java JUnit パッケージでは、次のような出力が生成されます:

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
         |— com.some-dependency.bar-4.1.jar
         |— com.another-dependency.thing-1.0.jar
         |— joda-time-2.7.jar
         `— log4j-1.2.14.jar
   ```

   詳細については、「[Device Farm で Appium テストを自動的に実行するAppium テストと Device Farm の統合](test-types-appium.md)」を参照してください。

## APPIUM\$1JAVA\$1JUNIT\$1TEST\$1PACKAGE\$1DEPENDENCY\$1DIR\$1MISSING
<a name="APPIUM_JAVA_JUNIT_TEST_PACKAGE_DEPENDENCY_DIR_MISSING"></a>

次のメッセージが表示された場合は、下の手順に従って問題を解決してください。

**警告**  
dependency-jars のディレクトリがテストパッケージ内に見つかりませんでした。テストパッケージを解凍し、dependency-jars ディレクトリがパッケージ内にあることを確認して、もう一度やり直してください。

次の例では、パッケージ名は「**zip-with-dependencies.zip**」です。

1. テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:

   ```
   $ unzip zip-with-dependencies.zip
   ```

1. 正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:

   ```
   $ tree .
   ```

   Appium Java JUnit パッケージが有効な場合は、作業ディレクトリ内に *dependency-jars* ディレクトリがあります:

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
         |— com.some-dependency.bar-4.1.jar
         |— com.another-dependency.thing-1.0.jar
         |— joda-time-2.7.jar
         `— log4j-1.2.14.jar
   ```

   詳細については、「[Device Farm で Appium テストを自動的に実行するAppium テストと Device Farm の統合](test-types-appium.md)」を参照してください。

## APPIUM\$1JAVA\$1JUNIT\$1TEST\$1PACKAGE\$1JAR\$1MISSING\$1IN\$1DEPENDENCY\$1DIR
<a name="APPIUM_JAVA_JUNIT_TEST_PACKAGE_JAR_MISSING_IN_DEPENDENCY_DIR"></a>

次のメッセージが表示された場合は、下の手順に従って問題を解決してください。

**警告**  
dependency-jars ディレクトリツリー内に JAR ファイルが見つかりませんでした。テストパッケージを解凍してから dependency-jars ディレクトリを開き、少なくとも 1 つの JAR ファイルがディレクトリにあることを確認して、もう一度やり直してください。

次の例では、パッケージ名は「**zip-with-dependencies.zip**」です。

1. テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:

   ```
   $ unzip zip-with-dependencies.zip
   ```

1. 正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:

   ```
   $ tree .
   ```

   Appium Java JUnit パッケージが有効な場合は、*dependency-jars* ディレクトリ内に少なくとも 1 つの *jar* ファイルがあります:

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
         |— com.some-dependency.bar-4.1.jar
         |— com.another-dependency.thing-1.0.jar
         |— joda-time-2.7.jar
         `— log4j-1.2.14.jar
   ```

   詳細については、「[Device Farm で Appium テストを自動的に実行するAppium テストと Device Farm の統合](test-types-appium.md)」を参照してください。

## APPIUM\$1JAVA\$1JUNIT\$1TEST\$1PACKAGE\$1TESTS\$1JAR\$1FILE\$1MISSING
<a name="APPIUM_JAVA_JUNIT_TEST_PACKAGE_TESTS_JAR_FILE_MISSING"></a>

次のメッセージが表示された場合は、下の手順に従って問題を解決してください。

**警告**  
テストパッケージ内に \$1-tests.jar ファイルが見つかりませんでした。テストパッケージを解凍し、パッケージ内に少なくとも 1 つの \$1-tests.jar ファイルがあることを確認して、もう一度やり直してください。

次の例では、パッケージ名は「**zip-with-dependencies.zip**」です。

1. テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:

   ```
   $ unzip zip-with-dependencies.zip
   ```

1. 正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:

   ```
   $ tree .
   ```

   Appium Java JUnit パッケージが有効な場合は、この例の *acme-android-appium-1.0-SNAPSHOT-tests.jar* のような *jar* ファイルが少なくとも 1 つあります。ファイルの名前は異なる場合がありますが、*–tests.jar* で終わります。

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
         |— com.some-dependency.bar-4.1.jar
         |— com.another-dependency.thing-1.0.jar
         |— joda-time-2.7.jar
         `— log4j-1.2.14.jar
   ```

   詳細については、「[Device Farm で Appium テストを自動的に実行するAppium テストと Device Farm の統合](test-types-appium.md)」を参照してください。

## APPIUM\$1JAVA\$1JUNIT\$1TEST\$1PACKAGE\$1CLASS\$1FILE\$1MISSING\$1IN\$1TESTS\$1JAR
<a name="APPIUM_JAVA_JUNIT_TEST_PACKAGE_CLASS_FILE_MISSING_IN_TESTS_JAR"></a>

次のメッセージが表示された場合は、下の手順に従って問題を解決してください。

**警告**  
テスト JAR ファイル内にクラスファイルが見つかりませんでした。テストパッケージを解凍してから、テスト JAR ファイルをアンジャーし、JAR ファイル内に少なくとも 1 つのクラスファイルがあることを確認して、もう一度やり直してください。

次の例では、パッケージ名は「**zip-with-dependencies.zip**」です。

1. テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:

   ```
   $ unzip zip-with-dependencies.zip
   ```

1. 正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:

   ```
   $ tree .
   ```

   この例の *acme-android-appium-1.0-SNAPSHOT-tests.jar* のような jar ファイルが少なくとも 1 つあります。ファイルの名前は異なる場合がありますが、*–tests.jar* で終わります。

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
         |— com.some-dependency.bar-4.1.jar
         |— com.another-dependency.thing-1.0.jar
         |— joda-time-2.7.jar
         `— log4j-1.2.14.jar
   ```

1. ファイルを正常に抽出したら、次のコマンドを実行すれば作業ディレクトリツリーに少なくとも 1 つのクラスがあるはずです: 

   ```
   $ tree .
   ```

   次のような出力が表示されます:

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing 
   everything built from the ./src/test directory)
   |- one-class-file.class
   |- folder
   |    `-another-class-file.class
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
         |— com.some-dependency.bar-4.1.jar
         |— com.another-dependency.thing-1.0.jar
         |— joda-time-2.7.jar
         `— log4j-1.2.14.jar
   ```

   詳細については、「[Device Farm で Appium テストを自動的に実行するAppium テストと Device Farm の統合](test-types-appium.md)」を参照してください。

## APPIUM\$1JAVA\$1JUNIT\$1TEST\$1PACKAGE\$1JUNIT\$1VERSION\$1VALUE\$1UNKNOWN
<a name="APPIUM_JAVA_JUNIT_TEST_PACKAGE_JUNIT_VERSION_VALUE_UNKNOWN"></a>

次のメッセージが表示された場合は、下の手順に従って問題を解決してください。

**警告**  
JUnit のバージョン値が見つかりませんでした。テストパッケージを解凍し、dependency-jars ディレクトリを開き、JUnit JAR ファイルがディレクトリ内にあることを確認して、もう一度やり直してください。

次の例では、パッケージ名は「**zip-with-dependencies.zip**」です。

1. テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:

   ```
   $ unzip zip-with-dependencies.zip
   ```

1. 正常にパッケージを解凍すると、次のコマンドを実行すれば、作業ディレクトリのツリー構造を見つけることができます:

   ```
   tree .
   ```

   出力は次のようになります:

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
       |— junit-4.10.jar
       |— com.some-dependency.bar-4.1.jar
       |— com.another-dependency.thing-1.0.jar
       |— joda-time-2.7.jar
       `— log4j-1.2.14.jar
   ```

   Appium Java JUnit パッケージが有効な場合は、この例の jar ファイル *junit-4.10.jar* のような JUnit 依存関係ファイルがあります。名前はキーワード「*junit*」とバージョン番号からなります。この例では 4.10 です。

   詳細については、「[Device Farm で Appium テストを自動的に実行するAppium テストと Device Farm の統合](test-types-appium.md)」を参照してください。

## APPIUM\$1JAVA\$1JUNIT\$1TEST\$1PACKAGE\$1INVALID\$1JUNIT\$1VERSION
<a name="APPIUM_JAVA_JUNIT_TEST_PACKAGE_INVALID_JUNIT_VERSION"></a>

次のメッセージが表示された場合は、下の手順に従って問題を解決してください。

**警告**  
JUnit のバージョンが、サポート対象の最小バージョン 4.10 よりも低いことがわかりました。JUnit のバージョンを変更して、もう一度試してください。

次の例では、パッケージ名は「**zip-with-dependencies.zip**」です。

1. テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:

   ```
   $ unzip zip-with-dependencies.zip
   ```

1. 正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:

   ```
   $ tree .
   ```

   この例の *junit-4.10.jar* のような JUnit 依存関係ファイルとそのバージョン番号 (この例では 4.10) が見つかります:

   ```
   .
   |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
   |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
   |— zip-with-dependencies.zip (this .zip file contains all of the items)
   `— dependency-jars (this is the directory that contains all of your dependencies, built as JAR files)
         |— junit-4.10.jar
         |— com.some-dependency.bar-4.1.jar
         |— com.another-dependency.thing-1.0.jar
         |— joda-time-2.7.jar
         `— log4j-1.2.14.jar
   ```
**注記**  
テストパッケージで指定された JUnit のバージョンが、サポート対象の最小バージョン 4.10 よりも低い場合、テストが正しく実行されないことがあります。

   詳細については、「[Device Farm で Appium テストを自動的に実行するAppium テストと Device Farm の統合](test-types-appium.md)」を参照してください。