Search in sources :

Example 21 with KnownFailure

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");
    }
}
Also used : SSLEngine(javax.net.ssl.SSLEngine) ByteBuffer(java.nio.ByteBuffer) IOException(java.io.IOException) KeyManagementException(java.security.KeyManagementException) SSLException(javax.net.ssl.SSLException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) ReadOnlyBufferException(java.nio.ReadOnlyBufferException) KnownFailure(dalvik.annotation.KnownFailure)

Example 22 with KnownFailure

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");
    }
}
Also used : SSLEngine(javax.net.ssl.SSLEngine) ByteBuffer(java.nio.ByteBuffer) IOException(java.io.IOException) KeyManagementException(java.security.KeyManagementException) SSLException(javax.net.ssl.SSLException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) ReadOnlyBufferException(java.nio.ReadOnlyBufferException) KnownFailure(dalvik.annotation.KnownFailure)

Example 23 with KnownFailure

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");
    }
}
Also used : SSLEngine(javax.net.ssl.SSLEngine) ByteBuffer(java.nio.ByteBuffer) IOException(java.io.IOException) KeyManagementException(java.security.KeyManagementException) SSLException(javax.net.ssl.SSLException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) ReadOnlyBufferException(java.nio.ReadOnlyBufferException) KnownFailure(dalvik.annotation.KnownFailure)

Example 24 with KnownFailure

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
    }
}
Also used : SSLEngine(javax.net.ssl.SSLEngine) ByteBuffer(java.nio.ByteBuffer) KnownFailure(dalvik.annotation.KnownFailure)

Example 25 with KnownFailure

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");
    }
}
Also used : ReadOnlyBufferException(java.nio.ReadOnlyBufferException) SSLEngine(javax.net.ssl.SSLEngine) ByteBuffer(java.nio.ByteBuffer) IOException(java.io.IOException) KeyManagementException(java.security.KeyManagementException) SSLException(javax.net.ssl.SSLException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) ReadOnlyBufferException(java.nio.ReadOnlyBufferException) KnownFailure(dalvik.annotation.KnownFailure)

Aggregations

KnownFailure (dalvik.annotation.KnownFailure)39 ResultSet (java.sql.ResultSet)21 IOException (java.io.IOException)12 SQLException (java.sql.SQLException)12 ByteBuffer (java.nio.ByteBuffer)11 SSLEngine (javax.net.ssl.SSLEngine)11 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)10 ReadOnlyBufferException (java.nio.ReadOnlyBufferException)9 KeyManagementException (java.security.KeyManagementException)9 ResultSetMetaData (java.sql.ResultSetMetaData)9 SSLException (javax.net.ssl.SSLException)9 URL (java.net.URL)2 URLClassLoader (java.net.URLClassLoader)2 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)2 HashSet (java.util.HashSet)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 InputStream (java.io.InputStream)1