當前位置: 首頁>>代碼示例>>Java>>正文


Java HsqldbTestServer.resetServer方法代碼示例

本文整理匯總了Java中com.cloudera.sqoop.testutil.HsqldbTestServer.resetServer方法的典型用法代碼示例。如果您正苦於以下問題:Java HsqldbTestServer.resetServer方法的具體用法?Java HsqldbTestServer.resetServer怎麽用?Java HsqldbTestServer.resetServer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.cloudera.sqoop.testutil.HsqldbTestServer的用法示例。


在下文中一共展示了HsqldbTestServer.resetServer方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import com.cloudera.sqoop.testutil.HsqldbTestServer; //導入方法依賴的package包/類
@Before
public void setUp() {
  testServer = new HsqldbTestServer();
  try {
    testServer.resetServer();
  } catch (SQLException sqlE) {
    LOG.error("Got SQLException: " + sqlE.toString());
    fail("Got SQLException: " + sqlE.toString());
  } catch (ClassNotFoundException cnfe) {
    LOG.error("Could not find class for db driver: " + cnfe.toString());
    fail("Could not find class for db driver: " + cnfe.toString());
  }

  manager = testServer.getManager();
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:16,代碼來源:TestHsqldbManager.java

示例2: setUp

import com.cloudera.sqoop.testutil.HsqldbTestServer; //導入方法依賴的package包/類
@Before
public void setUp() {
  testServer = new HsqldbTestServer();
  org.apache.log4j.Logger root = org.apache.log4j.Logger.getRootLogger();
  root.setLevel(org.apache.log4j.Level.DEBUG);
  try {
    testServer.resetServer();
  } catch (SQLException sqlE) {
    LOG.error("Got SQLException: " + sqlE.toString());
    fail("Got SQLException: " + sqlE.toString());
  } catch (ClassNotFoundException cnfe) {
    LOG.error("Could not find class for db driver: " + cnfe.toString());
    fail("Could not find class for db driver: " + cnfe.toString());
  }

  manager = testServer.getManager();
  options = testServer.getSqoopOptions();

  // sanity check: make sure we're in a tmp dir before we blow anything away.
  assertTrue("Test generates code in non-tmp dir!",
      CODE_GEN_DIR.startsWith(ImportJobTestCase.TEMP_BASE_DIR));
  assertTrue("Test generates jars in non-tmp dir!",
      JAR_GEN_DIR.startsWith(ImportJobTestCase.TEMP_BASE_DIR));

  // start out by removing these directories ahead of time
  // to ensure that this is truly generating the code.
  File codeGenDirFile = new File(CODE_GEN_DIR);
  File classGenDirFile = new File(JAR_GEN_DIR);

  if (codeGenDirFile.exists()) {
    LOG.debug("Removing code gen dir: " + codeGenDirFile);
    if (!DirUtil.deleteDir(codeGenDirFile)) {
      LOG.warn("Could not delete " + codeGenDirFile + " prior to test");
    }
  }

  if (classGenDirFile.exists()) {
    LOG.debug("Removing class gen dir: " + classGenDirFile);
    if (!DirUtil.deleteDir(classGenDirFile)) {
      LOG.warn("Could not delete " + classGenDirFile + " prior to test");
    }
  }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:44,代碼來源:TestClassWriter.java


注:本文中的com.cloudera.sqoop.testutil.HsqldbTestServer.resetServer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。