Package org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses

Examples of org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SqlDataClass


     * @throws Exception
     */
    /* */
    @Test
    public void testSqlDate() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();

        // LOG.log(Level.INFO, "Test: testSqlDate() '2011-4-8' == 1302220800000");

        // 2011-4-8 = 1302220800000
        // LOG.log(Level.INFO, "sqlDate.toString() as String:" + sqlDate); // shows as 2011-04-07
        // LOG.log(Level.INFO, "sqlDate.getTime() as Long:" + sqlDate.getTime());

        // 2011-4-8 = 1302220800000
        // LOG.log(Level.INFO, "sqlDataClass.getSqlDate() as String:" + sqlDataClass.getSqlDate()); // shows as
        // 2011-04-07
        // LOG.log(Level.INFO, "sqlDataClass.getSqlDate().getTime() as Long:" + sqlDataClass.getSqlDate().getTime());

        if (sqlDate.compareTo(sqlDataClass.getSqlDate()) != 0) {
            fail("SQL date: Test '2011-4-8', expected " + sqlDate.toString() + ", but got "
                + sqlDataClass.getSqlDate().toString() + ". Check log for more info.");
            // LOG.log(Level.INFO, "SQL date: Test '2011-4-8', expected " + sqlDate.toString() + ", and got "
            // + sqlDataClass.getSqlDate().toString() +". Check log for more info.");
        } else {
            // LOG.log(Level.INFO, "SQL date: test passed! Woohoo!");
        }
View Full Code Here


    /**
     * Test {@link Money} type.
     */

    public void testMoney() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        assertEquals(money, sqlDataClass.getMoney());
        // assertTrue("Money " + money.toString() + " is not equal to " + sqlDataClass.getMoney().toString(),
        // money.equals(sqlDataClass.getMoney()));
    }
View Full Code Here

    /**
     * Test {@link DateTime} type.
     */
    public void testDateTime() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();

        LOG.log(Level.INFO, "Test: testDateTime()");
        LOG.log(Level.INFO, "sqlDataClass.getDateTime() as String:" + sqlDataClass.getDateTime());
        LOG.log(Level.INFO, "dateTime.toString() as String:" + dateTime);

        LOG.log(Level.INFO, "sqlDataClass.getDateTime().getTime() as Long:"
            + sqlDataClass.getDateTime().millisSinceEpoch());
        LOG.log(Level.INFO, "dateTime.getTime() as Long:" + dateTime.millisSinceEpoch());

        if (!dateTime.equals(sqlDataClass.getDateTime())) {
            fail("DateTime " + dateTime.toString() + " is not equal to " + sqlDataClass.getDateTime().toString());
        }
    }
View Full Code Here

    /**
     * Test {@link TimeStamp} type.
     */
    public void testTimeStamp() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        assertTrue("TimeStamp " + timeStamp.toString() + " is not equal to " + sqlDataClass.getTimeStamp().toString(),
            timeStamp.isEqualTo(sqlDataClass.getTimeStamp()));
    }
View Full Code Here

    /**
     * Test {@link Time} type.
     */
    /**/
    public void testTime() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        assertNotNull("sqlDataClass is null", sqlDataClass);
        assertNotNull("getTime() is null", sqlDataClass.getTime());
        assertTrue("Time 14h56: expected " + time.toString() + ", but got " + sqlDataClass.getTime().toString(),
            time.isEqualTo(sqlDataClass.getTime()));
    }
View Full Code Here

    /**
     * Test {@link Color} type.
     */
    public void testColor() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        assertEquals(color, sqlDataClass.getColor());
        // assertTrue("Color Black, expected " + color.toString() + " but got " + sqlDataClass.getColor().toString(),
        // color.isEqualTo(sqlDataClass.getColor()));
    }
View Full Code Here

    /**
     * Test {@link Password} type.
     */
    public void testPassword() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        assertEquals(password, sqlDataClass.getPassword());
    }
View Full Code Here

    /**
     * Test {@link Percentage} type.
     */
    public void testPercentage() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        assertEquals(percentage, sqlDataClass.getPercentage());
    }
View Full Code Here

        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        assertEquals(percentage, sqlDataClass.getPercentage());
    }

    public void testStandardValueTypesMaxima() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        final NumericTestClass numericTestMaxClass = sqlDataClass.getNumericTestClassMax();

        assertEquals(shortMaxValue, numericTestMaxClass.getShortValue());
        assertEquals(intMaxValue, numericTestMaxClass.getIntValue());
        assertEquals(longMaxValue, numericTestMaxClass.getLongValue());
        assertEquals(doubleMaxValue, numericTestMaxClass.getDoubleValue()); // fails in MySQL = infinity
View Full Code Here

        assertEquals(doubleMaxValue, numericTestMaxClass.getDoubleValue()); // fails in MySQL = infinity
        assertEquals(floatMaxValue, numericTestMaxClass.getFloatValue());
    }

    public void testStandardValueTypesMinima() {
        final SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getDataClass();
        final NumericTestClass numericTestMinClass = sqlDataClass.getNumericTestClassMin();

        assertEquals(shortMinValue, numericTestMinClass.getShortValue());
        assertEquals(intMinValue, numericTestMinClass.getIntValue());
        assertEquals(longMinValue, numericTestMinClass.getLongValue());
        assertEquals(doubleMinValue, numericTestMinClass.getDoubleValue()); // fails in MySQL = infinity
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.objectstores.sql.testsystem.dataclasses.SqlDataClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.