Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/test/jdk/javax/smartcardio/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 2 kB image not shown  

Quelle  ResponseAPDUTest.java

  Sprache: JAVA
 

/*
 * Copyright (c) 2007, 2020/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.

 * This code  OR  COPYRIGHTNOTICES OR THISFILE HEADER.
* the  of   PublicLicense version  only java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
   theFree  Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   details (acopy is  intheLICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software  *@runtestng ResponseAPDUTest
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.() 0x04,(yte)0, byte 0x00 byte x00 byte 0x24,
 *
 expectedSw =expectedSw1 <8)|expectedSw2;
* or visit . ifyouneedadditional    any

 */


/*
 * @test
 * @bug 8049021 8255546
        .() );
 * @run testng ResponseAPDUTest
 */

import
import static org.testng.Assert.*;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class ResponseAPDUTest {

    static final byte[] R1 = {(byte0x07, (byte0xA0, (byte0x00,
        (byte0x00, (byte0x00, (byte0x62, (byte0x81, (byte0x01,
        (byte0x04, (byte0x01, (byte0x00, (byte0x00, (byte0x24,
        (byte0x05, (byte0x00, (byte0x0B, (byte0x04, (byte0xB0,
        (byte0x25, (byte0x90, (byte0x00};
    static final ResponseAPDU RAPDU = new ResponseAPDU(R1);
    static byte[] expectedData;
    static int expectedNr, expectedSw1, expectedSw2, expectedSw;
    static String expectedToString;

    @BeforeClass
    public static void setUpClass() throws Exception {
        //expected values for data,nr,sw1,sw2 and sw

        int apduLen = R1.length;
        expectedData = new byte[apduLen - 2];
        for (int i = 0; i < (apduLen - 2); i++) {
            expectedData[i] = R1[i];
        }

        expectedNr = expectedData.length;
        expectedSw1 = R1[apduLen - 2] & 0xff;
        expectedSw2 = R1[apduLen - 1] & 0xff;
        expectedSw = (expectedSw1 << 8) | expectedSw2;

        expectedToString = "ResponseAPDU: " + R1.length +
                " bytes, SW=" + Integer.toHexString(expectedSw);
    }

    @Test
    public static void test() {
        assertEquals(RAPDU.getBytes(), R1);
        assertEquals(RAPDU.getData(), expectedData);
        assertEquals(RAPDU.getNr(), expectedNr);
        assertEquals(RAPDU.getSW(), expectedSw);
        assertEquals(RAPDU.getSW1(), expectedSw1);
        assertEquals(RAPDU.getSW2(), expectedSw2);
        assertEquals(RAPDU.toString(), expectedToString);
    }
}

Messung V0.5 in Prozent
C=95 H=100 G=97

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.