Documentation of 'org.hsqldb.test.TestGroupByHaving' Java class
TestGroupByHaving
org.hsqldb.test

Class TestGroupByHaving

  • All Implemented Interfaces:
    junit.framework.Test


    public class TestGroupByHaving
    extends junit.framework.TestCase
    Test cases for HSQL aggregates and HAVING clause.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TestGroupByHaving(java.lang.String s)
      Constructs a new SubselectTest.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void testAggregatedGroupBy()
      Tests aggregated selection with a GROUP_BY clause.
      void testAggregatedGroupByHaving1()
      Tests aggregated selection with a GROUP_BY clause and a HAVING clause.
      void testAggregatedGroupByHaving2()
      Tests aggregated selection with a GROUP_BY clause and a HAVING clause.
      void testHavingWithoutGroupBy1()
      Tests an unusual usage of the HAVING clause, without a GROUP BY clause.
      void testHavingWithoutGroupBy2()
      Tests an unusual usage of the HAVING clause, without a GROUP BY clause.
      void testInvalidHaving()
      Tests an invalid HAVING clause that contains columns not in the GROUP BY clause.
      • Methods inherited from class junit.framework.TestCase

        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, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TestGroupByHaving

        public TestGroupByHaving(java.lang.String s)
        Constructs a new SubselectTest.
    • Method Detail

      • testAggregatedGroupBy

        public void testAggregatedGroupBy()
                                   throws java.sql.SQLException
        Tests aggregated selection with a GROUP_BY clause. This is a normal use of the GROUP_BY clause. The first two employees do not have a superior, and must be grouped within the same group, according to GROUP_BY standard.
        Throws:
        java.sql.SQLException
      • testAggregatedGroupByHaving1

        public void testAggregatedGroupByHaving1()
                                          throws java.sql.SQLException
        Tests aggregated selection with a GROUP_BY clause and a HAVING clause.

        This is a typical use of the GROUP_BY + HAVING clause. The first two employees are eliminated due to the HAVING condition.

        This test uses aggregated function to eliminate first group.

        Throws:
        java.sql.SQLException
      • testAggregatedGroupByHaving2

        public void testAggregatedGroupByHaving2()
                                          throws java.sql.SQLException
        Tests aggregated selection with a GROUP_BY clause and a HAVING clause.

        This is a typical use of the GROUP_BY + HAVING clause. The first two employees are eliminated due to the HAVING condition.

        This test uses GROUP_BY column to eliminate first group.

        Throws:
        java.sql.SQLException
      • testHavingWithoutGroupBy1

        public void testHavingWithoutGroupBy1()
                                       throws java.sql.SQLException
        Tests an unusual usage of the HAVING clause, without a GROUP BY clause.

        Only one row is returned by the aggregate selection without a GROUP BY clause. The HAVING clause is applied to the only returned row. In this case, the HAVING condition is satisfied.

        Throws:
        java.sql.SQLException
      • testHavingWithoutGroupBy2

        public void testHavingWithoutGroupBy2()
                                       throws java.sql.SQLException
        Tests an unusual usage of the HAVING clause, without a GROUP BY clause.

        Only one row is returned by the aggregate selection without a GROUP BY clause. The HAVING clause is applied to the only returned row. In this case, the HAVING condition is NOT satisfied.

        Throws:
        java.sql.SQLException
      • testInvalidHaving

        public void testInvalidHaving()
                               throws java.sql.SQLException
        Tests an invalid HAVING clause that contains columns not in the GROUP BY clause. A SQLException should be thrown.
        Throws:
        java.sql.SQLException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.