Package org.apache.calcite.test
Class SplunkAdapterTest
- java.lang.Object
-
- org.apache.calcite.test.SplunkAdapterTest
-
public class SplunkAdapterTest extends java.lang.Object
Unit test of the Calcite adapter for Splunk.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
ENABLED
Whether to run Splunk tests.(package private) static java.lang.String[]
ERROR_SQL_STRINGS
static java.lang.String
SPLUNK_PASSWORD
static java.lang.String
SPLUNK_URL
static java.lang.String
SPLUNK_USER
(package private) static java.lang.String[]
SQL_STRINGS
-
Constructor Summary
Constructors Constructor Description SplunkAdapterTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkSql(java.lang.String sql, java.util.function.Function<java.sql.ResultSet,java.lang.Void> f)
private void
close(java.sql.Connection connection, java.sql.Statement statement)
private boolean
enabled()
Whether this test is enabled.private static java.util.function.Function<java.sql.ResultSet,java.lang.Void>
expect(java.lang.String... lines)
private void
loadDriverClass()
void
testGroupBy()
void
testJoinToJdbc()
void
testSelect()
Reads from a table.void
testSelectDistinct()
void
testSelectNonBuiltInColumn()
"status" is not a built-in column but we know it has some values in the test data.void
testVanityDriver()
Tests the vanity driver.void
testVanityDriverArgsInUrl()
Tests the vanity driver with properties in the URL.
-
-
-
Field Detail
-
SPLUNK_URL
public static final java.lang.String SPLUNK_URL
- See Also:
- Constant Field Values
-
SPLUNK_USER
public static final java.lang.String SPLUNK_USER
- See Also:
- Constant Field Values
-
SPLUNK_PASSWORD
public static final java.lang.String SPLUNK_PASSWORD
- See Also:
- Constant Field Values
-
ENABLED
public static final boolean ENABLED
Whether to run Splunk tests. Disabled by default, because we do not expect Splunk to be installed and populated data set. To enable, specify-Dcalcite.test.splunk
on the Java command line.
-
SQL_STRINGS
static final java.lang.String[] SQL_STRINGS
-
ERROR_SQL_STRINGS
static final java.lang.String[] ERROR_SQL_STRINGS
-
-
Method Detail
-
enabled
private boolean enabled()
Whether this test is enabled. Tests are disabled unless we know that Splunk is present and loaded with the requisite data.
-
loadDriverClass
private void loadDriverClass()
-
close
private void close(java.sql.Connection connection, java.sql.Statement statement)
-
testVanityDriver
public void testVanityDriver() throws java.sql.SQLException
Tests the vanity driver.- Throws:
java.sql.SQLException
-
testVanityDriverArgsInUrl
public void testVanityDriverArgsInUrl() throws java.sql.SQLException
Tests the vanity driver with properties in the URL.- Throws:
java.sql.SQLException
-
testSelect
public void testSelect() throws java.sql.SQLException
Reads from a table.- Throws:
java.sql.SQLException
-
testSelectDistinct
public void testSelectDistinct() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
expect
private static java.util.function.Function<java.sql.ResultSet,java.lang.Void> expect(java.lang.String... lines)
-
testSelectNonBuiltInColumn
public void testSelectNonBuiltInColumn() throws java.sql.SQLException
"status" is not a built-in column but we know it has some values in the test data.- Throws:
java.sql.SQLException
-
testJoinToJdbc
public void testJoinToJdbc() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
testGroupBy
public void testGroupBy() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
checkSql
private void checkSql(java.lang.String sql, java.util.function.Function<java.sql.ResultSet,java.lang.Void> f) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-