public void CanCreateNewSqoopDefinition_WithResources()
        {
            var pigJobDefinition = new SqoopJobCreateParameters
            {
                Command = "load 'passwd' using SqoopStorage(':'); B = foreach A generate $0 as id;"
            };

            pigJobDefinition.Files.Add("pidata.txt");
            pigJobDefinition.Files.Add("pidate2.txt");

            INewAzureHDInsightSqoopJobDefinitionCommand newSqoopJobDefinitionCommand =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateNewSqoopDefinition();

            newSqoopJobDefinitionCommand.Command = pigJobDefinition.Command;
            newSqoopJobDefinitionCommand.Files   = pigJobDefinition.Files.ToArray();
            newSqoopJobDefinitionCommand.EndProcessing();

            AzureHDInsightSqoopJobDefinition pigJobFromCommand = newSqoopJobDefinitionCommand.Output.ElementAt(0);

            Assert.AreEqual(pigJobDefinition.Command, pigJobFromCommand.Command);

            foreach (string resource in pigJobDefinition.Files)
            {
                Assert.IsTrue(
                    pigJobFromCommand.Files.Any(arg => string.Equals(resource, arg)),
                    "Unable to find File '{0}' in value returned from command",
                    resource);
            }
        }
        public void CanCreateNewSqoopDefinition_WithFile()
        {
            var pigJobDefinition = new SqoopJobCreateParameters {
                File = "my local file"
            };

            INewAzureHDInsightSqoopJobDefinitionCommand newSqoopJobDefinitionCommand =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateNewSqoopDefinition();

            newSqoopJobDefinitionCommand.File = pigJobDefinition.File;
            newSqoopJobDefinitionCommand.EndProcessing();

            AzureHDInsightSqoopJobDefinition pigJobFromCommand = newSqoopJobDefinitionCommand.Output.ElementAt(0);

            Assert.AreEqual(pigJobDefinition.File, pigJobFromCommand.File);
        }
        public void CanCreateNewSqoopDefinition()
        {
            var pigJobDefinition = new SqoopJobCreateParameters
            {
                Command = "load 'passwd' using SqoopStorage(':'); B = foreach A generate $0 as id;"
            };

            INewAzureHDInsightSqoopJobDefinitionCommand newSqoopJobDefinitionCommand =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateNewSqoopDefinition();

            newSqoopJobDefinitionCommand.Command = pigJobDefinition.Command;
            newSqoopJobDefinitionCommand.EndProcessing();

            AzureHDInsightSqoopJobDefinition pigJobFromCommand = newSqoopJobDefinitionCommand.Output.ElementAt(0);

            Assert.AreEqual(pigJobDefinition.Command, pigJobFromCommand.Command);
        }
 /// <summary>
 ///     Initializes a new instance of the NewAzureHDInsightSqoopJobDefinitionCmdlet class.
 /// </summary>
 public NewAzureHDInsightSqoopJobDefinitionCmdlet()
 {
     this.command = ServiceLocator.Instance.Locate<IAzureHDInsightCommandFactory>().CreateNewSqoopDefinition();
 }
 /// <summary>
 ///     Initializes a new instance of the NewAzureHDInsightSqoopJobDefinitionCmdlet class.
 /// </summary>
 public NewAzureHDInsightSqoopJobDefinitionCmdlet()
 {
     this.command = ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateNewSqoopDefinition();
 }