交易設定物件

交易 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() 可傳回 ITargetPreparer 的清單 包含 PreloadedClassesPreparer 的例項。
  • IConfiguration#getTests():傳回 IRemoteTest 清單,其中包含 HostTest 的例項。

設定物件中的每個單一物件都能對應到 XML 因此瞭解 XML 定義通常有助於瞭解 對設定物件的影響