-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e23a5e3
commit fd70e5c
Showing
7 changed files
with
177 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
wrapper/src/main/java/software/amazon/jdbc/plugin/dev/ExceptionSimulatorConnectCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package software.amazon.jdbc.plugin.dev; | ||
|
||
import java.sql.SQLException; | ||
import java.util.Properties; | ||
import software.amazon.jdbc.HostSpec; | ||
|
||
public interface ExceptionSimulatorConnectCallback { | ||
SQLException getExceptionToRaise( | ||
final String driverProtocol, | ||
final HostSpec hostSpec, | ||
final Properties props, | ||
final boolean isInitialConnection); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
wrapper/src/main/java/software/amazon/jdbc/plugin/dev/ExceptionSimulatorManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package software.amazon.jdbc.plugin.dev; | ||
|
||
public class ExceptionSimulatorManager { | ||
|
||
static Throwable nextException; | ||
static ExceptionSimulatorConnectCallback connectCallback; | ||
|
||
public static void raiseExceptionOnNextConnect(final Throwable throwable) { | ||
nextException = throwable; | ||
} | ||
|
||
public static void setCallback(final ExceptionSimulatorConnectCallback exceptionSimulatorConnectCallback) { | ||
connectCallback = exceptionSimulatorConnectCallback; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters