Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,7 +34,10 @@
* -Dtest.libs=N ReplayCacheTestProc
*/

import java.io.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.BufferUnderflowException;
import java.nio.channels.SeekableByteChannel;
import java.nio.file.Files;
Expand All @@ -43,13 +46,19 @@
import java.nio.file.StandardOpenOption;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.HexFormat;
import java.util.List;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import jdk.test.lib.Asserts;
import jdk.test.lib.Platform;
import jdk.test.lib.process.Proc;
import jtreg.SkippedException;
import sun.security.jgss.GSSUtil;
import sun.security.krb5.internal.rcache.AuthTime;

Expand Down Expand Up @@ -126,8 +135,7 @@ public static void main0(String[] args) throws Exception {
libs = userLibs.split(",");
if (Arrays.asList(libs).contains("N") && !isNativeLibAvailable()) {
// Skip test when native GSS libs are not available in running platform
System.out.println("Native mode not available - skipped");
return;
throw new SkippedException("Native mode not available - skipped");
}

KDC kdc = KDC.create(OneKDC.REALM, HOST, 0, true);
Expand Down
9 changes: 5 additions & 4 deletions test/jdk/sun/security/krb5/config/ConfPlusProp.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,22 +25,23 @@
* @bug 6857795
* @bug 6858589
* @bug 6972005
* @library /test/lib/
* @modules java.security.jgss/sun.security.krb5
* @compile -XDignore.symbol.file ConfPlusProp.java
* @run main/othervm ConfPlusProp
* @summary krb5.conf ignored if system properties on realm and kdc are provided
*/

import jtreg.SkippedException;
import sun.security.krb5.Config;

public class ConfPlusProp {
Config config;
public static void main(String[] args) throws Exception {
if (System.getenv("USERDNSDOMAIN") != null ||
System.getenv("LOGONSERVER") != null) {
System.out.println(
"Looks like a Windows machine in a domain. Skip test.");
return;
throw new SkippedException(
"Test cannot run in a domain.");
}
new ConfPlusProp().run();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -49,6 +49,7 @@

import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jtreg.SkippedException;

/*
* @test
Expand Down Expand Up @@ -250,8 +251,7 @@ static void testConstraint(String[] trustNames, String[] certNames,
Exception serverException = serverFuture.get(TIMEOUT, TimeUnit.MILLISECONDS);
if (serverException instanceof SocketTimeoutException
|| clientOut.contains("SocketTimeoutException")) {
System.out.println("The communication gets timeout and skips the test.");
return;
throw new SkippedException("The communication gets timeout.");
}

if (pass) {
Expand Down
7 changes: 5 additions & 2 deletions test/jdk/sun/security/util/Resources/Usages.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,9 +29,12 @@
* java.base/sun.security.tools.keytool.resources
* jdk.jartool/sun.security.tools.jarsigner.resources
* @summary Check usages of security-related Resources files
* @library /test/lib/
* @run main/othervm Usages
*/

import jtreg.SkippedException;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -149,7 +152,7 @@ public static void main(String[] args) {
if (Files.exists(SRC)) {
MAP.forEach(Usages::check);
} else {
System.out.println("No src directory. Test skipped.");
throw new SkippedException("No src directory");
}
}

Expand Down