⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 importnodesfiltersearchcallbacktest.java

📁 采用 Java 编写的数据库系统单元测试程序。
💻 JAVA
字号:
/*
 *
 * The DbUnit Database Testing Framework
 * Copyright (C)2005, DbUnit.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
package org.dbunit.database.search;

import org.dbunit.database.IDatabaseConnection;

/**  
 * @author Felipe Leme <dbunit@felipeal.net>
 * @version $Revision: 493 $
 * @since Aug 28, 2005
 */
public class ImportNodesFilterSearchCallbackTest extends AbstractMetaDataBasedSearchCallbackTestCase {
  
  public static final String SQL_FILE = "hypersonic_import.sql";

  public static final String[][] SINGLE_INPUT = new String[][] {
    new String[] { "A" }, 
    new String[] { "B" }, 
    new String[] { "C" },
    new String[] { "D" }, 
    new String[] { "E" }, 
    new String[] { "F" },
    new String[] { "G" }, 
    new String[] { "H" }
  };
  
  public static final String[][] COMPOUND_INPUT = new String[][] {
    new String[] { "A", "H" }, 
    new String[] { "H", "A" },
    new String[] { "A", "B" }, 
    new String[] { "B", "A" },
    new String[] { "B", "A", "A", "B", "D", "G" } 
  };
  
  public static final String[][] SINGLE_OUTPUT = new String[][] {
    new String[] { "G", "D", "A" },
    new String[] { "G", "D", "A", "F", "C", "E", "H", "B" },
    new String[] { "G", "D", "A", "F", "C" },
    new String[] { "A", "G", "D" }, 
    new String[] { "G", "D", "A", "E" },
    new String[] { "A", "G", "D", "F" }, 
    new String[] { "D", "A", "G" },
    new String[] { "H" },    
  };

  public static final String[][] COMPOUND_OUTPUT = new String[][] {
    new String[] { "G", "D", "A", "H" },
    new String[] { "H", "G", "D", "A" },
    new String[] { "G", "D", "A", "F", "C", "E", "H", "B" },
    new String[] { "G", "D", "A", "F", "C", "E", "H", "B" },
    new String[] { "G", "D", "A", "F", "C", "E", "H", "B" }     
  };
  
   public ImportNodesFilterSearchCallbackTest(String testName) {
   super(testName, SQL_FILE);
   }
     
  protected String[][] getInput() { 
    String[][] input = new String[SINGLE_INPUT.length+COMPOUND_INPUT.length][];
    System.arraycopy( SINGLE_INPUT, 0, input, 0, SINGLE_INPUT.length);
    System.arraycopy(COMPOUND_INPUT,0,input,SINGLE_INPUT.length,COMPOUND_INPUT.length);
    return input;
  }
  protected String[][] getExpectedOutput() { 
    String[][] output = new String[SINGLE_OUTPUT.length+COMPOUND_OUTPUT.length][];
    System.arraycopy( SINGLE_OUTPUT, 0, output, 0, SINGLE_OUTPUT.length);
    System.arraycopy(COMPOUND_OUTPUT,0,output,SINGLE_OUTPUT.length,COMPOUND_OUTPUT.length);
    return output;    
  }

  protected AbstractMetaDataBasedSearchCallback getCallback(IDatabaseConnection connection) {
    return new ImportedKeysSearchCallback(connection);
  }

}

⌨️ 快捷键说明

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