Package org.h2.test

Examples of org.h2.test.TestBase


        testReadOnly();
        testAdapter();
    }

    private static void testAdapter() {
        TraceSystem ts = new TraceSystem(null);
        ts.setLevelFile(TraceSystem.ADAPTER);
        ts.getTrace("test").info("test");
        ts.close();
    }
View Full Code Here


        ts.getTrace("test").info("test");
        ts.close();
    }

    private void testTraceDebug() {
        TraceSystem ts = new TraceSystem(null);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ts.setSysOut(new PrintStream(out));
        ts.setLevelSystemOut(TraceSystem.DEBUG);
        ts.getTrace("test").debug(new Exception("error"), "test");
        ts.close();
        String outString = new String(out.toByteArray());
        assertContains(outString, "error");
        assertContains(outString, "Exception");
        assertContains(outString, "test");
    }
View Full Code Here

    private void testReadOnly() throws Exception {
        String readOnlyFile = getBaseDir() + "/readOnly.log";
        IOUtils.delete(readOnlyFile);
        IOUtils.openFileOutputStream(readOnlyFile, false).close();
        FileSystem.getInstance(getBaseDir()).setReadOnly(readOnlyFile);
        TraceSystem ts = new TraceSystem(readOnlyFile);
        ts.setLevelFile(TraceSystem.INFO);
        ts.getTrace("test").info("test");
        IOUtils.delete(readOnlyFile);
        ts.close();
    }
View Full Code Here

        FileSystem.getInstance("split:").delete("split:" + getBaseDir() + "/openClose2.h2.db");
        Connection conn;
        conn = DriverManager.getConnection("jdbc:h2:split:18:" + getBaseDir() + "/openClose2");
        conn.createStatement().execute("create table test(id int, name varchar) as select 1, space(1000000)");
        conn.close();
        FileObject f = FileSystem.getInstance(getBaseDir()).openFileObject(getBaseDir() + "/openClose2.h2.db.1.part", "rw");
        f.setFileLength(f.length() * 2);
        f.close();
        assertThrows(ErrorCode.IO_EXCEPTION_2, this).
                getConnection("jdbc:h2:split:18:" + getBaseDir() + "/openClose2");
        FileSystem.getInstance("split:").delete("split:" + getBaseDir() + "/openClose2.h2.db");
    }
View Full Code Here

     *
     * @param a ignored
     */
    public static void main(String... a) throws Exception {
        // run using -javaagent:ext/h2-1.2.139.jar
        TestBase test = TestBase.createCaller().init();
        test.config.traceTest = true;
        test.test();
    }
View Full Code Here

     * Run just this test.
     *
     * @param a ignored
     */
    public static void main(String... a) throws Exception {
        TestBase test = TestBase.createCaller().init();
        test.config.traceTest = true;
        test.test();
    }
View Full Code Here

     * Run just this test.
     *
     * @param a ignored
     */
    public static void main(String... a) throws Exception {
        TestBase test = TestBase.createCaller().init();
        test.config.big = true;
        test.test();
        test.test();
        test.test();
    }
View Full Code Here

     * Run just this test.
     *
     * @param a ignored
     */
    public static void main(String... a) throws Exception {
        TestBase test = TestBase.createCaller().init();
        // test.config.big = true;
        test.test();
    }
View Full Code Here

     * Run just this test.
     *
     * @param a ignored
     */
    public static void main(String... a) throws Exception {
        TestBase test = TestBase.createCaller().init();
        // test.config.traceTest = true;
        test.test();
    }
View Full Code Here

     * Run just this test.
     *
     * @param a ignored
     */
    public static void main(String... a) throws Exception {
        TestBase test = TestBase.createCaller().init();
        test.config.traceTest = true;
        test.test();
    }
View Full Code Here

TOP

Related Classes of org.h2.test.TestBase

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.