本文整理匯總了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();
}
示例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");
}
}
}