You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/12/01 13:01:34 UTC

[brooklyn-server] 01/03: fix tests to be compatible with s3

This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 496874433997f002de2c7ad9a267e3d770758064
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Wed Dec 1 12:58:20 2021 +0000

    fix tests to be compatible with s3
---
 .../apache/brooklyn/core/mgmt/persist/jclouds/BlobStoreTest.java    | 4 ++--
 .../mgmt/persist/jclouds/JcloudsBlobStoreBasedObjectStoreTest.java  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/BlobStoreTest.java b/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/BlobStoreTest.java
index 6fb2f37..e45c9b6 100644
--- a/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/BlobStoreTest.java
+++ b/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/BlobStoreTest.java
@@ -65,7 +65,7 @@ public class BlobStoreTest {
 
     @BeforeMethod(alwaysRun=true)
     public void setup() {
-        testContainerName = CONTAINER_PREFIX+"-"+Identifiers.makeRandomId(8);
+        testContainerName = (CONTAINER_PREFIX+"-"+Identifiers.makeRandomId(8)).toLowerCase();
         mgmt = new LocalManagementContextForTests(BrooklynProperties.Factory.newDefault());
         location = (JcloudsLocation) mgmt.getLocationRegistry().getLocationManaged(locationSpec);
         context = BlobStoreContextFactoryImpl.INSTANCE.newBlobStoreContext(location);
@@ -82,7 +82,7 @@ public class BlobStoreTest {
         PageSet<? extends StorageMetadata> ps = context.getBlobStore().list();
         assertHasItemNamed(ps, testContainerName);
         
-        Blob b = context.getBlobStore().blobBuilder("my-blob-1").payload(Streams.newInputStreamWithContents("hello world")).build();
+        Blob b = context.getBlobStore().blobBuilder("my-blob-1").payload("hello world").build();
         context.getBlobStore().putBlob(testContainerName, b);
         
         Blob b2 = context.getBlobStore().getBlob(testContainerName, "my-blob-1");
diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/JcloudsBlobStoreBasedObjectStoreTest.java b/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/JcloudsBlobStoreBasedObjectStoreTest.java
index 63020ca..9ecac6b 100644
--- a/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/JcloudsBlobStoreBasedObjectStoreTest.java
+++ b/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/JcloudsBlobStoreBasedObjectStoreTest.java
@@ -82,14 +82,14 @@ public class JcloudsBlobStoreBasedObjectStoreTest {
     
     @Test(groups={"Live", "Live-sanity"})
     public void testJclouds() throws Exception {
-        doTestWithStore( newObjectStore(BlobStoreTest.PERSIST_TO_OBJECT_STORE_FOR_TEST_SPEC, 
-            BlobStoreTest.CONTAINER_PREFIX+"-"+Identifiers.makeRandomId(4)) );
+        doTestWithStore( newObjectStore(BlobStoreTest.PERSIST_TO_OBJECT_STORE_FOR_TEST_SPEC,
+                (BlobStoreTest.CONTAINER_PREFIX+"-"+Identifiers.makeRandomId(4)).toLowerCase()) );
     }
     
     @Test(groups={"Live", "Live-sanity"})
     public void testJcloudsWithSubPathInContainerName() throws Exception {
         doTestWithStore( newObjectStore(BlobStoreTest.PERSIST_TO_OBJECT_STORE_FOR_TEST_SPEC, 
-            BlobStoreTest.CONTAINER_PREFIX+"-"+Identifiers.makeRandomId(4)+"/subpath1/subpath2") );
+            BlobStoreTest.CONTAINER_PREFIX+"-"+Identifiers.makeRandomId(4).toLowerCase()+"/subpath1/subpath2") );
     }
     
     protected void doTestWithStore(PersistenceObjectStore objectStore) {