< prev index next >

test/sun/security/krb5/config/Duration.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 8044500
  27  * @summary Add kinit options and krb5.conf flags that allow users to
  28  *          obtain renewable tickets and specify ticket lifetimes

  29  * @compile -XDignore.symbol.file Duration.java
  30  * @run main Duration
  31  */
  32 import sun.security.krb5.Config;
  33 import sun.security.krb5.KrbException;
  34 
  35 public class Duration {
  36     public static void main(String[] args) throws Exception {
  37         check("123", 123);
  38         check("1:1", 3660);
  39         check("1:1:1", 3661);
  40         check("1d", 86400);
  41         check("1h", 3600);
  42         check("1h1m", 3660);
  43         check("1h 1m", 3660);
  44         check("1d 1h 1m 1s", 90061);
  45         check("1d1h1m1s", 90061);
  46 
  47         check("", -1);
  48         check("abc", -1);




   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 8044500
  27  * @summary Add kinit options and krb5.conf flags that allow users to
  28  *          obtain renewable tickets and specify ticket lifetimes
  29  * @modules java.security.jgss/sun.security.krb5
  30  * @compile -XDignore.symbol.file Duration.java
  31  * @run main Duration
  32  */
  33 import sun.security.krb5.Config;
  34 import sun.security.krb5.KrbException;
  35 
  36 public class Duration {
  37     public static void main(String[] args) throws Exception {
  38         check("123", 123);
  39         check("1:1", 3660);
  40         check("1:1:1", 3661);
  41         check("1d", 86400);
  42         check("1h", 3600);
  43         check("1h1m", 3660);
  44         check("1h 1m", 3660);
  45         check("1d 1h 1m 1s", 90061);
  46         check("1d1h1m1s", 90061);
  47 
  48         check("", -1);
  49         check("abc", -1);


< prev index next >