Skip to content

Instantly share code, notes, and snippets.

Created May 14, 2013 21:26
Show Gist options
  • Save anonymous/5579687 to your computer and use it in GitHub Desktop.
Save anonymous/5579687 to your computer and use it in GitHub Desktop.
package com.automatedev.releasequeue.debian;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.iterable.S3Objects;
import com.amazonaws.services.s3.model.S3ObjectSummary;
import com.automatedev.releasequeue.debian.store.Key;
import junit.framework.Test;
import java.util.ArrayList;
import java.util.List;
public class FakeS3TestCase {
@org.junit.Test
public void testGetObjects()
{
String awsAccessKey = "xxx";
String awsSecretAccessKey = "xxx";
BasicAWSCredentials credentials = new BasicAWSCredentials(awsAccessKey, awsSecretAccessKey);
AmazonS3Client amazonS3 = new AmazonS3Client(credentials);
amazonS3.setEndpoint("http://fakes3:4567");
for (S3ObjectSummary summary : S3Objects.withPrefix(amazonS3, "releasequeue", "automatedev")) {
System.out.println("summary.getKey() = " + summary.getKey());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment