public void CanSerializeValidPigJobRequest_WithFile() { var pigJob = new PigJobCreateParameters() { File = Constants.WabsProtocolSchemeName + "filepath.hql" }; var payloadConverter = new PayloadConverterBase(); var payload = payloadConverter.SerializePigRequest("hadoop", pigJob); Assert.IsTrue(payload.Contains(string.Format("{0}={1}", WebHCatConstants.File, Uri.EscapeDataString(pigJob.File)))); }
public void CanSerializeValidPigJobRequest() { var pigJob = new PigJobCreateParameters() { Query = "show tables" }; var payloadConverter = new PayloadConverterBase(); var payload = payloadConverter.SerializePigRequest("hadoop", pigJob); Assert.IsTrue(payload.Contains(string.Format("{0}={1}", WebHCatConstants.Execute, Uri.EscapeDataString(pigJob.Query)))); }
public void ShouldNotSerializePigJobName() { var pigJob = new PigJobCreateParameters(); pigJob.Arguments.Add("16"); pigJob.Query = "show tables"; pigJob.Arguments.Add("10000"); var payloadConverter = new PayloadConverterBase(); var payload = payloadConverter.SerializePigRequest("hadoop", pigJob); Assert.IsFalse((payload.Contains(WebHCatConstants.DefineJobName))); }
public void CanSerializeValidJobRequest_Arguments() { var pigJob = new PigJobCreateParameters(); pigJob.Arguments.Add("16"); pigJob.Query = "show tables"; pigJob.Arguments.Add("10000"); var payloadConverter = new PayloadConverterBase(); var payload = payloadConverter.SerializePigRequest("hadoop", pigJob); foreach (var argument in pigJob.Arguments) { Assert.IsTrue(payload.Contains(string.Format("{0}={1}", WebHCatConstants.Arg, argument))); } }