Package com.amazonaws.services.dynamodbv2.model

Examples of com.amazonaws.services.dynamodbv2.model.ScanResult


        rangeKeyCondition.setComparisonOperator(ComparisonOperator.GT);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        request.setLimit(limit);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        int itemCount = result.getItems().size();
        Assert.assertTrue(itemCount <= limit);
        for (Map<String, AttributeValue> item : result.getItems()) {
            Assert.assertTrue(new Integer(item.get("range").getN()) > new Integer(new AttributeValue().withN("50").getN()));
        }
    }
View Full Code Here


        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.GE);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        Assert.assertEquals(90, result.getItems().size());
        final Integer i = new Integer(comparisonValue);
        for (Map<String, AttributeValue> item : result.getItems()) {
            String testValue = item.get("range").getN();
            Assert.assertTrue(testValue, new Integer(testValue).compareTo(i) >= 0);
        }
    }
View Full Code Here

        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.LE);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        for (Map<String, AttributeValue> item : result.getItems()) {
//            Assert.assertTrue(new Integer(item.get("range").getN()) <= new Integer(rangeKey.getN()));
            Assert.assertTrue(new Integer(item.get("range").getN()) <= new Integer(new AttributeValue().withN("120").getN()));
        }
    }
View Full Code Here

        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.LT);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        for (Map<String, AttributeValue> item : result.getItems()) {
            Assert.assertTrue(new Integer(item.get("range").getN()) < new Integer(new AttributeValue().withN("0").getN()));
        }
    }
View Full Code Here

        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.IN);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        for (Map<String, AttributeValue> item : result.getItems()) {
            Assert.assertTrue(new Integer(item.get("range").getN()) == 102 || new Integer(item.get("range").getN()) == 101 || new Integer(item.get("range").getN()) == 100);
        }
    }
View Full Code Here

        rangeKeyCondition.setComparisonOperator(ComparisonOperator.BETWEEN);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);

        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        Assert.assertEquals(40, result.getItems().size());
        for (Map<String, AttributeValue> item : result.getItems()) {
            Assert.assertTrue(new Integer(item.get("range").getN()) <= 104 && new Integer(item.get("range").getN()) >= 100);
        }
    }
View Full Code Here

        rangeKeyCondition.setComparisonOperator(ComparisonOperator.BEGINS_WITH);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("string", rangeKeyCondition);
        request.setScanFilter(conditionMap);

        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        Assert.assertEquals(100, result.getItems().size());
        for (Map<String, AttributeValue> item : result.getItems()) {
            Assert.assertTrue(item.get("string").getS().startsWith("5"));
        }
    }
View Full Code Here

        rangeKeyCondition.setComparisonOperator(ComparisonOperator.CONTAINS);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);

        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        Assert.assertEquals(40, result.getItems().size());
        for (Map<String, AttributeValue> item : result.getItems()) {
            Assert.assertTrue(item.get("range").getN().contains("4"));
        }
    }
View Full Code Here

        rangeKeyCondition.setComparisonOperator(ComparisonOperator.EQ);
        conditionMap.put("second", rangeKeyCondition);

        request.setScanFilter(conditionMap);

        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
        Assert.assertNotNull(result.getItems());
        //Should be no duplicates
        Assert.assertEquals(10, result.getItems().size());
        for (Map<String,AttributeValue> item : result.getItems()) {
            Assert.assertEquals("4", item.get("range").getN());
            Assert.assertEquals("4", item.get("second").getN());
        }
    }
View Full Code Here

            Mockito.mock(AmazonDynamoDB.class);
        Mockito.doAnswer(
            new Answer<ScanResult>() {
                @Override
                public ScanResult answer(final InvocationOnMock invocation) {
                    return new ScanResult().withItems(items);
                }
            }
        ).when(aws).scan(Mockito.any(ScanRequest.class));
        Mockito.doAnswer(
            new Answer<PutItemResult>() {
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodbv2.model.ScanResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.