test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/CheckStatus.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   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  */


 605         checkResult(oneToTwo, appIn2, result2,
 606              Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING,
 607              result1.bytesProduced(), 0);
 608 
 609         if (!ssle2.isOutboundDone()) {
 610             throw new Exception("ssle1 outboundDone is NOT done");
 611         }
 612 
 613         if (!ssle2.isInboundDone()) {
 614             throw new Exception("ssle1 inboundDone is NOT done");
 615         }
 616 
 617         if (isHandshaking(ssle2)) {
 618             throw new Exception("ssle1 IS handshaking");
 619         }
 620 
 621         oneToTwo.compact();
 622     }
 623 
 624     public static void main(String args[]) throws Exception {



 625 
 626         CheckStatus cs;
 627 
 628         cs = new CheckStatus();
 629 
 630         cs.createSSLEngines();
 631 
 632         cs.test();
 633 
 634         System.out.println("Test Passed.");
 635     }
 636 
 637     /*
 638      * **********************************************************
 639      * Majority of the test case is above, below is just setup stuff
 640      * **********************************************************
 641      */
 642 
 643     public CheckStatus() throws Exception {
 644         sslc = getSSLContext(keyFilename, trustFilename);


   1 /*
   2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   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  */


 605         checkResult(oneToTwo, appIn2, result2,
 606              Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING,
 607              result1.bytesProduced(), 0);
 608 
 609         if (!ssle2.isOutboundDone()) {
 610             throw new Exception("ssle1 outboundDone is NOT done");
 611         }
 612 
 613         if (!ssle2.isInboundDone()) {
 614             throw new Exception("ssle1 inboundDone is NOT done");
 615         }
 616 
 617         if (isHandshaking(ssle2)) {
 618             throw new Exception("ssle1 IS handshaking");
 619         }
 620 
 621         oneToTwo.compact();
 622     }
 623 
 624     public static void main(String args[]) throws Exception {
 625         // reset the security property to make sure that the algorithms
 626         // and keys used in this test are not disabled.
 627         Security.setProperty("jdk.tls.disabledAlgorithms", "");
 628 
 629         CheckStatus cs;
 630 
 631         cs = new CheckStatus();
 632 
 633         cs.createSSLEngines();
 634 
 635         cs.test();
 636 
 637         System.out.println("Test Passed.");
 638     }
 639 
 640     /*
 641      * **********************************************************
 642      * Majority of the test case is above, below is just setup stuff
 643      * **********************************************************
 644      */
 645 
 646     public CheckStatus() throws Exception {
 647         sslc = getSSLContext(keyFilename, trustFilename);