This commit is contained in:
Lana Steuck 2014-10-09 12:16:00 -07:00
commit c33027a2e4
81 changed files with 9967 additions and 920 deletions

View File

@ -384,7 +384,7 @@ public abstract class $Type$Buffer
* and vice versa. The new buffer's capacity and limit will be
* <tt>array.length</tt>, its position will be zero, and its mark will be
* undefined. Its {@link #array backing array} will be the
* given array, and its {@link #arrayOffset array offset>} will
* given array, and its {@link #arrayOffset array offset} will
* be zero. </p>
*
* @param array

View File

@ -208,7 +208,7 @@ public abstract class FileStore {
* @param attribute
* the attribute to read
* @return the attribute value; {@code null} may be a valid valid for some
* @return the attribute value; {@code null} may be a valid for some
* attributes
*
* @throws UnsupportedOperationException

View File

@ -1480,7 +1480,7 @@ public final class Files {
* <li>It is <i>transitive</i>: for three {@code Paths}
* {@code f}, {@code g}, and {@code h}, if {@code isSameFile(f,g)} returns
* {@code true} and {@code isSameFile(g,h)} returns {@code true}, then
* {@code isSameFile(f,h)} will return return {@code true}.
* {@code isSameFile(f,h)} will return {@code true}.
* </ul>
*
* @param path
@ -2818,7 +2818,7 @@ public final class Files {
/**
* Opens or creates a file for writing, returning a {@code BufferedWriter}
* that may be used to write text to the file in an efficient manner.
* The {@code options} parameter specifies how the the file is created or
* The {@code options} parameter specifies how the file is created or
* opened. If no options are present then this method works as if the {@link
* StandardOpenOption#CREATE CREATE}, {@link
* StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, and {@link
@ -3307,7 +3307,7 @@ public final class Files {
* line.separator}. Characters are encoded into bytes using the specified
* charset.
*
* <p> The {@code options} parameter specifies how the the file is created
* <p> The {@code options} parameter specifies how the file is created
* or opened. If no options are present then this method works as if the
* {@link StandardOpenOption#CREATE CREATE}, {@link
* StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, and {@link

View File

@ -115,7 +115,7 @@ public interface SecureDirectoryStream<T>
* channel.
*
* @param path
* the path of the file to open open or create
* the path of the file to open or create
* @param options
* options specifying how the file is opened
* @param attrs

View File

@ -74,7 +74,7 @@ class TempFileHelper {
}
/**
* Creates a file or directory in in the given given directory (or in the
* Creates a file or directory in the given directory (or in the
* temporary directory if dir is {@code null}).
*/
private static Path create(Path dir,
@ -149,7 +149,7 @@ class TempFileHelper {
}
/**
* Creates a temporary file in the given directory, or in in the
* Creates a temporary file in the given directory, or in the
* temporary directory if dir is {@code null}.
*/
static Path createTempFile(Path dir,
@ -162,7 +162,7 @@ class TempFileHelper {
}
/**
* Creates a temporary directory in the given directory, or in in the
* Creates a temporary directory in the given directory, or in the
* temporary directory if dir is {@code null}.
*/
static Path createTempDirectory(Path dir,

View File

@ -51,7 +51,7 @@
* <p> An attribute view provides a read-only or updatable view of the non-opaque
* values, or <em>metadata</em>, associated with objects in a file system.
* The {@link java.nio.file.attribute.FileAttributeView} interface is
* extended by several other interfaces that that views to specific sets of file
* extended by several other interfaces that views to specific sets of file
* attributes. {@code FileAttributeViews} are selected by invoking the {@link
* java.nio.file.Files#getFileAttributeView} method with a
* <em>type-token</em> to identify the required view. Views can also be identified

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, 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
@ -63,7 +63,7 @@ package java.security;
* </pre>
*
* For more information, see
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280:
* Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>.
*
* <LI>A Format

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2014, 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
@ -27,8 +27,8 @@ package java.security.cert;
/**
* The CRLReason enumeration specifies the reason that a certificate
* is revoked, as defined in <a href="http://www.ietf.org/rfc/rfc3280.txt">
* RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL
* is revoked, as defined in <a href="http://tools.ietf.org/html/rfc5280">
* RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL
* Profile</a>.
*
* @author Sean Mullan

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2014, 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
@ -28,7 +28,7 @@ package java.security.cert;
/**
* The {@code PKIXReason} enumerates the potential PKIX-specific reasons
* that an X.509 certification path may be invalid according to the PKIX
* (RFC 3280) standard. These reasons are in addition to those of the
* (RFC 5280) standard. These reasons are in addition to those of the
* {@code CertPathValidatorException.BasicReason} enumeration.
*
* @since 1.7

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, 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
@ -78,7 +78,7 @@ public class TrustAnchor {
* The name constraints are specified as a byte array. This byte array
* should contain the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in
* <a href="http://www.ietf.org/rfc/rfc3280">RFC 3280</a>
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280</a>
* and X.509. The ASN.1 definition of this structure appears below.
*
* <pre>{@code
@ -140,7 +140,7 @@ public class TrustAnchor {
* <p>
* The name constraints are specified as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #TrustAnchor(X509Certificate, byte[])
@ -179,7 +179,7 @@ public class TrustAnchor {
* <p>
* The name constraints are specified as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #TrustAnchor(X509Certificate, byte[])
@ -294,7 +294,7 @@ public class TrustAnchor {
* <p>
* The name constraints are returned as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #TrustAnchor(X509Certificate, byte[])

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, 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
@ -69,7 +69,7 @@ import sun.security.x509.X509CRLImpl;
* </pre>
* <p>
* More information can be found in
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
* <p>
* The ASN.1 definition of {@code tbsCertList} is:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -52,7 +52,7 @@ import sun.security.x509.X500Name;
* {@link CertStore#getCRLs CertStore.getCRLs} or some similar
* method.
* <p>
* Please refer to <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
* Please refer to <a href="http://tools.ietf.org/html/rfc5280">RFC 5280:
* Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>
* for definitions of the X.509 CRL fields and extensions mentioned below.
* <p>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -65,7 +65,7 @@ import sun.security.x509.*;
* number. Other unique combinations include the issuer, subject,
* subjectKeyIdentifier and/or the subjectPublicKey criteria.
* <p>
* Please refer to <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
* Please refer to <a href="http://tools.ietf.org/html/rfc5280">RFC 5280:
* Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a> for
* definitions of the X.509 certificate extensions mentioned below.
* <p>
@ -728,7 +728,7 @@ public class X509CertSelector implements CertSelector {
* The name is provided in string format.
* <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>, DNS, and URI
* names use the well-established string formats for those types (subject to
* the restrictions included in RFC 3280). IPv4 address names are
* the restrictions included in RFC 5280). IPv4 address names are
* supplied using dotted quad notation. OID address names are represented
* as a series of nonnegative integers separated by periods. And
* directory names (distinguished names) are supplied in RFC 2253 format.
@ -746,7 +746,7 @@ public class X509CertSelector implements CertSelector {
* String form of some distinguished names.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string form (not {@code null})
* @throws IOException if a parsing error occurs
*/
@ -770,7 +770,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name is provided as a byte array. This byte array should contain
* the DER encoded name, as it would appear in the GeneralName structure
* defined in RFC 3280 and X.509. The encoded byte array should only contain
* defined in RFC 5280 and X.509. The encoded byte array should only contain
* the encoded value of the name, and should not include the tag associated
* with the name in the GeneralName structure. The ASN.1 definition of this
* structure appears below.
@ -806,7 +806,7 @@ public class X509CertSelector implements CertSelector {
* must contain the specified subjectAlternativeName.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string or byte array form
* @throws IOException if a parsing error occurs
*/
@ -995,7 +995,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name constraints are specified as a byte array. This byte array
* should contain the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 definition of this structure appears below.
*
* <pre>{@code
@ -1197,7 +1197,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name is provided in string format. RFC 822, DNS, and URI names
* use the well-established string formats for those types (subject to
* the restrictions included in RFC 3280). IPv4 address names are
* the restrictions included in RFC 5280). IPv4 address names are
* supplied using dotted quad notation. OID address names are represented
* as a series of nonnegative integers separated by periods. And
* directory names (distinguished names) are supplied in RFC 2253 format.
@ -1214,7 +1214,7 @@ public class X509CertSelector implements CertSelector {
* String form of some distinguished names.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string form
* @throws IOException if a parsing error occurs
*/
@ -1234,7 +1234,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name is provided as a byte array. This byte array should contain
* the DER encoded name, as it would appear in the GeneralName structure
* defined in RFC 3280 and X.509. The ASN.1 definition of this structure
* defined in RFC 5280 and X.509. The ASN.1 definition of this structure
* appears in the documentation for
* {@link #addSubjectAlternativeName(int type, byte [] name)
* addSubjectAlternativeName(int type, byte [] name)}.
@ -1243,7 +1243,7 @@ public class X509CertSelector implements CertSelector {
* subsequent modifications.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name a byte array containing the name in ASN.1 DER encoded form
* @throws IOException if a parsing error occurs
*/
@ -1258,7 +1258,7 @@ public class X509CertSelector implements CertSelector {
* the specified pathToName.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string or byte array form
* @throws IOException if an encoding error occurs (incorrect form for DN)
*/
@ -1715,7 +1715,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name constraints are returned as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #setNameConstraints(byte [] bytes) setNameConstraints(byte [] bytes)}.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, 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
@ -63,7 +63,7 @@ import sun.security.x509.X509CertImpl;
* CA such as a "root" CA.
* <p>
* More information can be found in
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
* <p>
* The ASN.1 definition of {@code tbsCertificate} is:
@ -408,7 +408,7 @@ implements X509Extension {
* Gets the {@code issuerUniqueID} value from the certificate.
* The issuer unique identifier is present in the certificate
* to handle the possibility of reuse of issuer names over time.
* RFC 3280 recommends that names not be reused and that
* RFC 5280 recommends that names not be reused and that
* conforming certificates not make use of unique identifiers.
* Applications conforming to that profile should be capable of
* parsing unique identifiers and making comparisons.
@ -459,7 +459,7 @@ implements X509Extension {
* encipherOnly (7),
* decipherOnly (8) }
* </pre>
* RFC 3280 recommends that when used, this be marked
* RFC 5280 recommends that when used, this be marked
* as a critical extension.
*
* @return the KeyUsage extension of this certificate, represented as
@ -572,7 +572,7 @@ implements X509Extension {
* <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>, DNS, and URI
* names are returned as {@code String}s,
* using the well-established string formats for those types (subject to
* the restrictions included in RFC 3280). IPv4 address names are
* the restrictions included in RFC 5280). IPv4 address names are
* returned using dotted quad notation. IPv6 address names are returned
* in the form "a1:a2:...:a8", where a1-a8 are hexadecimal values
* representing the eight 16-bit pieces of the address. OID names are

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -41,13 +41,13 @@ import sun.security.util.*;
* of the distinguished name, or by using the ASN.1 DER encoded byte
* representation of the distinguished name. The current specification
* for the string representation of a distinguished name is defined in
* <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253: Lightweight
* <a href="http://tools.ietf.org/html/rfc2253">RFC 2253: Lightweight
* Directory Access Protocol (v3): UTF-8 String Representation of
* Distinguished Names</a>. This class, however, accepts string formats from
* both RFC 2253 and <a href="http://www.ietf.org/rfc/rfc1779.txt">RFC 1779:
* both RFC 2253 and <a href="http://tools.ietf.org/html/rfc1779">RFC 1779:
* A String Representation of Distinguished Names</a>, and also recognizes
* attribute type keywords whose OIDs (Object Identifiers) are defined in
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
*
* <p> The string representation for this {@code X500Principal}
@ -108,7 +108,7 @@ public final class X500Principal implements Principal, java.io.Serializable {
* (and listed in {@link #getName(String format) getName(String format)}),
* as well as the T, DNQ or DNQUALIFIER, SURNAME, GIVENNAME, INITIALS,
* GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose Object
* Identifiers (OIDs) are defined in RFC 3280 and its successor.
* Identifiers (OIDs) are defined in RFC 5280.
* Any other attribute type must be specified as an OID.
*
* <p>This implementation enforces a more restrictive OID syntax than
@ -456,7 +456,7 @@ public final class X500Principal implements Principal, java.io.Serializable {
* (obtained via the {@code getName(X500Principal.CANONICAL)} method)
* of this object and <i>o</i> are equal.
*
* <p> This implementation is compliant with the requirements of RFC 3280.
* <p> This implementation is compliant with the requirements of RFC 5280.
*
* @param o Object to be compared for equality with this
* {@code X500Principal}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -31,15 +31,15 @@
* <h2>Package Specification</h2>
*
* <ul>
* <li><a href="http://www.ietf.org/rfc/rfc1779.txt">
* <li><a href="http://tools.ietf.org/html/rfc1779">
* RFC 1779: A String Representation of Distinguished Names</a></li>
* <li><a href="http://www.ietf.org/rfc/rfc2253.txt">
* <li><a href="http://tools.ietf.org/html/rfc2253">
* RFC 2253: Lightweight Directory Access Protocol (v3):
* UTF-8 String Representation of Distinguished Names</a></li>
* <li><a href="http://www.ietf.org/rfc/rfc3280.txt">
* RFC 3280: Internet X.509 Public Key Infrastructure
* <li><a href="http://tools.ietf.org/html/rfc5280">
* RFC 5280: Internet X.509 Public Key Infrastructure
* Certificate and Certificate Revocation List (CRL) Profile</a></li>
* <li><a href="http://www.ietf.org/rfc/rfc4512.txt">
* <li><a href="http://tools.ietf.org/html/rfc4512">
* RFC 4512: Lightweight Directory Access Protocol (LDAP):
* Directory Information Models</a></li>
* </ul>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, 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
@ -64,7 +64,7 @@ import java.security.*;
* and CRLs. Aliases for X.509 are X509.
*
* - PKIX is the certification path validation algorithm described
* in RFC 3280. The ValidationAlgorithm attribute notes the
* in RFC 5280. The ValidationAlgorithm attribute notes the
* specification that this provider implements.
*
* - LDAP is the CertStore type for LDAP repositories. The
@ -250,7 +250,7 @@ final class SunEntries {
map.put("CertPathBuilder.PKIX",
"sun.security.provider.certpath.SunCertPathBuilder");
map.put("CertPathBuilder.PKIX ValidationAlgorithm",
"RFC3280");
"RFC5280");
/*
* CertPathValidator
@ -258,7 +258,7 @@ final class SunEntries {
map.put("CertPathValidator.PKIX",
"sun.security.provider.certpath.PKIXCertPathValidator");
map.put("CertPathValidator.PKIX ValidationAlgorithm",
"RFC3280");
"RFC5280");
/*
* CertStores

View File

@ -434,7 +434,7 @@ public class DistributionPointFetcher {
}
if (indirectCRL) {
if (pointCrlIssuers.size() != 1) {
// RFC 3280: there must be only 1 CRL issuer
// RFC 5280: there must be only 1 CRL issuer
// name when relativeName is present
if (debug != null) {
debug.println("must only be one CRL " +

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -578,7 +578,7 @@ class PolicyChecker extends PKIXCertPathChecker {
}
/**
* Rewrite leaf nodes at the end of validation as described in RFC 3280
* Rewrite leaf nodes at the end of validation as described in RFC 5280
* section 6.1.5: Step (g)(iii). Leaf nodes with anyPolicy are replaced
* by nodes explicitly representing initial policies not already
* represented by leaf nodes.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -56,7 +56,7 @@ final class PolicyNodeImpl implements PolicyNode {
private PolicyNodeImpl mParent;
private HashSet<PolicyNodeImpl> mChildren;
// the 4 fields specified by RFC 3280
// the 4 fields specified by RFC 5280
private String mValidPolicy;
private HashSet<PolicyQualifierInfo> mQualifierSet;
private boolean mCriticalityIndicator;

View File

@ -472,9 +472,9 @@ class RevocationChecker extends PKIXRevocationChecker {
" ---checking revocation status ...");
}
// reject circular dependencies - RFC 3280 is not explicit on how
// to handle this, so we feel it is safest to reject them until
// the issue is resolved in the PKIX WG.
// Reject circular dependencies - RFC 5280 is not explicit on how
// to handle this, but does suggest that they can be a security
// risk and can create unresolvable dependencies
if (stackedCerts != null && stackedCerts.contains(cert)) {
if (debug != null) {
debug.println("RevocationChecker.checkCRLs()" +
@ -628,7 +628,7 @@ class RevocationChecker extends PKIXRevocationChecker {
/*
* Abort CRL validation and throw exception if there are any
* unrecognized critical CRL entry extensions (see section
* 5.3 of RFC 3280).
* 5.3 of RFC 5280).
*/
Set<String> unresCritExts = entry.getCriticalExtensionOIDs();
if (unresCritExts != null && !unresCritExts.isEmpty()) {
@ -880,9 +880,9 @@ class RevocationChecker extends PKIXRevocationChecker {
" ---checking " + msg + "...");
}
// reject circular dependencies - RFC 3280 is not explicit on how
// to handle this, so we feel it is safest to reject them until
// the issue is resolved in the PKIX WG.
// Reject circular dependencies - RFC 5280 is not explicit on how
// to handle this, but does suggest that they can be a security
// risk and can create unresolvable dependencies
if ((stackedCerts != null) && stackedCerts.contains(cert)) {
if (debug != null) {
debug.println(

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -53,7 +53,7 @@ import sun.security.util.Debug;
* <p> If successful, it returns a certification path which has successfully
* satisfied all the constraints and requirements specified in the
* PKIXBuilderParameters object and has been validated according to the PKIX
* path validation algorithm defined in RFC 3280.
* path validation algorithm defined in RFC 5280.
*
* <p> This implementation uses a depth-first search approach to finding
* certification paths. If it comes to a point in which it cannot find

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, 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
@ -285,7 +285,7 @@ class DerInputBuffer extends ByteArrayInputStream implements Cloneable {
* YYMMDDhhmmss-hhmm
* UTC Time is broken in storing only two digits of year.
* If YY < 50, we assume 20YY;
* if YY >= 50, we assume 19YY, as per RFC 3280.
* if YY >= 50, we assume 19YY, as per RFC 5280.
*
* Generalized time has a four-digit year and allows any
* precision specified in ISO 8601. However, for our purposes,

View File

@ -461,7 +461,7 @@ extends ByteArrayOutputStream implements DerEncoder {
* Marshals a DER UTC time/date value.
*
* <P>YYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time
* and with seconds (even if seconds=0) as per RFC 3280.
* and with seconds (even if seconds=0) as per RFC 5280.
*/
public void putUTCTime(Date d) throws IOException {
putTime(d, DerValue.tag_UtcTime);
@ -471,7 +471,7 @@ extends ByteArrayOutputStream implements DerEncoder {
* Marshals a DER Generalized Time/date value.
*
* <P>YYYYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time
* and with seconds (even if seconds=0) as per RFC 3280.
* and with seconds (even if seconds=0) as per RFC 5280.
*/
public void putGeneralizedTime(Date d) throws IOException {
putTime(d, DerValue.tag_GeneralizedTime);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, 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
@ -45,8 +45,8 @@ import sun.misc.IOUtils;
* (such as PKCS #10 certificate requests, and some kinds of PKCS #7 data).
*
* A note with respect to T61/Teletex strings: From RFC 1617, section 4.1.3
* and RFC 3280, section 4.1.2.4., we assume that this kind of string will
* contain ISO-8859-1 characters only.
* and RFC 5280, section 8, we assume that this kind of string will contain
* ISO-8859-1 characters only.
*
*
* @author David Brownell

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2014, 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
@ -43,7 +43,7 @@ import sun.security.util.DerValue;
* certificate that identifies the specific OCSP Responder to use when
* performing on-line validation of that certificate.
* <p>
* This extension is defined in <a href="http://www.ietf.org/rfc/rfc3280.txt">
* This extension is defined in <a href="http://tools.ietf.org/html/rfc5280">
* Internet X.509 PKI Certificate and Certificate Revocation List
* (CRL) Profile</a>. The profile permits
* the extension to be included in end-entity or CA certificates,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, 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
@ -44,7 +44,7 @@ import sun.security.util.DerOutputStream;
* <p>
* If used by conforming CRL issuers, this extension is always
* critical. If an implementation ignored this extension it could not
* correctly attribute CRL entries to certificates. PKIX (RFC 3280)
* correctly attribute CRL entries to certificates. PKIX (RFC 5280)
* RECOMMENDS that implementations recognize this extension.
* <p>
* The ASN.1 definition for this is:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, 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
@ -45,7 +45,7 @@ import sun.security.util.*;
*
* <p>
* The extension is defined in Section 5.2.4 of
* <a href="http://www.ietf.org/rfc/rfc3280.txt">Internet X.509 PKI Certific
* <a href="http://tools.ietf.org/html/rfc5280">Internet X.509 PKI Certific
ate and Certificate Revocation List (CRL) Profile</a>.
*
* <p>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, 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
@ -94,7 +94,7 @@ implements CertAttrSet<String> {
public static final String NAME = "ExtendedKeyUsage";
public static final String USAGES = "usages";
// OID defined in RFC 3280 Sections 4.2.1.13
// OID defined in RFC 5280 Sections 4.2.1.12
// more from http://www.alvestrand.no/objectid/1.3.6.1.5.5.7.3.html
private static final Map <ObjectIdentifier, String> map =
new HashMap <ObjectIdentifier, String> ();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, 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
@ -42,7 +42,7 @@ import sun.security.util.*;
*
* <p>
* The extension is defined in Section 5.2.6 of
* <a href="http://www.ietf.org/rfc/rfc3280.txt">Internet X.509 PKI Certific
* <a href="http://tools.ietf.org/html/rfc5280">Internet X.509 PKI Certific
ate and Certificate Revocation List (CRL) Profile</a>.
*
* <p>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2014, 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
@ -33,7 +33,7 @@ import java.util.Enumeration;
import sun.security.util.*;
/**
* From RFC 3280:
* From RFC 5280:
* <p>
* The invalidity date is a non-critical CRL entry extension that
* provides the date on which it is known or suspected that the private

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, 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
@ -46,7 +46,7 @@ import sun.security.util.DerValue;
*
* <p>
* The extension is defined in Section 5.2.5 of
* <a href="http://www.ietf.org/rfc/rfc3280.txt">Internet X.509 PKI Certific
* <a href="http://tools.ietf.org/html/rfc5280">Internet X.509 PKI Certific
ate and Certificate Revocation List (CRL) Profile</a>.
*
* <p>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2014, 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
@ -341,7 +341,7 @@ public class RDN {
/*
* Returns a printable form of this RDN, using RFC 1779 style catenation
* of attribute/value assertions, and emitting attribute type keywords
* from RFCs 1779, 2253, and 3280.
* from RFCs 1779, 2253, and 5280.
*/
public String toString() {
if (assertion.length == 1) {

View File

@ -34,7 +34,7 @@ found in:
Protocol (LDAP) that many organizations are expecting will help
address online certificate distribution over the Internet.
RFC 3280, which describes the Internet X.509 Public Key
RFC 5280, which describes the Internet X.509 Public Key
Infrastructure Certificate and CRL Profile.
RSA DSI has a bunch of "Public Key Cryptography Standards" (PKCS) which

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2014, 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
@ -47,7 +47,7 @@ import sun.security.util.DerValue;
* included in end entity or CA certificates. Conforming CAs MUST mark
* this extension as non-critical.
* <p>
* This extension is defined in <a href="http://www.ietf.org/rfc/rfc3280.txt">
* This extension is defined in <a href="http://tools.ietf.org/html/rfc5280">
* Internet X.509 PKI Certificate and Certificate Revocation List
* (CRL) Profile</a>. The profile permits
* the extension to be included in end-entity or CA certificates,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, 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
@ -35,15 +35,15 @@ import sun.security.util.*;
* This class implements the URIName as required by the GeneralNames
* ASN.1 object.
* <p>
* [RFC3280] When the subjectAltName extension contains a URI, the name MUST be
* [RFC5280] When the subjectAltName extension contains a URI, the name MUST be
* stored in the uniformResourceIdentifier (an IA5String). The name MUST
* be a non-relative URL, and MUST follow the URL syntax and encoding
* rules specified in [RFC 1738]. The name must include both a scheme
* rules specified in [RFC 3986]. The name must include both a scheme
* (e.g., "http" or "ftp") and a scheme-specific-part. The scheme-
* specific-part must include a fully qualified domain name or IP
* address as the host.
* <p>
* As specified in [RFC 1738], the scheme name is not case-sensitive
* As specified in [RFC 3986], the scheme name is not case-sensitive
* (e.g., "http" is equivalent to "HTTP"). The host part is also not
* case-sensitive, but other components of the scheme-specific-part may
* be case-sensitive. When comparing URIs, conforming implementations
@ -113,7 +113,7 @@ public class URIName implements GeneralNameInterface {
}
host = uri.getHost();
// RFC 3280 says that the host should be non-null, but we allow it to
// RFC 5280 says that the host should be non-null, but we allow it to
// be null because some widely deployed certificates contain CDP
// extensions with URIs that have no hostname (see bugs 4802236 and
// 5107944).
@ -148,7 +148,7 @@ public class URIName implements GeneralNameInterface {
/**
* Create the URIName object with the specified name constraint. URI
* name constraints syntax is different than SubjectAltNames, etc. See
* 4.2.1.11 of RFC 3280.
* 4.2.1.10 of RFC 5280.
*
* @param value the URI name constraint
* @throws IOException if name is not a proper URI name constraint
@ -300,7 +300,7 @@ public class URIName implements GeneralNameInterface {
* These results are used in checking NameConstraints during
* certification path verification.
* <p>
* RFC3280: For URIs, the constraint applies to the host part of the name.
* RFC5280: For URIs, the constraint applies to the host part of the name.
* The constraint may specify a host or a domain. Examples would be
* "foo.bar.com"; and ".xyz.com". When the the constraint begins with
* a period, it may be expanded with one or more subdomains. That is,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, 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
@ -605,7 +605,7 @@ public class X500Name implements GeneralNameInterface, Principal {
* Returns a string form of the X.500 distinguished name.
* The format of the string is from RFC 1779. The returned string
* may contain non-standardised keywords for more readability
* (keywords from RFCs 1779, 2253, and 3280).
* (keywords from RFCs 1779, 2253, and 5280).
*/
public String toString() {
if (dn == null) {
@ -866,7 +866,7 @@ public class X500Name implements GeneralNameInterface, Principal {
* O="Sue, Grabbit and Runn" or
* O=Sue\, Grabbit and Runn
*
* This method can parse RFC 1779, 2253 or 4514 DNs and non-standard 3280
* This method can parse RFC 1779, 2253 or 4514 DNs and non-standard 5280
* keywords. Additional keywords can be specified in the keyword/OID map.
*/
private void parseDN(String input, Map<String, String> keywordMap)
@ -1122,7 +1122,7 @@ public class X500Name implements GeneralNameInterface, Principal {
/*
* Selected OIDs from X.520
* Includes all those specified in RFC 3280 as MUST or SHOULD
* Includes all those specified in RFC 5280 as MUST or SHOULD
* be recognized
*/
private static final int commonName_data[] = { 2, 5, 4, 3 };
@ -1220,7 +1220,7 @@ public class X500Name implements GeneralNameInterface, Principal {
ipAddress_oid = intern(ObjectIdentifier.newInternal(ipAddress_data));
/*
* Domain component OID from RFC 1274, RFC 2247, RFC 3280
* Domain component OID from RFC 1274, RFC 2247, RFC 5280
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, 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
@ -63,7 +63,7 @@ import sun.misc.HexDumpEncoder;
* signature BIT STRING }
* </pre>
* More information can be found in
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
* <p>
* The ASN.1 definition of <code>tbsCertList</code> is:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, 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
@ -708,7 +708,7 @@ public class X509CertInfo implements CertAttrSet<String> {
}
/*
* Verify if X.509 V3 Certificate is compliant with RFC 3280.
* Verify if X.509 V3 Certificate is compliant with RFC 5280.
*/
private void verifyCert(X500Name subject,
CertificateExtensions extensions)

View File

@ -345,7 +345,7 @@ networkaddress.cache.negative.ttl=10
# By default, the location of the OCSP responder is determined implicitly
# from the certificate being validated. This property explicitly specifies
# the location of the OCSP responder. The property is used when the
# Authority Information Access extension (defined in RFC 3280) is absent
# Authority Information Access extension (defined in RFC 5280) is absent
# from the certificate or when it requires overriding.
#
# Example,

View File

@ -1376,8 +1376,12 @@ public class Logger {
return;
}
if (!isLoggable(Level.FINER)) return;
for (int i = 0; i < params.length; i++) {
msg = msg + " {" + i + "}";
if (params.length > 0) {
final StringBuilder b = new StringBuilder(msg);
for (int i = 0; i < params.length; i++) {
b.append(' ').append('{').append(i).append('}');
}
msg = b.toString();
}
logp(Level.FINER, sourceClass, sourceMethod, msg, params);
}

View File

@ -92,6 +92,10 @@ typedef struct {
* Code copied to target process
*/
#pragma check_stack (off)
/* Switch off all runtime checks (checks caused by /RTC<x>). They cause the
* generated code to contain relative jumps to check functions which make
* the code position dependent. */
#pragma runtime_checks ("scu", off)
DWORD WINAPI jvm_attach_thread_func(DataBlock *pData)
{
HINSTANCE h;
@ -122,7 +126,7 @@ DWORD WINAPI jvm_attach_thread_func(DataBlock *pData)
void jvm_attach_thread_func_end (void) {
}
#pragma check_stack
#pragma runtime_checks ("scu", restore)
/*
* Class: sun_tools_attach_VirtualMachineImpl

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2014, 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
@ -140,7 +140,7 @@ public final class TimestampedSigner extends ContentSigner {
/**
* Examine the certificate for a Subject Information Access extension
* (<a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280</a>).
* (<a href="http://tools.ietf.org/html/rfc5280">RFC 5280</a>).
* The extension's <tt>accessMethod</tt> field should contain the object
* identifier defined for timestamping: 1.3.6.1.5.5.7.48.3 and its
* <tt>accessLocation</tt> field should contain an HTTP or HTTPS URL.

View File

@ -365,7 +365,6 @@ needs_jdk = \
java/util/zip/3GBZipFiles.sh \
jdk/lambda/FDTest.java \
jdk/lambda/separate/Compiler.java \
sun/management/jdp/JdpTest.sh \
sun/management/jmxremote/bootstrap/JvmstatCountersTest.java \
sun/management/jmxremote/bootstrap/LocalManagementTest.java \
sun/management/jmxremote/bootstrap/CustomLauncherTest.java \

View File

@ -184,7 +184,8 @@ public class RunToExit {
if (exitCode == 0 && error_seen == 0) {
System.out.println("Test passed - server debuggee cleanly terminated");
} else {
throw new RuntimeException("Test failed - server debuggee generated an error when it terminated");
throw new RuntimeException("Test failed - server debuggee generated an error when it terminated, " +
"exit code was " + exitCode + ", " + error_seen + " error(s) seen in debugee output.");
}
}
}

View File

@ -0,0 +1,173 @@
/*
* Copyright (c) 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import java.util.logging.StreamHandler;
/**
* @test
* @bug 8028788
* @summary tests that the message format string is correctly constructed
* by Logger.entering
* @run main/othervm LoggerEnteringWithParams
* @author daniel fuchs
*/
public class LoggerEnteringWithParams {
final static Object[] data = {
"one", "two", "three", "four", "five", "six", "seven", "eight"
};
static final class TestHandler extends Handler {
final List<LogRecord> events = new CopyOnWriteArrayList<>();
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
final StreamHandler wrapped = new StreamHandler(bytes, new SimpleFormatter());
@Override
public void publish(LogRecord record) {
events.add(record);
wrapped.publish(record);
wrapped.flush();
}
@Override
public void flush() {
wrapped.flush();
}
@Override
public void close() throws SecurityException {
wrapped.close();
}
@Override
public synchronized void setLevel(Level newLevel) throws SecurityException {
super.setLevel(newLevel);
wrapped.setLevel(newLevel);
}
public void reset() {
bytes.reset();
events.clear();
}
}
public static void main(String[] args) {
Logger logger = Logger.getLogger("some.logger");
TestHandler handler = new TestHandler();
logger.setUseParentHandlers(false);
handler.setLevel(Level.ALL);
logger.setLevel(Level.FINEST);
logger.addHandler(handler);
// Auto-detect the line termination used by SimpleFormatter - (CR vs CRLF)
logger.entering("test", "test");
final String test = handler.bytes.toString();
System.out.println(test);
final String lineEnd = test.substring(test.indexOf("ENTRY")+"ENTRY".length());
System.out.print("Line termination is " + lineEnd.length() + " char(s) long:");
for (int i=0; i<lineEnd.length(); i++) {
System.out.print(" code="+(int)lineEnd.charAt(i));
}
System.out.println();
handler.reset();
for (int i=0 ; i<=data.length; i++) {
final StringBuilder b = new StringBuilder("ENTRY");
final StringBuilder f = new StringBuilder("ENTRY");
final Object[] params = new Object[i];
for (int k=0; k<i; k++) {
params[k] = data[k];
b.append(' ').append(String.valueOf(params[k]));
f.append(" {").append(String.valueOf(k)).append('}');
}
final String expected = b.toString();
final String format = f.toString();
final String className = "class"+i;
final String methodName = "method"+i;
logger.entering(className, methodName, params);
final String logged = handler.bytes.toString();
System.out.println("got:\n" + logged);
if (!logged.contains(className)) {
throw new RuntimeException("Marker for " + className
+ " not found."
+ "\n\tgot: <<\n" + logged + "\t >>");
}
if (!logged.contains(methodName)) {
throw new RuntimeException("Marker for " + methodName
+ " not found."
+ "\n\tgot: <<\n" + logged + "\t >>");
}
if (!logged.contains(expected)) {
throw new RuntimeException("Marker for parameters[size="
+ i + "] not found"
+ "\n\tgot: <<\n" + logged + "\t >>");
}
if (!logged.contains(expected+lineEnd)) {
throw new RuntimeException("Marker for parameters[size="
+ i + "] has extra characters"
+ "\n\tgot: <<\n" + logged + "\t >>");
}
LogRecord record = handler.events.remove(0);
if (!handler.events.isEmpty()) {
throw new RuntimeException("Handler has more log records: "
+ handler.events.toString());
}
if (!className.equals(record.getSourceClassName())) {
throw new RuntimeException("Unexpected class name in LogRecord."
+ "\n\texpected: " + className
+ "\n\tgot: " + record.getSourceClassName());
}
if (!methodName.equals(record.getSourceMethodName())) {
throw new RuntimeException("Unexpected method name in LogRecord."
+ "\n\texpected: " + methodName
+ "\n\tgot: " + record.getSourceMethodName());
}
if (!format.equals(record.getMessage())) {
throw new RuntimeException("Unexpected message format in LogRecord."
+ "\n\texpected: " + format
+ "\n\tgot: " + record.getMessage());
}
if (!Arrays.deepEquals(params, record.getParameters())) {
throw new RuntimeException("Unexpected parameter array in LogRecord."
+ "\n\texpected: " + Arrays.toString(params)
+ "\n\tgot: " + Arrays.toString(record.getParameters()));
}
handler.reset();
}
}
}

View File

@ -1,2 +1,3 @@
# JDBC unit tests uses TestNG
TestNG.dirs= .
TestNG.dirs= .
othervm.dirs= .

View File

@ -0,0 +1 @@
invalid.RowSetFactoryImpl

View File

@ -0,0 +1 @@
util.StubRowSetFactory

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package test.rowset;
import java.sql.SQLException;
import javax.sql.rowset.RowSetFactory;
import javax.sql.rowset.RowSetProvider;
import static org.testng.Assert.*;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import util.BaseTest;
public class RowSetFactoryTests extends BaseTest {
// RowSet implementations that we are testing for
private final String DEFAULT_CACHEDROWSET_CLASSNAME = "com.sun.rowset.CachedRowSetImpl";
private final String DEFAULT_FILTEREDROWSET_CLASSNAME = "com.sun.rowset.FileteredRowSetImpl";
private final String DEFAULT_JDBCROWSET_CLASSNAME = "com.sun.rowset.JdbcRowSetImpl";
private final String DEFAULT_JOINROWSET_CLASSNAME = "com.sun.rowset.JoinRowSetImpl";
private final String DEFAULT_WEBROWSET_CLASSNAME = "com.sun.rowset.WebRowSetImpl";
private final String STUB_FACTORY_CLASSNAME = "util.StubRowSetFactory";
private final String STUB_CACHEDROWSET_CLASSNAME = "util.StubCachedRowSetImpl";
private final String STUB_FILTEREDROWSET_CLASSNAME = "util.StubFilteredRowSetImpl";
private final String STUB_JDBCROWSET_CLASSNAME = "util.StubJdbcRowSetImpl";
private final String STUB_JOINROWSET_CLASSNAME = "util.StubJoinRowSetImpl";
private final String STUB_WEBROWSET_CLASSNAME = "util.StubWebRowSetImpl";
/*
* Validate that the RowSetFactory returned by RowSetProvider.newFactory()
* returns the correct RowSet implementations
*/
@Test(dataProvider = "RowSetValues", enabled = true)
public void test(RowSetFactory rsf, String impl) throws SQLException {
validateRowSetImpl(rsf, impl);
}
/*
* Utility Method to validate the RowsetFactory returns the correct
* RowSet implementation
*/
private void validateRowSetImpl(RowSetFactory rsf, String implName)
throws SQLException {
assertNotNull(rsf, "RowSetFactory should not be null");
switch (implName) {
case DEFAULT_CACHEDROWSET_CLASSNAME:
assertTrue(rsf.createCachedRowSet() instanceof com.sun.rowset.CachedRowSetImpl);
break;
case DEFAULT_FILTEREDROWSET_CLASSNAME:
assertTrue(rsf.createFilteredRowSet() instanceof com.sun.rowset.FilteredRowSetImpl);
break;
case DEFAULT_JDBCROWSET_CLASSNAME:
assertTrue(rsf.createJdbcRowSet() instanceof com.sun.rowset.JdbcRowSetImpl);
break;
case DEFAULT_JOINROWSET_CLASSNAME:
assertTrue(rsf.createJoinRowSet() instanceof com.sun.rowset.JoinRowSetImpl);
break;
case DEFAULT_WEBROWSET_CLASSNAME:
assertTrue(rsf.createWebRowSet() instanceof com.sun.rowset.WebRowSetImpl);
break;
case STUB_CACHEDROWSET_CLASSNAME:
assertTrue(rsf.createCachedRowSet() instanceof util.StubCachedRowSetImpl);
break;
case STUB_FILTEREDROWSET_CLASSNAME:
assertTrue(rsf.createFilteredRowSet() instanceof util.StubFilteredRowSetImpl);
break;
case STUB_JDBCROWSET_CLASSNAME:
assertTrue(rsf.createJdbcRowSet() instanceof util.StubJdbcRowSetImpl);
break;
case STUB_WEBROWSET_CLASSNAME:
assertTrue(rsf.createWebRowSet() instanceof util.StubWebRowSetImpl);
break;
}
}
/*
* DataProvider used to provide the RowSetFactory and the RowSet
* implementation that should be returned
*/
@DataProvider(name = "RowSetValues")
private Object[][] RowSetValues() throws SQLException {
RowSetFactory rsf = RowSetProvider.newFactory();
RowSetFactory rsf1 = RowSetProvider.newFactory(STUB_FACTORY_CLASSNAME, null);
return new Object[][]{
{rsf, DEFAULT_CACHEDROWSET_CLASSNAME},
{rsf, DEFAULT_FILTEREDROWSET_CLASSNAME},
{rsf, DEFAULT_JDBCROWSET_CLASSNAME},
{rsf, DEFAULT_JOINROWSET_CLASSNAME},
{rsf, DEFAULT_WEBROWSET_CLASSNAME},
{rsf1, STUB_CACHEDROWSET_CLASSNAME},
{rsf1, STUB_FILTEREDROWSET_CLASSNAME},
{rsf1, STUB_JDBCROWSET_CLASSNAME},
{rsf1, STUB_JOINROWSET_CLASSNAME},
{rsf1, STUB_WEBROWSET_CLASSNAME}
};
}
}

View File

@ -0,0 +1,189 @@
/*
* Copyright (c) 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package test.rowset;
import com.sun.rowset.RowSetFactoryImpl;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import java.sql.SQLException;
import javax.sql.rowset.RowSetFactory;
import javax.sql.rowset.RowSetProvider;
import static org.testng.Assert.*;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import util.BaseTest;
import util.StubRowSetFactory;
public class RowSetProviderTests extends BaseTest {
// Default RowSetFactory Implementation
private final String DEFFAULT_FACTORY_CLASSNAME = "com.sun.rowset.RowSetFactoryImpl";
// Stub RowSetFactory Implementation
private final String STUB_FACTORY_CLASSNAME = "util.StubRowSetFactory";
// Indicator that the factory implementation does not need to be checked
private final String NO_VALADATE_IMPL = "";
// Original System property value for javax.sql.rowset.RowSetFactory
private static String origFactoryProperty;
// Original ClassLoader
private static ClassLoader cl;
// Path to the location of the jar files used by the ServiceLoader API
private static String jarPath;
/*
* Save off the original property value for javax.sql.rowset.RowSetFactory,
* original classloader and define the path to the jars directory
*/
@BeforeClass
public static void setUpClass() throws Exception {
origFactoryProperty = System.getProperty("javax.sql.rowset.RowSetFactory");
cl = Thread.currentThread().getContextClassLoader();
jarPath = System.getProperty("test.src", ".") + File.separatorChar
+ "jars" + File.separatorChar;
}
/*
* Install the original javax.sql.rowset.RowSetFactory property value
*/
@AfterClass
public static void tearDownClass() throws Exception {
if (origFactoryProperty != null) {
System.setProperty("javax.sql.rowset.RowSetFactory",
origFactoryProperty);
}
}
/*
* Clear the javax.sql.rowset.RowSetFactory property value and
* reset the classloader to its original value
*/
@AfterMethod
public void tearDownMethod() throws Exception {
System.clearProperty("javax.sql.rowset.RowSetFactory");
Thread.currentThread().setContextClassLoader(cl);
}
/*
* Validate that the correct RowSetFactory is returned by newFactory().
*/
@Test(dataProvider = "RowSetFactoryValues")
public void test(RowSetFactory rsf, String impl) throws SQLException {
validateProvider(rsf, impl);
}
/*
* Validate that the default RowSetFactory is returned by newFactory()
* when specified by the javax.sql.rowset.RowSetFactory property.
*/
@Test
public void test01() throws SQLException {
System.setProperty("javax.sql.rowset.RowSetFactory",
DEFFAULT_FACTORY_CLASSNAME);
validateProvider(RowSetProvider.newFactory(), DEFFAULT_FACTORY_CLASSNAME);
}
/*
* Validate that the correct RowSetFactory is returned by newFactory()
* when specified by the javax.sql.rowset.RowSetFactory property.
*/
@Test(enabled = true)
public void test02() throws SQLException {
System.setProperty("javax.sql.rowset.RowSetFactory", STUB_FACTORY_CLASSNAME);
validateProvider(RowSetProvider.newFactory(), STUB_FACTORY_CLASSNAME);
}
/*
* Validate that a SQLException is thrown by newFactory()
* when specified RowSetFactory specified by the
* javax.sql.rowset.RowSetFactory property is not valid.
*/
@Test(expectedExceptions = SQLException.class)
public void test03() throws SQLException {
System.setProperty("javax.sql.rowset.RowSetFactory",
"invalid.RowSetFactoryImpl");
RowSetFactory rsf = RowSetProvider.newFactory();
}
/*
* Validate that the correct RowSetFactory is returned by newFactory()
* when specified by the ServiceLoader API.
*/
@Test
public void test04() throws Exception {
File f = new File(jarPath + "goodFactory");
URLClassLoader loader = new URLClassLoader(new URL[]{
new URL(f.toURI().toString())}, getClass().getClassLoader());
Thread.currentThread().setContextClassLoader(loader);
validateProvider(RowSetProvider.newFactory(), STUB_FACTORY_CLASSNAME);
}
/*
* Validate that a SQLException is thrown by newFactory() if the default
* RowSetFactory specified by the ServiceLoader API is not valid
*/
@Test(expectedExceptions = SQLException.class)
public void test05() throws Exception {
File f = new File(jarPath + "badFactory");
URLClassLoader loader = new URLClassLoader(new URL[]{
new URL(f.toURI().toString())}, getClass().getClassLoader());
Thread.currentThread().setContextClassLoader(loader);
RowSetProvider.newFactory();
}
/*
* Utility Method to validate that the RowsetFactory returned from
* RowSetProvider.newFactory() is correct
*/
private void validateProvider(RowSetFactory rsf, String implName) {
assertNotNull(rsf, "RowSetFactory should not be null");
switch (implName) {
case DEFFAULT_FACTORY_CLASSNAME:
assertTrue(rsf instanceof RowSetFactoryImpl);
break;
case STUB_FACTORY_CLASSNAME:
assertTrue(rsf instanceof StubRowSetFactory);
break;
default:
}
}
/*
* DataProvider used to provide a RowSetFactory and the expected
* RowSetFactory implementation that should be returned
*/
@DataProvider(name = "RowSetFactoryValues")
private Object[][] RowSetFactoryValues() throws SQLException {
RowSetFactory rsf = RowSetProvider.newFactory();
RowSetFactory rsf1 = RowSetProvider.newFactory(STUB_FACTORY_CLASSNAME, null);
RowSetFactory rsf2 = RowSetProvider.newFactory(DEFFAULT_FACTORY_CLASSNAME, null);
return new Object[][]{
{rsf, NO_VALADATE_IMPL},
{rsf, DEFFAULT_FACTORY_CLASSNAME},
{rsf1, STUB_FACTORY_CLASSNAME},
{rsf2, DEFFAULT_FACTORY_CLASSNAME}
};
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package util;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.FilteredRowSet;
import javax.sql.rowset.JdbcRowSet;
import javax.sql.rowset.JoinRowSet;
import javax.sql.rowset.RowSetFactory;
import javax.sql.rowset.WebRowSet;
public class StubRowSetFactory implements RowSetFactory {
@Override
public CachedRowSet createCachedRowSet() throws SQLException {
return new StubCachedRowSetImpl();
}
@Override
public FilteredRowSet createFilteredRowSet() throws SQLException {
return new StubFilteredRowSetImpl();
}
@Override
public JdbcRowSet createJdbcRowSet() throws SQLException {
return new StubJdbcRowSetImpl();
}
@Override
public JoinRowSet createJoinRowSet() throws SQLException {
return new StubJoinRowSetImpl();
}
@Override
public WebRowSet createWebRowSet() throws SQLException {
return new StubWebRowSetImpl();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,190 +0,0 @@
/*
* Copyright (c) 2012, 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.net.ProtocolFamily;
import java.net.StandardProtocolFamily;
import java.net.StandardSocketOptions;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Map;
import sun.management.jdp.JdpException;
import sun.management.jdp.JdpJmxPacket;
import sun.management.jdp.JdpPacketReader;
public class JdpClient {
private static class PacketListener implements Runnable {
private static final int BUFFER_LENGTH = 4096;
private final DatagramChannel channel;
private static int maxPacketCount = 1;
private static int maxEmptyPacketCount = 10;
private void get(Map<?, ?> map, String key)
throws JdpException {
if (map.get(key) == null) {
throw new JdpException("Test failed, packet field " + key + " missed");
}
}
private void checkFieldPresence(JdpJmxPacket p)
throws IOException, JdpException {
byte[] b = p.getPacketData();
JdpPacketReader reader = new JdpPacketReader(b);
Map<String, String> pMap = reader.getDiscoveryDataAsMap();
get(pMap, JdpJmxPacket.UUID_KEY);
get(pMap, JdpJmxPacket.MAIN_CLASS_KEY);
get(pMap, JdpJmxPacket.JMX_SERVICE_URL_KEY);
// get(pMap, JdpJmxPacket.INSTANCE_NAME_KEY);
get(pMap, JdpJmxPacket.PROCESS_ID_KEY);
get(pMap, JdpJmxPacket.BROADCAST_INTERVAL_KEY);
get(pMap, JdpJmxPacket.RMI_HOSTNAME_KEY);
}
PacketListener(DatagramChannel channel) {
this.channel = channel;
}
@java.lang.Override
public void run() {
try {
Selector sel;
sel = Selector.open();
channel.configureBlocking(false);
channel.register(sel, SelectionKey.OP_READ);
ByteBuffer buf = ByteBuffer.allocate(1024);
int count = 1;
int emptyPacketsCount = 1;
try {
while (true) {
// Use tcpdump -U -w - -s 1400 -c 2 -vv port 7095
// to verify that correct packet being sent
sel.selectedKeys().clear();
buf.rewind();
sel.select(10 * 1000);
channel.receive(buf);
if (buf.position() == 0) {
if (JdpDoSomething.getVerbose()) {
System.err.println("Empty packet received");
}
if (++emptyPacketsCount > maxEmptyPacketCount) {
throw new RuntimeException("Test failed, maxEmptyPacketCount reached");
}
continue;
}
buf.flip();
byte[] dgramData = new byte[buf.remaining()];
buf.get(dgramData);
try {
JdpJmxPacket packet = new JdpJmxPacket(dgramData);
JdpDoSomething.printJdpPacket(packet);
checkFieldPresence(packet);
if (++count > maxPacketCount) {
break;
}
} catch (JdpException e) {
e.printStackTrace();
throw new RuntimeException("Test failed");
}
}
System.out.println("OK: Test passed");
} finally {
sel.close();
channel.close();
}
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Test failed");
}
}
}
public static void main(String[] args) {
try {
String discoveryPort = System.getProperty("com.sun.management.jdp.port");
String discoveryAddress = System.getProperty("com.sun.management.jdp.address");
if (discoveryAddress == null || discoveryPort == null) {
System.out.println("Test failed. address and port must be specified");
return;
}
int port = Integer.parseInt(discoveryPort);
InetAddress address = InetAddress.getByName(discoveryAddress);
ProtocolFamily family = (address instanceof Inet6Address)
? StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
DatagramChannel channel;
channel = DatagramChannel.open(family);
channel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
channel.bind(new InetSocketAddress(port));
Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();
for (NetworkInterface interf : Collections.list(nets)) {
if (interf.supportsMulticast()) {
try {
channel.join(address, interf);
} catch (IOException e) {
// Skip not configured interfaces
}
}
}
PacketListener listener = new PacketListener(channel);
new Thread(listener, "Jdp Client").start();
} catch (RuntimeException e) {
System.out.println("Test failed.");
} catch (Exception e) {
e.printStackTrace();
System.out.println("Test failed. unexpected error " + e);
}
}
}

View File

@ -25,6 +25,9 @@
* A JVM with JDP on should send multicast JDP packets regularly.
*
* @author Alex Schenkman
*/
/*
* @test JdpDefaultsTest
* @summary Assert that we can read JDP packets from a multicast socket connection, on default IP and port.
* @library /lib/testlibrary

View File

@ -1,106 +0,0 @@
/*
* Copyright (c) 2012, 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Objects;
import sun.management.jdp.JdpJmxPacket;
import sun.management.jdp.JdpException;
public class JdpDoSomething {
private static final String lockFileName = "JdpDoSomething.lck";
private static final boolean verbose = false;
public static boolean getVerbose() {
return verbose;
}
public static void printJdpPacket(JdpJmxPacket p) {
if (getVerbose()) {
try {
RandomAccessFile f = new RandomAccessFile("out.dmp", "rw");
f.write(p.getPacketData());
f.close();
} catch (IOException e) {
System.out.println("Can't write a dump file: " + e);
}
System.out.println("Id: " + p.getId());
System.out.println("Jmx: " + p.getJmxServiceUrl());
System.out.println("Main: " + p.getMainClass());
System.out.println("InstanceName: " + p.getInstanceName());
System.out.println("ProccessId: " + p.getProcessId());
System.out.println("BroadcastInterval: " + p.getBroadcastInterval());
System.out.println("Rmi Hostname: " + p.getRmiHostname());
System.out.flush();
}
}
public static void compaireJdpPacketEx(JdpJmxPacket p1, JdpJmxPacket p2)
throws JdpException {
if (!Objects.equals(p1, p1)) {
throw new JdpException("Packet mismatch error");
}
if (!Objects.equals(p1.getMainClass(), p2.getMainClass())) {
throw new JdpException("Packet mismatch error (main class)");
}
if (!Objects.equals(p1.getInstanceName(), p2.getInstanceName())) {
throw new JdpException("Packet mismatch error (instance name)");
}
}
public static void doSomething() {
try {
File lockFile = new File(lockFileName);
lockFile.createNewFile();
while (lockFile.exists()) {
long datetime = lockFile.lastModified();
long epoch = System.currentTimeMillis() / 1000;
// Don't allow test app to run more than an hour
if (epoch - datetime > 3600) {
System.err.println("Lock is too old. Aborting");
return;
}
Thread.sleep(1);
}
} catch (Throwable e) {
System.err.println("Something bad happens:" + e);
}
}
public static void main(String args[]) throws Exception {
System.err.println("main enter");
doSomething();
System.err.println("main exit");
}
}

View File

@ -26,6 +26,9 @@
* com.sun.management.jmxremote.autodiscovery=false should be respected.
*
* @author Alex Schenkman
*/
/*
* @test JdpOffTest.java
* @summary Assert that no JDP packets are sent to the default address and port.
* @library /lib/testlibrary

View File

@ -25,6 +25,9 @@
* A JVM with JDP on should send multicast JDP packets regularly.
*
* @author Alex Schenkman
*/
/*
* @test JdpSpecificAddressTest
* @summary Assert that we can read JDP packets from a multicast socket connection, on specific IP and port.
* @library /lib/testlibrary

View File

@ -1,358 +0,0 @@
#!/bin/sh -x
# Copyright (c) 2011, 2013, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
# @test
# @bug 7169888
# @compile -XDignore.symbol.file JdpUnitTest.java JdpClient.java JdpDoSomething.java
# @run shell JdpTest.sh --jtreg --no-compile
# @summary No word Failed expected in the test output
_verbose=no
_jtreg=no
_compile=yes
# temporary disable jcmd related tests
# _testsuite="01,02,03,04,05"
_testsuite="01"
_pwd=`pwd`
_testclasses=".classes"
_testsrc="${_pwd}"
_lockFileName="JdpDoSomething.lck"
_logname=".classes/output.txt"
_last_pid=""
_ip="224.0.23.178"
_port="7095"
_jmxport="4545"
_do_compile(){
# If the test run without JTReg, we have to compile it by our self
# Under JTReg see @compile statement above
# sun.* packages is not included to symbol file lib/ct.sym so we have
# to ignore it
if [ ! -d ${_testclasses} ]
then
mkdir -p ${_testclasses}
fi
rm -f ${_testclasses}/*.class
# Compile testcase
${COMPILEJAVA}/bin/javac -XDignore.symbol.file -d ${_testclasses} \
JdpUnitTest.java \
JdpDoSomething.java \
JdpClient.java
if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ]
then
echo "ERROR: Can't compile"
exit 255
fi
}
_app_start(){
testappname=$1
shift
${TESTJAVA}/bin/java -server $* -cp ${_testclasses} ${testappname} >> ${_logname} 2>&1 &
_last_pid=$!
# wait until VM is actually starts.
# please note, if vm doesn't start for some reason
# jtreg kills the test by timeout. Don't file a bug.
cnt=1
while true
do
npid=`_get_pid`
if [ "${npid}" != "" ]
then
break
fi
if [ "${cnt}" = "10" ]
then
echo "ERROR: Test app not started. Please check machine resources before filing a bug."
if [ "${_jtreg}" = "yes" ]
then
exit 255
fi
break
fi
cnt=`expr $cnt + 1`
sleep 1
done
}
_get_pid(){
${TESTJAVA}/bin/jps | sed -n "/Jdp/s/ .*//p"
}
_app_stop(){
rm ${_lockFileName}
# wait until VM is actually shuts down
while true
do
npid=`_get_pid`
if [ "${npid}" = "" ]
then
break
fi
sleep 1
done
}
_testme(){
${TESTJAVA}/bin/java \
-cp ${_testclasses} \
$* \
-Dcom.sun.management.jdp.port=${_port} \
-Dcom.sun.management.jdp.address=${_ip} \
JdpClient
}
_jcmd(){
${TESTJAVA}/bin/jcmd JdpDoSomething $* > /dev/null 2>/dev/null
}
_echo(){
echo "$*"
echo "$*" >> ${_logname}
}
# ============= TESTS ======================================
test_01(){
_echo "**** Test one ****"
_app_start JdpUnitTest \
-Dcom.sun.management.jdp.port=${_port} \
-Dcom.sun.management.jdp.address=${_ip} \
-Dcom.sun.management.jdp.name=testme \
-Djava.rmi.server.hostname=localhost \
-Dcom.sun.management.jdp.pause=5
res=`_testme`
case "${res}" in
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
_app_stop
}
test_02(){
_echo "**** Test two ****"
_app_start JdpDoSomething \
-Dcom.sun.management.jdp.port=${_port} \
-Dcom.sun.management.jdp.address=${_ip} \
-Dcom.sun.management.jdp.pause=5 \
-Dcom.sun.management.jdp.name=testme \
-Djava.rmi.server.hostname=localhost \
-Dcom.sun.management.jmxremote.port=${_jmxport} \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false
res=`_testme`
case "${res}" in
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
_app_stop
}
test_03(){
_echo "**** Test three ****"
_app_start JdpDoSomething
_jcmd ManagementAgent.start\
jdp.port=${_port} \
jdp.address=${_ip} \
jdp.pause=5 \
jdp.name=jcmdtest \
jmxremote.port=${_jmxport} \
jmxremote.authenticate=false \
jmxremote.ssl=false
res=`_testme`
case "${res}" in
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
_app_stop
}
test_04(){
_echo "**** Test four ****"
_app_start JdpDoSomething \
-Dcom.sun.management.jmxremote.autodiscovery=true \
-Dcom.sun.management.jdp.name=testme \
-Djava.rmi.server.hostname=localhost \
-Dcom.sun.management.jmxremote.port=${_jmxport} \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false
res=`_testme`
case "${res}" in
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
_app_stop
}
test_05(){
_echo "**** Test five ****"
_app_start JdpDoSomething
_jcmd ManagementAgent.start\
jmxremote.autodiscovery=true \
jmxremote.port=${_jmxport} \
jmxremote.authenticate=false \
jmxremote.ssl=false
res=`_testme`
case "${res}" in
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
_app_stop
}
# ============= MAIN =======================================
if [ "x${TESTJAVA}" = "x" ]
then
echo "TESTJAVA env have to be set"
exit
fi
# COMPILEJAVA variable is set when we test jre
if [ "x${COMPILEJAVA}" = "x" ]
then
COMPILEJAVA="${TESTJAVA}"
fi
#------------------------------------------------------------------------------
# reading parameters
for parm in "$@"
do
case $parm in
--verbose) _verbose=yes ;;
--jtreg) _jtreg=yes ;;
--no-compile) _compile=no ;;
--testsuite=*) _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"` ;;
*)
echo "Undefined parameter $parm. Try --help for help"
exit
;;
esac
done
if [ "${_compile}" = "yes" ]
then
_do_compile
fi
if [ "${_jtreg}" = "yes" ]
then
_testclasses=${TESTCLASSES}
_testsrc=${TESTSRC}
_logname="output.txt"
fi
# Make sure _tesclasses is absolute path
tt=`echo ${_testclasses} | sed -e 's,/,,'`
if [ "${tt}" = "${_testclasses}" ]
then
_testclasses="${_pwd}/${_testclasses}"
fi
_policyname="${_testclasses}/policy"
rm -f ${_logname}
rm -f ${_policyname}
if [ -f ${_testsrc}/policy.tpl ]
then
cat ${_testsrc}/policy.tpl | \
sed -e "s,@_TESTCLASSES@,${_testclasses},g" -e "s,@TESTJAVA@,${TESTJAVA},g" \
> ${_policyname}
fi
# Local mode tests
for i in `echo ${_testsuite} | sed -e "s/,/ /g"`
do
test_${i}
done

View File

@ -1,96 +0,0 @@
/*
* Copyright (c) 2012, 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.IOException;
import java.net.InetAddress;
import java.util.UUID;
import sun.management.jdp.JdpController;
import sun.management.jdp.JdpPacket;
import sun.management.jdp.JdpJmxPacket;
import sun.management.jdp.JdpException;
public class JdpUnitTest {
static byte[] russian_name = {(byte) 0xd0, (byte) 0xbf, (byte) 0xd1, (byte) 0x80, (byte) 0xd0, (byte) 0xbe, (byte) 0xd0, (byte) 0xb2,
(byte) 0xd0, (byte) 0xb5, (byte) 0xd1, (byte) 0x80, (byte) 0xd0, (byte) 0xba, (byte) 0xd0, (byte) 0xb0,
(byte) 0x20, (byte) 0xd1, (byte) 0x81, (byte) 0xd0, (byte) 0xb2, (byte) 0xd1, (byte) 0x8f, (byte) 0xd0,
(byte) 0xb7, (byte) 0xd0, (byte) 0xb8, (byte) 0x0a};
/**
* This test tests that complete packet is build correctly
*/
public static void PacketBuilderTest()
throws IOException, JdpException {
/* Complete packet test */
{
JdpJmxPacket p1 = new JdpJmxPacket(UUID.randomUUID(), "fake://unit-test");
p1.setMainClass("FakeUnitTest");
p1.setInstanceName(new String(russian_name, "UTF-8"));
byte[] b = p1.getPacketData();
JdpJmxPacket p2 = new JdpJmxPacket(b);
JdpDoSomething.printJdpPacket(p1);
JdpDoSomething.compaireJdpPacketEx(p1, p2);
}
/*Missed field packet test*/
{
JdpJmxPacket p1 = new JdpJmxPacket(UUID.randomUUID(), "fake://unit-test");
p1.setMainClass("FakeUnitTest");
p1.setInstanceName(null);
byte[] b = p1.getPacketData();
JdpJmxPacket p2 = new JdpJmxPacket(b);
JdpDoSomething.printJdpPacket(p1);
JdpDoSomething.compaireJdpPacketEx(p1, p2);
}
System.out.println("OK: Test passed");
}
public static void startFakeDiscoveryService()
throws IOException, JdpException {
String discoveryPort = System.getProperty("com.sun.management.jdp.port");
String discoveryAddress = System.getProperty("com.sun.management.jdp.address");
InetAddress address = InetAddress.getByName(discoveryAddress);
int port = Integer.parseInt(discoveryPort);
JdpController.startDiscoveryService(address, port, "FakeDiscovery", "fake://unit-test");
}
public static void main(String[] args) {
try {
PacketBuilderTest();
startFakeDiscoveryService();
JdpDoSomething.doSomething();
} catch (Throwable e) {
e.printStackTrace();
System.out.println("Test failed. unexpected error " + e);
}
}
}

View File

@ -1,32 +1,4 @@
The following test were contributed by dmitry.samersoff@oracle.com and will be ported in the near future:
JdpClient.java
JdpDoSomething.java
JdpTest.sh
JdpUnitTest.java
JdpTest.sh:
-------------------------------------
test_01 - basic test, check if JDP packet assembler and other
parts of JDP is not broken
test_02 - test if JDP starts with custom parameters. (disabled)
test_03 - test if jcmd is able to start jdp with
custom parameters (disabled)
test_04 - test if JDP starts with default parameters (disabled)
test_05 - test if jcmd is able to start jdp with default
parameters (disabled)
Only test_01 is enabled at the moment.
JdpUnitTest.java: contains unit tests used under development.
==========================================================================
The other Java-based tests in this folder are contributed by alex.schenkman@oracle.com
The tests in this folder are contributed by alex.schenkman@oracle.com
There are three Jdp test cases in this folder:
1) Jdp is turned off.

View File

@ -47,7 +47,7 @@ import java.util.concurrent.FutureTask;
* @summary Verify if CallerSensitive methods are annotated with
* sun.reflect.CallerSensitive annotation
* @build CallerSensitiveFinder
* @run main/othervm/timeout=900 -mx600m CallerSensitiveFinder
* @run main/othervm/timeout=900 CallerSensitiveFinder
*/
public class CallerSensitiveFinder {
private static int numThreads = 3;

View File

@ -189,6 +189,8 @@ public abstract class PKCS11Test {
if (osName.startsWith("Win")) {
osName = "Windows";
NSPR_PREFIX = "lib";
} else if (osName.equals("Mac OS X")) {
osName = "MacOSX";
}
String osid = osName + "-"
+ props.getProperty("os.arch") + "-" + props.getProperty("sun.arch.data.model");
@ -507,6 +509,8 @@ public abstract class PKCS11Test {
PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)});
osMap.put("Windows-amd64-64", new String[]{
PKCS11_BASE + "/nss/lib/windows-amd64/".replace('/', SEP)});
osMap.put("MacOSX-x86_64-64", new String[]{
PKCS11_BASE + "/nss/lib/macosx-x86_64/"});
}
private final static char[] hexDigits = "0123456789abcdef".toCharArray();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2014, 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
@ -23,7 +23,7 @@
/**
* @test
* @bug 6298106 6275523 6420252
* @bug 6298106 6275523 6420252 8059627
* @summary make sure we can access the NSS trust anchor module
* @author Andreas Sterbenz
* @library ..
@ -43,10 +43,12 @@ public class TrustAnchors extends SecmodTest {
return;
}
if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
// our secmod.db file says nssckbi.*so*, so NSS does not find the
// *DLL* on windows.
System.out.println("Test currently does not work on Windows, skipping");
// our secmod.db file says nssckbi.*so*, so NSS does not find the
// *DLL* on Windows nor the *DYLIB* on Mac OSX.
String osName = System.getProperty("os.name").toLowerCase();
if (osName.startsWith("win") || osName.startsWith("mac")) {
System.out.println("Test currently does not work on " + osName +
", skipping");
return;
}

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2014, 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
@ -22,7 +22,7 @@
#
# @test
# @bug 7133495
# @bug 7133495 8041740
# @summary [macosx] KeyChain KeyStore implementation retrieves only one private key entry
if [ "${TESTJAVA}" = "" ] ; then
@ -49,8 +49,10 @@ PWD="xxxxxx"
KEYTOOL="${TESTJAVA}/bin/keytool ${TESTTOOLVMOPTS} -storetype KeychainStore -keystore NONE -storepass $PWD"
TEMPORARY_P12="$TESTCLASSES/7133495.p12"
TEMPORARY_KC="$TESTCLASSES/7133495.keychain"
TEMPORARY_LIST="$TESTCLASSES/7133495.tmp"
CLEANUP_P12="rm -f $TEMPORARY_P12"
CLEANUP_KC="security delete-keychain $TEMPORARY_KC"
CLEANUP_LIST="rm -f $TEMPORARY_LIST"
# Count the number of private key entries in the Keychain keystores
@ -115,6 +117,15 @@ if [ $? -ne 0 ]; then
fi
echo "Imported keypairs from PKCS12 keystore into the keychain"
# Adjust the keychain search order
echo "\"$TEMPORARY_KC\"" > $TEMPORARY_LIST
security list-keychains >> $TEMPORARY_LIST
security list-keychains -s `xargs < ${TEMPORARY_LIST}`
`$CLEANUP_LIST`
echo "Temporary keychain search order:"
security list-keychains
# Recount the number of private key entries in the Keychain keystores
COUNT=`$KEYTOOL -list | grep PrivateKeyEntry | wc -l`

View File

@ -85,9 +85,7 @@ case "$OS" in
fi
;;
Darwin )
LIBNAME=`find_one \
"/Applications/Firefox.app/Contents/MacOS/libsoftokn3.dylib" \
"/Applications/Thunderbird.app//Contents/MacOS/libsoftokn3.dylib"`
LIBNAME="$TESTSRC/../../pkcs11/nss/lib/macosx-x86_64/libsoftokn3.dylib"
;;
* )
echo "Will not run test on: ${OS}"
@ -102,10 +100,6 @@ fi
echo "Using NSS lib at $LIBNAME"
if [ $OS = Darwin ]; then
export DYLD_LIBRARY_PATH=`dirname $LIBNAME`
fi
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . -XDignore.symbol.file \
${TESTSRC}${FS}KeyToolTest.java || exit 10