diff --git a/labs/aws-sqs/pom.xml b/labs/aws-sqs/pom.xml new file mode 100644 index 0000000000..9572ac5b42 --- /dev/null +++ b/labs/aws-sqs/pom.xml @@ -0,0 +1,114 @@ + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.5.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.labs + aws-sqs + jclouds Amazon Simple Queue Service provider + Simple Queue Service implementation targeted to Amazon Web Services + bundle + + + https://sqs.us-east-1.amazonaws.com + 2011-10-01 + + ${test.aws.identity} + ${test.aws.credential} + + org.jclouds.aws.sqs*;version="${project.version}" + org.jclouds*;version="${project.version}",* + + + + + org.jclouds.labs + sqs + ${project.version} + jar + + + org.jclouds.labs + sqs + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds.driver + jclouds-slf4j + ${project.version} + test + + + ch.qos.logback + logback-classic + 1.0.0 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + ${test.aws-sqs.endpoint} + ${test.aws-sqs.api-version} + ${test.aws-sqs.build-version} + ${test.aws-sqs.identity} + ${test.aws-sqs.credential} + + + + + + + + + + + diff --git a/labs/aws-sqs/src/main/java/org/jclouds/aws/sqs/AWSSQSProviderMetadata.java b/labs/aws-sqs/src/main/java/org/jclouds/aws/sqs/AWSSQSProviderMetadata.java new file mode 100644 index 0000000000..5b85c987ea --- /dev/null +++ b/labs/aws-sqs/src/main/java/org/jclouds/aws/sqs/AWSSQSProviderMetadata.java @@ -0,0 +1,107 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds 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.sqs; + +import static org.jclouds.aws.domain.Region.AP_NORTHEAST_1; +import static org.jclouds.aws.domain.Region.AP_SOUTHEAST_1; +import static org.jclouds.aws.domain.Region.EU_WEST_1; +import static org.jclouds.aws.domain.Region.SA_EAST_1; +import static org.jclouds.aws.domain.Region.US_EAST_1; +import static org.jclouds.aws.domain.Region.US_WEST_1; +import static org.jclouds.aws.domain.Region.US_WEST_2; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION; + +import java.net.URI; +import java.util.Properties; + +import org.jclouds.aws.domain.Region; +import org.jclouds.sqs.SQSApiMetadata; +import org.jclouds.providers.ProviderMetadata; +import org.jclouds.providers.internal.BaseProviderMetadata; + +/** + * Implementation of @ link org.jclouds.types.ProviderMetadata} for Amazon's Simple Queue Service + * provider. + * + * @author Adrian Cole + */ +public class AWSSQSProviderMetadata extends BaseProviderMetadata { + + /** The serialVersionUID */ + private static final long serialVersionUID = 7750012233546655021L; + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return Builder.class.cast(builder().fromProviderMetadata(this)); + } + + public AWSSQSProviderMetadata() { + super(builder()); + } + + public AWSSQSProviderMetadata(Builder builder) { + super(builder); + } + + public static Properties defaultProperties() { + Properties properties = new Properties(); + properties.putAll(Region.regionProperties()); + properties.setProperty(PROPERTY_REGION + "." + US_EAST_1 + ".endpoint", + "https://sqs.us-east-1.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + US_WEST_1 + ".endpoint", + "https://sqs.us-west-1.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + US_WEST_2 + ".endpoint", + "https://sqs.us-west-2.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + SA_EAST_1 + ".endpoint", + "https://sqs.sa-east-1.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + EU_WEST_1 + ".endpoint", + "https://sqs.eu-west-1.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + AP_SOUTHEAST_1 + ".endpoint", + "https://sqs.ap-southeast-1.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + AP_NORTHEAST_1 + ".endpoint", + "https://sqs.ap-northeast-1.amazonaws.com"); + return properties; + } + + public static class Builder extends BaseProviderMetadata.Builder { + + protected Builder(){ + id("aws-sqs") + .name("Amazon Simple Queue Service") + .endpoint("https://sqs.us-east-1.amazonaws.com") + .homepage(URI.create("http://aws.amazon.com/sqs")) + .console(URI.create("https://console.aws.amazon.com/ec2/home")) + .linkedServices("aws-ec2", "aws-rds", "aws-sqs", "aws-elb", "aws-iam","aws-cloudwatch", "aws-s3", "aws-simpledb") + .iso3166Codes("US-VA", "US-CA", "BR-SP", "US-OR", "IE", "SG", "JP-13") + .apiMetadata(new SQSApiMetadata()) + .defaultProperties(AWSSQSProviderMetadata.defaultProperties()); + } + + @Override + public Builder fromProviderMetadata( + ProviderMetadata in) { + super.fromProviderMetadata(in); + return this; + } + } +} diff --git a/labs/aws-sqs/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/labs/aws-sqs/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..6f797d6ddc --- /dev/null +++ b/labs/aws-sqs/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.aws.sqs.AWSSQSProviderMetadata diff --git a/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/AWSSQSProviderTest.java b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/AWSSQSProviderTest.java new file mode 100644 index 0000000000..8b137f7ea6 --- /dev/null +++ b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/AWSSQSProviderTest.java @@ -0,0 +1,36 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds 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.sqs; + +import org.jclouds.sqs.SQSApiMetadata; +import org.jclouds.providers.internal.BaseProviderMetadataTest; +import org.testng.annotations.Test; + +/** + * The AWSSQSProviderTest tests the org.jclouds.providers.AWSSQSProvider class. + * + * @author Adrian Cole + */ +@Test(groups = "unit", testName = "AWSSQSProviderTest") +public class AWSSQSProviderTest extends BaseProviderMetadataTest { + + public AWSSQSProviderTest() { + super(new AWSSQSProviderMetadata(), new SQSApiMetadata()); + } +} diff --git a/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSMessageApiLiveTest.java b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSMessageApiLiveTest.java new file mode 100644 index 0000000000..43d1c95584 --- /dev/null +++ b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSMessageApiLiveTest.java @@ -0,0 +1,35 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds 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.sqs.features; + +import org.jclouds.sqs.features.MessageApiLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "AWSMessageApiLiveTest") +public class AWSMessageApiLiveTest extends MessageApiLiveTest { + + public AWSMessageApiLiveTest() { + provider = "aws-sqs"; + } + +} diff --git a/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSPermissionApiLiveTest.java b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSPermissionApiLiveTest.java new file mode 100644 index 0000000000..14fa42384f --- /dev/null +++ b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSPermissionApiLiveTest.java @@ -0,0 +1,35 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds 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.sqs.features; + +import org.jclouds.sqs.features.PermissionApiLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "AWSPermissionApiLiveTest") +public class AWSPermissionApiLiveTest extends PermissionApiLiveTest { + + public AWSPermissionApiLiveTest() { + provider = "aws-sqs"; + } + +} diff --git a/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSQueueApiLiveTest.java b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSQueueApiLiveTest.java new file mode 100644 index 0000000000..0065477e22 --- /dev/null +++ b/labs/aws-sqs/src/test/java/org/jclouds/aws/sqs/features/AWSQueueApiLiveTest.java @@ -0,0 +1,35 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds 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.sqs.features; + +import org.jclouds.sqs.features.QueueApiLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "AWSQueueApiLiveTest") +public class AWSQueueApiLiveTest extends QueueApiLiveTest { + + public AWSQueueApiLiveTest() { + provider = "aws-sqs"; + } + +} diff --git a/labs/pom.xml b/labs/pom.xml index 5a445e29e9..c12e25c585 100644 --- a/labs/pom.xml +++ b/labs/pom.xml @@ -62,5 +62,6 @@ fgcp-au fgcp-de sqs + aws-sqs