Send feedback
Class BigtableEmulatorRule (2.39.5)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.39.5 keyboard_arrow_down
Beta
This library is covered by the Pre-GA Offerings Terms
of the Terms of Service. Pre-GA libraries might have limited support,
and changes to pre-GA libraries might not be compatible with other pre-GA versions.
For more information, see the
launch stage descriptions .
public class BigtableEmulatorRule extends ExternalResource
The BigtableEmulatorRule manages the lifecycle of the Bigtable Emulator . Before the start
of a test, the emulator will be started on a random port and will be shutdown after the test
finishes.
Example usage:
{@literal @RunWith(JUnit4.class)}
public class MyTest {
{@literal @Rule}
public final BigtableEmulatorRule bigtableEmulator = BigtableEmulatorRule.create();
{@literal @Test}
public void testUsingEmulator() {
ManagedChannel adminChannel = bigtableEmulator.getAdminChannel();
// Do something with channel
}
}
Inheritance
java.lang.Object >
org.junit.rules.ExternalResource >
BigtableEmulatorRule
Inherited Members
org.junit.rules.ExternalResource.after()
org.junit.rules.ExternalResource.apply(org.junit.runners.model.Statement,org.junit.runner.Description)
org.junit.rules.ExternalResource.before()
Static Methods
create()
public static BigtableEmulatorRule create ()
Methods
after()
Stops the Bigtable emulator after a test finishes.
Overrides
org.junit.rules.ExternalResource.after()
before()
Initializes the Bigtable emulator before a test runs.
Overrides
org.junit.rules.ExternalResource.before()
getAdminChannel()
public ManagedChannel getAdminChannel ()
Gets a ManagedChannel connected to the Emulator. This channel should be used for admin
operations.
Returns
Type
Description
io.grpc.ManagedChannel
getDataChannel()
public ManagedChannel getDataChannel ()
Gets a ManagedChannel connected to the Emulator. The channel is configured for data
operations.
Returns
Type
Description
io.grpc.ManagedChannel
getPort()
Gets the port of the emulator, allowing the caller to create their own ManagedChannel .
Returns
Type
Description
int
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-10 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-10 UTC."}