public final class DateTimeTest extends BaseJDBCTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
DateTimeTest(java.lang.String name)
Public constructor required for running test as standalone JUnit.
|
Modifier and Type | Method and Description |
---|---|
private void |
assertSingleValue(java.lang.String sql,
java.lang.String expectedValue)
Execute an SQL statement and check that it returns a single, specific
value.
|
protected static junit.framework.Test |
baseSuite(java.lang.String name) |
private static void |
createTableForArithmeticTest(java.sql.Statement stmt) |
private static void |
createTableForConversionTest(java.sql.Statement st) |
private static void |
createTableForISOFormatTest(java.sql.Statement st) |
private static void |
createTableForSyntaxTest(java.sql.Statement stmt) |
static junit.framework.Test |
suite() |
void |
test_DateAndDatetimeFunctionsMore()
Test unary date and datetime functions.
|
void |
testArithOpers_Comarision() |
void |
testArithOpers_ComparisonOnBeyondLimits()
Show that overflow and underflow are not allowed
(SQL92 would have these report errors).
|
void |
testArithOpers_ComparisonOnEqualSQ()
Test =SQ .
|
void |
testArithOpers_ComparisonOnGarbage()
Show garbage in == errors out
|
void |
testArithOpers_ComparisonOnLimits()
Check limit values.
|
void |
testArithOpers_ComparisonOnNullAndNonNull() |
void |
testArithOpers_CompraionOnMixedTypes()
Show comparisons with mixed types don't work.
|
void |
testArithOpers_CompraionOnNotExistingValue()
Look for a value that isn't in the table.
|
void |
testArithOpers_math()
date/times don't support math, show each combination.
|
void |
testConversion_Aggregates() |
void |
testConversion() |
void |
testConversionToString()
Regression test case for DERBY-4621, which caused the conversion of
timestamp and time values to varchar to generate wrong results when
a Calendar object was supplied.
|
void |
testConvertFromString() |
void |
testConvertToStringWithCalendar()
Test that conversion from timestamp to string is correct when a
calendar is specified.
|
void |
testDerby3856()
Regression test case for DERBY-3856.
|
void |
testFormat_Additional() |
void |
testFormat() |
void |
testISOFormat_LeadingZero()
Should be rejected because leading zero in year is missing.
|
void |
testISOFormat_MoreThanNanoseconds()
Don't allow more than nanoseconds in ISO format.
|
void |
testISOFormat_OmitLeadingZero()
leading zeros may be omitted from the month,
day and part of the timestamp.
|
void |
testISOFormat_TrailingBlanks()
Trailing blanks are allowed.
|
void |
testISOFormat_TrailingZero()
UDB allows this by "appending a zero"; so, cloudscape follows.
|
void |
testISOFormat_WrongTimestampFormat()
not valid Time format in the timestamp strings: cloudscape rejects
|
void |
testNanosecondResolution()
Test case to show that timestamp function accepts nanoseconds
resolution (DERBY-4625).
|
void |
testNulls()
Null values in datetime scalar functions.
|
void |
testRandom()
Random tests for date.
|
void |
testSyntax_CurrentFunctions() |
void |
testSyntax_EscapedFunctions() |
void |
testSyntax_Extract() |
void |
testSyntax_Insert()
Test a variety of inserts.
|
void |
testSyntax_SpecifiedPrecision()
Test syntax: precision cannot be specified.
|
void |
testSyntax_Update()
Test a variety of updates.
|
void |
testTimeStampFunction()
Test the timestamp( d, t) function.
|
void |
testTrailingZeros()
Test that trailing zeros in the nanoseconds component of a timestamp
are handled the same way by
PreparedStatement.setTimestamp(int,Timestamp) and
PreparedStatement.setTimestamp(int,Timestamp, Calendar)
when converting the timestamp to a VARCHAR. |
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, setUp, toString
public DateTimeTest(java.lang.String name)
public static junit.framework.Test suite()
protected static junit.framework.Test baseSuite(java.lang.String name)
private static void createTableForISOFormatTest(java.sql.Statement st) throws java.sql.SQLException
java.sql.SQLException
private static void createTableForConversionTest(java.sql.Statement st) throws java.sql.SQLException
java.sql.SQLException
private static void createTableForSyntaxTest(java.sql.Statement stmt) throws java.sql.SQLException
java.sql.SQLException
private static void createTableForArithmeticTest(java.sql.Statement stmt) throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_math() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_Comarision() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_CompraionOnMixedTypes() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_CompraionOnNotExistingValue() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_ComparisonOnGarbage() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_ComparisonOnLimits() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_ComparisonOnBeyondLimits() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_ComparisonOnNullAndNonNull() throws java.sql.SQLException
java.sql.SQLException
public void testArithOpers_ComparisonOnEqualSQ() throws java.sql.SQLException
java.sql.SQLException
public void testSyntax_SpecifiedPrecision() throws java.sql.SQLException
java.sql.SQLException
public void testSyntax_Insert() throws java.sql.SQLException
java.sql.SQLException
public void testSyntax_Update() throws java.sql.SQLException
java.sql.SQLException
public void testSyntax_CurrentFunctions() throws java.sql.SQLException
java.sql.SQLException
public void testSyntax_EscapedFunctions() throws java.sql.SQLException
java.sql.SQLException
public void testSyntax_Extract() throws java.sql.SQLException
java.sql.SQLException
public void testRandom() throws java.sql.SQLException
java.sql.SQLException
public void testConvertFromString() throws java.sql.SQLException
java.sql.SQLException
public void testConvertToStringWithCalendar() throws java.sql.SQLException
java.sql.SQLException
public void testConversionToString() throws java.sql.SQLException
java.sql.SQLException
public void testTrailingZeros() throws java.sql.SQLException
PreparedStatement.setTimestamp(int,Timestamp)
and
PreparedStatement.setTimestamp(int,Timestamp, Calendar)
when converting the timestamp to a VARCHAR. (DERBY-4810)java.sql.SQLException
public void testConversion_Aggregates() throws java.sql.SQLException
java.sql.SQLException
public void testConversion() throws java.sql.SQLException
java.sql.SQLException
public void testISOFormat_OmitLeadingZero() throws java.sql.SQLException
java.sql.SQLException
public void testISOFormat_TrailingBlanks() throws java.sql.SQLException
java.sql.SQLException
public void testISOFormat_TrailingZero() throws java.sql.SQLException
java.sql.SQLException
public void testISOFormat_LeadingZero() throws java.sql.SQLException
java.sql.SQLException
public void testISOFormat_WrongTimestampFormat() throws java.sql.SQLException
java.sql.SQLException
public void testISOFormat_MoreThanNanoseconds() throws java.sql.SQLException
java.sql.SQLException
public void testTimeStampFunction() throws java.sql.SQLException
java.sql.SQLException
public void testFormat() throws java.sql.SQLException
java.sql.SQLException
public void testFormat_Additional() throws java.sql.SQLException
java.sql.SQLException
public void test_DateAndDatetimeFunctionsMore() throws java.lang.Exception
java.lang.Exception
public void testNulls() throws java.sql.SQLException
java.sql.SQLException
public void testDerby3856() throws java.sql.SQLException
java.sql.SQLException
public void testNanosecondResolution() throws java.sql.SQLException
java.sql.SQLException
private void assertSingleValue(java.lang.String sql, java.lang.String expectedValue) throws java.sql.SQLException
sql
- the statement to executeexpectedValue
- the expected valuejava.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.