Class TestListener

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.h2.test.TestDb

        org.h2.test.TestDb.Child
      • Nested classes/interfaces inherited from class org.h2.test.TestBase

        org.h2.test.TestBase.VoidCallable
    • Constructor Summary

      Constructors 
      Constructor Description
      TestListener()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      boolean isEnabled()  
      static void main​(java.lang.String... a)
      Run just this test.
      void opened()
      This method is called after the database has been opened.
      void setProgress​(int state, java.lang.String name, long current, long 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.TestDb

        buildChild, deleteDb, deleteDb, getConnection, getConnection, getURL
      • Methods inherited from class org.h2.test.TestBase

        assertContains, assertEmpty, assertEqualDatabases, assertEqualReaders, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualStreams, assertFalse, assertFalse, assertKnownException, assertKnownException, assertNotContaining, assertNotNull, assertNotNull, assertNull, assertResult, assertResultRowCount, assertResultSetMeta, assertResultSetOrdered, assertResultSetOrdered, assertSame, assertSingleValue, assertSmaller, assertStartsWith, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertTrue, assertTrue, checkErrorCode, crash, createCaller, createFailingStream, eatMemory, execute, execute, fail, fail, freeMemory, getBaseDir, getClassPath, getFilePassword, getJVM, getMemoryUsed, getMemoryUsedBytes, getPassword, getPassword, getPowerOffCount, getSize, getTestDir, getTestName, getUser, init, init, logError, logErrorMessage, println, printTime, printTimeMemory, readString, runTest, setPowerOffCount, testFromMain, throwException, trace, trace, traceMemory
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TestListener

        public TestListener()
    • Method Detail

      • main

        public static void main​(java.lang.String... a)
                         throws java.lang.Exception
        Run just this test.
        Parameters:
        a - ignored
        Throws:
        java.lang.Exception
      • isEnabled

        public boolean isEnabled()
        Overrides:
        isEnabled in class org.h2.test.TestBase
        Returns:
        whether this test is enabled in the current configuration
      • test

        public void test()
                  throws java.sql.SQLException
        Description copied from class: org.h2.test.TestBase
        This method will be called by the test framework.
        Specified by:
        test in class org.h2.test.TestBase
        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
      • setProgress

        public void setProgress​(int state,
                                java.lang.String name,
                                long current,
                                long 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
        current - the current position
        max - the highest possible value or 0 if unknown
      • closingDatabase

        public void closingDatabase()
        Description copied from interface: DatabaseEventListener
        This method is called before the database is closed normally. It is safe 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
      • 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 safe to connect to the database and execute statements at this point.
        Specified by:
        opened in interface DatabaseEventListener