use of dalvik.annotation.KnownFailure in project robovm by robovm.
the class SSLEngineTest method test_unwrap_04.
/**
* javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
* int offset, int length)
* Exception case: IllegalArgumentException should be thrown.
*/
@KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
public void test_unwrap_04() {
String host = "new host";
int port = 8080;
ByteBuffer[] bbA = { ByteBuffer.allocate(100), ByteBuffer.allocate(10), ByteBuffer.allocate(100) };
ByteBuffer[] bbAN = { ByteBuffer.allocate(100), null, ByteBuffer.allocate(100) };
ByteBuffer[] bbN = null;
ByteBuffer bb = ByteBuffer.allocate(10);
ByteBuffer bN = null;
SSLEngine sse = getEngine(host, port);
sse.setUseClientMode(true);
try {
sse.unwrap(bN, bbA, 0, 3);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iobe) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
try {
sse.unwrap(bb, bbAN, 0, 3);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iobe) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
try {
sse.unwrap(bb, bbN, 0, 0);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iobe) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
try {
sse.unwrap(bN, bbN, 0, 0);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iobe) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
}
use of dalvik.annotation.KnownFailure in project robovm by robovm.
the class SSLEngineTest method test_unwrap_ByteBuffer_ByteBuffer_03.
/**
* javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
* IllegalArgumentException should be thrown.
*/
@KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
public void test_unwrap_ByteBuffer_ByteBuffer_03() {
String host = "new host";
int port = 8080;
ByteBuffer bbsN = null;
ByteBuffer bbdN = null;
ByteBuffer bbs = ByteBuffer.allocate(10);
ByteBuffer bbd = ByteBuffer.allocate(100);
SSLEngine sse = getEngine(host, port);
sse.setUseClientMode(true);
try {
sse.unwrap(bbsN, bbd);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iae) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
try {
sse.unwrap(bbs, bbdN);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iae) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
try {
sse.unwrap(bbsN, bbdN);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iae) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
}
use of dalvik.annotation.KnownFailure in project robovm by robovm.
the class SSLEngineTest method test_wrap_ByteBuffer$ByteBuffer_03.
/**
* javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
* IllegalArgumentException should be thrown.
*/
@KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
public void test_wrap_ByteBuffer$ByteBuffer_03() {
String host = "new host";
int port = 8080;
ByteBuffer[] bbA = { ByteBuffer.allocate(100), ByteBuffer.allocate(10), ByteBuffer.allocate(100) };
ByteBuffer[] bbAN = null;
ByteBuffer bb = ByteBuffer.allocate(10);
ByteBuffer bN = null;
SSLEngine sse = getEngine(host, port);
sse.setUseClientMode(true);
try {
sse.wrap(bbA, bN);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iobe) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
try {
sse.wrap(bbAN, bb);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iobe) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
try {
sse.wrap(bbAN, bN);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException iobe) {
//expected
} catch (NullPointerException npe) {
} catch (Exception e) {
fail(e + " was thrown instead of IllegalArgumentException");
}
}
use of dalvik.annotation.KnownFailure in project robovm by robovm.
the class SSLEngineTest method test_wrap_02.
/**
* javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
* int length, ByteBuffer dst)
* Exception case: IndexOutOfBoundsException should be thrown.
*/
@KnownFailure("Fixed in DonutBurger, boundary checks missing")
public void test_wrap_02() throws SSLException {
String host = "new host";
int port = 8080;
ByteBuffer bb = ByteBuffer.allocate(10);
ByteBuffer[] bbA = { ByteBuffer.allocate(5), ByteBuffer.allocate(10), ByteBuffer.allocate(5) };
SSLEngine sse = getEngine(host, port);
sse.setUseClientMode(true);
try {
sse.wrap(bbA, -1, 3, bb);
fail("IndexOutOfBoundsException wasn't thrown");
} catch (IndexOutOfBoundsException iobe) {
//expected
}
try {
sse.wrap(bbA, 0, -3, bb);
fail("IndexOutOfBoundsException wasn't thrown");
} catch (IndexOutOfBoundsException iobe) {
//expected
}
try {
sse.wrap(bbA, bbA.length + 1, bbA.length, bb);
fail("IndexOutOfBoundsException wasn't thrown");
} catch (IndexOutOfBoundsException iobe) {
//expected
}
try {
sse.wrap(bbA, 0, bbA.length + 1, bb);
fail("IndexOutOfBoundsException wasn't thrown");
} catch (IndexOutOfBoundsException iobe) {
//expected
}
}
use of dalvik.annotation.KnownFailure in project robovm by robovm.
the class SSLEngineTest method test_unwrap_ByteBuffer_ByteBuffer_02.
/**
* javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
* ReadOnlyBufferException should be thrown.
*/
@KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
public void test_unwrap_ByteBuffer_ByteBuffer_02() {
String host = "new host";
int port = 8080;
ByteBuffer bbs = ByteBuffer.allocate(10);
ByteBuffer bbd = ByteBuffer.allocate(100).asReadOnlyBuffer();
SSLEngine sse = getEngine(host, port);
sse.setUseClientMode(true);
try {
sse.unwrap(bbs, bbd);
fail("ReadOnlyBufferException wasn't thrown");
} catch (ReadOnlyBufferException iobe) {
//expected
} catch (Exception e) {
fail(e + " was thrown instead of ReadOnlyBufferException");
}
}
Aggregations