AdGroupAd adGroupAd = new AdGroupAd();
adGroupAd.setAd(ad);
adGroupAd.setAdGroupId(adGroup.getId());
adGroupAdService.mutate(new AdGroupAdOperation[] {new AdGroupAdOperation(Operator.ADD,
"ADD", adGroupAd, null)});
}
numAds = generator.nextInt(10) + 1;
for (int k = 0; k < numAds; k++) {
ImageAd ad = new ImageAd();
Image image = new Image();
image.setData(DataUtils.getTestImage());
image.setName("name.jpg");
ad.setImage(image);
ad.setDisplayUrl("http://google.com/");
ad.setUrl("http://example.com");
ad.setName("name.jpg");
AdGroupAd adGroupAd = new AdGroupAd();
adGroupAd.setAd(ad);
adGroupAd.setAdGroupId(adGroup.getId());
adGroupAdService.mutate(new AdGroupAdOperation[] {new AdGroupAdOperation(Operator.ADD,
"ADD", adGroupAd, null)});
}
ArrayList<AdGroupCriterionOperation> criteriaOps =
new ArrayList<AdGroupCriterionOperation>();