Package org.apache.torque.test

Examples of org.apache.torque.test.ClobTest


            ClobTestPeer.doDelete(criteria);
        }

        // create a new ClobTest Object with a large clob value
        // and save it
        ClobTest clobTest = new ClobTest();
        {
            int length = 10000;
            StringBuffer chars = new StringBuffer();
            String charTemplate = "1234567890abcdefghijklmnopqrstuvwxyz";
            for (int i = 0; i < length; ++i)
            {
                 chars.append(charTemplate.charAt(i % charTemplate.length()));
            }
            clobTest.setClobValue(chars.toString());
        }
        clobTest.save();

        // read the ClobTests from the database
        // and check the values against the original values
        List clobTestList = ClobTestPeer.doSelect(new Criteria());
        assertTrue("clobTestList should contain 1 object but contains "
                + clobTestList.size(),
                clobTestList.size() == 1);

        ClobTest readClobTest = (ClobTest) clobTestList.get(0);
        assertTrue("read and written clobs should be equal",
                clobTest.getClobValue().equals(readClobTest.getClobValue()));
    }
View Full Code Here


            ClobTestPeer.doDelete(criteria);
        }

        // create a new ClobTest Object with a large clob value
        // and save it
        ClobTest clobTest = new ClobTest();
        {
            int length = 10000;
            StringBuffer chars = new StringBuffer();
            String charTemplate = "1234567890abcdefghijklmnopqrstuvwxyz";
            for (int i = 0; i < length; ++i)
            {
                 chars.append(charTemplate.charAt(i % charTemplate.length()));
            }
            clobTest.setClobValue(chars.toString());
        }
        clobTest.save();
       
        // read the ClobTests from the database
        // and check the values against the original values
        List clobTestList = ClobTestPeer.doSelect(new Criteria());
        assertTrue("clobTestList should contain 1 object but contains "
                + clobTestList.size(),
                clobTestList.size() == 1);
       
        ClobTest readClobTest = (ClobTest) clobTestList.get(0);
        assertTrue("read and written clobs should be equal",
                clobTest.getClobValue().equals(readClobTest.getClobValue()));
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.test.ClobTest

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.