Skip to content

Commit

Permalink
Add Assert.fail() to test that should expected an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jcralmeida authored and rafael-telles committed Dec 6, 2021
1 parent 5937f74 commit 7d5cb74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.util.AutoCloseables;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -149,7 +150,7 @@ public void testUnencryptedConnectionWithEmptyHost()

try (Connection connection = DriverManager
.getConnection(invalidUrl, properties)) {
// Shouldn't reach this since we are expecting an Exception.
Assert.fail();
}
}

Expand Down Expand Up @@ -188,7 +189,7 @@ public void testUnencryptedConnectionProvidingInvalidPort()

try (Connection connection = DriverManager
.getConnection(invalidUrl, properties)) {
// Shouldn't reach this since we are expecting an Exception.
Assert.fail();
}
}

Expand Down Expand Up @@ -244,7 +245,7 @@ public void testUnencryptedConnectionShouldThrowExceptionWhenProvidedWithInvalid

try (Connection connection = DriverManager.getConnection(serverUrl,
properties)) {
// Shouldn't reach this.
Assert.fail();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.apache.arrow.util.AutoCloseables;
import org.apache.calcite.avatica.org.apache.http.auth.UsernamePasswordCredentials;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -159,7 +160,7 @@ public void testGetEncryptedClientWithNoCertificateOnKeyStore() throws Exception
allocator, flightTestUtils.getLocalhost(), this.tlsServer.getPort(),
null, noCertificateKeyStorePath,
noCertificateKeyStorePassword)) {
// Shouldn't reach this since we are expecting an Exception.
Assert.fail();
}
}

Expand Down Expand Up @@ -197,7 +198,7 @@ public void testGetEncryptedClientWithKeyStoreBadPasswordAndNoAuth() throws Exce
allocator, flightTestUtils.getLocalhost(), this.tlsServer.getPort(),
null, keyStorePath,
keyStoreBadPassword)) {
// Shouldn't reach this since we are expecting an Exception.
Assert.fail();
}
}

Expand Down Expand Up @@ -243,7 +244,7 @@ public void testGetAuthenticatedEncryptedConnectionWithKeyStoreBadPassword() thr

try (Connection connection = DriverManager
.getConnection(serverUrl, properties)) {
// Shouldn't reach this since we are expecting an Exception.
Assert.fail();
}
}

Expand Down

0 comments on commit 7d5cb74

Please sign in to comment.