8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @bug 8049021 27 * @summary Construct ResponseAPDU from byte array and check NR< SW, SW1 and SW2 28 * @compile -addmods java.smartcardio ResponseAPDUTest.java 29 * @run testng/othervm -addmods java.smartcardio ResponseAPDUTest 30 */ 31 import javax.smartcardio.ResponseAPDU; 32 import static org.testng.Assert.*; 33 import org.testng.annotations.BeforeClass; 34 import org.testng.annotations.Test; 35 36 public class ResponseAPDUTest { 37 38 static final byte[] R1 = {(byte) 0x07, (byte) 0xA0, (byte) 0x00, 39 (byte) 0x00, (byte) 0x00, (byte) 0x62, (byte) 0x81, (byte) 0x01, 40 (byte) 0x04, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x24, 41 (byte) 0x05, (byte) 0x00, (byte) 0x0B, (byte) 0x04, (byte) 0xB0, 42 (byte) 0x25, (byte) 0x90, (byte) 0x00}; 43 static final ResponseAPDU RAPDU = new ResponseAPDU(R1); 44 static byte[] expectedData; 45 static int expectedNr, expectedSw1, expectedSw2, expectedSw; 46 47 @BeforeClass 48 public static void setUpClass() throws Exception { 49 //expected values for data,nr,sw1,sw2 and sw | 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @bug 8049021 27 * @summary Construct ResponseAPDU from byte array and check NR< SW, SW1 and SW2 28 * @compile --add-modules=java.smartcardio ResponseAPDUTest.java 29 * @run testng/othervm --add-modules=java.smartcardio ResponseAPDUTest 30 */ 31 import javax.smartcardio.ResponseAPDU; 32 import static org.testng.Assert.*; 33 import org.testng.annotations.BeforeClass; 34 import org.testng.annotations.Test; 35 36 public class ResponseAPDUTest { 37 38 static final byte[] R1 = {(byte) 0x07, (byte) 0xA0, (byte) 0x00, 39 (byte) 0x00, (byte) 0x00, (byte) 0x62, (byte) 0x81, (byte) 0x01, 40 (byte) 0x04, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x24, 41 (byte) 0x05, (byte) 0x00, (byte) 0x0B, (byte) 0x04, (byte) 0xB0, 42 (byte) 0x25, (byte) 0x90, (byte) 0x00}; 43 static final ResponseAPDU RAPDU = new ResponseAPDU(R1); 44 static byte[] expectedData; 45 static int expectedNr, expectedSw1, expectedSw2, expectedSw; 46 47 @BeforeClass 48 public static void setUpClass() throws Exception { 49 //expected values for data,nr,sw1,sw2 and sw |