Package org.hivedb.management

Source Code of org.hivedb.management.TestHiveInstaller

package org.hivedb.management;

import org.hivedb.util.database.test.H2TestCase;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

import java.util.Arrays;
import java.util.Collection;

public class TestHiveInstaller extends H2TestCase {
  private static String TEST_DB = "testDB";

  @Test
  public void testHiveInstall() {
    HiveConfigurationSchemaInstaller installer = new HiveConfigurationSchemaInstaller(getConnectString(TEST_DB));
    installer.run();
    JdbcDaoSupport dao = new SimpleJdbcDaoSupport();
    dao.setDataSource(getDataSource(TEST_DB));
    int rowCount = dao.getJdbcTemplate().queryForInt("select count(1) from semaphore_metadata");
    Assert.assertEquals(1, rowCount);
  }

  @Override
  public Collection<String> getDatabaseNames() {
    return Arrays.asList(new String[]{TEST_DB});
  }
}
TOP

Related Classes of org.hivedb.management.TestHiveInstaller

TOP
Copyright © 2018 www.massapi.com. 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.