< prev index next >

jdk/test/javax/smartcardio/Serialize.java

Print this page




   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 6445367
  27  * @summary make sure serialization works
  28  * @author Andreas Sterbenz
  29  * @compile -addmods java.smartcardio Serialize.java
  30  * @run main/othervm -addmods java.smartcardio Serialize
  31  */
  32 
  33 import java.io.*;
  34 
  35 import javax.smartcardio.*;
  36 
  37 public class Serialize {
  38 
  39     public static void main(String[] args) throws Exception {
  40         ByteArrayOutputStream bout = new ByteArrayOutputStream();
  41         ObjectOutputStream oout = new ObjectOutputStream(bout);
  42 
  43         CommandAPDU c1 = new CommandAPDU(parse("00 A4 04 00 07 A0 00 00 00 62 81 01 00"));
  44         ResponseAPDU r1 = new ResponseAPDU(parse("07 A0 00 00 00 62 81 01 04 01 00 00 24 05 00 0B 04 B0 25 90 00"));
  45         ATR a1 = new ATR(parse("3B 7F 18 00 00 00 31 C0 73 9E 01 0B 64 52 D9 04 00 82 90 00"));
  46 
  47         oout.writeObject(c1);
  48         oout.writeObject(r1);
  49         oout.writeObject(a1);
  50         oout.close();




   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 6445367
  27  * @summary make sure serialization works
  28  * @author Andreas Sterbenz
  29  * @compile --add-modules=java.smartcardio Serialize.java
  30  * @run main/othervm --add-modules=java.smartcardio Serialize
  31  */
  32 
  33 import java.io.*;
  34 
  35 import javax.smartcardio.*;
  36 
  37 public class Serialize {
  38 
  39     public static void main(String[] args) throws Exception {
  40         ByteArrayOutputStream bout = new ByteArrayOutputStream();
  41         ObjectOutputStream oout = new ObjectOutputStream(bout);
  42 
  43         CommandAPDU c1 = new CommandAPDU(parse("00 A4 04 00 07 A0 00 00 00 62 81 01 00"));
  44         ResponseAPDU r1 = new ResponseAPDU(parse("07 A0 00 00 00 62 81 01 04 01 00 00 24 05 00 0B 04 B0 25 90 00"));
  45         ATR a1 = new ATR(parse("3B 7F 18 00 00 00 31 C0 73 9E 01 0B 64 52 D9 04 00 82 90 00"));
  46 
  47         oout.writeObject(c1);
  48         oout.writeObject(r1);
  49         oout.writeObject(a1);
  50         oout.close();


< prev index next >