Get standalone server mode working for all tests.
This commit is contained in:
parent
cb28eeefbb
commit
81836b6981
78 changed files with 957 additions and 783 deletions
52
other_langs/sqsSample.java
Normal file
52
other_langs/sqsSample.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file 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 com.amazonaws.samples;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
import com.amazonaws.AmazonClientException;
|
||||
import com.amazonaws.AmazonServiceException;
|
||||
import com.amazonaws.regions.Region;
|
||||
import com.amazonaws.regions.Regions;
|
||||
import com.amazonaws.services.sqs.AmazonSQS;
|
||||
import com.amazonaws.services.sqs.AmazonSQSClient;
|
||||
|
||||
public class S3Sample {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
AmazonSQS sqs = new AmazonSQSClient();
|
||||
Region usWest2 = Region.getRegion(Regions.US_WEST_2);
|
||||
sqs.setRegion(usWest2);
|
||||
sqs.setEndpoint("http://localhost:8086");
|
||||
|
||||
String queueName = "my-first-queue";
|
||||
sqs.createQueue(queueName);
|
||||
|
||||
System.out.println("Listing queues");
|
||||
for (String queue_url: sqs.listQueues().getQueueUrls()) {
|
||||
System.out.println(" - " + queue_url);
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
26
other_langs/test.js
Normal file
26
other_langs/test.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
var AWS = require('aws-sdk');
|
||||
|
||||
var s3 = new AWS.S3({endpoint: "http://localhost:8086"});
|
||||
var myBucket = 'my.unique.bucket.name';
|
||||
|
||||
var myKey = 'myBucketKey';
|
||||
|
||||
s3.createBucket({Bucket: myBucket}, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
params = {Bucket: myBucket, Key: myKey, Body: 'Hello!'};
|
||||
s3.putObject(params, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
} else {
|
||||
console.log("Successfully uploaded data to myBucket/myKey");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
s3.listBuckets(function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
6
other_langs/test.rb
Normal file
6
other_langs/test.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
require 'aws-sdk'
|
||||
|
||||
sqs = Aws::SQS::Resource.new(region: 'us-west-2', endpoint: 'http://localhost:8086')
|
||||
my_queue = sqs.create_queue(queue_name: 'my-bucket')
|
||||
|
||||
puts sqs.client.list_queues()
|
||||
Loading…
Add table
Add a link
Reference in a new issue