Package com.cumulocity.me.lang

Examples of com.cumulocity.me.lang.Iterator


        allOperations = (OperationCollectionRepresentation) deviceControlResource.getOperationsByFilter(filter).get();
    }

    @Then("^all received operations should have status '([^']*)'$")
    public void allRecievedOperationsShouldHaveStatusX(String status) {
        Iterator iterator = allOperations.getOperations().iterator();
        while (iterator.hasNext()) {
            assertThat(((OperationRepresentation) iterator.next()).getStatus(), is(equalTo(status)));
        }
    }
View Full Code Here


        ManagedObjectCollectionRepresentation firstPage = (ManagedObjectCollectionRepresentation) inventory.getManagedObjects().getPreviousPage(secondPage);
        assertThat(firstPage.getPageStatistics().getCurrentPage()).isEqualTo(1);
    }

    private void deleteMOs(List mosOn1stPage) throws SDKException {
        Iterator iterator = mosOn1stPage.iterator();
        while (iterator.hasNext()) {
        ManagedObjectRepresentation mo  = (ManagedObjectRepresentation) iterator.next();
            inventory.getManagedObject(mo.getId()).delete();
        }
    }
View Full Code Here

    private List getMOsFrom1stPage() throws SDKException {
        return ((ManagedObjectCollectionRepresentation) inventoryApi.getManagedObjects().get()).getManagedObjects();
    }
   
    private void deleteMOs(List mosOn1stPage) throws SDKException {
        Iterator iterator = mosOn1stPage.iterator();
        while (iterator.hasNext()) {
        ManagedObjectRepresentation mo  = (ManagedObjectRepresentation) iterator.next();
            inventoryApi.getManagedObject(mo.getId()).delete();
        }
    }
View Full Code Here

    // ------------------------------------------------------------------------

    @When("I create all audit records$")
    public void iCreateAll() throws SDKException {
        try {
            Iterator iterator = input.iterator();
            while (iterator.hasNext()) {
                result1.add(auditRecordsApi.create((AuditRecordRepresentation) iterator.next()));
            }
        } catch (SDKException ex) {
            ex.printStackTrace();
            status = ex.getHttpStatus();
        }
View Full Code Here

    public void shouldGetAllMeasurements() {
        assertThat(collection1.getAuditRecords().size(), is(equalTo(result1.size())));

        Map map = new HashMap();

        Iterator iterator = result1.iterator();
        while (iterator.hasNext()) {
            AuditRecordRepresentation rep = (AuditRecordRepresentation) iterator.next();
            map.put(rep.getId(), rep);
        }

        iterator = collection1.getAuditRecords().iterator();
        while (iterator.hasNext()) {
            AuditRecordRepresentation orig = (AuditRecordRepresentation) map.get(((AuditRecordRepresentation) iterator.next()).getId());
            assertThat(orig, is(notNullValue()));
        }
    }
View Full Code Here

        notFound = false;
    }

    @After
    public void tearDown() throws SDKException {
        Iterator iterator = input.iterator();
        while (iterator.hasNext()) {
            try {
                identity.deleteExternalId((ExternalIDRepresentation) iterator.next());
            } catch (SDKException e1) {
                if (e1.getHttpStatus() != 404) {
                    throw e1;
                }
            }
View Full Code Here

        ManagedObjectRepresentation mo = new ManagedObjectRepresentation();
        GId gId = new GId();
        gId.setValue(Long.toString(globalId));
        mo.setId(gId);

        Iterator iterator = rows.iterator();

        while (iterator.hasNext()) {
            Row row = (Row) iterator.next();
            ExternalIDRepresentation rep = new ExternalIDRepresentation();
            rep.setExternalId(row.value);
            rep.setType(row.type);
            rep.setManagedObject(mo);
            input.add(rep);
View Full Code Here

        result1.add(identity.create((ExternalIDRepresentation) input.get(0)));
    }

    @When("I create all external ids")
    public void iCreateAll() throws SDKException {
        Iterator iterator = input.iterator();
        while(iterator.hasNext()) {
            result1.add(identity.create((ExternalIDRepresentation) iterator.next()));
        }
    }
View Full Code Here

            return WebMethod.POST;
        }
    }

    private WebRequestExecutor writeHeaders() throws IOException {
        Iterator entries = request.getHeaders().entrySet().iterator();
        while (entries.hasNext()) {
            Entry thisEntry = (Entry) entries.next();
            String headerName = StringUtils.toString(thisEntry.getKey());
            String headerValue = StringUtils.toString(thisEntry.getValue());
            connection.setRequestProperty(headerName, headerValue);
        }
        WebMethod requestMethod = request.getMethod();
View Full Code Here

    }

    @Override
    protected AuditRecordRepresentation createDomainObject() {
        AuditRecordRepresentation audit = new AuditRecordRepresentation();
        Iterator iterator = dynamicProperties.iterator();
        while(iterator.hasNext()) {
            audit.set(iterator.next());
        }
        return audit;
    }
View Full Code Here

TOP

Related Classes of com.cumulocity.me.lang.Iterator

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.