jdk/test/sun/security/krb5/auto/BogusKDC.java
changeset 36967 d041d2e80712
parent 31801 1297473ab237
child 45028 b0ea3c0bfb81
equal deleted inserted replaced
36966:4209c9e19c45 36967:d041d2e80712
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 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.
    80 
    80 
    81         // create a krb5 config with non-existing host for master KDC,
    81         // create a krb5 config with non-existing host for master KDC,
    82         // and wrong port for slave KDC
    82         // and wrong port for slave KDC
    83         try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
    83         try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
    84             w.write(String.format(KRB5_CONF_TEMPLATE,
    84             w.write(String.format(KRB5_CONF_TEMPLATE,
    85                     KDC.KDCNameService.NOT_EXISTING_HOST, WRONG_KDC_PORT));
    85                     KDC.NOT_EXISTING_HOST, WRONG_KDC_PORT));
    86             w.flush();
    86             w.flush();
    87         }
    87         }
    88 
    88 
    89         // login with not-refreshable config
    89         // login with not-refreshable config
    90         try {
    90         try {
    96 
    96 
    97         // create a krb5 config with non-existing host for master KDC,
    97         // create a krb5 config with non-existing host for master KDC,
    98         // but correct port for slave KDC
    98         // but correct port for slave KDC
    99         try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
    99         try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
   100             w.write(String.format(KRB5_CONF_TEMPLATE,
   100             w.write(String.format(KRB5_CONF_TEMPLATE,
   101                     KDC.KDCNameService.NOT_EXISTING_HOST, kdc.getPort()));
   101                     KDC.NOT_EXISTING_HOST, kdc.getPort()));
   102             w.flush();
   102             w.flush();
   103         }
   103         }
   104 
   104 
   105         // login with not-refreshable config
   105         // login with not-refreshable config
   106         try {
   106         try {