Ejemplo n.º 1
0
  /**
   * checkAndSetParamHCのテストケース 正常系:エクスポートファイルをTSVファイルに変換する際のファイル分割サイズが不正なケース
   *
   * @throws Exception
   */
  @Test
  public void checkAndSetParamHC06() throws Exception {
    ConfigurationLoader.init(properties_hc, false, true);
    Properties p = ConfigurationLoader.getProperty();
    p.setProperty("export.tsv-max-size", "a");
    ConfigurationLoader.setProperty(p);

    try {
      ConfigurationLoader.checkAndSetParamHC();
      fail();
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(e instanceof BulkLoaderSystemException);
    }
  }
Ejemplo n.º 2
0
  /**
   * checkAndSetParamHCのテストケース 正常系:エクスポートファイルをTSVファイルに変換する際のファイル分割サイズが設定されていないケース(デフォルト値が設定される)
   *
   * @throws Exception
   */
  @Test
  public void checkAndSetParamHC05() throws Exception {
    ConfigurationLoader.init(properties_hc, false, true);
    Properties p = ConfigurationLoader.getProperty();
    p.setProperty("export.tsv-max-size", "");
    ConfigurationLoader.setProperty(p);

    try {
      ConfigurationLoader.checkAndSetParamHC();
    } catch (Exception e) {
      fail();
      e.printStackTrace();
    }
    assertEquals("16777216", ConfigurationLoader.getProperty(Constants.PROP_KEY_EXP_LOAD_MAX_SIZE));
  }
Ejemplo n.º 3
0
  /**
   * checkAndSetParamHCのテストケース 異常系:HDFSのプロトコルとホスト名が設定されていないケース
   *
   * @throws Exception
   */
  @Ignore("hdfs-protocol-host is obsoleted")
  @Test
  public void checkAndSetParamHC04() throws Exception {
    ConfigurationLoader.init(properties_hc, false, true);
    Properties p = ConfigurationLoader.getProperty();
    p.setProperty("hdfs-protocol-host", "");
    ConfigurationLoader.setProperty(p);

    try {
      ConfigurationLoader.checkAndSetParamHC();
      fail();
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(e instanceof BulkLoaderSystemException);
    }
  }
Ejemplo n.º 4
0
  /**
   * checkAndSetParamHCのテストケース 正常系:出力ファイルの圧縮有無が設定されていないケース(デフォルト値が設定される)
   *
   * @throws Exception
   */
  @Test
  public void checkAndSetParamHC07() throws Exception {
    ConfigurationLoader.init(properties_hc, false, true);
    Properties p = ConfigurationLoader.getProperty();
    p.setProperty("import.seq-comp-type", "");
    ConfigurationLoader.setProperty(p);

    try {
      ConfigurationLoader.checkAndSetParamHC();
    } catch (Exception e) {
      fail();
      e.printStackTrace();
    }

    assertEquals(
        "NONE", ConfigurationLoader.getProperty(Constants.PROP_KEY_IMP_SEQ_FILE_COMP_TYPE));
  }
Ejemplo n.º 5
0
  /**
   * checkAndSetParamHCのテストケース 正常系:ワーキングディレクトリベースが設定されていないケース
   *
   * @throws Exception
   */
  @Ignore("hadoop-cluster.workingdir.use is obsoleted")
  @Test
  public void checkAndSetParamHC03() throws Exception {
    ConfigurationLoader.init(properties_hc, false, true);
    Properties p = ConfigurationLoader.getProperty();
    p.setProperty("hadoop-cluster.workingdir.use", "");
    ConfigurationLoader.setProperty(p);

    try {
      ConfigurationLoader.checkAndSetParamHC();
    } catch (Exception e) {
      fail();
      e.printStackTrace();
    }

    assertEquals("false", ConfigurationLoader.getProperty(Constants.PROP_KEY_WORKINGDIR_USE));
  }
Ejemplo n.º 6
0
  /**
   * checkAndSetParamHCのテストケース 正常系:Exportファイルの圧縮有無が設定されていないケース(デフォルト値が設定される)
   *
   * @throws Exception
   */
  @Test
  public void checkAndSetParamHC01() throws Exception {
    ConfigurationLoader.init(properties_hc, false, true);
    Properties p = ConfigurationLoader.getProperty();
    p.setProperty("export.zip-comp-type", "");
    ConfigurationLoader.setProperty(p);

    try {
      ConfigurationLoader.checkAndSetParamHC();
    } catch (Exception e) {
      fail();
      e.printStackTrace();
    }

    assertEquals(
        FileCompType.STORED,
        FileCompType.find(ConfigurationLoader.getProperty(Constants.PROP_KEY_EXP_FILE_COMP_TYPE)));
  }