交易設定物件

系統會剖析交易 XML 設定,並據此建立 Configuration 物件來描述完整設定。

IConfiguration 介面會說明這個物件。這個物件會包含 XML 中定義的所有物件執行個體。

這個範例:

<configuration description="<description of the configuration>">
    <!-- A build provider that takes local device information -->
    <build_provider class="com.android.tradefed.build.BootstrapBuildProvider" />

    <!-- Some target preparation, disabled by default -->
    <target_preparer class="com.android.tradefed.targetprep.PreloadedClassesPreparer">
        <option name="disable" value="true" />
    </target_preparer>

    <!-- One test running some unit tests -->
    <test class="com.android.tradefed.testtype.HostTest">
        <option name="class" value="com.android.tradefed.build.BuildInfoTest" />
    </test>
</configuration>

會產生:

  • IConfiguration#getBuildProvider():傳回 BootstrapBuildProvider 例項。
  • IConfiguration#getTargetPreparers():傳回包含 PreloadedClassesPreparer 例項的 ITargetPreparer 清單。
  • IConfiguration#getTests() 表示傳回 IRemoteTest 清單,其中包含 HostTest 的執行個體。

設定物件中的每個物件都能對應至 XML 定義,因此瞭解 XML 定義通常有助於瞭解設定物件中預期的內容。