use of dalvik.annotation.BrokenTest in project robovm by robovm.
the class OldPKIXParametersTest method testPKIXParametersKeyStore04.
/**
* Test #4 for <code>PKIXParameters(KeyStore)</code> constructor<br>
*
* @throws InvalidAlgorithmParameterException
* @throws KeyStoreException
*/
@BrokenTest("Fails in CTS environment, but passes in CoreTestRunner")
public final void testPKIXParametersKeyStore04() throws Exception {
KeyStore store = KeyStore.getInstance("PKCS12");
KeyStoreTestPKCS12 k = new KeyStoreTestPKCS12();
ByteArrayInputStream stream = new ByteArrayInputStream(k.keyStoreData);
try {
PKIXParameters p = new PKIXParameters(store);
} catch (KeyStoreException e) {
// ok
}
store = KeyStore.getInstance("PKCS12");
store.load(stream, new String(KeyStoreTestPKCS12.keyStorePassword).toCharArray());
stream.close();
try {
PKIXParameters p = new PKIXParameters(store);
} catch (InvalidAlgorithmParameterException e) {
// ok
}
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(null, null);
keystore.setCertificateEntry("test", TestUtils.rootCertificateSS);
PKIXParameters p = new PKIXParameters(keystore);
}
use of dalvik.annotation.BrokenTest in project robovm by robovm.
the class URLConnectionTest method test_getContentEncoding.
/**
* @throws IOException
* {@link java.net.URLConnection#getContentEncoding()}
*/
@BrokenTest("Fails in CTS, passes in CoreTestRunner")
public void test_getContentEncoding() throws IOException {
// faulty setup
try {
fileURLCon.getContentEncoding();
fail("Exception expected");
} catch (Throwable e) {
//ok
}
// positive case
URL url = new URL("http://www.amazon.com/");
URLConnection con = url.openConnection();
con.setRequestProperty("Accept-Encoding", "gzip");
con.connect();
assertEquals(con.getContentEncoding(), "gzip");
uc2.setRequestProperty("Accept-Encoding", "bla");
uc2.connect();
assertNull(uc2.getContentEncoding());
}
Aggregations