Issue 440: added ScaleUp Storage to provider group

This commit is contained in:
Adrian Cole 2011-01-05 00:42:41 +01:00
parent 0263a15278
commit 45da77073a
18 changed files with 585 additions and 12 deletions

View File

@ -44,6 +44,11 @@
<artifactId>googlestorage</artifactId> <artifactId>googlestorage</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>scaleup-storage</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>jclouds-azure</artifactId> <artifactId>jclouds-azure</artifactId>

View File

@ -157,11 +157,10 @@ walrus.contextbuilder=org.jclouds.s3.S3ContextBuilder
walrus.propertiesbuilder=org.jclouds.s3.WalrusPropertiesBuilder walrus.propertiesbuilder=org.jclouds.s3.WalrusPropertiesBuilder
googlestorage.contextbuilder=org.jclouds.s3.S3ContextBuilder googlestorage.contextbuilder=org.jclouds.s3.S3ContextBuilder
googlestorage.propertiesbuilder=org.jclouds.s3.GoogleStoragePropertiesBuilder googlestorage.propertiesbuilder=org.jclouds.googlestorage.GoogleStoragePropertiesBuilder
scaleup-storage.contextbuilder=org.jclouds.s3.blobstore.ScaleUpCloudBlobStoreContextContextBuilder scaleup-storage.contextbuilder=org.jclouds.scaleup.storage.ScaleUpStorageContextBuilder
scaleup-storage.propertiesbuilder=org.jclouds.s3.S3PropertiesBuilder scaleup-storage.propertiesbuilder=org.jclouds.scaleup.storage.ScaleUpStoragePropertiesBuilder
scaleup-storage.endpoint=https://scs.scaleupstorage.com
transient.contextbuilder=org.jclouds.blobstore.TransientBlobStoreContextBuilder transient.contextbuilder=org.jclouds.blobstore.TransientBlobStoreContextBuilder
transient.propertiesbuilder=org.jclouds.blobstore.TransientBlobStorePropertiesBuilder transient.propertiesbuilder=org.jclouds.blobstore.TransientBlobStorePropertiesBuilder

View File

@ -40,5 +40,6 @@
<module>aws-elb</module> <module>aws-elb</module>
<module>aws-s3</module> <module>aws-s3</module>
<module>googlestorage</module> <module>googlestorage</module>
<module>scaleup-storage</module>
</modules> </modules>
</project> </project>

View File

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
====================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
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.
====================================================================
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4.0.0.xsd" >
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds.provider</groupId>
<artifactId>jclouds-providers-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>scaleup-storage</artifactId>
<name>jclouds ScaleUp Cloud Storage provider</name>
<description>Simple Storage Service (S3) implementation targeted to ScaleUp Cloud Storage</description>
<properties>
<test.initializer>org.jclouds.scaleup.storage.blobstore.ScaleUpStorageTestInitializer</test.initializer>
<test.scaleup-storage.endpoint>https://scs.scaleupstorage.com</test.scaleup-storage.endpoint>
<test.scaleup-storage.apiversion>2006-03-01</test.scaleup-storage.apiversion>
<test.scaleup-storage.identity>${test.scaleup-storage.identity}</test.scaleup-storage.identity>
<test.scaleup-storage.credential>${test.scaleup-storage.credential}</test.scaleup-storage.credential>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>s3</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>s3</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-blobstore</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>live</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemProperties>
<property>
<name>test.scaleup-storage.endpoint</name>
<value>${test.scaleup-storage.endpoint}</value>
</property>
<property>
<name>test.scaleup-storage.apiversion</name>
<value>${test.scaleup-storage.apiversion}</value>
</property>
<property>
<name>test.scaleup-storage.identity</name>
<value>${test.scaleup-storage.identity}</value>
</property>
<property>
<name>test.scaleup-storage.credential</name>
<value>${test.scaleup-storage.credential}</value>
</property>
<property>
<name>test.initializer</name>
<value>${test.initializer}</value>
</property>
<property>
<name>jclouds.blobstore.httpstream.url</name>
<value>${jclouds.blobstore.httpstream.url}</value>
</property>
<property>
<name>jclouds.blobstore.httpstream.md5</name>
<value>${jclouds.blobstore.httpstream.md5}</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -17,13 +17,13 @@
* ==================================================================== * ====================================================================
*/ */
package org.jclouds.s3.blobstore; package org.jclouds.scaleup.storage;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import org.jclouds.s3.S3ContextBuilder; import org.jclouds.s3.S3ContextBuilder;
import org.jclouds.s3.blobstore.config.ScaleUpCloudBlobStoreContextModule; import org.jclouds.scaleup.storage.blobstore.config.ScaleUpStorageBlobStoreContextModule;
import com.google.inject.Module; import com.google.inject.Module;
@ -31,15 +31,15 @@ import com.google.inject.Module;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class ScaleUpCloudBlobStoreContextContextBuilder extends S3ContextBuilder { public class ScaleUpStorageContextBuilder extends S3ContextBuilder {
public ScaleUpCloudBlobStoreContextContextBuilder(Properties props) { public ScaleUpStorageContextBuilder(Properties props) {
super(props); super(props);
} }
@Override @Override
protected void addContextModule(List<Module> modules) { protected void addContextModule(List<Module> modules) {
modules.add(new ScaleUpCloudBlobStoreContextModule()); modules.add(new ScaleUpStorageBlobStoreContextModule());
} }
} }

View File

@ -0,0 +1,45 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import java.util.Properties;
import org.jclouds.s3.S3PropertiesBuilder;
/**
* Builds properties used in Google Storage
*
* @author Adrian Cole
*/
public class ScaleUpStoragePropertiesBuilder extends S3PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_ENDPOINT, "https://scs.scaleupstorage.com");
return properties;
}
public ScaleUpStoragePropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -17,8 +17,9 @@
* ==================================================================== * ====================================================================
*/ */
package org.jclouds.s3.blobstore.config; package org.jclouds.scaleup.storage.blobstore.config;
import org.jclouds.s3.blobstore.config.S3BlobStoreContextModule;
import org.jclouds.s3.domain.BucketMetadata; import org.jclouds.s3.domain.BucketMetadata;
import org.jclouds.domain.Location; import org.jclouds.domain.Location;
@ -30,8 +31,8 @@ import com.google.inject.TypeLiteral;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class ScaleUpCloudBlobStoreContextModule extends S3BlobStoreContextModule { public class ScaleUpStorageBlobStoreContextModule extends S3BlobStoreContextModule {
// TODO: this is really a scality concern that is coupled to all installations of theirs
@SuppressWarnings({ "rawtypes", "unchecked" }) @SuppressWarnings({ "rawtypes", "unchecked" })
@Override @Override
protected void bindBucketLocationStrategy() { protected void bindBucketLocationStrategy() {

View File

@ -0,0 +1,37 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(enabled = false, groups = "unit", testName = "ScaleUpStorageAsyncClientTest")
public class ScaleUpStorageAsyncClientTestDisabled extends org.jclouds.s3.S3AsyncClientTest {
public ScaleUpStorageAsyncClientTestDisabled() {
this.provider = "scaleup-storage";
this.url = "commondatastorage.googleapis.com";
}
// TODO parameterize this test so that it can pass
}

View File

@ -0,0 +1,33 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage;
import org.jclouds.s3.S3ClientLiveTest;
import org.testng.annotations.Test;
/**
* Tests behavior of {@code S3Client}
*
* @author Adrian Cole
*/
@Test(groups = "live", sequential = true, testName = "ScaleUpStorageClientLiveTest")
public class ScaleUpStorageClientLiveTest extends S3ClientLiveTest {
}

View File

@ -0,0 +1,40 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageBlobIntegrationLiveTest")
public class ScaleUpStorageBlobIntegrationLiveTest extends BaseBlobIntegrationTest {
@Override
@Test(expectedExceptions = IllegalArgumentException.class)
public void testPutObjectStream() throws InterruptedException, IOException, ExecutionException {
super.testPutObjectStream();
}
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseBlobLiveTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageBlobLiveTest")
public class ScaleUpStorageBlobLiveTest extends BaseBlobLiveTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageBlobMapIntegrationLiveTest")
public class ScaleUpStorageBlobMapIntegrationLiveTest extends BaseBlobMapIntegrationTest {
}

View File

@ -0,0 +1,32 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseBlobSignerLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageBlobSignerLiveTest")
public class ScaleUpStorageBlobSignerLiveTest extends BaseBlobSignerLiveTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageContainerIntegrationLiveTest")
public class ScaleUpStorageContainerIntegrationLiveTest extends BaseContainerIntegrationTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseContainerLiveTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageContainerLiveTest")
public class ScaleUpStorageContainerLiveTest extends BaseContainerLiveTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseInputStreamMapIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageInputStreamMapIntegrationLiveTest")
public class ScaleUpStorageInputStreamMapIntegrationLiveTest extends BaseInputStreamMapIntegrationTest {
}

View File

@ -0,0 +1,31 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import org.jclouds.blobstore.integration.internal.BaseServiceIntegrationTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "ScaleUpStorageServiceIntegrationLiveTest")
public class ScaleUpStorageServiceIntegrationLiveTest extends BaseServiceIntegrationTest {
}

View File

@ -0,0 +1,51 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.scaleup.storage.blobstore;
import java.io.IOException;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.blobstore.BlobStoreContextFactory;
import org.jclouds.blobstore.integration.TransientBlobStoreTestInitializer;
import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest;
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
*
* @author Adrian Cole
*/
public class ScaleUpStorageTestInitializer extends TransientBlobStoreTestInitializer {
public ScaleUpStorageTestInitializer() {
provider = "scaleup-storage";
BaseBlobStoreIntegrationTest.SANITY_CHECK_RETURNED_BUCKET_NAME = true;
}
@Override
protected BlobStoreContext createLiveContext(Module configurationModule, String endpoint, String apiversion,
String app, String identity, String credential) throws IOException {
return new BlobStoreContextFactory().createContext(provider, ImmutableSet.of(configurationModule,
new Log4JLoggingModule()), setupProperties(endpoint, apiversion, identity, credential));
}
}