Search in sources :

Example 81 with ArrayList

use of java.util.ArrayList in project camel by apache.

the class AmazonS3ClientMock method listBuckets.

@Override
public List<Bucket> listBuckets() throws AmazonClientException, AmazonServiceException {
    ArrayList<Bucket> list = new ArrayList<Bucket>();
    Bucket bucket = new Bucket("camel-bucket");
    bucket.setOwner(new Owner("Camel", "camel"));
    bucket.setCreationDate(new Date());
    list.add(bucket);
    return list;
}
Also used : Owner(com.amazonaws.services.s3.model.Owner) Bucket(com.amazonaws.services.s3.model.Bucket) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) Date(java.util.Date)

Example 82 with ArrayList

use of java.util.ArrayList in project camel by apache.

the class BatchDeleteAttributesCommandTest method determineDeletableItems.

@Test
public void determineDeletableItems() {
    assertNull(this.command.determineDeletableItems());
    List<Item> deletableItems = new ArrayList<Item>();
    deletableItems.add(new Item());
    exchange.getIn().setHeader(SdbConstants.DELETABLE_ITEMS, deletableItems);
    assertEquals(deletableItems, this.command.determineDeletableItems());
}
Also used : Item(com.amazonaws.services.simpledb.model.Item) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 83 with ArrayList

use of java.util.ArrayList in project camel by apache.

the class BatchPutAttributesCommandTest method determineReplaceableItems.

@Test
public void determineReplaceableItems() {
    assertNull(this.command.determineReplaceableItems());
    List<ReplaceableItem> replaceableItems = new ArrayList<ReplaceableItem>();
    replaceableItems.add(new ReplaceableItem("ITEM1"));
    exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ITEMS, replaceableItems);
    assertEquals(replaceableItems, this.command.determineReplaceableItems());
}
Also used : ArrayList(java.util.ArrayList) ReplaceableItem(com.amazonaws.services.simpledb.model.ReplaceableItem) Test(org.junit.Test)

Example 84 with ArrayList

use of java.util.ArrayList in project camel by apache.

the class EC2ComponentSpringTest method ec2DescribeStatusSpecificInstancesTest.

@Test
public void ec2DescribeStatusSpecificInstancesTest() throws Exception {
    Exchange exchange = template.request("direct:describeStatus", new Processor() {

        @Override
        public void process(Exchange exchange) throws Exception {
            Collection l = new ArrayList();
            l.add("test-1");
            exchange.getIn().setHeader(EC2Constants.INSTANCES_IDS, l);
        }
    });
    assertMockEndpointsSatisfied();
    DescribeInstanceStatusResult resultGet = (DescribeInstanceStatusResult) exchange.getOut().getBody();
    assertEquals(resultGet.getInstanceStatuses().size(), 1);
    assertEquals(resultGet.getInstanceStatuses().get(0).getInstanceState().getName(), InstanceStateName.Running.toString());
}
Also used : Exchange(org.apache.camel.Exchange) Processor(org.apache.camel.Processor) DescribeInstanceStatusResult(com.amazonaws.services.ec2.model.DescribeInstanceStatusResult) ArrayList(java.util.ArrayList) Collection(java.util.Collection) Test(org.junit.Test)

Example 85 with ArrayList

use of java.util.ArrayList in project camel by apache.

the class EC2ComponentSpringTest method stopInstances.

@Test
public void stopInstances() {
    Exchange exchange = template.request("direct:stop", new Processor() {

        @Override
        public void process(Exchange exchange) throws Exception {
            Collection l = new ArrayList();
            l.add("test-1");
            exchange.getIn().setHeader(EC2Constants.INSTANCES_IDS, l);
        }
    });
    StopInstancesResult resultGet = (StopInstancesResult) exchange.getOut().getBody();
    assertEquals(resultGet.getStoppingInstances().get(0).getInstanceId(), "test-1");
    assertEquals(resultGet.getStoppingInstances().get(0).getPreviousState().getName(), InstanceStateName.Running.toString());
    assertEquals(resultGet.getStoppingInstances().get(0).getCurrentState().getName(), InstanceStateName.Stopped.toString());
}
Also used : Exchange(org.apache.camel.Exchange) Processor(org.apache.camel.Processor) StopInstancesResult(com.amazonaws.services.ec2.model.StopInstancesResult) ArrayList(java.util.ArrayList) Collection(java.util.Collection) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)55702 Test (org.junit.Test)8169 List (java.util.List)6815 HashMap (java.util.HashMap)5856 IOException (java.io.IOException)3899 Map (java.util.Map)3195 File (java.io.File)3090 HashSet (java.util.HashSet)2245 Iterator (java.util.Iterator)1591 Test (org.testng.annotations.Test)1074 SQLException (java.sql.SQLException)1046 ResultSet (java.sql.ResultSet)1017 Date (java.util.Date)997 Set (java.util.Set)917 LinkedHashMap (java.util.LinkedHashMap)886 PreparedStatement (java.sql.PreparedStatement)882 Collection (java.util.Collection)751 LinkedList (java.util.LinkedList)677 BufferedReader (java.io.BufferedReader)663 Path (org.apache.hadoop.fs.Path)611