mirror of https://github.com/apache/jclouds.git
Consistently name test container names
Previously jclouds allocated the initial container pool as $USERNAME-blobstore-1, 2, etc. and subsequent containers with $USERNAME-blobstore-$RANDOM. Use only the former instead.
This commit is contained in:
parent
d197a9e0cb
commit
de04c69141
|
@ -22,7 +22,6 @@ import static org.jclouds.reflect.Reflection2.typeToken;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -82,7 +81,7 @@ public class BaseBlobStoreIntegrationTest extends BaseViewLiveTest<BlobStoreCont
|
||||||
String.format(XML_STRING_FORMAT, "emma"));
|
String.format(XML_STRING_FORMAT, "emma"));
|
||||||
|
|
||||||
public static long INCONSISTENCY_WINDOW = 10000;
|
public static long INCONSISTENCY_WINDOW = 10000;
|
||||||
protected static volatile AtomicInteger containerIndex = new AtomicInteger(0);
|
protected static final AtomicInteger containerIndex = new AtomicInteger(0);
|
||||||
|
|
||||||
protected static volatile int containerCount = Integer.parseInt(System.getProperty("test.blobstore.container-count",
|
protected static volatile int containerCount = Integer.parseInt(System.getProperty("test.blobstore.container-count",
|
||||||
"10"));
|
"10"));
|
||||||
|
@ -514,7 +513,7 @@ public class BaseBlobStoreIntegrationTest extends BaseViewLiveTest<BlobStoreCont
|
||||||
deleteContainerOrWarnIfUnable(view, container);
|
deleteContainerOrWarnIfUnable(view, container);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
String newScratchContainer = CONTAINER_PREFIX + new SecureRandom().nextLong();
|
String newScratchContainer = CONTAINER_PREFIX + containerIndex.incrementAndGet();
|
||||||
System.err.printf("*** allocated new container %s...%n", newScratchContainer);
|
System.err.printf("*** allocated new container %s...%n", newScratchContainer);
|
||||||
return newScratchContainer;
|
return newScratchContainer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,8 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
|
||||||
public void testCreateContainer() throws Exception {
|
public void testCreateContainer() throws Exception {
|
||||||
boolean created = false;
|
boolean created = false;
|
||||||
while (!created) {
|
while (!created) {
|
||||||
privateContainer = CONTAINER_PREFIX + new SecureRandom().nextInt();
|
// testListOwnedContainers requires a unique prefix
|
||||||
|
privateContainer = CONTAINER_PREFIX + "unique-" + containerIndex.incrementAndGet();
|
||||||
try {
|
try {
|
||||||
created = getApi().createContainer(privateContainer, withMetadata(ImmutableMultimap.of("foo", "bar")));
|
created = getApi().createContainer(privateContainer, withMetadata(ImmutableMultimap.of("foo", "bar")));
|
||||||
} catch (UndeclaredThrowableException e) {
|
} catch (UndeclaredThrowableException e) {
|
||||||
|
@ -118,7 +119,7 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
|
||||||
public void testCreatePublicContainer() throws Exception {
|
public void testCreatePublicContainer() throws Exception {
|
||||||
boolean created = false;
|
boolean created = false;
|
||||||
while (!created) {
|
while (!created) {
|
||||||
publicContainer = CONTAINER_PREFIX + new SecureRandom().nextInt();
|
publicContainer = CONTAINER_PREFIX + containerIndex.incrementAndGet();
|
||||||
try {
|
try {
|
||||||
created = getApi().createContainer(publicContainer, withPublicAccess(PublicAccess.BLOB));
|
created = getApi().createContainer(publicContainer, withPublicAccess(PublicAccess.BLOB));
|
||||||
} catch (UndeclaredThrowableException e) {
|
} catch (UndeclaredThrowableException e) {
|
||||||
|
@ -342,7 +343,7 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
|
||||||
|
|
||||||
@Test(timeOut = 5 * 60 * 1000)
|
@Test(timeOut = 5 * 60 * 1000)
|
||||||
public void testBlockOperations() throws Exception {
|
public void testBlockOperations() throws Exception {
|
||||||
String blockContainer = CONTAINER_PREFIX + new SecureRandom().nextInt();
|
String blockContainer = CONTAINER_PREFIX + containerIndex.incrementAndGet();
|
||||||
String blockBlob = "myblockblob-" + new SecureRandom().nextInt();
|
String blockBlob = "myblockblob-" + new SecureRandom().nextInt();
|
||||||
String A = "A";
|
String A = "A";
|
||||||
String B = "B";
|
String B = "B";
|
||||||
|
@ -380,7 +381,7 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGetSetACL() throws Exception {
|
public void testGetSetACL() throws Exception {
|
||||||
AzureBlobClient client = getApi();
|
AzureBlobClient client = getApi();
|
||||||
String blockContainer = CONTAINER_PREFIX + new SecureRandom().nextInt();
|
String blockContainer = CONTAINER_PREFIX + containerIndex.incrementAndGet();
|
||||||
client.createContainer(blockContainer);
|
client.createContainer(blockContainer);
|
||||||
try {
|
try {
|
||||||
assertThat(client.getPublicAccessForContainer(blockContainer)).isEqualTo(PublicAccess.PRIVATE);
|
assertThat(client.getPublicAccessForContainer(blockContainer)).isEqualTo(PublicAccess.PRIVATE);
|
||||||
|
|
Loading…
Reference in New Issue