< prev index next >

test/sun/security/tools/keytool/ImportPrompt.java

Print this page
rev 17325 : 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
Reviewed-by: duke


  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 import jdk.test.lib.Asserts;
  25 import jdk.test.lib.SecurityTools;
  26 import jdk.test.lib.process.OutputAnalyzer;
  27 
  28 import java.io.File;
  29 import java.security.KeyStore;
  30 
  31 /**
  32  * @test
  33  * @bug 8172975
  34  * @summary SecurityTools.keytool() needs to accept user input
  35  * @library /test/lib








  36  */
  37 
  38 public class ImportPrompt {
  39 
  40     private static final String COMMON =
  41             "-storetype jks -storepass changeit -keypass changeit -debug";
  42 
  43     public static void main(String[] args) throws Throwable {
  44 
  45         kt("-keystore ks1 -genkeypair -alias a -dname CN=A");
  46         kt("-keystore ks1 -exportcert -alias a -file a.cert");
  47 
  48         // Just create a keystore
  49         kt("-keystore ks2 -genkeypair -alias b -dname CN=B");
  50 
  51         // no response text, assume no
  52         kt("-keystore ks2 -importcert -alias a -file a.cert");
  53         Asserts.assertFalse(hasA());
  54 
  55         // no reply is no




  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 import jdk.test.lib.Asserts;
  25 import jdk.test.lib.SecurityTools;
  26 import jdk.test.lib.process.OutputAnalyzer;
  27 
  28 import java.io.File;
  29 import java.security.KeyStore;
  30 
  31 /**
  32  * @test
  33  * @bug 8172975
  34  * @summary SecurityTools.keytool() needs to accept user input
  35  * @library /test/lib
  36  * @build jdk.test.lib.SecurityTools
  37  *        jdk.test.lib.Utils
  38  *        jdk.test.lib.Asserts
  39  *        jdk.test.lib.JDKToolFinder
  40  *        jdk.test.lib.JDKToolLauncher
  41  *        jdk.test.lib.Platform
  42  *        jdk.test.lib.process.*
  43  * @run main ImportPrompt
  44  */
  45 
  46 public class ImportPrompt {
  47 
  48     private static final String COMMON =
  49             "-storetype jks -storepass changeit -keypass changeit -debug";
  50 
  51     public static void main(String[] args) throws Throwable {
  52 
  53         kt("-keystore ks1 -genkeypair -alias a -dname CN=A");
  54         kt("-keystore ks1 -exportcert -alias a -file a.cert");
  55 
  56         // Just create a keystore
  57         kt("-keystore ks2 -genkeypair -alias b -dname CN=B");
  58 
  59         // no response text, assume no
  60         kt("-keystore ks2 -importcert -alias a -file a.cert");
  61         Asserts.assertFalse(hasA());
  62 
  63         // no reply is no


< prev index next >