-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
7
-
generic
-
generic
JCK : JCK6a b01
J2SE : FAIL - dolphin b03, PASS mustang b104
Platform[s] : FAIL - seems to be all
switch/Mode : FAIL - default
Negative test api/java_security/cert/CertificateFactory/index.html#generate[CertificateFactory2019] fails because Dolphin throws ClassCastException instead of CertificateException on attempt of creating CertPath from a list of String oblects. According to specification any error should be CertificateException.
Error message is:
java.lang.ClassCastException: java.lang.String cannot be cast to java.security.cert.X509Certificate
at sun.security.provider.certpath.X509CertPath.<init>(X509CertPath.java:97)
at sun.security.provider.X509Factory.engineGenerateCertPath(X509Factory.java:375)
at java.security.cert.CertificateFactory.generateCertPath(CertificateFactory.java:387)
at javasoft.sqe.tests.api.java.security.cert.CertificateFactory.generateTests.CertificateFactory2019(generateTests.java:509)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:406)
at javasoft.sqe.jck.lib.ProviderTest.invokeTestCase(ProviderTest.java:281)
at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:127)
at javasoft.sqe.tests.api.java.security.cert.CertificateFactory.generateTests.main(generateTests.java:210)
steps to reproduce:
run the following code on JDK 6 and JDK 7:
import java.util.*;
import java.security.cert.*;
public class CF{
public static void main(String[] args){
List certs = new Vector();
certs.add("The first certificate");
certs.add("The third certificate");
certs.add("The second certificate");
certs.add("The fourth certificate");
try {
CertificateFactory cf = CertificateFactory.getInstance( "X509", "SUN");
CertPath cp = cf.generateCertPath( certs);
System.out.println("CertificateException has not been thrown on attempt to generate Certificate Path from a List of strings");
} catch(CertificateException ce) {
System.out.println("Expected exception "+ce);
ce.printStackTrace();
}
catch(Exception c) {
System.out.println("UNexpected exception "+c);
c.printStackTrace();
}
}
}
C:\tests\CertFactory>Z:/Links/stt/jdk_promotions/JDK6.0/b104/binaries/windows-i586/jdk1.6.0/bin/java -showversion -cp . CF
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b104)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b104, mixed mode)
Expected exception java.security.cert.CertificateException: List is not all X509Certificates: java.lang.String
java.security.cert.CertificateException: List is not all X509Certificates: java.lang.String
at sun.security.provider.certpath.X509CertPath.<init>(X509CertPath.java:99)
at sun.security.provider.X509Factory.engineGenerateCertPath(X509Factory.java:375)
at java.security.cert.CertificateFactory.generateCertPath(CertificateFactory.java:387)
at CF.main(CF.java:15)
C:\tests\CertFactory>pause
Press any key to continue . . .
C:\tests\CertFactory>Z:/Links/stt/jdk_promotions/JDK7.0/b03/binaries/windows-i586/jdk1.7.0/bin/java -showversion -cp . CF
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b03)
Java HotSpot(TM) Client VM (build 1.7.0-ea-b03, mixed mode)
UNexpected exception java.lang.ClassCastException: java.lang.String cannot be cast to java.security.cert.X509Certificate
java.lang.ClassCastException: java.lang.String cannot be cast to java.security.cert.X509Certificate
at sun.security.provider.certpath.X509CertPath.<init>(X509CertPath.java:97)
at sun.security.provider.X509Factory.engineGenerateCertPath(X509Factory.java:375)
at java.security.cert.CertificateFactory.generateCertPath(CertificateFactory.java:387)
at CF.main(CF.java:15)
J2SE : FAIL - dolphin b03, PASS mustang b104
Platform[s] : FAIL - seems to be all
switch/Mode : FAIL - default
Negative test api/java_security/cert/CertificateFactory/index.html#generate[CertificateFactory2019] fails because Dolphin throws ClassCastException instead of CertificateException on attempt of creating CertPath from a list of String oblects. According to specification any error should be CertificateException.
Error message is:
java.lang.ClassCastException: java.lang.String cannot be cast to java.security.cert.X509Certificate
at sun.security.provider.certpath.X509CertPath.<init>(X509CertPath.java:97)
at sun.security.provider.X509Factory.engineGenerateCertPath(X509Factory.java:375)
at java.security.cert.CertificateFactory.generateCertPath(CertificateFactory.java:387)
at javasoft.sqe.tests.api.java.security.cert.CertificateFactory.generateTests.CertificateFactory2019(generateTests.java:509)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:406)
at javasoft.sqe.jck.lib.ProviderTest.invokeTestCase(ProviderTest.java:281)
at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:127)
at javasoft.sqe.tests.api.java.security.cert.CertificateFactory.generateTests.main(generateTests.java:210)
steps to reproduce:
run the following code on JDK 6 and JDK 7:
import java.util.*;
import java.security.cert.*;
public class CF{
public static void main(String[] args){
List certs = new Vector();
certs.add("The first certificate");
certs.add("The third certificate");
certs.add("The second certificate");
certs.add("The fourth certificate");
try {
CertificateFactory cf = CertificateFactory.getInstance( "X509", "SUN");
CertPath cp = cf.generateCertPath( certs);
System.out.println("CertificateException has not been thrown on attempt to generate Certificate Path from a List of strings");
} catch(CertificateException ce) {
System.out.println("Expected exception "+ce);
ce.printStackTrace();
}
catch(Exception c) {
System.out.println("UNexpected exception "+c);
c.printStackTrace();
}
}
}
C:\tests\CertFactory>Z:/Links/stt/jdk_promotions/JDK6.0/b104/binaries/windows-i586/jdk1.6.0/bin/java -showversion -cp . CF
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b104)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b104, mixed mode)
Expected exception java.security.cert.CertificateException: List is not all X509Certificates: java.lang.String
java.security.cert.CertificateException: List is not all X509Certificates: java.lang.String
at sun.security.provider.certpath.X509CertPath.<init>(X509CertPath.java:99)
at sun.security.provider.X509Factory.engineGenerateCertPath(X509Factory.java:375)
at java.security.cert.CertificateFactory.generateCertPath(CertificateFactory.java:387)
at CF.main(CF.java:15)
C:\tests\CertFactory>pause
Press any key to continue . . .
C:\tests\CertFactory>Z:/Links/stt/jdk_promotions/JDK7.0/b03/binaries/windows-i586/jdk1.7.0/bin/java -showversion -cp . CF
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b03)
Java HotSpot(TM) Client VM (build 1.7.0-ea-b03, mixed mode)
UNexpected exception java.lang.ClassCastException: java.lang.String cannot be cast to java.security.cert.X509Certificate
java.lang.ClassCastException: java.lang.String cannot be cast to java.security.cert.X509Certificate
at sun.security.provider.certpath.X509CertPath.<init>(X509CertPath.java:97)
at sun.security.provider.X509Factory.engineGenerateCertPath(X509Factory.java:375)
at java.security.cert.CertificateFactory.generateCertPath(CertificateFactory.java:387)
at CF.main(CF.java:15)
- duplicates
-
JDK-6492692 Some JCK test failed because of the complier warnings changes
- Closed