jdk/test/sun/security/pkcs11/Signature/ByteBuffers.java
changeset 35379 1e8e336ef66b
parent 32138 23830562d3d1
child 40975 680639c9b307
equal deleted inserted replaced
35378:7e19fa0e4e5b 35379:1e8e336ef66b
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    26  * @bug 4856966
    26  * @bug 4856966
    27  * @summary Test the Signature.update(ByteBuffer) method
    27  * @summary Test the Signature.update(ByteBuffer) method
    28  * @author Andreas Sterbenz
    28  * @author Andreas Sterbenz
    29  * @library ..
    29  * @library ..
    30  * @key randomness
    30  * @key randomness
       
    31  * @run main/othervm ByteBuffers
       
    32  * @run main/othervm ByteBuffers sm
    31  */
    33  */
    32 
    34 
    33 import java.util.*;
    35 import java.nio.ByteBuffer;
    34 import java.nio.*;
    36 import java.security.KeyPair;
    35 
    37 import java.security.KeyPairGenerator;
    36 import java.security.*;
    38 import java.security.Provider;
       
    39 import java.security.Signature;
       
    40 import java.util.Random;
    37 
    41 
    38 public class ByteBuffers extends PKCS11Test {
    42 public class ByteBuffers extends PKCS11Test {
    39 
    43 
    40     public static void main(String[] args) throws Exception {
    44     public static void main(String[] args) throws Exception {
    41         main(new ByteBuffers());
    45         main(new ByteBuffers(), args);
    42     }
    46     }
    43 
    47 
       
    48     @Override
    44     public void main(Provider p) throws Exception {
    49     public void main(Provider p) throws Exception {
    45 
    50 
    46         /*
    51         /*
    47          * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
    52          * Use Solaris SPARC 11.2 or later to avoid an intermittent failure
    48          * when running SunPKCS11-Solaris provider (8044554)
    53          * when running SunPKCS11-Solaris provider (8044554)
    49          */
    54          */
    50         if (p.getName().equals("SunPKCS11-Solaris") &&
    55         if (p.getName().equals("SunPKCS11-Solaris") &&
    51             System.getProperty("os.name").equals("SunOS") &&
    56             props.getProperty("os.name").equals("SunOS") &&
    52             System.getProperty("os.arch").equals("sparcv9") &&
    57             props.getProperty("os.arch").equals("sparcv9") &&
    53             System.getProperty("os.version").compareTo("5.11") <= 0 &&
    58             props.getProperty("os.version").compareTo("5.11") <= 0 &&
    54             getDistro().compareTo("11.2") < 0) {
    59             getDistro().compareTo("11.2") < 0) {
    55 
    60 
    56             System.out.println("SunPKCS11-Solaris provider requires " +
    61             System.out.println("SunPKCS11-Solaris provider requires " +
    57                 "Solaris SPARC 11.2 or later, skipping");
    62                 "Solaris SPARC 11.2 or later, skipping");
    58             return;
    63             return;