TimestampTest (jTDS API)
Keywords: net.sourceforge.jtds.test.TimestampTest class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.jtds.test
Class TimestampTest

    java.lang.Object
      junit.framework.Assert
          junit.framework.TestCase
              net.sourceforge.jtds.test.TestBase
                  net.sourceforge.jtds.test.DatabaseTestCase
                      net.sourceforge.jtds.test.TimestampTest

All Implemented Interfaces:
  junit.framework.Test

public class TimestampTest
extends DatabaseTestCase

test getting timestamps from the database.

Version:
  $Id: TimestampTest.java,v 1.32.2.5 2009/08/20 19:44:04 ickzon Exp $
Author:
  Alin Sinpalean

Field Summary

Fields inherited from class net.sourceforge.jtds.test.DatabaseTestCase
``

Fields inherited from class net.sourceforge.jtds.test.TestBase
`con, props`

Fields inherited from class junit.framework.TestCase
``

Constructor Summary
`TimestampTest(java.lang.String name)`

Method Summary
`(package private) java.lang.Object[][]` | `getDatatypes()`
`long` | `getTimeInMs(java.sql.ResultSet rs)` Java 1.3 Timestamp.getDate() does not add the nano seconds to the millisecond value returned.
`static void` | `main(java.lang.String[] args)`
`void` | `test1899Date()` Test for bug [1234531] Dates before 01/01/1900 broken due to DateTime value markers.
`void` | `testBigint0000()`
`void` | `testBlob0021()`
`void` | `testConnection0038()`
`void` | `testConnection0039()`
`void` | `testDateTimeDegeneration()` Test for bug [2508201], date field is changed by 3 milliseconds.
`void` | `testDatetimeRounding1()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding10()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding2()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding3()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding4()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding5()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding6()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding7()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding8()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDatetimeRounding9()` Test for bug [994916] datetime decoding in TdsData.java
`void` | `testDayOfWeek()` Test for bug [1226210] {fn dayofweek()} depends on the language.
`void` | `testDecimalConversion0058()`
`void` | `testEmptyResults0011()`
`void` | `testEmptyResults0012()`
`void` | `testEmptyResults0013()`
`void` | `testEra()` Test for bugs [2181003]/[2349058], an attempt to set a BC date invalidates driver state/DateTime allows invalid dates through.
`void` | `testErrors0036()`
`void` | `testEscape(java.lang.String sql, java.lang.String expected)`
`void` | `testEscapes0006()`
`void` | `testEscaping()`
`void` | `testForBrowse0014()`
`void` | `testGetBoolean0025()`
`void` | `testGetString()` Test for bug [1235845] getTimestamp() returns illegal value after getString().
`void` | `testMetaData0046()`
`void` | `testMissingParameter0016()`
`void` | `testMultipleResults0015()`
`void` | `testNestedStatements0022()`
`void` | `testNestedStatements0026()` SAfe Tests whether cursor-based statements still work ok when nested.
`void` | `testOutputParams()`
`void` | `testPreparedStatement0007()`
`void` | `testPreparedStatement0008()`
`void` | `testPreparedStatement0009()`
`void` | `testPreparedStatement0040()`
`void` | `testPreparedStatement0041()`
`void` | `testPreparedStatement0042()`
`void` | `testPrimaryKeyFloat0023()`
`void` | `testPrimaryKeyReal0024()`
`void` | `testResultSet0043()`
`void` | `testResultSet0044()`
`void` | `testResultSet0045()`
`void` | `testStatements0020()`
`void` | `testTimestampRange()` Test for bug [1040475] Possible bug when converting to and from datetime.
`void` | `testTimestamps0001()`
`void` | `testTimestamps0004()`
`void` | `testTimestamps0037()`
`void` | `testTimestamps0047()`
`void` | `testTimestamps0048()`
`void` | `testTimestampTimeZone()` Test for bug [1036059] getTimestamp with Calendar applies tzone offset wrong way.
`void` | `testTransactions0010()`
`void` | `testWriteDate()` Test that `java.sql.Date` objects are inserted and retrieved correctly (ie no time component).

Methods inherited from class net.sourceforge.jtds.test.DatabaseTestCase
`compareBytes, dropFunction, dropProcedure, dropProcedure, dropTable, getLongString, getLongString, getType, getTypemap`

Methods inherited from class net.sourceforge.jtds.test.TestBase
`compareInputStreams, compareReaders, connect, dump, dumpRow, getConnection, getConnection, makeObjects, makeTestTables, setUp, tearDown`

Methods inherited from class junit.framework.TestCase
`countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString`

Methods inherited from class junit.framework.Assert
`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, fail, fail`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TimestampTest

    public TimestampTest(java.lang.String name)

Method Detail

### main

    public static void main(java.lang.String[] args)

### testBigint0000

    public void testBigint0000()
                        throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testTimestamps0001

    public void testTimestamps0001()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testTimestamps0004

    public void testTimestamps0004()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEscape

    public void testEscape(java.lang.String sql,
                           java.lang.String expected)
                    throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEscapes0006

    public void testEscapes0006()
                         throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPreparedStatement0007

    public void testPreparedStatement0007()
                                   throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPreparedStatement0008

    public void testPreparedStatement0008()
                                   throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPreparedStatement0009

    public void testPreparedStatement0009()
                                   throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testTransactions0010

    public void testTransactions0010()
                              throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEmptyResults0011

    public void testEmptyResults0011()
                              throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEmptyResults0012

    public void testEmptyResults0012()
                              throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testEmptyResults0013

    public void testEmptyResults0013()
                              throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testForBrowse0014

    public void testForBrowse0014()
                           throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testMultipleResults0015

    public void testMultipleResults0015()
                                 throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testMissingParameter0016

    public void testMissingParameter0016()
                                  throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### getDatatypes

    java.lang.Object[][] getDatatypes()

### testOutputParams

    public void testOutputParams()
                          throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testStatements0020

    public void testStatements0020()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testBlob0021

    public void testBlob0021()
                      throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testNestedStatements0022

    public void testNestedStatements0022()
                                  throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPrimaryKeyFloat0023

    public void testPrimaryKeyFloat0023()
                                 throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPrimaryKeyReal0024

    public void testPrimaryKeyReal0024()
                                throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testGetBoolean0025

    public void testGetBoolean0025()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testNestedStatements0026

    public void testNestedStatements0026()
                                  throws java.lang.Exception

  SAfe Tests whether cursor-based statements still work ok when nested. Similar to `testNestedStatements0022`, which tests the same with plain (non-cursor-based) statements (and unfortunately fails).

  Throws:
    `java.lang.Exception` - if an Exception occurs (very relevant, huh?)

### testErrors0036

    public void testErrors0036()
                        throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testTimestamps0037

    public void testTimestamps0037()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testConnection0038

    public void testConnection0038()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testConnection0039

    public void testConnection0039()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPreparedStatement0040

    public void testPreparedStatement0040()
                                   throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPreparedStatement0041

    public void testPreparedStatement0041()
                                   throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testPreparedStatement0042

    public void testPreparedStatement0042()
                                   throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testResultSet0043

    public void testResultSet0043()
                           throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testResultSet0044

    public void testResultSet0044()
                           throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testResultSet0045

    public void testResultSet0045()
                           throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testMetaData0046

    public void testMetaData0046()
                          throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testTimestamps0047

    public void testTimestamps0047()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testTimestamps0048

    public void testTimestamps0048()
                            throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testDecimalConversion0058

    public void testDecimalConversion0058()
                                   throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### testDatetimeRounding1

    public void testDatetimeRounding1()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding2

    public void testDatetimeRounding2()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding3

    public void testDatetimeRounding3()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding4

    public void testDatetimeRounding4()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding5

    public void testDatetimeRounding5()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding6

    public void testDatetimeRounding6()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding7

    public void testDatetimeRounding7()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding8

    public void testDatetimeRounding8()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding9

    public void testDatetimeRounding9()
                               throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testDatetimeRounding10

    public void testDatetimeRounding10()
                                throws java.lang.Exception

  Test for bug [994916] datetime decoding in TdsData.java

  Throws:
    `java.lang.Exception`

### testTimestampTimeZone

    public void testTimestampTimeZone()
                               throws java.sql.SQLException

  Test for bug [1036059] getTimestamp with Calendar applies tzone offset wrong way.

  Throws:
    `java.sql.SQLException`

### testTimestampRange

    public void testTimestampRange()
                            throws java.sql.SQLException

  Test for bug [1040475] Possible bug when converting to and from datetime.

  jTDS seems to accept dates outside the range accepted by SQL Server (i.e. 1753-9999).

  Throws:
    `java.sql.SQLException`

### testWriteDate

    public void testWriteDate()
                       throws java.sql.SQLException

  Test that `java.sql.Date` objects are inserted and retrieved correctly (ie no time component).

  Throws:
    `java.sql.SQLException`

### testDayOfWeek

    public void testDayOfWeek()
                       throws java.lang.Exception

  Test for bug [1226210] {fn dayofweek()} depends on the language.

  Throws:
    `java.lang.Exception`

### testGetString

    public void testGetString()
                       throws java.sql.SQLException

  Test for bug [1235845] getTimestamp() returns illegal value after getString().

  Throws:
    `java.sql.SQLException`

### test1899Date

    public void test1899Date()
                      throws java.lang.Exception

  Test for bug [1234531] Dates before 01/01/1900 broken due to DateTime value markers.

  Throws:
    `java.lang.Exception`

### getTimeInMs

    public long getTimeInMs(java.sql.ResultSet rs)
                     throws java.sql.SQLException

  Java 1.3 Timestamp.getDate() does not add the nano seconds to the millisecond value returned. This causes the timestamp tests to fail. If running under java 1.3 we add the nanos ourselves.

  Parameters:
    `rs` - the result set returning the Timstamp value in column 1
  Returns:
    the millisecond date value as a `long`.
  Throws:
    `java.sql.SQLException`

### testDateTimeDegeneration

    public void testDateTimeDegeneration()
                                  throws java.lang.Exception

  Test for bug [2508201], date field is changed by 3 milliseconds. Note: This test will fail for some server types due to "DATE" and "TIME" data types not being available.

  Throws:
    `java.lang.Exception`

### testEscaping

    public void testEscaping()
                      throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### testEra

    public void testEra()
                 throws java.sql.SQLException

  Test for bugs [2181003]/[2349058], an attempt to set a BC date invalidates driver state/DateTime allows invalid dates through.

  Throws:
    `java.sql.SQLException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Generated on December 30 2009