From 5f8961723f6bd36ebc6ab23360bed25d043e5963 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 24 Sep 2013 21:11:08 -0700 Subject: [PATCH] Remove BlobStore Map abstractions These provide little end-user benefit and make evolving the core API more difficult. We deprecated these in 1.6.0. --- .../config/AtmosBlobStoreContextModule.java | 2 - ...tmosInputStreamMapIntegrationLiveTest.java | 86 ----- .../AtmosMapIntegrationLiveTest.java | 40 -- .../CloudFilesBlobMapIntegrationLiveTest.java | 30 -- ...ilesInputStreamMapIntegrationLiveTest.java | 30 -- .../FilesystemBlobStoreContextModule.java | 2 - ...esystemBlobMapIntegrationTestDisabled.java | 44 --- ...InputStreamMapIntegrationTestDisabled.java | 43 --- .../config/S3BlobStoreContextModule.java | 2 - .../internal/S3BlobStoreContextImpl.java | 8 +- .../S3BlobMapIntegrationLiveTest.java | 33 -- .../S3InputStreamMapIntegrationLiveTest.java | 33 -- .../config/SwiftBlobStoreContextModule.java | 2 - .../SwiftBlobMapIntegrationLiveTest.java | 40 -- ...wiftInputStreamMapIntegrationLiveTest.java | 40 -- .../java/org/jclouds/blobstore/BlobMap.java | 48 --- .../jclouds/blobstore/BlobStoreContext.java | 55 --- .../org/jclouds/blobstore/InputStreamMap.java | 60 --- .../org/jclouds/blobstore/ListableMap.java | 39 -- .../blobstore/config/BlobStoreMapModule.java | 96 ----- .../TransientBlobStoreContextModule.java | 1 - .../blobstore/internal/BaseBlobMap.java | 219 ----------- .../blobstore/internal/BlobMapImpl.java | 130 ------- .../internal/BlobStoreContextImpl.java | 30 +- .../internal/InputStreamMapImpl.java | 188 --------- .../TransientBlobMapIntegrationTest.java | 31 -- ...ransientInputStreamMapIntegrationTest.java | 30 -- .../internal/BaseBlobMapIntegrationTest.java | 292 -------------- .../BaseInputStreamMapIntegrationTest.java | 338 ---------------- .../internal/BaseMapIntegrationTest.java | 360 ------------------ .../blobstore/internal/BaseBlobMapTest.java | 60 --- .../internal/AWSS3BlobStoreContextImpl.java | 8 +- .../AWSS3BlobMapIntegrationLiveTest.java | 30 -- ...WSS3InputStreamMapIntegrationLiveTest.java | 30 -- .../config/AzureBlobStoreContextModule.java | 2 - ...BlobInputStreamMapIntegrationLiveTest.java | 30 -- .../AzureBlobMapIntegrationLiveTest.java | 30 -- ...loudFilesUKBlobMapIntegrationLiveTest.java | 31 -- ...esUKInputStreamMapIntegrationLiveTest.java | 31 -- ...loudFilesUSBlobMapIntegrationLiveTest.java | 30 -- ...esUSInputStreamMapIntegrationLiveTest.java | 30 -- ...dOneStorageBlobMapIntegrationLiveTest.java | 31 -- ...rageInputStreamMapIntegrationLiveTest.java | 31 -- ...udObjectStorageBlobStoreContextModule.java | 2 - ...jectStorageBlobMapIntegrationLiveTest.java | 31 -- ...rageInputStreamMapIntegrationLiveTest.java | 31 -- ...foldStorageBlobMapIntegrationLiveTest.java | 31 -- ...rageInputStreamMapIntegrationLiveTest.java | 31 -- 48 files changed, 8 insertions(+), 2844 deletions(-) delete mode 100644 apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosInputStreamMapIntegrationLiveTest.java delete mode 100644 apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosMapIntegrationLiveTest.java delete mode 100644 apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesBlobMapIntegrationLiveTest.java delete mode 100644 apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesInputStreamMapIntegrationLiveTest.java delete mode 100644 apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemBlobMapIntegrationTestDisabled.java delete mode 100644 apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemInputStreamMapIntegrationTestDisabled.java delete mode 100644 apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobMapIntegrationLiveTest.java delete mode 100644 apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3InputStreamMapIntegrationLiveTest.java delete mode 100644 apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftBlobMapIntegrationLiveTest.java delete mode 100644 apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftInputStreamMapIntegrationLiveTest.java delete mode 100644 blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java delete mode 100644 blobstore/src/main/java/org/jclouds/blobstore/InputStreamMap.java delete mode 100644 blobstore/src/main/java/org/jclouds/blobstore/ListableMap.java delete mode 100644 blobstore/src/main/java/org/jclouds/blobstore/config/BlobStoreMapModule.java delete mode 100644 blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobMap.java delete mode 100644 blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java delete mode 100644 blobstore/src/main/java/org/jclouds/blobstore/internal/InputStreamMapImpl.java delete mode 100644 blobstore/src/test/java/org/jclouds/blobstore/integration/TransientBlobMapIntegrationTest.java delete mode 100644 blobstore/src/test/java/org/jclouds/blobstore/integration/TransientInputStreamMapIntegrationTest.java delete mode 100644 blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java delete mode 100644 blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java delete mode 100644 blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java delete mode 100644 blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobMapTest.java delete mode 100644 providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobMapIntegrationLiveTest.java delete mode 100644 providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3InputStreamMapIntegrationLiveTest.java delete mode 100644 providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobInputStreamMapIntegrationLiveTest.java delete mode 100644 providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobMapIntegrationLiveTest.java delete mode 100644 providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobMapIntegrationLiveTest.java delete mode 100644 providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKInputStreamMapIntegrationLiveTest.java delete mode 100644 providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobMapIntegrationLiveTest.java delete mode 100644 providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSInputStreamMapIntegrationLiveTest.java delete mode 100644 providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageBlobMapIntegrationLiveTest.java delete mode 100644 providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageInputStreamMapIntegrationLiveTest.java delete mode 100644 providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageBlobMapIntegrationLiveTest.java delete mode 100644 providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageInputStreamMapIntegrationLiveTest.java delete mode 100644 providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobMapIntegrationLiveTest.java delete mode 100644 providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageInputStreamMapIntegrationLiveTest.java diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/config/AtmosBlobStoreContextModule.java b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/config/AtmosBlobStoreContextModule.java index d3d6d53783..ba4b8ef9a0 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/config/AtmosBlobStoreContextModule.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/config/AtmosBlobStoreContextModule.java @@ -29,7 +29,6 @@ import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.attr.ConsistencyModel; -import org.jclouds.blobstore.config.BlobStoreMapModule; import org.jclouds.blobstore.strategy.ContainsValueInListStrategy; import com.google.common.cache.CacheBuilder; @@ -48,7 +47,6 @@ public class AtmosBlobStoreContextModule extends AbstractModule { @Override protected void configure() { - install(new BlobStoreMapModule()); bind(ConsistencyModel.class).toInstance(ConsistencyModel.EVENTUAL); bind(AsyncBlobStore.class).to(AtmosAsyncBlobStore.class).in(Scopes.SINGLETON); bind(BlobStore.class).to(AtmosBlobStore.class).in(Scopes.SINGLETON); diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosInputStreamMapIntegrationLiveTest.java b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 8c5bc856dc..0000000000 --- a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.atmos.blobstore.integration; - -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class AtmosInputStreamMapIntegrationLiveTest extends BaseInputStreamMapIntegrationTest { - public AtmosInputStreamMapIntegrationLiveTest() { - provider = "atmos"; - } - - @Override - @Test(enabled = false) - public void testContainsBytesValue() throws InterruptedException, ExecutionException, - TimeoutException { - // TODO not reliable - } - - @Override - @Test(enabled = false) - public void testContainsFileValue() throws InterruptedException, ExecutionException, - TimeoutException { - // TODO not reliable - } - - @Override - @Test(enabled = false) - public void testContainsInputStreamValue() throws InterruptedException, ExecutionException, - TimeoutException { - // TODO not reliable - } - - @Override - @Test(enabled = false) - public void testContainsStringValue() throws InterruptedException, ExecutionException, - TimeoutException { - // TODO not reliable - } - - @Override - @Test(enabled = false) - public void testPut() { - // TODO not reliable NPE@BaseInputStreamMapIntegrationTest.java:258 - } - - @Override - @Test(enabled = false) - public void testPutBytes() { - // TODO not reliable NPE - } - - @Override - @Test(enabled = false) - public void testPutFile() { - // TODO not reliable NPE - } - - @Override - @Test(enabled = false) - public void testPutString() { - // TODO not reliable NPE - } - -} diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosMapIntegrationLiveTest.java b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosMapIntegrationLiveTest.java deleted file mode 100644 index 90879ef131..0000000000 --- a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosMapIntegrationLiveTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.atmos.blobstore.integration; - -import java.io.IOException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class AtmosMapIntegrationLiveTest extends BaseBlobMapIntegrationTest { - public AtmosMapIntegrationLiveTest() { - provider = "atmos"; - } - @Override - // NO support for Content-MD5, so contains cannot work - public void testContains() throws InterruptedException, ExecutionException, TimeoutException, IOException { - - } - -} diff --git a/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesBlobMapIntegrationLiveTest.java b/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesBlobMapIntegrationLiveTest.java deleted file mode 100644 index 45451e370e..0000000000 --- a/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.cloudfiles.blobstore.integration; - -import org.jclouds.openstack.swift.blobstore.integration.SwiftBlobMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class CloudFilesBlobMapIntegrationLiveTest extends SwiftBlobMapIntegrationLiveTest { - public CloudFilesBlobMapIntegrationLiveTest(){ - provider = "cloudfiles"; - } -} diff --git a/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesInputStreamMapIntegrationLiveTest.java b/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 557d96cffa..0000000000 --- a/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/integration/CloudFilesInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.cloudfiles.blobstore.integration; - -import org.jclouds.openstack.swift.blobstore.integration.SwiftInputStreamMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class CloudFilesInputStreamMapIntegrationLiveTest extends SwiftInputStreamMapIntegrationLiveTest { - public CloudFilesInputStreamMapIntegrationLiveTest(){ - provider = "cloudfiles"; - } -} diff --git a/apis/filesystem/src/main/java/org/jclouds/filesystem/config/FilesystemBlobStoreContextModule.java b/apis/filesystem/src/main/java/org/jclouds/filesystem/config/FilesystemBlobStoreContextModule.java index 4c8adc6cc6..299b470e2b 100644 --- a/apis/filesystem/src/main/java/org/jclouds/filesystem/config/FilesystemBlobStoreContextModule.java +++ b/apis/filesystem/src/main/java/org/jclouds/filesystem/config/FilesystemBlobStoreContextModule.java @@ -25,7 +25,6 @@ import org.jclouds.blobstore.LocalAsyncBlobStore; import org.jclouds.blobstore.LocalBlobRequestSigner; import org.jclouds.blobstore.LocalStorageStrategy; import org.jclouds.blobstore.attr.ConsistencyModel; -import org.jclouds.blobstore.config.BlobStoreMapModule; import org.jclouds.blobstore.config.BlobStoreObjectModule; import org.jclouds.blobstore.config.LocalBlobStore; import org.jclouds.blobstore.util.BlobUtils; @@ -52,7 +51,6 @@ public class FilesystemBlobStoreContextModule extends AbstractModule { bind(BlobStore.class).to(LocalBlobStore.class); install(new BlobStoreObjectModule()); - install(new BlobStoreMapModule()); bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(LocalStorageStrategy.class).to(FilesystemStorageStrategyImpl.class); bind(BlobUtils.class).to(FileSystemBlobUtilsImpl.class); diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemBlobMapIntegrationTestDisabled.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemBlobMapIntegrationTestDisabled.java deleted file mode 100644 index d5bdfcd09f..0000000000 --- a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemBlobMapIntegrationTestDisabled.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.filesystem.integration; - -import java.util.Properties; - -import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest; -import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; -import org.jclouds.filesystem.reference.FilesystemConstants; -import org.jclouds.filesystem.utils.TestUtils; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ - -@Test(groups = { "integration", "live" }, testName = "blobstore.FilesystemBlobMapIntegrationTest") -public class FilesystemBlobMapIntegrationTestDisabled extends BaseBlobMapIntegrationTest { - public FilesystemBlobMapIntegrationTestDisabled() { - provider = "filesystem"; - BaseBlobStoreIntegrationTest.SANITY_CHECK_RETURNED_BUCKET_NAME = true; - } - - @Override - protected Properties setupProperties() { - Properties props = super.setupProperties(); - props.setProperty(FilesystemConstants.PROPERTY_BASEDIR, TestUtils.TARGET_BASE_DIR); - return props; - } -} diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemInputStreamMapIntegrationTestDisabled.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemInputStreamMapIntegrationTestDisabled.java deleted file mode 100644 index fc13fe6163..0000000000 --- a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemInputStreamMapIntegrationTestDisabled.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.filesystem.integration; - -import java.util.Properties; - -import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; -import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest; -import org.jclouds.filesystem.reference.FilesystemConstants; -import org.jclouds.filesystem.utils.TestUtils; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = { "integration", "live" }, testName = "blobstore.FilesystemInputStreamMapIntegrationTest") -public class FilesystemInputStreamMapIntegrationTestDisabled extends BaseInputStreamMapIntegrationTest { - public FilesystemInputStreamMapIntegrationTestDisabled() { - provider = "filesystem"; - BaseBlobStoreIntegrationTest.SANITY_CHECK_RETURNED_BUCKET_NAME = true; - } - - @Override - protected Properties setupProperties() { - Properties props = super.setupProperties(); - props.setProperty(FilesystemConstants.PROPERTY_BASEDIR, TestUtils.TARGET_BASE_DIR); - return props; - } -} diff --git a/apis/s3/src/main/java/org/jclouds/s3/blobstore/config/S3BlobStoreContextModule.java b/apis/s3/src/main/java/org/jclouds/s3/blobstore/config/S3BlobStoreContextModule.java index 501f23882a..e4d324e167 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/blobstore/config/S3BlobStoreContextModule.java +++ b/apis/s3/src/main/java/org/jclouds/s3/blobstore/config/S3BlobStoreContextModule.java @@ -26,7 +26,6 @@ import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.attr.ConsistencyModel; -import org.jclouds.blobstore.config.BlobStoreMapModule; import org.jclouds.domain.Location; import org.jclouds.s3.S3AsyncClient; import org.jclouds.s3.blobstore.S3AsyncBlobStore; @@ -53,7 +52,6 @@ public class S3BlobStoreContextModule extends AbstractModule { @Override protected void configure() { - install(new BlobStoreMapModule()); bind(ConsistencyModel.class).toInstance(ConsistencyModel.EVENTUAL); bind(AsyncBlobStore.class).to(S3AsyncBlobStore.class).in(SINGLETON); bind(BlobStore.class).to(S3BlobStore.class).in(SINGLETON); diff --git a/apis/s3/src/main/java/org/jclouds/s3/blobstore/internal/S3BlobStoreContextImpl.java b/apis/s3/src/main/java/org/jclouds/s3/blobstore/internal/S3BlobStoreContextImpl.java index a7ff0754ed..2e332e257f 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/blobstore/internal/S3BlobStoreContextImpl.java +++ b/apis/s3/src/main/java/org/jclouds/s3/blobstore/internal/S3BlobStoreContextImpl.java @@ -21,10 +21,8 @@ import javax.inject.Singleton; import org.jclouds.Context; import org.jclouds.blobstore.AsyncBlobStore; -import org.jclouds.blobstore.BlobMap; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.InputStreamMap; import org.jclouds.blobstore.attr.ConsistencyModel; import org.jclouds.blobstore.internal.BlobStoreContextImpl; import org.jclouds.location.Provider; @@ -43,10 +41,10 @@ public class S3BlobStoreContextImpl extends BlobStoreContextImpl implements S3Bl @Inject public S3BlobStoreContextImpl(@Provider Context backend, @Provider TypeToken backendType, - BlobMap.Factory blobMapFactory, Utils utils, ConsistencyModel consistencyModel, - InputStreamMap.Factory inputStreamMapFactory, AsyncBlobStore ablobStore, BlobStore blobStore, + Utils utils, ConsistencyModel consistencyModel, + AsyncBlobStore ablobStore, BlobStore blobStore, BlobRequestSigner blobRequestSigner) { - super(backend, backendType, blobMapFactory, utils, consistencyModel, inputStreamMapFactory, ablobStore, + super(backend, backendType, utils, consistencyModel, ablobStore, blobStore, blobRequestSigner); } diff --git a/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobMapIntegrationLiveTest.java b/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobMapIntegrationLiveTest.java deleted file mode 100644 index d35536dfed..0000000000 --- a/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.s3.blobstore.integration; - -import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest; -import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "S3BlobMapIntegrationLiveTest") -public class S3BlobMapIntegrationLiveTest extends BaseBlobMapIntegrationTest { - - public S3BlobMapIntegrationLiveTest() { - provider = "s3"; - BaseBlobStoreIntegrationTest.SANITY_CHECK_RETURNED_BUCKET_NAME = true; - } -} diff --git a/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3InputStreamMapIntegrationLiveTest.java b/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3InputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 15b467491a..0000000000 --- a/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3InputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.s3.blobstore.integration; - -import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; -import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "S3InputStreamMapIntegrationLiveTest") -public class S3InputStreamMapIntegrationLiveTest extends BaseInputStreamMapIntegrationTest { - - public S3InputStreamMapIntegrationLiveTest() { - provider = "s3"; - BaseBlobStoreIntegrationTest.SANITY_CHECK_RETURNED_BUCKET_NAME = true; - } -} diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/SwiftBlobStoreContextModule.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/SwiftBlobStoreContextModule.java index b59502c07e..1156be9a3d 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/SwiftBlobStoreContextModule.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/SwiftBlobStoreContextModule.java @@ -20,7 +20,6 @@ package org.jclouds.openstack.swift.blobstore.config; import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.attr.ConsistencyModel; -import org.jclouds.blobstore.config.BlobStoreMapModule; import org.jclouds.openstack.swift.blobstore.SwiftAsyncBlobStore; import org.jclouds.openstack.swift.blobstore.SwiftBlobStore; @@ -37,7 +36,6 @@ public class SwiftBlobStoreContextModule extends AbstractModule { @Override protected void configure() { - install(new BlobStoreMapModule()); bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(AsyncBlobStore.class).to(SwiftAsyncBlobStore.class).in(Scopes.SINGLETON); bind(BlobStore.class).to(SwiftBlobStore.class).in(Scopes.SINGLETON); diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftBlobMapIntegrationLiveTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftBlobMapIntegrationLiveTest.java deleted file mode 100644 index 5c3d1fbeaa..0000000000 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.openstack.swift.blobstore.integration; - -import java.util.Properties; - -import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class SwiftBlobMapIntegrationLiveTest extends BaseBlobMapIntegrationTest { - @Override - protected Properties setupProperties() { - Properties props = super.setupProperties(); - setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE); - return props; - } - - public SwiftBlobMapIntegrationLiveTest() { - provider = System.getProperty("test.swift.provider", "swift"); - } -} diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftInputStreamMapIntegrationLiveTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 3454e287a2..0000000000 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.openstack.swift.blobstore.integration; - -import java.util.Properties; - -import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class SwiftInputStreamMapIntegrationLiveTest extends BaseInputStreamMapIntegrationTest { - @Override - protected Properties setupProperties() { - Properties props = super.setupProperties(); - setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE); - return props; - } - - public SwiftInputStreamMapIntegrationLiveTest() { - provider = System.getProperty("test.swift.provider", "swift"); - } -} diff --git a/blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java b/blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java deleted file mode 100644 index 8b412b0c48..0000000000 --- a/blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore; - -import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.BlobBuilder; -import org.jclouds.blobstore.internal.BlobMapImpl; -import org.jclouds.blobstore.options.ListContainerOptions; - -import com.google.inject.ImplementedBy; - -/** - * This allows you to access the underlying {@link Blob} so that you can manually set metadata such - * as length, content-type, or eTag hash. - * - * @author Adrian Cole - * - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ -@Deprecated -@ImplementedBy(BlobMapImpl.class) -public interface BlobMap extends ListableMap { - - /** - * - * @return builder for creating new {@link Blob}s - */ - BlobBuilder blobBuilder(); - - public static interface Factory { - BlobMap create(String containerName, ListContainerOptions options); - } - -} diff --git a/blobstore/src/main/java/org/jclouds/blobstore/BlobStoreContext.java b/blobstore/src/main/java/org/jclouds/blobstore/BlobStoreContext.java index 36f3e10a75..269c71ca07 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/BlobStoreContext.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/BlobStoreContext.java @@ -42,61 +42,6 @@ public interface BlobStoreContext extends Closeable, View { */ BlobRequestSigner getSigner(); - /** - * Creates a Map view of the specified container. Use this for - * simplest access to blobstore, knowing that MD5s will be calculated for every object. - * - * @param container - * existing container you wish to read or modify - * @param options - * allow you to specify a directory within the container, or whether to list - * recursively. - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ - @Deprecated - InputStreamMap createInputStreamMap(String container, ListContainerOptions options); - - /** - * Creates a Map view of the specified container. Use this for - * simplest access to blobstore, knowing that MD5s will be calculated for every object. - * - * Only root-level blobs will be visible. - * - * @param container - * existing container you wish to read or modify - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ - @Deprecated - InputStreamMap createInputStreamMap(String container); - - /** - * Creates a Map view of the specified container. Use this when you wan - * to control the content type, or manually specify length or size of blobs. - * - * @param container - * existing container you wish to read or modify - * @param options - * allow you to specify a directory within the container, or whether to list - * recursively. - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ - @Deprecated - BlobMap createBlobMap(String container, ListContainerOptions options); - - /** - * Creates a Map view of the specified container. - * Use this when you wan to control the content type, or manually specify - * length or size of blobs. - * - * Only root-level blobs will be visible. - * - * @param container - * existing container you wish to read or modify - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ - @Deprecated - BlobMap createBlobMap(String container); - /** * @return a portable asynchronous interface for the BlobStore, which returns * {@code Future}s for each call. diff --git a/blobstore/src/main/java/org/jclouds/blobstore/InputStreamMap.java b/blobstore/src/main/java/org/jclouds/blobstore/InputStreamMap.java deleted file mode 100644 index 05dfe88840..0000000000 --- a/blobstore/src/main/java/org/jclouds/blobstore/InputStreamMap.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore; - -import java.io.File; -import java.io.InputStream; -import java.util.Map; - -import org.jclouds.blobstore.internal.InputStreamMapImpl; -import org.jclouds.blobstore.options.ListContainerOptions; - -import com.google.inject.ImplementedBy; - -/** - * Map view of an {@link org.jclouds.aws.s3.domain.S3Bucket}. Provides additional methods for - * inserting common object types. - *

- *

Note

All put operations will invoke - * {@link org.jclouds.aws.s3.domain.S3Object#generateETag}. By extension, - * {@link #put(Object, Object)} will result in the InputStream being converted to a byte array. For - * this reason, do not use {@link #put(Object, Object)} to store files. Use - * {@link #putFile(String, File)} or {@link S3ObjectMap} instead. - * - * @author Adrian Cole - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ -@Deprecated -@ImplementedBy(InputStreamMapImpl.class) -public interface InputStreamMap extends ListableMap { - public static interface Factory { - InputStreamMap create(String containerName, ListContainerOptions options); - } - - InputStream putString(String key, String value); - - InputStream putFile(String key, File value); - - InputStream putBytes(String key, byte[] value); - - void putAllStrings(Map map); - - void putAllBytes(Map map); - - void putAllFiles(Map map); - -} diff --git a/blobstore/src/main/java/org/jclouds/blobstore/ListableMap.java b/blobstore/src/main/java/org/jclouds/blobstore/ListableMap.java deleted file mode 100644 index 88ea990090..0000000000 --- a/blobstore/src/main/java/org/jclouds/blobstore/ListableMap.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore; - -import java.util.Map; - -import org.jclouds.blobstore.domain.StorageMetadata; - -/** - * All Map views of {@link ContainerListing}s provide means to access the underlying Blob. - * - * @author Adrian Cole - * - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ -@Deprecated -public interface ListableMap extends Map { - - /** - * - * @return blob listing that this map represents - */ - Iterable list(); - -} diff --git a/blobstore/src/main/java/org/jclouds/blobstore/config/BlobStoreMapModule.java b/blobstore/src/main/java/org/jclouds/blobstore/config/BlobStoreMapModule.java deleted file mode 100644 index 6031a9cc5c..0000000000 --- a/blobstore/src/main/java/org/jclouds/blobstore/config/BlobStoreMapModule.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.config; - -import javax.inject.Inject; -import javax.inject.Provider; - -import org.jclouds.blobstore.BlobMap; -import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.InputStreamMap; -import org.jclouds.blobstore.domain.BlobBuilder; -import org.jclouds.blobstore.internal.BlobMapImpl; -import org.jclouds.blobstore.internal.InputStreamMapImpl; -import org.jclouds.blobstore.options.ListContainerOptions; -import org.jclouds.blobstore.strategy.ContainsValueInListStrategy; -import org.jclouds.blobstore.strategy.GetBlobsInListStrategy; -import org.jclouds.blobstore.strategy.PutBlobsStrategy; -import org.jclouds.blobstore.strategy.internal.ListContainerAndRecurseThroughFolders; - -import com.google.inject.AbstractModule; -import com.google.inject.Scopes; - -/** - * Configures the domain object mappings needed for all Blob implementations - * - * @author Adrian Cole - */ -public class BlobStoreMapModule extends AbstractModule { - - /** - * explicit factories are created here as it has been shown that Assisted Inject is extremely - * inefficient. http://code.google.com/p/google-guice/issues/detail?id=435 - */ - @Override - protected void configure() { - bind(BlobMap.Factory.class).to(BlobMapFactory.class).in(Scopes.SINGLETON); - bind(InputStreamMap.Factory.class).to(InputStreamMapFactory.class).in(Scopes.SINGLETON); - } - - private static class BlobMapFactory implements BlobMap.Factory { - @Inject - BlobStore connection; - @Inject - GetBlobsInListStrategy getAllBlobs; - @Inject - ContainsValueInListStrategy containsValueStrategy; - @Inject - PutBlobsStrategy putBlobsStrategy; - @Inject - ListContainerAndRecurseThroughFolders listStrategy; - @Inject - Provider blobBuilders; - - public BlobMap create(String containerName, ListContainerOptions options) { - return new BlobMapImpl(connection, getAllBlobs, containsValueStrategy, putBlobsStrategy, listStrategy, - containerName, options, blobBuilders); - } - - } - - private static class InputStreamMapFactory implements InputStreamMap.Factory { - @Inject - BlobStore connection; - @Inject - Provider blobBuilders; - @Inject - GetBlobsInListStrategy getAllBlobs; - @Inject - ContainsValueInListStrategy containsValueStrategy; - @Inject - PutBlobsStrategy putBlobsStrategy; - @Inject - ListContainerAndRecurseThroughFolders listStrategy; - - public InputStreamMap create(String containerName, ListContainerOptions options) { - return new InputStreamMapImpl(connection, blobBuilders, getAllBlobs, listStrategy, containsValueStrategy, - putBlobsStrategy, containerName, options); - } - - } - -} diff --git a/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java b/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java index 93767b21b3..a5e816fc5e 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java @@ -41,7 +41,6 @@ public class TransientBlobStoreContextModule extends AbstractModule { // forward all requests from TransientBlobStore to TransientAsyncBlobStore. needs above binding as cannot proxy a class bindSyncToAsyncApi(binder(), LocalBlobStore.class, AsyncBlobStore.class); install(new BlobStoreObjectModule()); - install(new BlobStoreMapModule()); bind(BlobStore.class).to(LocalBlobStore.class); bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(LocalStorageStrategy.class).to(TransientStorageStrategy.class); diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobMap.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobMap.java deleted file mode 100644 index 6986d1985d..0000000000 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobMap.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.internal; - -import static com.google.common.base.Functions.identity; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.collect.Iterables.transform; - -import java.util.Map; -import java.util.Set; - -import javax.inject.Inject; - -import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.ListableMap; -import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.BlobMetadata; -import org.jclouds.blobstore.domain.MutableBlobMetadata; -import org.jclouds.blobstore.domain.internal.MutableBlobMetadataImpl; -import org.jclouds.blobstore.options.ListContainerOptions; -import org.jclouds.blobstore.options.ListContainerOptions.ImmutableListContainerOptions; -import org.jclouds.blobstore.strategy.ContainsValueInListStrategy; -import org.jclouds.blobstore.strategy.GetBlobsInListStrategy; -import org.jclouds.blobstore.strategy.PutBlobsStrategy; -import org.jclouds.blobstore.strategy.internal.ListContainerAndRecurseThroughFolders; - -import com.google.common.base.Function; -import com.google.common.collect.ImmutableSet; - -/** - * Implements core Map functionality with a {@link BlobStore} - * - * - * @author Adrian Cole - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ -@Deprecated -public abstract class BaseBlobMap implements ListableMap { - protected final BlobStore blobstore; - protected final String containerName; - protected final Function prefixer; - protected final Function pathStripper; - protected final ListContainerOptions options; - protected final GetBlobsInListStrategy getAllBlobs; - protected final ContainsValueInListStrategy containsValueStrategy; - protected final ListContainerAndRecurseThroughFolders listStrategy; - protected final PutBlobsStrategy putBlobsStrategy; - - static class StripPath implements Function { - private final String prefix; - private final String delimiter; - - StripPath(String prefix, String delimiter) { - this.prefix = checkNotNull(prefix, "prefix"); - this.delimiter = checkNotNull(delimiter, "delimiter"); - } - - public String apply(String from) { - return from.replaceFirst(prefix + delimiter, ""); - } - } - - static class PrefixKey implements Function { - private final String prefix; - private final String delimiter; - - PrefixKey(String prefix, String delimiter) { - this.prefix = checkNotNull(prefix, "prefix"); - this.delimiter = checkNotNull(delimiter, "delimiter"); - } - - public String apply(String from) { - return prefix + delimiter + from; - } - } - - @Inject - public BaseBlobMap(BlobStore blobstore, GetBlobsInListStrategy getAllBlobs, - ContainsValueInListStrategy containsValueStrategy, PutBlobsStrategy putBlobsStrategy, - ListContainerAndRecurseThroughFolders listStrategy, String containerName, ListContainerOptions options) { - this.blobstore = checkNotNull(blobstore, "blobstore"); - this.containerName = checkNotNull(containerName, "container"); - checkArgument(containerName.indexOf('/') == -1, - "please specify directory path using the option: inDirectory, not encoded in the container name"); - this.options = checkNotNull(options, "options") instanceof ImmutableListContainerOptions ? options - : new ImmutableListContainerOptions(options); - String dir = options.getDir(); - if (dir == null) { - prefixer = identity(); - pathStripper = prefixer; - } else { - prefixer = new PrefixKey(dir, "/"); - pathStripper = new StripPath(dir, "/"); - } - this.getAllBlobs = checkNotNull(getAllBlobs, "getAllBlobs"); - this.listStrategy = checkNotNull(listStrategy, "listStrategy"); - this.containsValueStrategy = checkNotNull(containsValueStrategy, "containsValueStrategy"); - this.putBlobsStrategy = checkNotNull(putBlobsStrategy, "putBlobsStrategy"); - checkArgument(!containerName.equals(""), "container name must not be a blank string!"); - } - - @Override - public Set> entrySet() { - return ImmutableSet.copyOf(transform(list(), new Function>() { - @Override - public java.util.Map.Entry apply(BlobMetadata from) { - return new Entry(pathStripper.apply(from.getName())); - } - })); - } - - public class Entry implements java.util.Map.Entry { - - private final String key; - - Entry(String key) { - this.key = key; - } - - @Override - public String getKey() { - return key; - } - - @Override - public V getValue() { - return get(prefixer.apply(key)); - } - - @Override - public V setValue(V value) { - return put(prefixer.apply(key), value); - } - - } - - @Override - public int size() { - return (int) blobstore.countBlobs(containerName, options); - } - - protected Iterable getAllBlobs() { - Iterable returnVal = getAllBlobs.execute(containerName, options); - if (options != null) { - for (Blob from : returnVal) - stripPrefix(from); - } - return returnVal; - } - - protected Blob stripPrefix(Blob from) { - from.getMetadata().setName(pathStripper.apply(from.getMetadata().getName())); - return from; - } - - @Override - public boolean containsValue(Object value) { - return containsValueStrategy.execute(containerName, value, options); - } - - @Override - public void clear() { - blobstore.clearContainer(containerName, options); - } - - @Override - public Set keySet() { - return ImmutableSet.copyOf(transform(list(), new Function() { - @Override - public String apply(BlobMetadata from) { - return from.getName(); - } - })); - } - - @Override - public boolean containsKey(Object key) { - String realKey = prefixer.apply(checkNotNull(key, "key").toString()); - return blobstore.blobExists(containerName, realKey); - } - - @Override - public boolean isEmpty() { - return size() == 0; - } - - public Iterable list() { - return transform(listStrategy.execute(containerName, options), new Function() { - public BlobMetadata apply(BlobMetadata from) { - MutableBlobMetadata md = new MutableBlobMetadataImpl(from); - if (options.getDir() != null) - md.setName(pathStripper.apply(from.getName())); - return md; - } - - }); - } - - @Override - public String toString() { - return "[containerName=" + containerName + ", options=" + options + "]"; - } - -} diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java deleted file mode 100644 index 60ce143e86..0000000000 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.internal; - -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.collect.Iterables.transform; - -import java.util.Collection; -import java.util.Map; - -import javax.inject.Inject; -import javax.inject.Provider; - -import org.jclouds.blobstore.BlobMap; -import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.KeyNotFoundException; -import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.BlobBuilder; -import org.jclouds.blobstore.options.ListContainerOptions; -import org.jclouds.blobstore.strategy.ContainsValueInListStrategy; -import org.jclouds.blobstore.strategy.GetBlobsInListStrategy; -import org.jclouds.blobstore.strategy.PutBlobsStrategy; -import org.jclouds.blobstore.strategy.internal.ListContainerAndRecurseThroughFolders; - -import com.google.common.base.Function; -import com.google.common.collect.ImmutableSet; - -/** - * Map representation of a live connection to a Blob Service. - * - * @see BlobStore - * @see BaseBlobMap - * - * @author Adrian Cole - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ -@Deprecated -public class BlobMapImpl extends BaseBlobMap implements BlobMap { - public static class CorrectBlobName implements Function, Blob> { - private final Function prefixer; - - public CorrectBlobName(Function prefixer) { - this.prefixer = checkNotNull(prefixer, "prefixer"); - } - - @Override - public Blob apply(java.util.Map.Entry arg0) { - return apply(arg0.getKey(), arg0.getValue()); - } - - public Blob apply(String key, Blob blob) { - blob.getMetadata().setName(prefixer.apply(key)); - return blob; - } - } - - private final CorrectBlobName correctBlobName; - private final Provider blobBuilders; - - @Inject - public BlobMapImpl(BlobStore blobstore, GetBlobsInListStrategy getAllBlobs, - ContainsValueInListStrategy containsValueStrategy, PutBlobsStrategy putBlobsStrategy, - ListContainerAndRecurseThroughFolders listStrategy, String containerName, ListContainerOptions options, - Provider blobBuilders) { - super(blobstore, getAllBlobs, containsValueStrategy, putBlobsStrategy, listStrategy, containerName, options); - this.correctBlobName = new CorrectBlobName(prefixer); - this.blobBuilders = checkNotNull(blobBuilders, "blobBuilders"); - } - - @Override - public Blob get(Object key) { - String realKey = prefixer.apply(checkNotNull(key, "key").toString()); - Blob blob = blobstore.getBlob(containerName, realKey); - return blob != null ? stripPrefix(blob) : null; - } - - @Override - public Blob put(String key, Blob value) { - Blob returnVal = getLastValue(checkNotNull(key, "key")); - blobstore.putBlob(containerName, correctBlobName.apply(key, value)); - return returnVal; - } - - @Override - public void putAll(Map map) { - putBlobsStrategy.execute(containerName, transform(checkNotNull(map, "map").entrySet(), correctBlobName)); - } - - @Override - public Blob remove(Object key) { - Blob old = getLastValue(checkNotNull(key, "key")); - String realKey = prefixer.apply(key.toString()); - blobstore.removeBlob(containerName, realKey); - return old; - } - - private Blob getLastValue(Object key) { - Blob old; - try { - old = get(checkNotNull(key, "key")); - } catch (KeyNotFoundException e) { - old = null; - } - return old; - } - - @Override - public Collection values() { - return ImmutableSet.copyOf(getAllBlobs.execute(containerName, options)); - } - - @Override - public BlobBuilder blobBuilder() { - return blobBuilders.get(); - } -} diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobStoreContextImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobStoreContextImpl.java index 673f16ea67..11fa405d20 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobStoreContextImpl.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobStoreContextImpl.java @@ -23,11 +23,9 @@ import javax.inject.Singleton; import org.jclouds.Context; import org.jclouds.blobstore.AsyncBlobStore; -import org.jclouds.blobstore.BlobMap; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.blobstore.InputStreamMap; import org.jclouds.blobstore.attr.ConsistencyModel; import org.jclouds.blobstore.options.ListContainerOptions; import org.jclouds.internal.BaseView; @@ -43,8 +41,6 @@ import com.google.common.reflect.TypeToken; */ @Singleton public class BlobStoreContextImpl extends BaseView implements BlobStoreContext { - private final BlobMap.Factory blobMapFactory; - private final InputStreamMap.Factory inputStreamMapFactory; private final AsyncBlobStore ablobStore; private final BlobStore blobStore; private final ConsistencyModel consistencyModel; @@ -53,13 +49,11 @@ public class BlobStoreContextImpl extends BaseView implements BlobStoreContext { @Inject public BlobStoreContextImpl(@Provider Context backend, @Provider TypeToken backendType, - BlobMap.Factory blobMapFactory, Utils utils, ConsistencyModel consistencyModel, - InputStreamMap.Factory inputStreamMapFactory, AsyncBlobStore ablobStore, BlobStore blobStore, + Utils utils, ConsistencyModel consistencyModel, + AsyncBlobStore ablobStore, BlobStore blobStore, BlobRequestSigner blobRequestSigner) { super(backend, backendType); this.consistencyModel = checkNotNull(consistencyModel, "consistencyModel"); - this.blobMapFactory = checkNotNull(blobMapFactory, "blobMapFactory"); - this.inputStreamMapFactory = checkNotNull(inputStreamMapFactory, "inputStreamMapFactory"); this.ablobStore = checkNotNull(ablobStore, "ablobStore"); this.blobStore = checkNotNull(blobStore, "blobStore"); this.utils = checkNotNull(utils, "utils"); @@ -71,26 +65,6 @@ public class BlobStoreContextImpl extends BaseView implements BlobStoreContext { return consistencyModel; } - @Override - public BlobMap createBlobMap(String container, ListContainerOptions options) { - return blobMapFactory.create(container, options); - } - - @Override - public BlobMap createBlobMap(String container) { - return blobMapFactory.create(container, ListContainerOptions.NONE); - } - - @Override - public InputStreamMap createInputStreamMap(String container, ListContainerOptions options) { - return inputStreamMapFactory.create(container, options); - } - - @Override - public InputStreamMap createInputStreamMap(String container) { - return inputStreamMapFactory.create(container, ListContainerOptions.NONE); - } - @Override public BlobStore getBlobStore() { return blobStore; diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/InputStreamMapImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/InputStreamMapImpl.java deleted file mode 100644 index bc7435905b..0000000000 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/InputStreamMapImpl.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.internal; - -import static com.google.common.collect.Iterables.transform; -import static com.google.common.collect.Lists.newArrayList; -import static org.jclouds.io.Payloads.newPayload; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Collection; -import java.util.Map; - -import javax.inject.Inject; -import javax.inject.Provider; - -import org.jclouds.blobstore.BlobMap; -import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.InputStreamMap; -import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.BlobBuilder; -import org.jclouds.blobstore.options.ListContainerOptions; -import org.jclouds.blobstore.strategy.ContainsValueInListStrategy; -import org.jclouds.blobstore.strategy.GetBlobsInListStrategy; -import org.jclouds.blobstore.strategy.PutBlobsStrategy; -import org.jclouds.blobstore.strategy.internal.ListContainerAndRecurseThroughFolders; -import org.jclouds.io.Payload; -import org.jclouds.io.Payloads; -import org.jclouds.io.payloads.ByteArrayPayload; -import org.jclouds.io.payloads.FilePayload; -import org.jclouds.io.payloads.InputStreamPayload; -import org.jclouds.io.payloads.StringPayload; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; -import com.google.common.base.Throwables; - -/** - * Map representation of a live connection to a BlobStore. All put operations will result in ETag - * calculation. If this is not desired, use {@link BlobMap} instead. - * - * @author Adrian Cole - * - * @see BlobStore - * @see InputStreamMap - * @see BaseBlobMap - * @deprecated will be removed in jclouds 1.7. Please use {@link BlobStore} - */ -@Deprecated -public class InputStreamMapImpl extends BaseBlobMap implements InputStreamMap { - - @Inject - public InputStreamMapImpl(BlobStore connection, Provider blobBuilders, - GetBlobsInListStrategy getAllBlobs, ListContainerAndRecurseThroughFolders listStrategy, - ContainsValueInListStrategy containsValueStrategy, PutBlobsStrategy putBlobsStrategy, String containerName, - ListContainerOptions options) { - super(connection, getAllBlobs, containsValueStrategy, putBlobsStrategy, listStrategy, containerName, options); - } - - @Override - public InputStream get(Object o) { - String realKey = prefixer.apply(o.toString()); - Blob blob = blobstore.getBlob(containerName, realKey); - return getInputStreamOrNull(blob); - } - - private InputStream getInputStreamOrNull(Blob blob) { - return blob != null ? blob.getPayload() != null ? blob.getPayload().getInput() : null : null; - } - - @Override - public InputStream remove(Object o) { - InputStream old = get(o); - String realKey = prefixer.apply(o.toString()); - blobstore.removeBlob(containerName, realKey); - return old; - } - - @Override - public Collection values() { - return newArrayList(transform(getAllBlobs.execute(containerName, options), new Function() { - public InputStream apply(Blob from) { - return getInputStreamOrNull(from); - } - })); - } - - @Override - public void putAll(Map map) { - putAllInternal(map); - } - - @Override - public void putAllBytes(Map map) { - putAllInternal(map); - } - - @Override - public void putAllFiles(Map map) { - putAllInternal(map); - } - - @Override - public void putAllStrings(Map map) { - putAllInternal(map); - } - - /** - * submits requests to add all objects and collects the results later. All values will have eTag - * calculated first. As a side-effect of this, the content will be copied into a byte []. - * - * @see S3Client#put(String, Blob) - */ - @VisibleForTesting - void putAllInternal(Map map) { - putBlobsStrategy.execute(containerName, - transform(map.entrySet(), new Function, Blob>() { - @Override - public Blob apply(Map.Entry from) { - String name = from.getKey(); - Object value = from.getValue(); - return newBlobWithMD5(name, value); - } - - })); - } - - @VisibleForTesting - Blob newBlobWithMD5(String name, Object value) { - Blob blob = blobstore.blobBuilder(prefixer.apply(name)).payload(newPayload(value)).build(); - try { - Payloads.calculateMD5(blob); - } catch (IOException e) { - Throwables.propagate(e); - } - return blob; - } - - @Override - public InputStream putString(String key, String value) { - return putInternal(key, new StringPayload(value)); - } - - @Override - public InputStream putFile(String key, File value) { - return putInternal(key, new FilePayload(value)); - } - - @Override - public InputStream putBytes(String key, byte[] value) { - return putInternal(key, new ByteArrayPayload(value)); - } - - @Override - public InputStream put(String key, InputStream value) { - return putInternal(key, new InputStreamPayload(value)); - } - - /** - * calculates eTag before adding the object to s3. As a side-effect of this, the content will be - * copied into a byte []. * - * - * @see S3Client#put(String, Blob) - */ - @VisibleForTesting - InputStream putInternal(String name, Payload payload) { - InputStream returnVal = containsKey(name) ? get(name) : null; - Blob blob = newBlobWithMD5(name, payload); - blobstore.putBlob(containerName, blob); - return returnVal; - } - -} diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/TransientBlobMapIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/TransientBlobMapIntegrationTest.java deleted file mode 100644 index 76ffefc79b..0000000000 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/TransientBlobMapIntegrationTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.integration; - -import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ - -@Test(groups = { "integration", "live" }) -public class TransientBlobMapIntegrationTest extends BaseBlobMapIntegrationTest { - public TransientBlobMapIntegrationTest() { - provider = "transient"; - } -} diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/TransientInputStreamMapIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/TransientInputStreamMapIntegrationTest.java deleted file mode 100644 index 3ffd31ea7d..0000000000 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/TransientInputStreamMapIntegrationTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.integration; - -import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = { "integration", "live" }) -public class TransientInputStreamMapIntegrationTest extends BaseInputStreamMapIntegrationTest { - public TransientInputStreamMapIntegrationTest() { - provider = "transient"; - } -} diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java deleted file mode 100644 index eded3a9378..0000000000 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobMapIntegrationTest.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.integration.internal; - -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.blobstore.options.ListContainerOptions.Builder.inDirectory; -import static org.jclouds.blobstore.options.ListContainerOptions.Builder.maxResults; -import static org.testng.Assert.assertEquals; - -import java.io.InputStream; -import java.io.IOException; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import org.jclouds.blobstore.BlobMap; -import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.options.ListContainerOptions; -import org.jclouds.io.Payloads; -import org.jclouds.util.Strings2; -import org.testng.annotations.Test; - -import com.google.common.base.Function; -import com.google.common.base.Throwables; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSet.Builder; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - -/** - * Tests to cover @{link LiveS3ObjectMap} - * - * @author Adrian Cole - */ -public abstract class BaseBlobMapIntegrationTest extends BaseMapIntegrationTest { - - private static class StringToBlob implements Function { - private final BlobMap map; - - private StringToBlob(BlobMap map) { - this.map = map; - } - - @Override - public Blob apply(String arg0) { - return map.blobBuilder().name(arg0).payload(arg0).build(); - } - } - - @Override - @Test(groups = { "integration", "live" }) - public void testValues() throws IOException, InterruptedException { - String bucketName = getContainerName(); - try { - BlobMap map = createMap(view, bucketName); - - putFiveStrings(map); - putFiveStringsUnderPath(map); - - Collection blobs = map.values(); - assertConsistencyAwareMapSize(map, 5); - Set blobsAsString = Sets.newLinkedHashSet(); - for (Blob blob : blobs) { - blobsAsString.add(getContentAsStringOrNullAndClose(blob)); - } - blobsAsString.removeAll(fiveStrings.values()); - assert blobsAsString.size() == 0 : blobsAsString.size() + ": " + blobs + ": " + blobsAsString; - } finally { - returnContainer(bucketName); - } - } - - @Test(groups = { "integration", "live" }) - public void testRemove() throws InterruptedException, ExecutionException, TimeoutException, IOException { - String bucketName = getContainerName(); - try { - Map map = createMap(view, bucketName); - putStringWithMD5(map, "one", "two"); - assertConsistencyAwareContentEquals(map, "one", "two"); - // TODO track how often this occurs and potentially update map implementation - assertConsistencyAwareRemoveEquals(map, "one", null); - assertConsistencyAwareGetEquals(map, "one", null); - assertConsistencyAwareKeySize(map, 0); - } finally { - returnContainer(bucketName); - } - } - - private void assertConsistencyAwareContentEquals(final Map map, final String key, final String blob) - throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - Blob old = map.remove(key); - try { - assertEquals(getContentAsStringOrNullAndClose(old), blob); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - }); - } - - @Override - @Test(groups = { "integration", "live" }) - public void testEntrySet() throws IOException, InterruptedException { - String bucketName = getContainerName(); - try { - final BlobMap map = createMap(view, bucketName); - putFiveStrings(map); - assertConsistencyAwareMapSize(map, 5); - Set> entries = map.entrySet(); - assertEquals(entries.size(), 5); - for (Entry entry : entries) { - assertEquals(fiveStrings.get(entry.getKey()), getContentAsStringOrNullAndClose(entry.getValue())); - Blob blob = entry.getValue(); - blob.setPayload(""); - Payloads.calculateMD5(blob); - entry.setValue(blob); - } - assertConsistencyAware(new Runnable() { - public void run() { - for (Blob blob : map.values()) { - try { - assertEquals(getContentAsStringOrNullAndClose(blob), ""); - } catch (IOException e) { - Throwables.propagate(e); - } - } - } - }); - - } finally { - returnContainer(bucketName); - } - } - - @Test(groups = { "integration", "live" }) - public void testContains() throws InterruptedException, ExecutionException, TimeoutException, IOException { - String bucketName = getContainerName(); - try { - Map map = createMap(view, bucketName); - putStringWithMD5(map, "one", "apple"); - Blob blob = view.getBlobStore().blobBuilder("one").payload("apple").calculateMD5().build(); - assertConsistencyAwareContainsValue(map, blob); - } finally { - returnContainer(bucketName); - } - } - - void getOneReturnsAppleAndOldValueIsNull(Map map, Blob old) throws IOException, InterruptedException { - assert old == null; - assertEquals(getContentAsStringOrNullAndClose(map.get("one")), "apple"); - assertConsistencyAwareMapSize(map, 1); - } - - void getOneReturnsBearAndOldValueIsApple(Map map, Blob oldValue) throws IOException, - InterruptedException { - assertEquals(getContentAsStringOrNullAndClose(checkNotNull(map.get("one"), "one")), "bear"); - assertEquals(getContentAsStringOrNullAndClose(oldValue), "apple"); - assertConsistencyAwareMapSize(map, 1); - } - - @Test(groups = { "integration", "live" }) - public void testPut() throws IOException, InterruptedException { - String bucketName = getContainerName(); - try { - Map map = createMap(view, bucketName); - Blob blob = view.getBlobStore().blobBuilder("one").payload(Strings2.toInputStream("apple")).calculateMD5() - .build(); - Blob old = map.put(blob.getMetadata().getName(), blob); - getOneReturnsAppleAndOldValueIsNull(map, old); - blob.setPayload(Strings2.toInputStream("bear")); - Payloads.calculateMD5(blob); - Blob apple = map.put(blob.getMetadata().getName(), blob); - getOneReturnsBearAndOldValueIsApple(map, apple); - } finally { - returnContainer(bucketName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutAll() throws InterruptedException, ExecutionException, TimeoutException { - String bucketName = getContainerName(); - try { - Map map = createMap(view, bucketName); - ImmutableMap.Builder newMap = ImmutableMap.builder(); - for (Map.Entry entry : fiveInputs.entrySet()) { - String key = entry.getKey(); - newMap.put( - key, - view.getBlobStore().blobBuilder(key).payload(entry.getValue()) - .contentLength((long) fiveBytes.get(key).length).build()); - } - map.putAll(newMap.build()); - assertConsistencyAwareMapSize(map, 5); - assertConsistencyAwareKeySetEquals(map, ImmutableSet.copyOf(fiveInputs.keySet())); - fourLeftRemovingOne(map); - } finally { - returnContainer(bucketName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutMoreThanSingleListing() throws InterruptedException, ExecutionException, TimeoutException { - if (maxResultsForTestListings() == 0) - return; - String bucketName = getContainerName(); - try { - BlobMap map = createMap(view, bucketName); - Builder keySet = ImmutableSet.builder(); - for (int i = 0; i < maxResultsForTestListings() + 1; i++) { - keySet.add(i + ""); - } - - Map newMap = Maps.newLinkedHashMap(); - for (String key : keySet.build()) { - newMap.put(key, map.blobBuilder().name(key).payload(key).build()); - } - map.putAll(newMap); - newMap.clear(); - - assertConsistencyAwareMapSize(map, maxResultsForTestListings() + 1); - assertConsistencyAwareKeySetEquals(map, keySet.build()); - map.clear(); - assertConsistencyAwareMapSize(map, 0); - } finally { - returnContainer(bucketName); - } - } - - @Override - protected void putStringWithMD5(Map map, String key, String text) throws IOException { - map.put(key, view.getBlobStore().blobBuilder(key).payload(text).calculateMD5().build()); - } - - protected void putFiveStrings(BlobMap map) { - map.putAll(Maps.transformValues(fiveStrings, new StringToBlob(map))); - } - - protected void putFiveStringsUnderPath(BlobMap map) { - map.putAll(Maps.transformValues(fiveStringsUnderPath, new StringToBlob(map))); - } - - protected int maxResultsForTestListings() { - return 100; - } - - @Override - protected BlobMap createMap(BlobStoreContext context, String bucket) { - return createMap(context, bucket, maxResults(maxResultsForTestListings())); - } - - @Override - protected BlobMap createMap(BlobStoreContext context, String bucket, ListContainerOptions options) { - return context.createBlobMap(bucket, options); - } - - @Override - protected void addTenObjectsUnderPrefix(String containerName, String prefix) throws InterruptedException { - BlobMap blobMap = createMap(view, containerName, inDirectory(prefix)); - for (int i = 0; i < 10; i++) { - blobMap.put(i + "", blobMap.blobBuilder().name(i + "").payload(i + "content").build()); - } - } - - @Override - protected void addTenObjectsUnderRoot(String containerName) throws InterruptedException { - BlobMap blobMap = createMap(view, containerName, ListContainerOptions.NONE); - for (int i = 0; i < 10; i++) { - blobMap.put(i + "", blobMap.blobBuilder().name(i + "").payload(i + "content").build()); - } - } -} diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java deleted file mode 100644 index 40bbd03024..0000000000 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseInputStreamMapIntegrationTest.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.integration.internal; - -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.blobstore.options.ListContainerOptions.Builder.maxResults; -import static org.testng.Assert.assertEquals; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.blobstore.InputStreamMap; -import org.jclouds.blobstore.options.ListContainerOptions; -import org.jclouds.util.Strings2; -import org.testng.annotations.Test; - -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - -/** - * Tests to cover @{link LiveS3ObjectMap} - * - * @author Adrian Cole - */ -public abstract class BaseInputStreamMapIntegrationTest extends BaseMapIntegrationTest { - - @Override - @Test(groups = { "integration", "live" }) - public void testValues() throws InterruptedException, IOException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - map.putAll(this.fiveInputs); - // this will cause us to block until the bucket updates. - assertConsistencyAwareMapSize(map, 5); - Collection values = map.values(); - assertEquals(values.size(), 5); - Set valuesAsString = Sets.newLinkedHashSet(); - for (InputStream stream : values) { - valuesAsString.add(Strings2.toStringAndClose(stream)); - } - valuesAsString.removeAll(fiveStrings.values()); - assert valuesAsString.size() == 0 : valuesAsString.size() + ": " + values + ": " + valuesAsString; - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutMoreThanSingleListing() throws InterruptedException, ExecutionException, TimeoutException { - String containerName = getContainerName(); - try { - InputStreamMap map = createMap(view, containerName); - Set keySet = Sets.newLinkedHashSet(); - for (int i = 0; i < maxResultsForTestListings() + 1; i++) { - keySet.add(i + ""); - } - - Map newMap = Maps.newHashMap(); - for (String key : keySet) { - newMap.put(key, key); - } - map.putAllStrings(newMap); - newMap.clear(); - - assertConsistencyAwareMapSize(map, maxResultsForTestListings() + 1); - assertConsistencyAwareKeySetEquals(map, keySet); - map.clear(); - assertConsistencyAwareMapSize(map, 0); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testRemove() throws InterruptedException, IOException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - putStringWithMD5(map, "one", "two"); - InputStream old = map.remove("one"); - assertEquals(Strings2.toStringAndClose(old), "two"); - assertConsistencyAwareKeySize(map, 0); - old = map.remove("one"); - assert old == null; - old = map.get("one"); - assert old == null; - assertConsistencyAwareKeySize(map, 0); - } finally { - returnContainer(containerName); - } - } - - @Override - @Test(groups = { "integration", "live" }) - public void testEntrySet() throws InterruptedException, IOException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - ((InputStreamMap) map).putAllStrings(this.fiveStrings); - // this will cause us to block until the bucket updates. - assertConsistencyAwareKeySize(map, 5); - Set> entries = map.entrySet(); - assertEquals(entries.size(), 5); - for (Entry entry : entries) { - assertEquals(fiveStrings.get(entry.getKey()), Strings2.toStringAndClose(entry.getValue())); - entry.setValue(Strings2.toInputStream("")); - } - assertConsistencyAwareMapSize(map, 5); - for (Entry entry : map.entrySet()) { - assertEquals(Strings2.toStringAndClose(checkNotNull(entry.getValue(), entry.getKey())), ""); - } - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testContainsStringValue() throws InterruptedException, ExecutionException, TimeoutException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - ((InputStreamMap) map).putString("one", String.format(XML_STRING_FORMAT, "apple")); - assertConsistencyAwareContainsValue(map, fiveStrings.get("one")); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testContainsFileValue() throws InterruptedException, ExecutionException, TimeoutException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - ((InputStreamMap) map).putString("one", String.format(XML_STRING_FORMAT, "apple")); - assertConsistencyAwareContainsValue(map, fiveFiles.get("one")); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testContainsInputStreamValue() throws InterruptedException, ExecutionException, TimeoutException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - ((InputStreamMap) map).putString("one", String.format(XML_STRING_FORMAT, "apple")); - assertConsistencyAwareContainsValue(map, this.fiveInputs.get("one")); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testContainsBytesValue() throws InterruptedException, ExecutionException, TimeoutException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - ((InputStreamMap) map).putString("one", String.format(XML_STRING_FORMAT, "apple")); - assertConsistencyAwareContainsValue(map, this.fiveBytes.get("one")); - } finally { - returnContainer(containerName); - } - } - - @Override - @Test(groups = { "integration", "live" }) - public void testPutAll() throws InterruptedException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - map.putAll(this.fiveInputs); - assertConsistencyAwareMapSize(map, 5); - assertConsistencyAwareKeySetEquals(map, new TreeSet(fiveInputs.keySet())); - fourLeftRemovingOne(map); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutAllBytes() throws InterruptedException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - - ((InputStreamMap) map).putAllBytes(this.fiveBytes); - assertConsistencyAwareMapSize(map, 5); - assertConsistencyAwareKeySetEquals(map, new TreeSet(fiveBytes.keySet())); - fourLeftRemovingOne(map); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutAllFiles() throws InterruptedException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - - ((InputStreamMap) map).putAllFiles(this.fiveFiles); - assertConsistencyAwareMapSize(map, 5); - assertConsistencyAwareKeySetEquals(map, new TreeSet(fiveFiles.keySet())); - fourLeftRemovingOne(map); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutAllStrings() throws InterruptedException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - - ((InputStreamMap) map).putAllStrings(this.fiveStrings); - assertConsistencyAwareMapSize(map, 5); - assertConsistencyAwareKeySetEquals(map, new TreeSet(fiveStrings.keySet())); - fourLeftRemovingOne(map); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutString() throws InterruptedException, IOException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - - InputStream old = ((InputStreamMap) map).putString("one", fiveStrings.get("one")); - getOneReturnsAppleAndOldValueIsNull(map, old); - InputStream apple = ((InputStreamMap) map).putString("one", fiveStrings.get("two")); - getOneReturnsBearAndOldValueIsApple(map, apple); - } finally { - returnContainer(containerName); - } - } - - void getOneReturnsAppleAndOldValueIsNull(Map map, InputStream old) throws IOException, - InterruptedException { - assert old == null; - assertEquals(Strings2.toStringAndClose(map.get("one")), String.format(XML_STRING_FORMAT, "apple")); - assertConsistencyAwareMapSize(map, 1); - } - - void getOneReturnsBearAndOldValueIsApple(Map map, InputStream oldValue) throws IOException, - InterruptedException { - assertEquals(Strings2.toStringAndClose(map.get("one")), String.format(XML_STRING_FORMAT, "bear")); - assertEquals(Strings2.toStringAndClose(oldValue), String.format(XML_STRING_FORMAT, "apple")); - assertConsistencyAwareMapSize(map, 1); - } - - @Test(groups = { "integration", "live" }) - public void testPutFile() throws IOException, InterruptedException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - - InputStream old = ((InputStreamMap) map).putFile("one", fiveFiles.get("one")); - getOneReturnsAppleAndOldValueIsNull(map, old); - InputStream apple = ((InputStreamMap) map).putFile("one", fiveFiles.get("two")); - getOneReturnsBearAndOldValueIsApple(map, apple); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPutBytes() throws InterruptedException, IOException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - - InputStream old = ((InputStreamMap) map).putBytes("one", fiveBytes.get("one")); - getOneReturnsAppleAndOldValueIsNull(map, old); - InputStream apple = ((InputStreamMap) map).putBytes("one", fiveBytes.get("two")); - getOneReturnsBearAndOldValueIsApple(map, apple); - } finally { - returnContainer(containerName); - } - } - - @Test(groups = { "integration", "live" }) - public void testPut() throws InterruptedException, IOException { - String containerName = getContainerName(); - try { - Map map = createMap(view, containerName); - - InputStream old = map.put("one", fiveInputs.get("one")); - getOneReturnsAppleAndOldValueIsNull(map, old); - InputStream apple = map.put("one", fiveInputs.get("two")); - getOneReturnsBearAndOldValueIsApple(map, apple); - } finally { - returnContainer(containerName); - } - } - - @Override - protected void putStringWithMD5(Map map, String key, String value) throws InterruptedException { - ((InputStreamMap) map).putString(key, value); - } - - protected int maxResultsForTestListings() { - return 100; - } - - protected InputStreamMap createMap(BlobStoreContext context, String bucket) { - return createMap(context, bucket, maxResults(maxResultsForTestListings())); - } - - protected InputStreamMap createMap(BlobStoreContext context, String bucket, ListContainerOptions options) { - return context.createInputStreamMap(bucket, options); - } -} diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java deleted file mode 100644 index 8c812f6102..0000000000 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.integration.internal; - -import static org.jclouds.blobstore.options.ListContainerOptions.Builder.inDirectory; -import static org.jclouds.blobstore.options.ListContainerOptions.Builder.recursive; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.blobstore.ListableMap; -import org.jclouds.blobstore.options.ListContainerOptions; -import org.jclouds.util.Strings2; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Optional; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import com.google.common.base.Charsets; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSortedSet; -import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import com.google.common.io.Files; - -public abstract class BaseMapIntegrationTest extends BaseBlobStoreIntegrationTest { - - public abstract void testPutAll() throws InterruptedException, ExecutionException, TimeoutException; - - public abstract void testEntrySet() throws IOException, InterruptedException, ExecutionException, TimeoutException; - - public abstract void testValues() throws IOException, InterruptedException, ExecutionException, TimeoutException; - - protected Map fiveBytes = Maps.transformValues(fiveStrings, new Function() { - public byte[] apply(String from) { - return from.getBytes(); - } - }); - protected Map fiveInputs; - protected Map fiveFiles; - String tmpDirectory; - - @BeforeMethod(groups = { "integration", "live" }) - protected void setUpInputStreams() { - fiveInputs = Maps.transformValues(fiveStrings, new Function() { - public InputStream apply(String from) { - return Strings2.toInputStream(from); - } - }); - } - - @BeforeClass(groups = { "integration", "live" }) - @Parameters({ "basedir" }) - protected void setUpTempDir(@Optional String basedir) throws InterruptedException, ExecutionException, - FileNotFoundException, IOException, TimeoutException { - if (basedir == null) { - basedir = System.getProperty("java.io.tmpdir"); - } - tmpDirectory = basedir + File.separator + "target" + File.separator + "testFiles" + File.separator - + getClass().getSimpleName(); - new File(tmpDirectory).mkdirs(); - fiveFiles = Maps.newHashMap(); - for (Entry entry : fiveStrings.entrySet()) { - File file = new File(tmpDirectory, entry.getKey()); - Files.write(entry.getValue().getBytes(Charsets.UTF_8), file); - fiveFiles.put(entry.getKey(), file); - } - } - - protected abstract Map createMap(BlobStoreContext context, String containerName); - - protected abstract Map createMap(BlobStoreContext context, String containerName, - ListContainerOptions options); - - @Test(groups = { "integration", "live" }) - public void testClear() throws InterruptedException, ExecutionException, TimeoutException, IOException { - String containerNameName = getContainerName(); - try { - Map map = createMap(view, containerNameName); - assertConsistencyAwareMapSize(map, 0); - putStringWithMD5(map, "one", "apple"); - assertConsistencyAwareMapSize(map, 1); - map.clear(); - assertConsistencyAwareMapSize(map, 0); - } finally { - returnContainer(containerNameName); - } - } - - @Test(groups = { "integration", "live" }) - public abstract void testRemove() throws IOException, InterruptedException, ExecutionException, TimeoutException; - - @Test(groups = { "integration", "live" }) - public void testKeySet() throws InterruptedException, ExecutionException, TimeoutException, IOException { - String containerNameName = getContainerName(); - try { - Map map = createMap(view, containerNameName); - assertConsistencyAwareKeySize(map, 0); - putStringWithMD5(map, "one", "two"); - assertConsistencyAwareKeySize(map, 1); - assertConsistencyAwareKeySetEquals(map, ImmutableSet.of("one")); - } finally { - returnContainer(containerNameName); - } - } - - protected void addTenObjectsUnderPrefix(String containerName, String prefix) throws InterruptedException { - for (int i = 0; i < 10; i++) { - view.getBlobStore().putBlob(containerName, - view.getBlobStore().blobBuilder(prefix + "/" + i).payload(i + "content").build()); - } - } - - protected void addTenObjectsUnderRoot(String containerName) throws InterruptedException { - for (int i = 0; i < 10; i++) { - view.getBlobStore().putBlob(containerName, - view.getBlobStore().blobBuilder(i + "").payload(i + "content").build()); - } - } - - @Test(groups = { "integration", "live" }) - public void testDirectory() throws InterruptedException { - String containerName = getContainerName(); - String directory = "apps"; - Map rootMap = createMap(view, containerName); - Map rootRecursiveMap = createMap(view, containerName, recursive()); - Map inDirectoryMap = createMap(view, containerName, inDirectory(directory)); - Map inDirectoryRecursiveMap = createMap(view, containerName, inDirectory(directory).recursive()); - try { - - view.getBlobStore().createDirectory(containerName, directory); - addTenObjectsUnderRoot(containerName); - assertEquals(rootMap.size(), 10); - assertEquals(ImmutableSortedSet.copyOf(rootMap.keySet()), - ImmutableSortedSet.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - assertEquals(rootRecursiveMap.size(), 10); - assertEquals(ImmutableSortedSet.copyOf(rootRecursiveMap.keySet()), - ImmutableSortedSet.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - assertEquals(inDirectoryMap.size(), 0); - assertEquals(inDirectoryRecursiveMap.size(), 0); - - addTenObjectsUnderPrefix(containerName, directory); - assertEquals(rootMap.size(), 10); - assertEquals(ImmutableSortedSet.copyOf(rootMap.keySet()), - ImmutableSortedSet.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - assertEquals(rootRecursiveMap.size(), 20); - assertEquals(ImmutableSortedSet.copyOf(rootRecursiveMap.keySet()), ImmutableSet.of("0", "1", "2", "3", "4", - "5", "6", "7", "8", "9", "apps/0", "apps/1", "apps/2", "apps/3", "apps/4", "apps/5", "apps/6", "apps/7", - "apps/8", "apps/9")); - assertEquals(inDirectoryMap.size(), 10); - assertEquals(ImmutableSortedSet.copyOf(inDirectoryMap.keySet()), - ImmutableSortedSet.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - assertEquals(inDirectoryRecursiveMap.size(), 10); - assertEquals(ImmutableSortedSet.copyOf(inDirectoryRecursiveMap.keySet()), - ImmutableSortedSet.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")); - - view.getBlobStore().createDirectory(containerName, directory + "/" + directory); - assertEquals(rootMap.size(), 10); - assertEquals(rootRecursiveMap.size(), 20); - assertEquals(inDirectoryMap.size(), 10); - assertEquals(inDirectoryRecursiveMap.size(), 10); - - rootMap.clear(); - assertEquals(rootMap.size(), 0); - assertEquals(rootRecursiveMap.size(), 10); - assertEquals(inDirectoryMap.size(), 10); - assertEquals(inDirectoryRecursiveMap.size(), 10); - - inDirectoryMap.clear(); - assertEquals(rootMap.size(), 0); - assertEquals(rootRecursiveMap.size(), 0); - assertEquals(inDirectoryMap.size(), 0); - assertEquals(inDirectoryRecursiveMap.size(), 0); - - } finally { - returnContainer(containerName); - } - - } - - protected void assertConsistencyAwareKeySetEquals(final Map map, final Set expected) - throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - Set toMatch = map.keySet(); - Set shouldBeEmpty = Sets.difference(expected, toMatch); - assert shouldBeEmpty.size() == 0 : "toMatch has less keys than expected. missing: " + shouldBeEmpty; - shouldBeEmpty = Sets.difference(toMatch, expected); - assert shouldBeEmpty.size() == 0 : "toMatch has more keys than expected. extras: " + shouldBeEmpty; - assertEquals(Sets.newTreeSet(toMatch), Sets.newTreeSet(expected)); - } - }); - } - - protected void assertConsistencyAwareRemoveEquals(final Map map, final String key, final Object equals) - throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assertEquals(map.remove(key), equals); - } - }); - } - - protected void assertConsistencyAwareGetEquals(final Map map, final String key, final Object equals) - throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assertEquals(map.get(key), equals); - } - }); - } - - protected void assertConsistencyAwareKeySize(final Map map, final int size) throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assertEquals(map.keySet().size(), size); - } - }); - } - - @Test(groups = { "integration", "live" }) - public void testContainsKey() throws InterruptedException, ExecutionException, TimeoutException, IOException { - String containerNameName = getContainerName(); - try { - Map map = createMap(view, containerNameName); - assertConsistencyAwareDoesntContainKey(map); - putStringWithMD5(map, "one", "apple"); - assertConsistencyAwareContainsKey(map); - } finally { - returnContainer(containerNameName); - } - } - - /** - * containsValue() uses eTag comparison to containerName contents, so this can be subject to - * eventual consistency problems. - */ - protected void assertConsistencyAwareContainsValue(final Map map, final Object value) - throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assert map.containsValue(value); - } - }); - } - - protected void assertConsistencyAwareContainsKey(final Map map) throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assert map.containsKey("one"); - } - }); - } - - protected void assertConsistencyAwareDoesntContainKey(final Map map) throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assert !map.containsKey("one"); - } - }); - } - - @Test(groups = { "integration", "live" }) - public void testIsEmpty() throws InterruptedException, ExecutionException, TimeoutException, IOException { - String containerNameName = getContainerName(); - try { - Map map = createMap(view, containerNameName); - assertConsistencyAwareEmpty(map); - putStringWithMD5(map, "one", "apple"); - assertConsistencyAwareNotEmpty(map); - } finally { - returnContainer(containerNameName); - } - } - - protected void assertConsistencyAwareNotEmpty(final Map map) throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assert !map.isEmpty(); - } - }); - } - - protected void assertConsistencyAwareEmpty(final Map map) throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assert map.isEmpty(); - } - }); - } - - abstract protected void putStringWithMD5(Map map, String key, String value) throws InterruptedException, - ExecutionException, TimeoutException, IOException; - - protected void fourLeftRemovingOne(Map map) throws InterruptedException { - map.remove("one"); - assertConsistencyAwareMapSize(map, 4); - assertConsistencyAwareKeySetEquals(map, new TreeSet(ImmutableSet.of("two", "three", "four", "five"))); - } - - protected void assertConsistencyAwareMapSize(final Map map, final int size) throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assertEquals(map.size(), size); - } - }); - } - - @Test(groups = { "integration", "live" }) - public abstract void testPut() throws IOException, InterruptedException, ExecutionException, TimeoutException; - - @Test(groups = { "integration", "live" }) - public void testListContainer() throws InterruptedException, ExecutionException, TimeoutException { - String containerNameName = getContainerName(); - try { - ListableMap map = (ListableMap) createMap(view, containerNameName); - assertConsistencyAwareListContainer(map, containerNameName); - } finally { - returnContainer(containerNameName); - } - } - - protected void assertConsistencyAwareListContainer(final ListableMap map, final String containerNameName) - throws InterruptedException { - assertConsistencyAware(new Runnable() { - public void run() { - assertTrue(Iterables.size(map.list()) >= 0); - } - }); - } - -} diff --git a/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobMapTest.java b/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobMapTest.java deleted file mode 100644 index bf553a8223..0000000000 --- a/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobMapTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.blobstore.internal; - -import static org.testng.Assert.assertEquals; - -import java.util.Map; - -import org.jclouds.ContextBuilder; -import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.blobstore.domain.Blob; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import com.google.inject.TypeLiteral; -import com.google.inject.util.Types; - -/** - * - * Tests retry logic. - * - * @author Adrian Cole - */ -@Test(groups = { "unit" }) -public class BaseBlobMapTest { - - BlobStoreContext context; - - InputStreamMapImpl map; - - @BeforeClass - void addDefaultObjectsSoThatTestsWillPass() { - context = ContextBuilder.newBuilder("transient").build(BlobStoreContext.class); - map = (InputStreamMapImpl) context.createInputStreamMap("test"); - } - - public void testTypes() { - TypeLiteral>> type0 = new TypeLiteral>>() { - }; - TypeLiteral type1 = TypeLiteral.get(Types.newParameterizedType(Map.class, String.class, - Types.newParameterizedType(Map.class, String.class, Blob.class))); - assertEquals(type0, type1); - - } - -} diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/internal/AWSS3BlobStoreContextImpl.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/internal/AWSS3BlobStoreContextImpl.java index 79b84273ae..b0703b8029 100644 --- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/internal/AWSS3BlobStoreContextImpl.java +++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/internal/AWSS3BlobStoreContextImpl.java @@ -24,10 +24,8 @@ import org.jclouds.aws.s3.blobstore.AWSS3AsyncBlobStore; import org.jclouds.aws.s3.blobstore.AWSS3BlobStore; import org.jclouds.aws.s3.blobstore.AWSS3BlobStoreContext; import org.jclouds.blobstore.AsyncBlobStore; -import org.jclouds.blobstore.BlobMap; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.InputStreamMap; import org.jclouds.blobstore.attr.ConsistencyModel; import org.jclouds.location.Provider; import org.jclouds.rest.Utils; @@ -43,10 +41,10 @@ public class AWSS3BlobStoreContextImpl extends S3BlobStoreContextImpl implements @Inject public AWSS3BlobStoreContextImpl(@Provider Context backend, @Provider TypeToken backendType, - BlobMap.Factory blobMapFactory, Utils utils, ConsistencyModel consistencyModel, - InputStreamMap.Factory inputStreamMapFactory, AsyncBlobStore ablobStore, BlobStore blobStore, + Utils utils, ConsistencyModel consistencyModel, + AsyncBlobStore ablobStore, BlobStore blobStore, BlobRequestSigner blobRequestSigner) { - super(backend, backendType, blobMapFactory, utils, consistencyModel, inputStreamMapFactory, ablobStore, + super(backend, backendType, utils, consistencyModel, ablobStore, blobStore, blobRequestSigner); } diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobMapIntegrationLiveTest.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobMapIntegrationLiveTest.java deleted file mode 100644 index abe5ec33f3..0000000000 --- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.aws.s3.blobstore.integration; - -import org.jclouds.s3.blobstore.integration.S3BlobMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "AWSS3BlobMapIntegrationLiveTest") -public class AWSS3BlobMapIntegrationLiveTest extends S3BlobMapIntegrationLiveTest { - public AWSS3BlobMapIntegrationLiveTest() { - provider = "aws-s3"; - } -} diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3InputStreamMapIntegrationLiveTest.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3InputStreamMapIntegrationLiveTest.java deleted file mode 100644 index b628ae9725..0000000000 --- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3InputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.aws.s3.blobstore.integration; - -import org.jclouds.s3.blobstore.integration.S3InputStreamMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "AWSS3InputStreamMapIntegrationLiveTest") -public class AWSS3InputStreamMapIntegrationLiveTest extends S3InputStreamMapIntegrationLiveTest { - public AWSS3InputStreamMapIntegrationLiveTest() { - provider = "aws-s3"; - } -} diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/config/AzureBlobStoreContextModule.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/config/AzureBlobStoreContextModule.java index a8f2711804..47614ab2ac 100644 --- a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/config/AzureBlobStoreContextModule.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/config/AzureBlobStoreContextModule.java @@ -30,7 +30,6 @@ import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.attr.ConsistencyModel; -import org.jclouds.blobstore.config.BlobStoreMapModule; import org.jclouds.blobstore.strategy.ContainsValueInListStrategy; import com.google.common.cache.CacheBuilder; @@ -49,7 +48,6 @@ public class AzureBlobStoreContextModule extends AbstractModule { @Override protected void configure() { - install(new BlobStoreMapModule()); bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(AsyncBlobStore.class).to(AzureAsyncBlobStore.class).in(Scopes.SINGLETON); bind(BlobStore.class).to(AzureBlobStore.class).in(Scopes.SINGLETON); diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobInputStreamMapIntegrationLiveTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 0a539f68e9..0000000000 --- a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.azureblob.blobstore.integration; - -import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class AzureBlobInputStreamMapIntegrationLiveTest extends BaseInputStreamMapIntegrationTest { - public AzureBlobInputStreamMapIntegrationLiveTest() { - provider = "azureblob"; - } -} diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobMapIntegrationLiveTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobMapIntegrationLiveTest.java deleted file mode 100644 index df49be86e0..0000000000 --- a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.azureblob.blobstore.integration; - -import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live") -public class AzureBlobMapIntegrationLiveTest extends BaseBlobMapIntegrationTest { - public AzureBlobMapIntegrationLiveTest() { - provider = "azureblob"; - } -} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobMapIntegrationLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobMapIntegrationLiveTest.java deleted file mode 100644 index ec08a36047..0000000000 --- a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.rackspace.cloudfiles.blobstore.integration; - -import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "CloudFilesUKBlobMapIntegrationLiveTest") -public class CloudFilesUKBlobMapIntegrationLiveTest extends CloudFilesBlobMapIntegrationLiveTest { - public CloudFilesUKBlobMapIntegrationLiveTest() { - provider = "cloudfiles-uk"; - } - -} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKInputStreamMapIntegrationLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 6ae1192bef..0000000000 --- a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.rackspace.cloudfiles.blobstore.integration; - -import org.jclouds.cloudfiles.blobstore.integration.CloudFilesInputStreamMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "CloudFilesUKInputStreamMapIntegrationLiveTest") -public class CloudFilesUKInputStreamMapIntegrationLiveTest extends CloudFilesInputStreamMapIntegrationLiveTest { - public CloudFilesUKInputStreamMapIntegrationLiveTest() { - provider = "cloudfiles-uk"; - } - -} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobMapIntegrationLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobMapIntegrationLiveTest.java deleted file mode 100644 index 49b2b4be75..0000000000 --- a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.rackspace.cloudfiles.blobstore.integration; - -import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "CloudFilesUSBlobMapIntegrationLiveTest") -public class CloudFilesUSBlobMapIntegrationLiveTest extends CloudFilesBlobMapIntegrationLiveTest { - public CloudFilesUSBlobMapIntegrationLiveTest() { - provider = "cloudfiles-us"; - } -} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSInputStreamMapIntegrationLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index cd79cca0bd..0000000000 --- a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.rackspace.cloudfiles.blobstore.integration; - -import org.jclouds.cloudfiles.blobstore.integration.CloudFilesInputStreamMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "CloudFilesUSInputStreamMapIntegrationLiveTest") -public class CloudFilesUSInputStreamMapIntegrationLiveTest extends CloudFilesInputStreamMapIntegrationLiveTest { - public CloudFilesUSInputStreamMapIntegrationLiveTest() { - provider = "cloudfiles-us"; - } -} diff --git a/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageBlobMapIntegrationLiveTest.java b/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageBlobMapIntegrationLiveTest.java deleted file mode 100644 index 50ec0893ef..0000000000 --- a/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.cloudonestorage.blobstore.integration; - -import org.jclouds.atmos.blobstore.integration.AtmosMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "CloudOneStorageBlobMapIntegrationLiveTest") -public class CloudOneStorageBlobMapIntegrationLiveTest extends AtmosMapIntegrationLiveTest { - public CloudOneStorageBlobMapIntegrationLiveTest() { - provider = "cloudonestorage"; - } - -} diff --git a/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageInputStreamMapIntegrationLiveTest.java b/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 4bf732cd2b..0000000000 --- a/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/blobstore/integration/CloudOneStorageInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.cloudonestorage.blobstore.integration; - -import org.jclouds.atmos.blobstore.integration.AtmosInputStreamMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "CloudOneStorageInputStreamMapIntegrationLiveTest") -public class CloudOneStorageInputStreamMapIntegrationLiveTest extends AtmosInputStreamMapIntegrationLiveTest { - public CloudOneStorageInputStreamMapIntegrationLiveTest() { - provider = "cloudonestorage"; - } - -} diff --git a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/config/HPCloudObjectStorageBlobStoreContextModule.java b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/config/HPCloudObjectStorageBlobStoreContextModule.java index 9c6dde0366..a321033533 100644 --- a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/config/HPCloudObjectStorageBlobStoreContextModule.java +++ b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/config/HPCloudObjectStorageBlobStoreContextModule.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.attr.ConsistencyModel; -import org.jclouds.blobstore.config.BlobStoreMapModule; import org.jclouds.hpcloud.objectstorage.HPCloudObjectStorageApi; import org.jclouds.hpcloud.objectstorage.blobstore.HPCloudObjectStorageAsyncBlobStore; import org.jclouds.hpcloud.objectstorage.blobstore.HPCloudObjectStorageBlobStore; @@ -98,7 +97,6 @@ public class HPCloudObjectStorageBlobStoreContextModule extends SwiftBlobStoreCo @Override protected void configure() { - install(new BlobStoreMapModule()); bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(AsyncBlobStore.class).to(HPCloudObjectStorageAsyncBlobStore.class); bind(BlobStore.class).to(HPCloudObjectStorageBlobStore.class); diff --git a/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageBlobMapIntegrationLiveTest.java b/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageBlobMapIntegrationLiveTest.java deleted file mode 100644 index 37d631140a..0000000000 --- a/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.hpcloud.objectstorage.blobstore.integration; - -import org.jclouds.openstack.swift.blobstore.integration.SwiftBlobMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Jeremy Daggett - */ -@Test(groups = "live") -public class HPCloudObjectStorageBlobMapIntegrationLiveTest extends SwiftBlobMapIntegrationLiveTest { - public HPCloudObjectStorageBlobMapIntegrationLiveTest() { - provider = "hpcloud-objectstorage"; - } - -} diff --git a/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageInputStreamMapIntegrationLiveTest.java b/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index 8caf2ab218..0000000000 --- a/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/integration/HPCloudObjectStorageInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.hpcloud.objectstorage.blobstore.integration; - -import org.jclouds.openstack.swift.blobstore.integration.SwiftInputStreamMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Jeremy Daggett - */ -@Test(groups = "live") -public class HPCloudObjectStorageInputStreamMapIntegrationLiveTest extends SwiftInputStreamMapIntegrationLiveTest { - public HPCloudObjectStorageInputStreamMapIntegrationLiveTest() { - provider = "hpcloud-objectstorage"; - } - -} diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobMapIntegrationLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobMapIntegrationLiveTest.java deleted file mode 100644 index 8ff545c33f..0000000000 --- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.ninefold.storage.blobstore.integration; - -import org.jclouds.atmos.blobstore.integration.AtmosMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "NinefoldStorageBlobMapIntegrationLiveTest") -public class NinefoldStorageBlobMapIntegrationLiveTest extends AtmosMapIntegrationLiveTest { - - public NinefoldStorageBlobMapIntegrationLiveTest() { - provider = "ninefold-storage"; - } -} diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageInputStreamMapIntegrationLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageInputStreamMapIntegrationLiveTest.java deleted file mode 100644 index d823f75ed3..0000000000 --- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageInputStreamMapIntegrationLiveTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * 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 org.jclouds.ninefold.storage.blobstore.integration; - -import org.jclouds.atmos.blobstore.integration.AtmosInputStreamMapIntegrationLiveTest; -import org.testng.annotations.Test; - -/** - * @author Adrian Cole - */ -@Test(groups = "live", testName = "NinefoldStorageInputStreamMapIntegrationLiveTest") -public class NinefoldStorageInputStreamMapIntegrationLiveTest extends AtmosInputStreamMapIntegrationLiveTest { - - public NinefoldStorageInputStreamMapIntegrationLiveTest() { - provider = "ninefold-storage"; - } -}