## org.h2.test.unit
Class TestExit

    java.lang.Object
      org.h2.test.TestBase
          org.h2.test.unit.TestExit

All Implemented Interfaces:
  java.util.EventListener, DatabaseEventListener

    public class TestExit

extends TestBase
implements DatabaseEventListener

Tests the flag db_close_on_exit. A new process is started.

Field Summary
`static java.sql.Connection` `conn`

Fields inherited from class org.h2.test.TestBase
`BASE_TEST_DIR, config, start, TEMP_DIR, uniqueId`

Fields inherited from interface org.h2.api.DatabaseEventListener
`STATE_BACKUP_FILE, STATE_CREATE_INDEX, STATE_RECONNECTED, STATE_RECOVER, STATE_SCAN_FILE, STATE_STATEMENT_END, STATE_STATEMENT_PROGRESS, STATE_STATEMENT_START`

Constructor Summary
`TestExit()`

Method Summary
`void` `closingDatabase()` This method is called before the database is closed normally.
`void` `exceptionThrown(java.sql.SQLException e, java.lang.String sql)` This method is called if an exception occurred.
`void` `init(java.lang.String url)` This method is called just after creating the object.
`static void` `main(java.lang.String... args)` This method is called when executing this application from the command line.
`void` `opened()` This method is called after the database has been opened.
`void` `setProgress(int state, java.lang.String name, int x, int max)` This method is called for long running events, such as recovering, scanning a file or building an index.
`void` `test()` This method will be called by the test framework.

Methods inherited from class org.h2.test.TestBase

`assertContains, assertEqualDatabases, assertEqualReaders, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualStreams, assertFalse, assertFalse, assertKnownException, assertKnownException, assertNull, assertResult, assertResultRowCount, assertResultSetMeta, assertResultSetOrdered, assertSingleValue, assertSmaller, assertStartsWith, assertThrows, assertThrows, assertThrows, assertTrue, assertTrue, crash, createCaller, createCaller, createClassProxy, deleteDb, deleteDb, eatMemory, fail, fail, freeMemory, getBaseDir, getClassPath, getConnection, getConnection, getFilePassword, getMemoryUsed, getPassword, getPassword, getSize, getTestDir, getURL, getUser, init, init, logError, println, printTime, printTimeMemory, readString, runTest, startServerIfRequired, testCase, trace, trace, traceMemory`

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

Field Detail

### conn

    public static java.sql.Connection conn

Constructor Detail

### TestExit

    public TestExit()

Method Detail

### test

    public void test()
              throws java.lang.Exception

  Description copied from class: `TestBase`
  This method will be called by the test framework.

  Specified by:
    `test` in class `TestBase`
  Throws:
    `java.lang.Exception` - if an exception in the test occurs

### main

    public static void main(java.lang.String... args)
                     throws java.sql.SQLException

  This method is called when executing this application from the command line.

  Parameters:
    `args` - the command line parameters
  Throws:
    `java.sql.SQLException`

### exceptionThrown

    public void exceptionThrown(java.sql.SQLException e,
                                java.lang.String sql)

  Description copied from interface: `DatabaseEventListener`
  This method is called if an exception occurred.

  Specified by:
    `exceptionThrown` in interface `DatabaseEventListener`
  Parameters:
    `e` - the exception
    `sql` - the SQL statement

### closingDatabase

    public void closingDatabase()

  Description copied from interface: `DatabaseEventListener`
  This method is called before the database is closed normally. It is save to connect to the database and execute statements at this point, however the connection must be closed before the method returns.

  Specified by:
    `closingDatabase` in interface `DatabaseEventListener`

### setProgress

    public void setProgress(int state,
                            java.lang.String name,
                            int x,
                            int max)

  Description copied from interface: `DatabaseEventListener`
  This method is called for long running events, such as recovering, scanning a file or building an index.

  More states might be added in future versions, therefore implementations should silently ignore states that they don't understand.

  Specified by:
    `setProgress` in interface `DatabaseEventListener`
  Parameters:
    `state` - the state
    `name` - the object name
    `x` - the current position
    `max` - the highest possible value (might be 0)

### init

    public void init(java.lang.String url)

  Description copied from interface: `DatabaseEventListener`
  This method is called just after creating the object. This is done when opening the database if the listener is specified in the database URL, but may be later if the listener is set at runtime with the SET SQL statement.

  Specified by:
    `init` in interface `DatabaseEventListener`
  Parameters:
    `url` - - the database URL

### opened

    public void opened()

  Description copied from interface: `DatabaseEventListener`
  This method is called after the database has been opened. It is save to connect to the database and execute statements at this point.

  Specified by:
    `opened` in interface `DatabaseEventListener`