testdatabaseoperation.java

来自「每个例子文件夹都附有数据库表、程序源文件和一个war包(或者jar包)。如果是c」· Java 代码 · 共 31 行

JAVA
31
字号
package test;

import junit.framework.*;
import myjdbc.*;

public class TestDatabaseOperation extends TestCase {
    private DatabaseOperation databaseOperation = null;

    protected void setUp() throws Exception {
        super.setUp();
        /**@todo verify the constructors*/
        databaseOperation = DatabaseOperation.getInstance();
    }

    protected void tearDown() throws Exception {
        databaseOperation = null;
        super.tearDown();
    }

    public void testGetTotalPage() {
        String sql = "select * from topic";
        Object[] paras = null;
        int pageSize = 5;
        int expectedReturn = 3;
        int actualReturn = databaseOperation.getTotalPage(sql, paras, pageSize);
        assertEquals("return value", expectedReturn, actualReturn);
        /**@todo fill in the test code*/
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?