Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  _index.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Android/development/development/samples/Alarm/tests/_index.html


<p>
    This sample is the test application for the <a href="../Alarm/index.html">Alarm</a>
    sample application. It tests the application's <code>AlarmService</code> service.
</p>
<p>
    The test application uses the
    <a href="../../../reference/android/test/ServiceTestCase.html">
    <code>ServiceTestCase</code></a>  test case class,
    which extends the JUnit <a href="../../../reference/junit/framework/TestCase.html">
    <code>TestCase</code></a> class. The test runner is
    <a href="../../../reference/android/test/InstrumentationTestRunner.html">
    <code>InstrumentationTestRunner</code></a>.
</p>
<p>
    The application shows how to set up a test application project,
    how to create the <a href="AndroidManifest.html"><code>AndroidManifest.xml</code></a>
    file for a test application, and how to set up a test case class for a service. The
    test case class, <a href="src/com/android/example/newalarm/ServiceAlarmTest.html">
    <code>AlarmServiceTest</code></a>, contains tests that demonstrate the following
    Android test patterns:
</p>
    <ul>
        <li>
            Test setup: The <code>setUp()</code> method re-initializes the state of the
            service under test before each test is run.
        </li>
        <li>
            Service start: The <code>Service.testServiceCreate()</code> test confirms that the
            service starts correctly and initializes the variables it needs to provide its
            services.
        </li>
    </ul>
<p>
    The <a href="AndroidManifest.html">manifest</a> declares an <code><instrumentation></code>
    element that links the test application with the application under test. Specifically, the
    element's <code>android:name</code> attribute specifies <code>InstrumentationTestRunner</code>
    as the instrumentation to use. The <code>android:targetPackage</code> attribute specifies
    <code>com.android.example.newalarm</code> as the name of the Android package that contains the
    service under test.
</p>
<p class="note">
    <strong>Note:</strong> <code>AlarmServiceTest.java</code> uses the Java package name
    <code>com.example.android.newalarm</code>, which is the same package used by service under
    test, <code>AlarmService.java</code>. This allows the test class to access members in the
    service under test that are defined with package visibility. To prevent conflicts, though,
    the generated java file <code>R.java</code> for <code>AlarmServiceTest</code> uses the
    Java package name <code>com.example.android.newalarm.test</code>. For the same reason, the
    Android package name for the test application (specified in the manifest file), is
    <code>com.example.android.newalarm.test</code>.
</p>

Messung V0.5 in Prozent
C=95 H=96 G=95

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik