Package com.amazonaws.services.dynamodbv2.model

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


        List<AttributeValue> keyValues = new ArrayList<AttributeValue>();
        keyValues.add(hashKeyValue);

        Map<String, Condition> keyConditions = new HashMap<String, Condition>();
        Condition hashKeyCondition =
            new Condition()
                .withComparisonOperator(ComparisonOperator.EQ)
                .withAttributeValueList(keyValues)
                ;
        keyConditions.put(hashKeyName, hashKeyCondition);
View Full Code Here


  //TODO : tests using the DynamoDBMapper instead of the Client.

    @Test
    public void scanWithScanFilterEQTestThatHasReturn() {
        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//        attributeValueList.add(new AttributeValue().withN(rangeKey.getN()));
        attributeValueList.add(new AttributeValue().withN("55"));
        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.EQ);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
View Full Code Here

    }
    // Test that expected return 0 items
    @Test
    public void scanWithScanFilterEQTestThatHasNoReturn() {
        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
        attributeValueList.add(new AttributeValue().withN("30"));
        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.EQ);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
View Full Code Here


    @Test
    public void scanWithScanFilterGTTestWithReturn() {
        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//
        attributeValueList.add(new AttributeValue().withN("50"));
        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.GT);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
View Full Code Here

    }

    @Test
    public void scanWithScanFilterGTTestWithNoReturn() {
        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();

        attributeValueList.add(new AttributeValue().withN("120"));
        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.GT);
        Map<String, Condition> conditionMap = new HashMap<String, Condition>();
        conditionMap.put("range", rangeKeyCondition);
        request.setScanFilter(conditionMap);
        ScanResult result = getClient().scan(request);
        Assert.assertNotNull(result);
View Full Code Here

    @Test
    public void scanWithScanFilterGTTestWithLowLimit() {
        final int limit = 5;

        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//
        attributeValueList.add(new AttributeValue().withN("50"));
        rangeKeyCondition.setAttributeValueList(attributeValueList);
        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);
View Full Code Here

    @Test
    public void scanWithScanFilterGTTestWithHighLimit() {
        final int limit = 1000;

        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//
        attributeValueList.add(new AttributeValue().withN("50"));
        rangeKeyCondition.setAttributeValueList(attributeValueList);
        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);
View Full Code Here


    @Test
    public void scanWithScanFilterGETest() { //Greater or Equal
        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
        String comparisonValue = "101";
        attributeValueList.add(new AttributeValue().withN(comparisonValue));
        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);
View Full Code Here

//    // TODO: Exception!
    @Test
    public void scanWithScanFilterLETest() {
        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//        attributeValueList.add(new AttributeValue().withN(rangeKey.getN()));
        attributeValueList.add(new AttributeValue().withN("120"));
        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);
View Full Code Here

    }

    @Test
    public void scanWithScanFilterLTTest() {
        ScanRequest request = getBasicReq();
        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
        attributeValueList.add(new AttributeValue().withN("0"));
        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);
View Full Code Here

TOP

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

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.