Package org.apache.sqoop.tool

Examples of org.apache.sqoop.tool.ImportTool


      assertTrue("Validate option missing.", argsList.contains("--validate"));
      assertTrue("Validator option missing.", argsList.contains("--validator"));

      String[] optionArgs = toStringArray(argsList);

      SqoopOptions validationOptions = new ImportTool().parseArguments(
        optionArgs, getConf(), getSqoopOptions(getConf()), true);
      assertEquals(RowCountValidator.class,
        validationOptions.getValidatorClass());
      assertEquals(AbsoluteValidationThreshold.class,
        validationOptions.getValidationThresholdClass());
View Full Code Here


      argsList.add("org.apache.sqoop.validation.NullFailureHandler");
      Collections.addAll(argsList, args);

      String[] optionArgs = toStringArray(argsList);

      new ImportTool().parseArguments(optionArgs, getConf(),
        getSqoopOptions(getConf()), true);
      fail("The validation options are incorrect and must throw an exception");
    } catch (Exception e) {
      System.out.println("e.getMessage() = " + e.getMessage());
      System.out.println("e.getClass() = " + e.getClass());
View Full Code Here

      extraArgs.add(TEMP_BASE_DIR + "unknown");
      String[] argv = getCommonArgs(false, extraArgs);

      Configuration conf = getConf();
      SqoopOptions opts = getSqoopOptions(conf);
      ImportTool importTool = new ImportTool();
      importTool.parseArguments(argv, conf, opts, true);
      fail("The password file does not exist! ");
    } catch (Exception e) {
      assertTrue(e.getMessage().contains("The password file does not exist!"));
    }
  }
View Full Code Here

      extraArgs.add(TEMP_BASE_DIR);
      String[] argv = getCommonArgs(false, extraArgs);

      Configuration conf = getConf();
      SqoopOptions opts = getSqoopOptions(conf);
      ImportTool importTool = new ImportTool();
      importTool.parseArguments(argv, conf, opts, true);
      fail("The password file cannot be a directory! ");
    } catch (Exception e) {
      assertTrue(e.getMessage().contains("The password file cannot "
        + "be a directory!"));
    }
View Full Code Here

      extraArgs.add(passwordFilePath);
      String[] argv = getCommonArgs(false, extraArgs);

      Configuration conf = getConf();
      SqoopOptions in = getSqoopOptions(conf);
      ImportTool importTool = new ImportTool();
      SqoopOptions out = importTool.parseArguments(argv, conf, in, true);
      assertNotNull(out.getPassword());
      importTool.validateOptions(out);
      fail("Either password or passwordPath must be specified but not both.");
    } catch (Exception e) {
      assertTrue(e.getMessage().contains("Either password or path to a "
        + "password file must be specified but not both"));
    }
View Full Code Here

      extraArgs.add(passwordFilePath);
      String[] commonArgs = getCommonArgs(false, extraArgs);

      Configuration conf = getConf();
      SqoopOptions in = getSqoopOptions(conf);
      ImportTool importTool = new ImportTool();
      SqoopOptions out = importTool.parseArguments(commonArgs, conf, in, true);
      assertNotNull(out.getPasswordFilePath());
      assertNotNull(out.getPassword());
      assertEquals("password", out.getPassword());
    } catch (Exception e) {
      fail("passwordPath option is missing.");
View Full Code Here

    extraArgs.add(passwordFilePath);
    String[] argv = getCommonArgs(false, extraArgs);

    Configuration conf = getConf();
    SqoopOptions in = getSqoopOptions(conf);
    ImportTool importTool = new ImportTool();
    SqoopOptions out = importTool.parseArguments(argv, conf, in, true);
    assertNotNull(out.getPassword());

    // Enable storing passwords in the metastore
    conf.set(SqoopOptions.METASTORE_PASSWORD_KEY, "true");
View Full Code Here

    extraArgs.add(passwordFilePath);
    String[] argv = getCommonArgs(false, extraArgs);

    Configuration conf = getConf();
    SqoopOptions in = getSqoopOptions(conf);
    ImportTool importTool = new ImportTool();
    SqoopOptions out = importTool.parseArguments(argv, conf, in, true);
    assertNotNull(out.getPassword());

    // Enable storing passwords in the metastore
    conf.set(SqoopOptions.METASTORE_PASSWORD_KEY, "false");
View Full Code Here

    extraArgs.add("password");
    String[] argv = getCommonArgs(false, extraArgs);

    Configuration conf = getConf();
    SqoopOptions in = getSqoopOptions(conf);
    ImportTool importTool = new ImportTool();
    SqoopOptions out = importTool.parseArguments(argv, conf, in, true);
    assertNotNull(out.getPassword());

    // Enable storing passwords in the metastore
    conf.set(SqoopOptions.METASTORE_PASSWORD_KEY, "true");
View Full Code Here

      extraArgs.add(TEMP_BASE_DIR + "unknown");
      String[] argv = getCommonArgs(false, extraArgs);

      Configuration conf = getConf();
      SqoopOptions opts = getSqoopOptions(conf);
      ImportTool importTool = new ImportTool();
      importTool.parseArguments(argv, conf, opts, true);
      fail("The password file does not exist! ");
    } catch (Exception e) {
      assertTrue(e.getMessage().contains("The password file does not exist!"));
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.sqoop.tool.ImportTool

Copyright © 2018 www.massapicom. 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.