Skip to content

Commit

Permalink
Merge pull request #385 from gcheng/nowarnning
Browse files Browse the repository at this point in the history
remove warning in code
  • Loading branch information
Albert Cheng committed Jul 20, 2013
2 parents b96cd5d + 02c8337 commit f178e8a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.microsoft.windowsazure.services.serviceBus;

Expand All @@ -20,12 +20,10 @@

public class Util {
public static Iterable<QueueInfo> iterateQueues(ServiceBusContract service) throws ServiceException {
// TODO: iterate over link rel=next pagination
return service.listQueues().getItems();
}

public static Iterable<TopicInfo> iterateTopics(ServiceBusContract service) throws ServiceException {
// TODO: iterate over link rel=next pagination
return service.listTopics().getItems();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ private void ThrowIfError(ClientResponse r) {
}

private String encodeODataURIValue(String value) {
//TODO: Unclear if OData value in URI's need to be encoded or not
return value;
}

Expand Down Expand Up @@ -757,7 +756,6 @@ private DataSource createBatchInsertOrUpdateEntityPart(String table, Entity enti
headers.addHeader("If-Match", entity.getEtag());
}

//TODO: Review code to make sure encoding is correct
ByteArrayOutputStream httpRequest = new ByteArrayOutputStream();
httpReaderWriter.appendMethod(httpRequest, verb, path);
httpReaderWriter.appendHeaders(httpRequest, headers);
Expand All @@ -780,7 +778,6 @@ private DataSource createBatchDeleteEntityPart(String table, String partitionKey
headers.addHeader("Content-ID", Integer.toString(contentId));
headers.addHeader("If-Match", etag == null ? "*" : etag);

//TODO: Review code to make sure encoding is correct
ByteArrayOutputStream httpRequest = new ByteArrayOutputStream();
httpReaderWriter.appendMethod(httpRequest, "DELETE", path);
httpReaderWriter.appendHeaders(httpRequest, headers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

public class MediaServiceScenarioTest extends ScenarioTestBase {
private static final String rootTestAssetPrefix = "testAssetPrefix-";
private static final String testJobPrefix = "testJobPrefix";
private static String testAssetPrefix;
private static MediaServiceWrapper wrapper;
private static MediaServiceValidation validator;
Expand All @@ -57,6 +58,7 @@ public static void setup() throws ServiceException {
public static void cleanup() throws ServiceException {
wrapper.removeAllAssetsWithPrefix(rootTestAssetPrefix);
wrapper.removeAllAccessPoliciesWithPrefix();
wrapper.removeAllJobWithPrefix(testJobPrefix);
}

@Test
Expand Down Expand Up @@ -119,7 +121,7 @@ public void createJob() throws Exception {
wrapper.uploadFilesToAsset(asset, 10, getTestAssetFiles());
signalSetupFinished();

String jobName = "my job createJob" + UUID.randomUUID().toString();
String jobName = testJobPrefix + UUID.randomUUID().toString();
JobInfo job = wrapper.createJob(jobName, asset, createTasks());
validator.validateJob(job, jobName, asset, createTasks());
}
Expand All @@ -129,7 +131,7 @@ public void transformAsset() throws Exception {
signalSetupStarting();
AssetInfo asset = wrapper.createAsset(testAssetPrefix + "transformAsset", AssetOption.None);
wrapper.uploadFilesToAsset(asset, 10, getTestAssetFiles());
String jobName = "my job transformAsset" + UUID.randomUUID().toString();
String jobName = testJobPrefix + UUID.randomUUID().toString();

JobInfo job = wrapper.createJob(jobName, asset,
wrapper.createTaskOptions("Transform", 0, 0, EncoderType.WindowsAzureMediaEncoder));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,19 @@ public void removeAllAccessPoliciesWithPrefix() throws ServiceException {
}
}

public void removeAllJobWithPrefix(String testJobPrefix) throws ServiceException {
List<JobInfo> jobInfos = service.list(Job.list());
for (JobInfo jobInfo : jobInfos) {
if (jobInfo.getName().startsWith(testJobPrefix)) {
try {
service.delete(Job.delete(jobInfo.getId()));
}
catch (ServiceException e) {
}
}
}
}

private static class EncryptionHelper {
public static boolean canUseStrongCrypto() {
try {
Expand Down

0 comments on commit f178e8a

Please sign in to comment.